@done-coding/cli-component 0.4.11-alpha.3 → 0.4.12

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 CHANGED
@@ -8,6 +8,7 @@
8
8
  ## 安装
9
9
 
10
10
  ### 独立安装
11
+
11
12
  ```bash
12
13
  npm install @done-coding/cli-component
13
14
  # 或
@@ -15,6 +16,7 @@ pnpm add @done-coding/cli-component
15
16
  ```
16
17
 
17
18
  ### 作为 done-coding CLI 的一部分
19
+
18
20
  ```bash
19
21
  npm install -g @done-coding/cli
20
22
  # 然后使用
@@ -46,6 +48,7 @@ dc-component --help
46
48
  ### 基础命令
47
49
 
48
50
  #### `dc-component add <name>`
51
+
49
52
  新增一个组件
50
53
 
51
54
  ```bash
@@ -57,9 +60,11 @@ dc-component add UserCard
57
60
  ```
58
61
 
59
62
  **参数说明**:
63
+
60
64
  - `name`: 组件名称(必需)
61
65
 
62
66
  #### `dc-component remove [name]`
67
+
63
68
  删除一个组件
64
69
 
65
70
  ```bash
@@ -71,9 +76,11 @@ dc-component remove
71
76
  ```
72
77
 
73
78
  **参数说明**:
79
+
74
80
  - `name`: 组件名称(可选)
75
81
 
76
82
  #### `dc-component list`
83
+
77
84
  展示组件列表
78
85
 
79
86
  ```bash
@@ -117,6 +124,7 @@ done-coding component list
117
124
  ### 常见问题
118
125
 
119
126
  **Q: 组件创建失败**
127
+
120
128
  ```bash
121
129
  # 检查当前目录
122
130
  pwd
@@ -126,6 +134,7 @@ dc-component add MyButton
126
134
  ```
127
135
 
128
136
  **Q: 组件列表为空**
137
+
129
138
  ```bash
130
139
  # 确认是否在正确的项目目录
131
140
  ls -la
@@ -135,6 +144,7 @@ dc-component list
135
144
  ```
136
145
 
137
146
  **Q: 删除组件失败**
147
+
138
148
  ```bash
139
149
  # 确认组件名称正确
140
150
  dc-component list
@@ -157,7 +167,7 @@ ls -la src/components/
157
167
 
158
168
  ```bash
159
169
  # 克隆仓库
160
- git clone https://gitee.com/done-coding/done-coding-cli.git
170
+ git clone https://github.com/done-coding/done-coding-cli.git
161
171
  cd done-coding-cli/packages/component
162
172
 
163
173
  # 安装依赖
package/es/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { c as m } from "./index-1a38bc43.js";
2
+ import { c as m } from "./index-6793b622.js";
3
3
  import "node:path";
4
4
  import "node:fs";
5
5
  import "@done-coding/cli-utils";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import p from "node:path";
3
3
  import l from "node:fs";
4
- import { outputConsole as m, json5 as L, chalk as b, xPrompts as w, createSubcommand as O, getRootScriptName as V, createMainCommand as J } from "@done-coding/cli-utils";
4
+ import { outputConsole as m, json5 as L, chalk as h, xPrompts as w, createSubcommand as O, getRootScriptName as V, createMainCommand as J } from "@done-coding/cli-utils";
5
5
  import x from "lodash.upperfirst";
6
6
  import S from "lodash.camelcase";
7
7
  import v from "lodash.kebabcase";
@@ -17,7 +17,7 @@ const _ = (e, t) => {
17
17
  保留名称: ${n.join(",")}`), process.exit(1)) : !0;
18
18
  }, g = {
19
19
  name: "@done-coding/cli-component",
20
- version: "0.4.11-alpha.3",
20
+ version: "0.4.12",
21
21
  description: "组件命令行工具",
22
22
  bin: {
23
23
  "dc-component": "es/cli.mjs"
@@ -86,22 +86,22 @@ const _ = (e, t) => {
86
86
  if (r) {
87
87
  const s = r;
88
88
  s != null && s.input && (s.input = f(s.input)(o)), s != null && s.output && (s.output = f(s.output)(o));
89
- const h = {
89
+ const b = {
90
90
  ...r,
91
91
  mode: C.APPEND,
92
92
  ...d
93
93
  };
94
- await E(h);
94
+ await E(b);
95
95
  }
96
96
  if (i) {
97
97
  const s = i;
98
98
  s != null && s.input && (s.input = f(s.input)(o)), s != null && s.output && (s.output = f(s.output)(o));
99
- const h = {
99
+ const b = {
100
100
  ...i,
101
101
  mode: C.OVERWRITE,
102
102
  ...d
103
103
  };
104
- await E(h);
104
+ await E(b);
105
105
  }
106
106
  }
107
107
  }, Z = () => ({
@@ -140,9 +140,9 @@ const _ = (e, t) => {
140
140
  });
141
141
  if (m.table(
142
142
  a.map(({ name: r, fullName: i, nameKebab: d }) => ({
143
- [b.greenBright("名称")]: r,
144
- [b.greenBright("带系列名称")]: i,
145
- [b.greenBright("绝对路径")]: p.resolve(
143
+ [h.greenBright("名称")]: r,
144
+ [h.greenBright("带系列名称")]: i,
145
+ [h.greenBright("绝对路径")]: p.resolve(
146
146
  n.componentDir,
147
147
  d
148
148
  )
package/es/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { S as u, a as b, h as c } from "./index-1a38bc43.js";
2
+ import { S as u, a as b, h as c } from "./index-6793b622.js";
3
3
  import "node:path";
4
4
  import "node:fs";
5
5
  import "@done-coding/cli-utils";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@done-coding/cli-component",
3
- "version": "0.4.11-alpha.3",
3
+ "version": "0.4.12",
4
4
  "description": "组件命令行工具",
5
5
  "private": false,
6
6
  "module": "es/index.mjs",
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "repository": {
29
29
  "type": "git",
30
- "url": "https://gitee.com/done-coding/done-coding-cli.git",
30
+ "url": "https://github.com/done-coding/done-coding-cli.git",
31
31
  "directory": "packages/component"
32
32
  },
33
33
  "publishConfig": {
@@ -38,7 +38,7 @@
38
38
  "license": "MIT",
39
39
  "sideEffects": false,
40
40
  "devDependencies": {
41
- "@done-coding/cli-inject": "0.5.22-alpha.3",
41
+ "@done-coding/cli-inject": "0.5.23",
42
42
  "@types/lodash.camelcase": "^4.3.8",
43
43
  "@types/lodash.kebabcase": "^4.1.8",
44
44
  "@types/lodash.lowerfirst": "^4.3.8",
@@ -51,8 +51,8 @@
51
51
  "vite-plugin-dts": "^3.6.0"
52
52
  },
53
53
  "dependencies": {
54
- "@done-coding/cli-template": "0.8.9-alpha.3",
55
- "@done-coding/cli-utils": "0.8.3-alpha.3",
54
+ "@done-coding/cli-template": "0.8.10",
55
+ "@done-coding/cli-utils": "0.8.4",
56
56
  "lodash.camelcase": "^4.3.0",
57
57
  "lodash.kebabcase": "^4.1.1",
58
58
  "lodash.lowerfirst": "^4.3.1",
@@ -62,5 +62,5 @@
62
62
  "engines": {
63
63
  "node": ">=18.0.0"
64
64
  },
65
- "gitHead": "30a4e6c8721e6bcafa72d4e05b35b5ed5fc75c0d"
65
+ "gitHead": "d90f437c0a716f3e62bd92a221341838710869ad"
66
66
  }