@done-coding/cli-template 0.2.1 → 0.2.2

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
File without changes
package/es/cli.mjs CHANGED
File without changes
package/es/handler.mjs CHANGED
File without changes
package/es/index.mjs CHANGED
File without changes
@@ -1,8 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  const e = {
3
+ version: "0.2.2",
3
4
  name: "@done-coding/cli-template",
4
- version: "0.2.1",
5
- description: "预编译命令行工具"
5
+ description: "预编译命令行工具",
6
+ cliConfig: {
7
+ namespaceDir: ".done-coding",
8
+ commandName: "template"
9
+ }
6
10
  };
7
11
  export {
8
12
  e as default
package/es/main.mjs CHANGED
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import l from "yargs";
3
- import { hideBin as p } from "yargs/helpers";
4
- import { OutputModeEnum as t } from "./utils/types.mjs";
5
- import { handler as a } from "./handler.mjs";
6
- import o from "chalk";
7
- import i from "./injectInfo.json.mjs";
8
- const d = () => ({
3
+ import { hideBin as d } from "yargs/helpers";
4
+ import { OutputModeEnum as s } from "./utils/types.mjs";
5
+ import { handler as i } from "./handler.mjs";
6
+ import t from "chalk";
7
+ import a from "./injectInfo.json.mjs";
8
+ const m = () => ({
9
9
  env: {
10
10
  alias: "e",
11
11
  describe: "环境数据文件JSON文件相对路径(优先级高于envData)",
@@ -31,12 +31,12 @@ const d = () => ({
31
31
  describe: "输出模式",
32
32
  type: "string",
33
33
  choices: [
34
- t.OVERWRITE,
35
- t.APPEND,
36
- t.REPLACE,
37
- t.RETURN
34
+ s.OVERWRITE,
35
+ s.APPEND,
36
+ s.REPLACE,
37
+ s.RETURN
38
38
  ],
39
- default: t.OVERWRITE
39
+ default: s.OVERWRITE
40
40
  },
41
41
  output: {
42
42
  alias: "o",
@@ -55,21 +55,21 @@ const d = () => ({
55
55
  type: "boolean",
56
56
  default: !1
57
57
  }
58
- }), n = "template", m = (e, s) => {
59
- console.log(e ? o.red(e) : o.red(s.message)), process.exit(1);
60
- }, g = i.description, u = `Usage: $0 ${n} [options]`, f = "Usage: $0 [options]", r = (e, s) => {
61
- const c = d();
62
- return e.strict().usage(s).help("help").version(i.version).alias("v", "version").alias("h", "help").options(c).fail(m).argv;
63
- }, b = (e) => r(e, u), C = {
58
+ }), n = a.cliConfig.commandName, p = (e, o) => {
59
+ console.log(e ? t.red(e) : t.red(o.message)), process.exit(1);
60
+ }, g = a.description, u = `Usage: $0 ${n} [options]`, f = "Usage: $0 [options]", r = (e, o) => {
61
+ const c = m();
62
+ return e.strict().usage(o).help("help").version(a.version).alias("v", "version").alias("h", "help").options(c).fail(p).argv;
63
+ }, b = (e) => r(e, u), N = {
64
64
  command: n,
65
65
  describe: g,
66
66
  builder: b,
67
- handler: a
68
- }, D = async () => {
69
- const e = l(p(process.argv)), s = await r(e, f);
70
- return a(s);
67
+ handler: i
68
+ }, O = async () => {
69
+ const e = l(d(process.argv)), o = await r(e, f);
70
+ return i(o);
71
71
  };
72
72
  export {
73
- C as command,
74
- D as createCli
73
+ N as command,
74
+ O as createCli
75
75
  };
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@done-coding/cli-template",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
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.2.2",
44
+ "@done-coding/cli-inject": "^0.3.0",
45
45
  "@types/lodash.get": "^4.4.9",
46
46
  "@types/lodash.set": "^4.3.9",
47
47
  "@types/lodash.template": "^4.5.3",
@@ -64,5 +64,5 @@
64
64
  "prompts": "^2.4.2",
65
65
  "yargs": "^17.7.2"
66
66
  },
67
- "gitHead": "e2dc7c4b0fa74aa83dc6173416aaffe0a0a445ad"
67
+ "gitHead": "0e9dcf532b8abf7608d07f738348538fa9a9864d"
68
68
  }
package/types/cli.d.ts CHANGED
File without changes
@@ -1,3 +1,3 @@
1
1
  import { type Options } from './utils';
2
2
  import type { ArgumentsCamelCase } from "yargs";
3
- export declare const handler: (argv: ArgumentsCamelCase<Options>) => Promise<string | undefined>;
3
+ export declare const handler: (argv: ArgumentsCamelCase<Options> | Options) => Promise<string | undefined>;
package/types/index.d.ts CHANGED
File without changes
@@ -1,7 +1,11 @@
1
1
  declare const _default: {
2
+ "version": "0.2.2",
2
3
  "name": "@done-coding/cli-template",
3
- "version": "0.2.1",
4
- "description": "预编译命令行工具"
4
+ "description": "预编译命令行工具",
5
+ "cliConfig": {
6
+ "namespaceDir": ".done-coding",
7
+ "commandName": "template"
8
+ }
5
9
  };
6
10
 
7
11
  export default _default;
package/types/main.d.ts CHANGED
File without changes
File without changes
File without changes