-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
4,424 additions
and
578 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
maintained node versions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
multipass: true | ||
|
||
plugins: | ||
- cleanupAttrs: true | ||
- inlineStyles: true | ||
- removeDoctype: true | ||
- removeXMLProcInst: true | ||
- removeComments: true | ||
- removeMetadata: true | ||
- removeTitle: true | ||
- removeDesc: true | ||
- removeUselessDefs: true | ||
- removeXMLNS: false | ||
- removeEditorsNSData: true | ||
- removeEmptyAttrs: true | ||
- removeHiddenElems: true | ||
- removeEmptyText: true | ||
- removeEmptyContainers: true | ||
- removeViewBox: false | ||
- cleanupEnableBackground: true | ||
- minifyStyles: true | ||
- convertStyleToAttrs: true | ||
- convertColors: true | ||
- convertPathData: true | ||
- convertTransform: true | ||
- removeUnknownsAndDefaults: true | ||
- removeNonInheritableGroupAttrs: true | ||
- removeUselessStrokeAndFill: true | ||
- removeUnusedNS: true | ||
- prefixIds: false | ||
- cleanupIDs: true | ||
- cleanupNumericValues: true | ||
- cleanupListOfValues: false | ||
- moveElemsAttrsToGroup: true | ||
- moveGroupAttrsToElems: true | ||
- collapseGroups: true | ||
- removeRasterImages: false | ||
- mergePaths: true | ||
- convertShapeToPath: true | ||
- convertEllipseToCircle: true | ||
- sortAttrs: false | ||
- sortDefsChildren: true | ||
- removeDimensions: true | ||
- removeAttrs: | ||
attrs: | ||
# - xmlns:xlink | ||
# - id | ||
# - class | ||
# - fill | ||
# - transform | ||
# - href | ||
# - clip-path | ||
# - clip-rule | ||
- data-.* | ||
- removeStyleElement: false | ||
- removeScriptElement: false | ||
- reusePaths: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# j-icon-cli | ||
自动将 `SVG` 图标转换为 [Icon](https://github.com/meshareL/j-icon/blob/master/index.d.ts#L3) 对象的命令行工具 | ||
|
||
## 安装 | ||
```shell | ||
npm install @tomoeed/j-icon-cli --save-dev | ||
``` | ||
|
||
## 使用 | ||
```shell | ||
j-icon -i svgs -o dist | ||
``` | ||
|
||
## 选项 | ||
```text | ||
-i, --input <path> 文件或文件夹路径 | ||
-o, --output <path> 文件输出目录 | ||
-m, --minify 是否压缩文件 (默认值: false) | ||
-f, --format 输出文件格式 (默认值: json esm umd ts type) | ||
-t, --target Vue 版本. 2 或 3 (默认值: 3) | ||
-n, --name 输出文件名称 (默认值: index) | ||
``` | ||
|
||
## API | ||
```js | ||
const process = require('@tomoeed/j-icon-cli'); | ||
process({input: '', output: ''}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
presets: [ | ||
['@babel/preset-env', { | ||
bugfixes: true, | ||
useBuiltIns: 'usage', | ||
corejs: 3 | ||
}] | ||
], | ||
plugins: [ | ||
['@babel/plugin-transform-runtime', { | ||
corejs: false, | ||
version: '^7.12.5' | ||
}] | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env node | ||
'use strict'; | ||
require('../dist/command'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
interface Option { | ||
/** 文件或目录路径(绝对路径) */ | ||
input: string; | ||
/** 文件输出路径(绝对路径) */ | ||
output: string; | ||
/** | ||
* 输出文件格式 | ||
* | ||
* @default ['json', 'esm', 'umd', 'ts', 'type'] | ||
*/ | ||
format?: Array<'json' | 'esm' | 'umd' | 'ts' | 'type'>; | ||
/** | ||
* 是否压缩文件 | ||
* | ||
* @default false | ||
*/ | ||
minify?: boolean; | ||
/** | ||
* 目标 Vue 代码. 2 或 3 | ||
* | ||
* @default 3 | ||
*/ | ||
target?: number; | ||
/** | ||
* 输出文件名称 | ||
* | ||
* @default index | ||
*/ | ||
name?: string; | ||
} | ||
|
||
export default function (option: Option): Promise<void>; | ||
export { Option }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
testEnvironment: 'node', | ||
testRegex: 'test/.*.spec.js$' | ||
}; |
Oops, something went wrong.