@wagq/wa-cli 0.6.57 → 0.6.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/config/command.js +8 -1
- package/lib/generateIcon/tsx.js +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -163,6 +163,7 @@ wa sk
|
|
|
163
163
|
- **别名**:`wa gitsx <svgPath>`
|
|
164
164
|
- **参数说明**
|
|
165
165
|
- `svgPath`:SVG 文件夹地址(需包含 `outline/`、`fill/`、`multipleTone/` 子目录)
|
|
166
|
+
- `output`: 导出文件输出文件地址
|
|
166
167
|
- **输出**
|
|
167
168
|
- `svgConfig/` — SVG 数据配置文件
|
|
168
169
|
- `icons/` — 生成的 TSX 组件
|
|
@@ -171,7 +172,7 @@ wa sk
|
|
|
171
172
|
|
|
172
173
|
```bash
|
|
173
174
|
wa generateIcon2Tsx ./svgs
|
|
174
|
-
wa gitsx ./svgs
|
|
175
|
+
wa gitsx ./svgs ./index.ts
|
|
175
176
|
```
|
|
176
177
|
|
|
177
178
|
### changesetDoc
|
package/config/command.js
CHANGED
|
@@ -127,7 +127,7 @@ const command = [
|
|
|
127
127
|
action: skill,
|
|
128
128
|
},
|
|
129
129
|
{
|
|
130
|
-
name: "generateIcon2Tsx [svgPath]",
|
|
130
|
+
name: "generateIcon2Tsx [svgPath] [output]",
|
|
131
131
|
alias: "gitsx",
|
|
132
132
|
description: `
|
|
133
133
|
- svg配置文件将生成在svg文件夹同级下的svgConfig中
|
|
@@ -145,6 +145,13 @@ const command = [
|
|
|
145
145
|
type: "string",
|
|
146
146
|
},
|
|
147
147
|
},
|
|
148
|
+
{
|
|
149
|
+
key: "output",
|
|
150
|
+
option: {
|
|
151
|
+
describe: "输出文件地址",
|
|
152
|
+
type: "string",
|
|
153
|
+
},
|
|
154
|
+
},
|
|
148
155
|
],
|
|
149
156
|
action: generateIcon2Tsx,
|
|
150
157
|
},
|
package/lib/generateIcon/tsx.js
CHANGED
|
@@ -5,10 +5,10 @@ const { promisify } = require("util");
|
|
|
5
5
|
const format = require("./prettier.js");
|
|
6
6
|
const synchoronousSvgConfig = require("./synchoronousSvgConfig.js");
|
|
7
7
|
|
|
8
|
-
const generateIcon2Tsx = async (svgPath) => {
|
|
8
|
+
const generateIcon2Tsx = async (svgPath, output) => {
|
|
9
9
|
const cwd = process.cwd();
|
|
10
10
|
const iconDir = path.join(cwd, svgPath);
|
|
11
|
-
const indexPath = path.join(
|
|
11
|
+
const indexPath = path.join(cwd, output);
|
|
12
12
|
const reactIconDir = path.join(iconDir, "../icons");
|
|
13
13
|
const configPath = path.join(iconDir, "../svgConfig");
|
|
14
14
|
// 线框风格
|
|
@@ -59,7 +59,7 @@ const generateIcon2Tsx = async (svgPath) => {
|
|
|
59
59
|
const reactContent = `
|
|
60
60
|
import IconBase from '../components/IconBase'
|
|
61
61
|
import icon from '../svgConfig/${fileName}'
|
|
62
|
-
import { IconProps } from '
|
|
62
|
+
import { IconProps } from '../types'
|
|
63
63
|
|
|
64
64
|
const ${fileName} = (props: IconProps) => {
|
|
65
65
|
|