@jixo/cli 0.21.6 → 0.22.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/bundle/index.js +712 -1092
- package/dist/commands/google-aistudio.d.ts.map +1 -1
- package/dist/commands/google-aistudio.js +16 -3
- package/dist/commands/google-aistudio.js.map +1 -1
- package/dist/runCli.d.ts +0 -4
- package/dist/runCli.d.ts.map +1 -1
- package/dist/runCli.js +0 -7
- package/dist/runCli.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"google-aistudio.d.ts","sourceRoot":"","sources":["../../src/commands/google-aistudio.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAY,aAAa,EAAC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"google-aistudio.d.ts","sourceRoot":"","sources":["../../src/commands/google-aistudio.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAY,aAAa,EAAC,MAAM,OAAO,CAAC;AA+DpD;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAAE,aAAa,CAAC,MAAM,EAAE,MAAM,CAU/D,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { doSync } from "@jixo/dev/google-aistudio";
|
|
1
|
+
import { doGoogleAiStudioAutomation, doSync } from "@jixo/dev/google-aistudio";
|
|
2
2
|
// 定义 'sync' 子命令
|
|
3
3
|
const syncCommand = {
|
|
4
4
|
command: "sync [path]",
|
|
@@ -32,6 +32,19 @@ const syncCommand = {
|
|
|
32
32
|
doSync(optionsForDoSync);
|
|
33
33
|
},
|
|
34
34
|
};
|
|
35
|
+
const browserCommand = {
|
|
36
|
+
command: "browser [dir]",
|
|
37
|
+
aliases: ["B"],
|
|
38
|
+
describe: "browser-kit for aistudio.google.com",
|
|
39
|
+
builder: (yargs) => yargs.positional("dir", {
|
|
40
|
+
describe: "Directory for aistudio output contents",
|
|
41
|
+
type: "string",
|
|
42
|
+
default: process.cwd(),
|
|
43
|
+
}),
|
|
44
|
+
handler: async (argv) => {
|
|
45
|
+
doGoogleAiStudioAutomation(argv.dir);
|
|
46
|
+
},
|
|
47
|
+
};
|
|
35
48
|
/**
|
|
36
49
|
* @jixo/cli google-aistudio
|
|
37
50
|
*
|
|
@@ -39,11 +52,11 @@ const syncCommand = {
|
|
|
39
52
|
*/
|
|
40
53
|
export const googleAistudioCommand = {
|
|
41
54
|
command: "google-aistudio <command>",
|
|
42
|
-
aliases: ["GO"],
|
|
55
|
+
aliases: ["GO", "Go", "go"],
|
|
43
56
|
describe: "Commands for Google AI Studio integration",
|
|
44
57
|
builder: (yargs) => {
|
|
45
58
|
// 将 syncCommand 注册为 google-aistudio 的子命令
|
|
46
|
-
return yargs.command(syncCommand).demandCommand(1, "You must provide a sub-command for 'google-aistudio'.");
|
|
59
|
+
return yargs.command(syncCommand).command(browserCommand).demandCommand(1, "You must provide a sub-command for 'google-aistudio'.");
|
|
47
60
|
},
|
|
48
61
|
// 这个 handler 理论上不会被执行,因为 yargs 会要求一个子命令
|
|
49
62
|
handler: () => { },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"google-aistudio.js","sourceRoot":"","sources":["../../src/commands/google-aistudio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAmB,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"google-aistudio.js","sourceRoot":"","sources":["../../src/commands/google-aistudio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,0BAA0B,EAAE,MAAM,EAAmB,MAAM,2BAA2B,CAAC;AAU/F,gBAAgB;AAChB,MAAM,WAAW,GAAoC;IACnD,OAAO,EAAE,aAAa;IACtB,OAAO,EAAE,CAAC,GAAG,CAAC;IACd,QAAQ,EAAE,wCAAwC;IAClD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CACjB,KAAK;SACF,UAAU,CAAC,MAAM,EAAE;QAClB,QAAQ,EAAE,gCAAg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ACjB,yCAAyC;QACzC,OAAO,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,aAAa,CAAC,CAAC,EAAE,uDAAuD,CAAC,CAAC;IACtI,CAAC;IACD,wCAAwC;IACxC,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC;CAClB,CAAC","sourcesContent":["import {doGoogleAiStudioAutomation, doSync, type SyncOptions} from \"@jixo/dev/google-aistudio\";\nimport type {Arguments, CommandModule} from \"yargs\";\n\n// 定义 yargs builder 所需的参数接口\ninterface SyncArgs {\n path?: string;\n watch?: boolean;\n outDir?: string;\n}\n\n// 定义 'sync' 子命令\nconst syncCommand: CommandModule<object, SyncArgs> = {\n command: \"sync [path]\",\n aliases: [\"S\"],\n describe: \"Sync with aistudio.google.com contents\",\n builder: (yargs) =>\n yargs\n .positional(\"path\", {\n describe: \"Directory or file path to sync\",\n type: \"string\",\n default: process.cwd(),\n })\n .option(\"watch\", {\n alias: \"W\",\n type: \"boolean\",\n describe: \"Watch for file changes and sync automatically\",\n default: false,\n })\n .option(\"outDir\", {\n alias: \"O\",\n type: \"string\",\n describe: \"Specify the output directory for generated markdown files\",\n }),\n handler: async (argv: Arguments<SyncArgs>) => {\n // 将 yargs 的解析结果适配为 doSync 函数期望的格式。\n // 关键是 yargs 的位置参数是命名好的 (argv.path),而 doSync\n // 期望它在 `_` 数组的第一个位置。\n const optionsForDoSync: SyncOptions = {\n ...argv,\n _: [argv.path as string],\n };\n doSync(optionsForDoSync);\n },\n};\n\ninterface BrowserArgs {\n dir?: string;\n}\n\nconst browserCommand: CommandModule<object, BrowserArgs> = {\n command: \"browser [dir]\",\n aliases: [\"B\"],\n describe: \"browser-kit for aistudio.google.com\",\n builder: (yargs) =>\n yargs.positional(\"dir\", {\n describe: \"Directory for aistudio output contents\",\n type: \"string\",\n default: process.cwd(),\n }),\n handler: async (argv) => {\n doGoogleAiStudioAutomation(argv.dir);\n },\n};\n\n/**\n * @jixo/cli google-aistudio\n *\n * Group of commands for interacting with Google AI Studio.\n */\nexport const googleAistudioCommand: CommandModule<object, object> = {\n command: \"google-aistudio <command>\",\n aliases: [\"GO\", \"Go\", \"go\"],\n describe: \"Commands for Google AI Studio integration\",\n builder: (yargs) => {\n // 将 syncCommand 注册为 google-aistudio 的子命令\n return yargs.command(syncCommand).command(browserCommand).demandCommand(1, \"You must provide a sub-command for 'google-aistudio'.\");\n },\n // 这个 handler 理论上不会被执行,因为 yargs 会要求一个子命令\n handler: () => {},\n};\n"]}
|
package/dist/runCli.d.ts
CHANGED
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
import { import_meta_ponyfill } from "import-meta-ponyfill";
|
|
2
1
|
export declare const runCli: (args?: string[]) => Promise<void>;
|
|
3
|
-
type AnyImportMeta = typeof import_meta_ponyfill extends (x: infer T) => any ? T : never;
|
|
4
|
-
export declare const tryRunCli: (importMeta: AnyImportMeta, args?: string[]) => void;
|
|
5
|
-
export {};
|
|
6
2
|
//# sourceMappingURL=runCli.d.ts.map
|
package/dist/runCli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runCli.d.ts","sourceRoot":"","sources":["../src/runCli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runCli.d.ts","sourceRoot":"","sources":["../src/runCli.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,MAAM,GAAU,OAAM,MAAM,EAAiB,kBAmBzD,CAAC"}
|
package/dist/runCli.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
process.removeAllListeners("warning");
|
|
2
|
-
import { import_meta_ponyfill } from "import-meta-ponyfill";
|
|
3
2
|
import yargs from "yargs";
|
|
4
3
|
import { hideBin } from "yargs/helpers";
|
|
5
4
|
import packageJson from "../package.json" with { type: "json" };
|
|
@@ -24,10 +23,4 @@ export const runCli = async (args = process.argv) => {
|
|
|
24
23
|
console.log(" " + "─".repeat(Math.max(4, process.stdout.columns - 2)));
|
|
25
24
|
}
|
|
26
25
|
};
|
|
27
|
-
export const tryRunCli = (importMeta, args) => {
|
|
28
|
-
if (import_meta_ponyfill(importMeta).main) {
|
|
29
|
-
runCli(args);
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
tryRunCli(import.meta);
|
|
33
26
|
//# sourceMappingURL=runCli.js.map
|
package/dist/runCli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runCli.js","sourceRoot":"","sources":["../src/runCli.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;AACtC,OAAO,
|
|
1
|
+
{"version":3,"file":"runCli.js","sourceRoot":"","sources":["../src/runCli.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;AACtC,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;AAC9D,OAAO,EAAC,YAAY,EAAC,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAC,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAC,qBAAqB,EAAC,MAAM,+BAA+B,CAAC;AAEpE,MAAM,CAAC,MAAM,MAAM,GAAG,KAAK,EAAE,OAAiB,OAAO,CAAC,IAAI,EAAE,EAAE;IAC5D,IAAI,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC5B,WAAW;SACV,UAAU,CAAC,MAAM,CAAC;SAClB,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC;SAC5B,aAAa,CAAC,CAAC,EAAE,gDAAgD,CAAC;SAClE,MAAM,EAAE;SACR,IAAI,EAAE;SACN,OAAO,CAAC,YAAY,CAAC;SACrB,OAAO,CAAC,UAAU,CAAC;SACnB,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAElC,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","sourcesContent":["process.removeAllListeners(\"warning\");\nimport yargs from \"yargs\";\nimport {hideBin} from \"yargs/helpers\";\nimport packageJson from \"../package.json\" with {type: \"json\"};\nimport {applyCommand} from \"./commands/apply.js\";\nimport {genCommand} from \"./commands/gen.js\";\nimport {googleAistudioCommand} from \"./commands/google-aistudio.js\";\n\nexport const runCli = async (args: string[] = process.argv) => {\n let cli = yargs(hideBin(args))\n // jixo cli\n .scriptName(\"jixo\")\n .version(packageJson.version)\n .demandCommand(1, \"You need at least one command before moving on\")\n .strict()\n .help()\n .command(applyCommand)\n .command(genCommand)\n .command(googleAistudioCommand);\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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jixo/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"jixo": "./bundle/index.js"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"tslib": "^2.8.1",
|
|
26
26
|
"yargs": "^18.0.0",
|
|
27
27
|
"zod": "^4.0.0",
|
|
28
|
-
"@jixo/dev": "^1.
|
|
28
|
+
"@jixo/dev": "^1.13.0"
|
|
29
29
|
},
|
|
30
30
|
"peerDependenciesMeta": {
|
|
31
31
|
"@jixo/dev": {
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"tslib": "^2.8.1",
|
|
60
60
|
"yargs": "^18.0.0",
|
|
61
61
|
"zod": "^4.0.0",
|
|
62
|
-
"@jixo/dev": "^1.
|
|
62
|
+
"@jixo/dev": "^1.13.0"
|
|
63
63
|
},
|
|
64
64
|
"scripts": {
|
|
65
65
|
"build": "pnpm run '/^b\\:.*/'",
|