@jixo/cli 0.20.0 → 0.21.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/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,MAAM,GAAU,OAAM,MAAM,EAAiB,kBAyBzD,CAAC"}
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,MAAM,GAAU,OAAM,MAAM,EAAiB,kBAyBzD,CAAC"}
package/dist/cli.js CHANGED
@@ -1,4 +1,5 @@
1
1
  process.removeAllListeners("warning");
2
+ import { import_meta_ponyfill } from "import-meta-ponyfill";
2
3
  import fs from "node:fs";
3
4
  import path from "node:path";
4
5
  import { fileURLToPath } from "node:url";
@@ -27,4 +28,7 @@ export const runCli = async (args = process.argv) => {
27
28
  console.log(" " + "─".repeat(Math.max(4, process.stdout.columns - 2)));
28
29
  }
29
30
  };
31
+ if (import_meta_ponyfill(import.meta).main) {
32
+ runCli();
33
+ }
30
34
  //# sourceMappingURL=cli.js.map
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;AACtC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AACtC,OAAO,WAAW,MAAM,iBAAiB,CAAC,OAAM,IAAI,EAAE,MAAM,EAAC,CAAC;AAE9D,MAAM,CAAC,MAAM,MAAM,GAAG,KAAK,E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C,EAAE,CAAC;QACxB,GAAG,CAAC,QAAQ,EAAE,CAAC;QACf,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACzE,CAAC;AACH,CAAC,CAAC","sourcesContent":["process.removeAllListeners(\"warning\");\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport {fileURLToPath} from \"node:url\";\nimport yargs from \"yargs\";\nimport {hideBin} from \"yargs/helpers\";\nimport packageJson from \"../package.json\" with {type: \"json\"};\n\nexport const runCli = async (args: string[] = process.argv) => {\n let cli = yargs(hideBin(args)).scriptName(\"jixo\").version(packageJson.version).demandCommand(1, \"You need at least one command before moving on\").strict().help();\n\n // 动态加载命令\n const __dirname = path.dirname(fileURLToPath(import.meta.url));\n const commandsDir = path.join(__dirname, \"commands\");\n const commandFiles = fs.readdirSync(commandsDir).filter((file) => file.endsWith(\".js\") || file.endsWith(\".ts\"));\n\n for (const file of commandFiles) {\n const commandModule = await import(path.join(commandsDir, file));\n // 假设每个模块导出一个或多个 yargs 命令模块\n for (const key in commandModule) {\n if (typeof commandModule[key] === \"object\" && commandModule[key].command) {\n cli = cli.command(commandModule[key]);\n }\n }\n }\n\n const argv = await cli.parse();\n\n // 如果没有命令被执行,显示帮助信息\n if (argv._.length === 0) {\n cli.showHelp();\n console.log(\" \" + \"─\".repeat(Math.max(4, process.stdout.columns - 2)));\n }\n};\n"]}
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;AACtC,OAAO,EAAC,oBAAoB,EAAC,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAC,a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,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC;YACxC,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,KAAK,EAAE,CAAC;IAE/B,mBAAmB;IACnB,IAAI,IAAI,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,GAAG,CAAC,QAAQ,EAAE,CAAC;QACf,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACzE,CAAC;AACH,CAAC,CAAC;AAEF,IAAI,oBAAoB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;IAC3C,MAAM,EAAE,CAAC;AACX,CAAC","sourcesContent":["process.removeAllListeners(\"warning\");\nimport {import_meta_ponyfill} from \"import-meta-ponyfill\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport {fileURLToPath} from \"node:url\";\nimport yargs from \"yargs\";\nimport {hideBin} from \"yargs/helpers\";\nimport packageJson from \"../package.json\" with {type: \"json\"};\n\nexport const runCli = async (args: string[] = process.argv) => {\n let cli = yargs(hideBin(args)).scriptName(\"jixo\").version(packageJson.version).demandCommand(1, \"You need at least one command before moving on\").strict().help();\n\n // 动态加载命令\n const __dirname = path.dirname(fileURLToPath(import.meta.url));\n const commandsDir = path.join(__dirname, \"commands\");\n const commandFiles = fs.readdirSync(commandsDir).filter((file) => file.endsWith(\".js\") || file.endsWith(\".ts\"));\n\n for (const file of commandFiles) {\n const commandModule = await import(path.join(commandsDir, file));\n // 假设每个模块导出一个或多个 yargs 命令模块\n for (const key in commandModule) {\n if (typeof commandModule[key] === \"object\" && commandModule[key].command) {\n cli = cli.command(commandModule[key]);\n }\n }\n }\n\n const argv = await cli.parse();\n\n // 如果没有命令被执行,显示帮助信息\n if (argv._.length === 0) {\n cli.showHelp();\n console.log(\" \" + \"─\".repeat(Math.max(4, process.stdout.columns - 2)));\n }\n};\n\nif (import_meta_ponyfill(import.meta).main) {\n runCli();\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1,2 @@
1
- import { runCli } from "./cli.js";
2
- // 启动 CLI
3
- runCli();
1
+ export * from "./cli.js";
4
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAEhC,SAAS;AACT,MAAM,EAAE,CAAC","sourcesContent":["import {runCli} from \"./cli.js\";\n\n// 启动 CLI\nrunCli();\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC","sourcesContent":["export * from \"./cli.js\";\n"]}
package/package.json CHANGED
@@ -1,36 +1,37 @@
1
1
  {
2
2
  "name": "@jixo/cli",
3
- "version": "0.20.0",
3
+ "version": "0.21.0",
4
4
  "type": "module",
5
5
  "bin": {
6
- "jixo": "./dist/index.js"
6
+ "jixo": "./bundle/index.js"
7
7
  },
8
8
  "files": [
9
9
  "dist"
10
10
  ],
11
11
  "exports": {
12
- ".": {
13
- "default": "./dist/index.js"
14
- }
12
+ ".": "./dist/index.js"
15
13
  },
16
14
  "dependencies": {
17
15
  "import-meta-ponyfill": "^3.2.2",
18
16
  "ts-pattern": "^5.7.1",
19
17
  "tslib": "^2.8.1",
20
18
  "yargs": "^18.0.0",
21
- "zod": "^3.25.76",
22
- "@jixo/dev": "^1.11.4"
19
+ "zod": "^4.0.0",
20
+ "@jixo/dev": "^1.12.0"
23
21
  },
24
22
  "devDependencies": {
25
23
  "@parcel/watcher": "^2.5.1",
26
24
  "@types/debug": "^4.1.12",
27
25
  "@types/json-schema": "^7.0.15",
28
26
  "@types/ms": "^2.1.0",
29
- "@types/node": "^24.0.12",
27
+ "@types/node": "^24.1.0",
30
28
  "@types/semver": "^7.7.0",
31
29
  "@types/yargs": "^17.0.33"
32
30
  },
33
31
  "scripts": {
32
+ "build": "pnpm run '/^b\\:.*/'",
33
+ "b:ts": "tsc --build",
34
+ "b:bundle": "tsdown",
34
35
  "gen-prompts": "node ./scripts/gen-prompts.ts"
35
36
  }
36
37
  }
package/dist/cli.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare const runCli: (args?: string[]) => Promise<void>;
2
- //# sourceMappingURL=cli.d.ts.map
@@ -1,9 +0,0 @@
1
- import { type ApplyOptions } from "@jixo/dev/apply-ai-response";
2
- import type { CommandModule } from "yargs";
3
- /**
4
- * @jixo/cli apply
5
- *
6
- * Apply changes from AI-generated markdown file.
7
- */
8
- export declare const applyCommand: CommandModule<object, ApplyOptions>;
9
- //# sourceMappingURL=apply.d.ts.map
@@ -1,9 +0,0 @@
1
- import { type GenOptions } from "@jixo/dev/gen-prompt";
2
- import type { CommandModule } from "yargs";
3
- /**
4
- * @jixo/cli gen
5
- *
6
- * Generate AI prompts from metadata files (*.meta.md).
7
- */
8
- export declare const genCommand: CommandModule<object, GenOptions>;
9
- //# sourceMappingURL=gen.d.ts.map
@@ -1,8 +0,0 @@
1
- import type { CommandModule } from "yargs";
2
- /**
3
- * @jixo/cli google-aistudio
4
- *
5
- * Group of commands for interacting with Google AI Studio.
6
- */
7
- export declare const googleAistudioCommand: CommandModule<object, object>;
8
- //# sourceMappingURL=google-aistudio.d.ts.map
package/dist/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.d.ts.map