@done-coding/cli-component 0.2.0-alpha.0 → 0.2.0

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/es/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { c as r } from "./index-d6f53839.js";
2
+ import { c as r } from "./index-78f9044a.js";
3
3
  import "chalk";
4
4
  import "node:path";
5
5
  import "node:fs";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import r from "chalk";
3
3
  import m from "node:path";
4
- import p from "node:fs";
4
+ import u from "node:fs";
5
5
  import I from "json5";
6
6
  import E from "lodash.upperfirst";
7
7
  import y from "lodash.camelcase";
@@ -23,7 +23,7 @@ const _ = (e, o) => {
23
23
  保留名称: ${t.join(",")}`)
24
24
  ), process.exit(1)) : !0;
25
25
  }, f = {
26
- version: "0.2.0-alpha.0",
26
+ version: "0.2.0",
27
27
  name: "@done-coding/cli-component",
28
28
  description: "组件命令行工具",
29
29
  cliConfig: {
@@ -34,15 +34,15 @@ const _ = (e, o) => {
34
34
  execDir: process.cwd(),
35
35
  templateDir: w()
36
36
  }), g = (e) => {
37
- const { series: o, name: t } = e, s = E(y(t)), i = L(s), a = x(s), l = o ? E(y(o)) : "", n = l ? `${l}${s}` : "", u = x(n);
37
+ const { series: o, name: t } = e, s = E(y(t)), i = L(s), a = x(s), l = o ? E(y(o)) : "", n = l ? `${l}${s}` : "", p = x(n);
38
38
  return {
39
39
  series: l,
40
40
  name: s,
41
41
  nameLowerFirst: i,
42
42
  nameKebab: a,
43
43
  fullName: n,
44
- fullNameKebab: u,
45
- cls: u
44
+ fullNameKebab: p,
45
+ cls: p
46
46
  };
47
47
  }, F = (e) => ({
48
48
  $: "$",
@@ -50,24 +50,24 @@ const _ = (e, o) => {
50
50
  ...g(e)
51
51
  }), h = () => {
52
52
  const e = m.resolve(w(), "index.json");
53
- if (!p.existsSync(e))
53
+ if (!u.existsSync(e))
54
54
  return console.log(r.red(`模块入口文件不存在: ${e}`)), process.exit(1);
55
- const t = JSON.parse(p.readFileSync(e, "utf-8")).config;
55
+ const t = JSON.parse(u.readFileSync(e, "utf-8")).config;
56
56
  if (!t)
57
57
  return console.log(r.red(`配置文件相对路径不存在: ${t}`)), process.exit(1);
58
58
  const s = m.resolve(
59
59
  m.dirname(e),
60
60
  t
61
61
  );
62
- if (!p.existsSync(s))
62
+ if (!u.existsSync(s))
63
63
  return console.log(r.red(`配置文件不存在: ${s}`)), process.exit(1);
64
- const i = I.parse(p.readFileSync(s, "utf-8")), a = M();
64
+ const i = I.parse(u.readFileSync(s, "utf-8")), a = M();
65
65
  return i.componentDir = d(i.componentDir)(a), i;
66
66
  }, v = (e) => {
67
67
  const { componentDir: o, nameExcludes: t } = e;
68
- return p.statSync(o).isDirectory() ? p.readdirSync(o).map((l) => {
68
+ return u.statSync(o).isDirectory() ? u.readdirSync(o).map((l) => {
69
69
  const n = m.join(o, l);
70
- return p.statSync(n).isDirectory() ? (console.log("filePath:", n, m.basename(n)), m.basename(n)) : "";
70
+ return u.statSync(n).isDirectory() ? (console.log("filePath:", n, m.basename(n)), m.basename(n)) : "";
71
71
  }).filter((l) => !(!l || t.includes(l))) : (console.log(r.red("组件源码路径不是目录")), process.exit(1));
72
72
  }, K = async () => {
73
73
  console.log(r.blue("展示列表"));
@@ -100,26 +100,26 @@ const _ = (e, o) => {
100
100
  if (a) {
101
101
  const n = a;
102
102
  n != null && n.input && (n.input = d(n.input)(s)), n != null && n.output && (n.output = d(n.output)(s));
103
- const u = {
103
+ const p = {
104
104
  ...a,
105
105
  envData: i,
106
106
  mode: $.APPEND,
107
107
  rollback: t === c.REMOVE,
108
108
  dealMarkdown: !0
109
109
  };
110
- await C(u);
110
+ await C(p);
111
111
  }
112
112
  if (l) {
113
113
  const n = l;
114
114
  n != null && n.input && (n.input = d(n.input)(s)), n != null && n.output && (n.output = d(n.output)(s));
115
- const u = {
115
+ const p = {
116
116
  ...l,
117
117
  envData: i,
118
118
  mode: $.OVERWRITE,
119
119
  rollback: t === c.REMOVE,
120
120
  dealMarkdown: !0
121
121
  };
122
- await C(u);
122
+ await C(p);
123
123
  }
124
124
  }
125
125
  }, U = async ({ name: e }) => {
@@ -166,7 +166,7 @@ const _ = (e, o) => {
166
166
  name: s,
167
167
  config: o,
168
168
  command: c.REMOVE
169
- }), p.rmdirSync(m.resolve(o.componentDir, a));
169
+ }), u.rmdirSync(m.resolve(o.componentDir, a));
170
170
  return;
171
171
  }
172
172
  return console.log(r.red(`组件${s}不存在`)), process.exit(1);
@@ -201,12 +201,12 @@ const _ = (e, o) => {
201
201
  describe: J,
202
202
  builder: W,
203
203
  handler: R
204
- }, pe = async () => {
204
+ }, ue = async () => {
205
205
  const e = k(T(process.argv)), o = await V(e);
206
206
  return R(o);
207
207
  };
208
208
  export {
209
209
  me as a,
210
- pe as c,
210
+ ue as c,
211
211
  R as h
212
212
  };
package/es/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { a as u, h as v } from "./index-d6f53839.js";
2
+ import { a as u, h as v } from "./index-78f9044a.js";
3
3
  import "chalk";
4
4
  import "node:path";
5
5
  import "node:fs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@done-coding/cli-component",
3
- "version": "0.2.0-alpha.0",
3
+ "version": "0.2.0",
4
4
  "description": "组件命令行工具",
5
5
  "private": false,
6
6
  "module": "es/index.mjs",
@@ -41,7 +41,7 @@
41
41
  "license": "MIT",
42
42
  "sideEffects": false,
43
43
  "devDependencies": {
44
- "@done-coding/cli-inject": "^0.4.3",
44
+ "@done-coding/cli-inject": "^0.4.4",
45
45
  "@types/json5": "^2.2.0",
46
46
  "@types/lodash.camelcase": "^4.3.8",
47
47
  "@types/lodash.curry": "^4.1.8",
@@ -62,7 +62,7 @@
62
62
  "node": ">=18.0.0"
63
63
  },
64
64
  "dependencies": {
65
- "@done-coding/cli-template": "^0.5.0-alpha.0",
65
+ "@done-coding/cli-template": "^0.5.0",
66
66
  "chalk": "^5.3.0",
67
67
  "json5": "^2.2.3",
68
68
  "lodash.camelcase": "^4.3.0",
@@ -75,5 +75,5 @@
75
75
  "prompts": "^2.4.2",
76
76
  "yargs": "^17.7.2"
77
77
  },
78
- "gitHead": "c386db9e11a6e5cf017839d657cd4c0bf1fb6a90"
78
+ "gitHead": "383ec04131808af21ca8fdf3652daa48d86cab1c"
79
79
  }
@@ -1,5 +1,5 @@
1
1
  declare const _default: {
2
- "version": "0.2.0-alpha.0",
2
+ "version": "0.2.0",
3
3
  "name": "@done-coding/cli-component",
4
4
  "description": "组件命令行工具",
5
5
  "cliConfig": {