done-coding-template 0.8.0-alpha.0 → 0.8.1

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 { e as m } from "./main-bd31ea48.js";
2
+ import { e as m } from "./main-b7fe5db5.js";
3
3
  import "node:path";
4
4
  import "node:fs";
5
5
  import "@done-coding/cli-utils";
package/es/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { M as r } from "./main-bd31ea48.js";
3
- import { d as f, O as T, S as _, T as h, b as A, a as O, c as b, h as L } from "./main-bd31ea48.js";
2
+ import { M as r } from "./main-b7fe5db5.js";
3
+ import { d as f, O as T, S as _, T as h, b as A, a as O, c as b, h as L } from "./main-b7fe5db5.js";
4
4
  import t from "node:path";
5
5
  import { existsSync as m } from "node:fs";
6
6
  import "@done-coding/cli-utils";
@@ -4,9 +4,9 @@ import p from "node:fs";
4
4
  import { log as a, xPrompts as A, getConfigFileCommonOptions as P, getUseDefaultConfig as V, initHandlerCommon as W, readConfigFile as G, createSubcommand as S, getRootScriptName as J, createMainCommand as K } from "@done-coding/cli-utils";
5
5
  import L from "lodash.template";
6
6
  import q from "lodash.assign";
7
- const N = {
7
+ const h = {
8
8
  name: "@done-coding/cli-template",
9
- version: "0.8.0-alpha.0",
9
+ version: "0.8.1",
10
10
  description: "预编译命令行工具",
11
11
  bin: {
12
12
  "dc-template": "es/cli.mjs"
@@ -17,7 +17,7 @@ const N = {
17
17
  }
18
18
  }, {
19
19
  cliConfig: { namespaceDir: z, moduleName: Z }
20
- } = N, Q = `./${z}/${Z}`, _ = `${Q}.json`, w = (t, n) => {
20
+ } = h, Q = `./${z}/${Z}`, _ = `${Q}.json`, w = (t, n) => {
21
21
  if (!n)
22
22
  return a.error(`${t}模式下output不能为空`), process.exit(1);
23
23
  }, k = (t, n) => {
@@ -75,7 +75,7 @@ const x = async (t, { rootDir: n, rollback: s }) => {
75
75
  mode: ${o}
76
76
  rollback: ${s}
77
77
  `);
78
- const h = F({
78
+ const N = F({
79
79
  rootDir: n,
80
80
  filePath: c,
81
81
  dataInit: r,
@@ -83,7 +83,7 @@ rollback: ${s}
83
83
  filePathKey: "input",
84
84
  dataInitKey: "inputData",
85
85
  dealMarkdown: D
86
- }), g = L(h), v = typeof E == "function" ? E() : E, l = g(v);
86
+ }), g = L(N), v = typeof E == "function" ? E() : E, l = g(v);
87
87
  switch (o) {
88
88
  case d.OVERWRITE: {
89
89
  w(o, i), k(i, c);
@@ -310,7 +310,7 @@ rollback: ${s}
310
310
  validate: (b) => b.length > 0 || `${m}不能为空`
311
311
  }))[e];
312
312
  }
313
- const h = $.map((l) => {
313
+ const N = $.map((l) => {
314
314
  const { envData: e, env: m, input: f, output: b, ...H } = l;
315
315
  return m && a.warn(`批量处理中 env:${m} 将被忽略, 只读envData`), {
316
316
  ...H,
@@ -327,7 +327,7 @@ rollback: ${s}
327
327
  rollback: i
328
328
  };
329
329
  }), g = [];
330
- for (const l of h) {
330
+ for (const l of N) {
331
331
  const e = await x(l, {
332
332
  rootDir: c,
333
333
  rollback: i
@@ -398,7 +398,7 @@ rollback: ${s}
398
398
  } = t, {
399
399
  rootDir: D = n.rootDir.default,
400
400
  rollbackDelNullFile: E,
401
- rollbackDelAskAsYes: h,
401
+ rollbackDelAskAsYes: N,
402
402
  dealMarkdown: g,
403
403
  rollback: v
404
404
  } = C;
@@ -421,7 +421,7 @@ rollback: ${s}
421
421
  output: i,
422
422
  mode: o,
423
423
  rollbackDelNullFile: E,
424
- rollbackDelAskAsYes: h,
424
+ rollbackDelAskAsYes: N,
425
425
  dealMarkdown: g,
426
426
  envData: l
427
427
  },
@@ -446,7 +446,7 @@ rollback: ${s}
446
446
  default:
447
447
  throw new Error(`不支持的命令 ${t}`);
448
448
  }
449
- }, { version: ie, description: le } = N, j = {
449
+ }, { version: ie, description: le } = h, j = {
450
450
  describe: le,
451
451
  version: ie,
452
452
  subcommands: [
@@ -455,10 +455,10 @@ rollback: ${s}
455
455
  re
456
456
  ].map(S),
457
457
  demandCommandCount: 1,
458
- rootScriptName: J({ packageJson: N })
458
+ rootScriptName: J({ packageJson: h })
459
459
  }, {
460
460
  cliConfig: { moduleName: T }
461
- } = N, B = (t = !1) => {
461
+ } = h, B = (t = !1) => {
462
462
  const n = t ? T : void 0, s = `$0${t ? ` ${T}` : ""} <command> [options]`;
463
463
  return { command: n, usage: s };
464
464
  }, $e = async () => K({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "done-coding-template",
3
- "version": "0.8.0-alpha.0",
3
+ "version": "0.8.1",
4
4
  "description": "预编译命令行工具",
5
5
  "private": false,
6
6
  "module": "es/index.mjs",
@@ -9,7 +9,8 @@
9
9
  "bin": "es/cli.mjs",
10
10
  "exports": {
11
11
  ".": {
12
- "import": "./es/index.mjs"
12
+ "import": "./es/index.mjs",
13
+ "types": "./types/index.d.ts"
13
14
  }
14
15
  },
15
16
  "files": [
@@ -30,7 +31,7 @@
30
31
  "license": "MIT",
31
32
  "sideEffects": false,
32
33
  "devDependencies": {
33
- "@done-coding/cli-inject": "^0.5.13-alpha.0",
34
+ "@done-coding/cli-inject": "^0.5.14",
34
35
  "@types/lodash.assign": "^4.2.9",
35
36
  "@types/lodash.template": "^4.5.3",
36
37
  "@types/node": "^18.0.0",
@@ -44,10 +45,10 @@
44
45
  "node": ">=18.0.0"
45
46
  },
46
47
  "dependencies": {
47
- "@done-coding/cli-utils": "^0.7.4-alpha.0",
48
+ "@done-coding/cli-utils": "^0.7.5",
48
49
  "lodash.assign": "^4.2.0",
49
50
  "lodash.template": "^4.5.0"
50
51
  },
51
- "gitHead": "a1acffae69586b12aec17d0ad76d6f75ad1d0ca0",
52
+ "gitHead": "fb405d55a9fe10014863d725b1f4e3bcd45412af",
52
53
  "scripts": {}
53
54
  }