@done-coding/cli-extract 0.0.2-alpha.0 → 0.0.3-alpha.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,6 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import { c as r } from "./index-daa98153.js";
3
- import "yargs";
4
- import "yargs/helpers";
2
+ import { c as m } from "./index-3e822021.js";
5
3
  import "@done-coding/cli-utils";
6
- r();
4
+ m();
@@ -0,0 +1,43 @@
1
+ #!/usr/bin/env node
2
+ import { createMainCommand as s, createSubcommand as i } from "@done-coding/cli-utils";
3
+ const r = async (n) => {
4
+ console.log(n);
5
+ }, d = {
6
+ version: "0.0.3-alpha.0",
7
+ name: "@done-coding/cli-extract",
8
+ description: "信息提取命令行工具",
9
+ cliConfig: {
10
+ namespaceDir: ".done-coding",
11
+ moduleName: "extract"
12
+ }
13
+ }, {
14
+ version: m,
15
+ description: l,
16
+ cliConfig: { moduleName: e }
17
+ } = d, p = () => ({
18
+ xx: {
19
+ alias: "x",
20
+ describe: "模版测试",
21
+ type: "string",
22
+ demandOption: !0
23
+ }
24
+ }), o = {
25
+ describe: l,
26
+ version: m,
27
+ options: p(),
28
+ handler: r
29
+ }, t = (n = !1) => {
30
+ const c = n ? e : void 0, a = `$0${n ? ` ${e}` : ""} [options]`;
31
+ return { command: c, usage: a };
32
+ }, g = async () => s({
33
+ ...o,
34
+ ...t()
35
+ }), f = () => i({
36
+ ...o,
37
+ ...t(!0)
38
+ });
39
+ export {
40
+ f as a,
41
+ g as c,
42
+ r as h
43
+ };
package/es/index.mjs CHANGED
@@ -1,9 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import { a as e, h as i } from "./index-daa98153.js";
3
- import "yargs";
4
- import "yargs/helpers";
2
+ import { a as n, h as o } from "./index-3e822021.js";
5
3
  import "@done-coding/cli-utils";
6
4
  export {
7
- e as command,
8
- i as handler
5
+ n as crateAsSubcommand,
6
+ o as handler
9
7
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@done-coding/cli-extract",
3
- "version": "0.0.2-alpha.0",
3
+ "version": "0.0.3-alpha.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.7-alpha.0",
44
+ "@done-coding/cli-inject": "^0.5.0-alpha.0",
45
45
  "@types/node": "^16.0.0",
46
46
  "@types/yargs": "^17.0.28",
47
47
  "rimraf": "^6.0.1",
@@ -53,8 +53,7 @@
53
53
  "node": ">=16.0.0"
54
54
  },
55
55
  "dependencies": {
56
- "@done-coding/cli-utils": "^0.2.2-alpha.0",
57
- "yargs": "^17.7.2"
56
+ "@done-coding/cli-utils": "^0.3.0-alpha.0"
58
57
  },
59
- "gitHead": "2e59e86ee192e023138e7475f4abbb5e7c42b29e"
58
+ "gitHead": "c5a54bdf08759425701a2024442a923883065189"
60
59
  }
@@ -1,3 +1,3 @@
1
1
  import type { Options } from './utils';
2
- import type { ArgumentsCamelCase } from "yargs";
3
- export declare const handler: (argv: ArgumentsCamelCase<Options>) => Promise<void>;
2
+ import type { CliHandlerArgv } from "@done-coding/cli-utils";
3
+ export declare const handler: (argv: CliHandlerArgv<Options>) => Promise<void>;
package/types/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export { handler } from "./handler";
2
- export { command } from "./main";
2
+ export { crateAsSubcommand } from "./main";
@@ -1,5 +1,5 @@
1
1
  declare const _default: {
2
- "version": "0.0.2-alpha.0",
2
+ "version": "0.0.3-alpha.0",
3
3
  "name": "@done-coding/cli-extract",
4
4
  "description": "信息提取命令行工具",
5
5
  "cliConfig": {
package/types/main.d.ts CHANGED
@@ -1,4 +1,9 @@
1
- import type { CommandModule } from "yargs";
2
- import type { Options } from './utils';
3
- export declare const command: CommandModule<Options, Options>;
4
- export declare const createCli: () => Promise<void>;
1
+ /// <reference types="yargs" />
2
+ /** 作为主命令创建 */
3
+ export declare const createCommand: () => Promise<void | {
4
+ [x: string]: unknown;
5
+ _: (string | number)[];
6
+ $0: string;
7
+ }>;
8
+ /** 作为子命令创建 */
9
+ export declare const crateAsSubcommand: () => import("yargs").CommandModule<{}, {}>;
@@ -1,40 +0,0 @@
1
- #!/usr/bin/env node
2
- import c from "yargs";
3
- import { hideBin as m } from "yargs/helpers";
4
- import { log as s } from "@done-coding/cli-utils";
5
- const i = async (o) => {
6
- console.log(o);
7
- }, n = {
8
- version: "0.0.2-alpha.0",
9
- name: "@done-coding/cli-extract",
10
- description: "信息提取命令行工具",
11
- cliConfig: {
12
- namespaceDir: ".done-coding",
13
- moduleName: "extract"
14
- }
15
- }, l = () => ({
16
- xx: {
17
- alias: "x",
18
- describe: "模版测试",
19
- type: "string",
20
- demandOption: !0
21
- }
22
- }), a = n.cliConfig.moduleName, d = (o, e) => {
23
- o ? s.error(o) : s.error(e.message), process.exit(1);
24
- }, p = n.description, g = `Usage: $0 ${a} [options]`, u = "Usage: $0 [options]", r = (o, e) => {
25
- const t = l();
26
- return o.strict().usage(e).help("help").version(n.version).alias("v", "version").alias("h", "help").options(t).fail(d).argv;
27
- }, f = (o) => r(o, g), C = {
28
- command: a,
29
- describe: p,
30
- builder: f,
31
- handler: i
32
- }, b = async () => {
33
- const o = c(m(process.argv)), e = await r(o, u);
34
- return i(e);
35
- };
36
- export {
37
- C as a,
38
- b as c,
39
- i as h
40
- };