@yongdall/cli 0.2.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/bin.mjs ADDED
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env node
2
+ //#region cli/cli/bin.mjs
3
+ /**
4
+ *
5
+ * @param {string[]} args
6
+ */
7
+ async function execve(args) {
8
+ if (typeof process.execve === "function") process.execve(process.execPath, [process.argv0, ...args], process.env);
9
+ const { spawn } = await import("node:child_process");
10
+ const child = spawn(process.execPath, args, {
11
+ stdio: "inherit",
12
+ env: process.env
13
+ });
14
+ child.on("close", (code) => {
15
+ process.exit(code);
16
+ });
17
+ child.on("error", (err) => {
18
+ console.error("❌ 启动调试模式失败:", err.message);
19
+ process.exit(1);
20
+ });
21
+ }
22
+ const inspectRegex = /^--inspect(-brk|-port|-publish-uid|-wait)?(=|$)/;
23
+ const watchRegex = /^--watch(-path|-preserve-output)?(=|$)/;
24
+ const argv = process.argv.slice(2);
25
+ const index = argv.indexOf("--");
26
+ const mainArgv = index < 0 ? argv : argv.slice(0, index);
27
+ const execArgv = process.execArgv.find((v) => inspectRegex.test(v)) ? [] : mainArgv.filter((v) => inspectRegex.test(v) || watchRegex.test(v));
28
+ if (execArgv.length) execve([
29
+ ...execArgv,
30
+ process.argv[1],
31
+ ...mainArgv.filter((v) => !inspectRegex.test(v) && !watchRegex.test(v)),
32
+ ...index < 0 ? [] : argv.slice(index)
33
+ ]);
34
+ else {
35
+ const { loadCommands, runCommands } = await import("#index");
36
+ await runCommands(await loadCommands(), argv);
37
+ }
38
+
39
+ //#endregion
40
+ //# sourceMappingURL=bin.mjs.map
package/bin.mjs.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin.mjs","names":[],"sources":["../../cli/cli/bin.mjs"],"sourcesContent":["#!/usr/bin/env node\n/**\n * \n * @param {string[]} args \n */\nasync function execve(args) {\n\tif (typeof process.execve === 'function') {\n\t\tprocess.execve(process.execPath, [process.argv0, ...args], process.env);\n\t}\n\tconst { spawn } = await import('node:child_process');\n\n\t// 生成新的 Node.js 进程\n\tconst child = spawn(process.execPath, args, {\n\t\tstdio: 'inherit', // 继承父进程的 stdio\n\t\tenv: process.env\n\t});\n\n\t// 监听子进程退出\n\tchild.on('close', (code) => {\n\t\tprocess.exit(code);\n\t});\n\n\tchild.on('error', (err) => {\n\t\tconsole.error('❌ 启动调试模式失败:', err.message);\n\t\tprocess.exit(1);\n\t});\n}\nconst inspectRegex = /^--inspect(-brk|-port|-publish-uid|-wait)?(=|$)/;\nconst watchRegex = /^--watch(-path|-preserve-output)?(=|$)/;\n\nconst argv = process.argv.slice(2);\nconst index = argv.indexOf('--');\nconst mainArgv = index < 0 ? argv : argv.slice(0, index);\nconst execArgv = process.execArgv.find(v => inspectRegex.test(v)) ? [] : mainArgv.filter(v => inspectRegex.test(v) || watchRegex.test(v));\n\nif (execArgv.length) {\n\texecve([\n\t\t...execArgv,\n\t\tprocess.argv[1],\n\t\t...mainArgv.filter(v => !inspectRegex.test(v) && !watchRegex.test(v)),\n\t\t...index < 0 ? [] : argv.slice(index),\n\t]);\n\n} else {\n\tconst { loadCommands, runCommands } = await import('#index');\n\tconst commands = await loadCommands();\n\tawait runCommands(commands, argv);\n\n}\n"],"mappings":";;;;;;AAKA,eAAe,OAAO,MAAM;AAC3B,KAAI,OAAO,QAAQ,WAAW,WAC7B,SAAQ,OAAO,QAAQ,UAAU,CAAC,QAAQ,OAAO,GAAG,KAAK,EAAE,QAAQ,IAAI;CAExE,MAAM,EAAE,UAAU,MAAM,OAAO;CAG/B,MAAM,QAAQ,MAAM,QAAQ,UAAU,MAAM;EAC3C,OAAO;EACP,KAAK,QAAQ;EACb,CAAC;AAGF,OAAM,GAAG,UAAU,SAAS;AAC3B,UAAQ,KAAK,KAAK;GACjB;AAEF,OAAM,GAAG,UAAU,QAAQ;AAC1B,UAAQ,MAAM,eAAe,IAAI,QAAQ;AACzC,UAAQ,KAAK,EAAE;GACd;;AAEH,MAAM,eAAe;AACrB,MAAM,aAAa;AAEnB,MAAM,OAAO,QAAQ,KAAK,MAAM,EAAE;AAClC,MAAM,QAAQ,KAAK,QAAQ,KAAK;AAChC,MAAM,WAAW,QAAQ,IAAI,OAAO,KAAK,MAAM,GAAG,MAAM;AACxD,MAAM,WAAW,QAAQ,SAAS,MAAK,MAAK,aAAa,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,SAAS,QAAO,MAAK,aAAa,KAAK,EAAE,IAAI,WAAW,KAAK,EAAE,CAAC;AAEzI,IAAI,SAAS,OACZ,QAAO;CACN,GAAG;CACH,QAAQ,KAAK;CACb,GAAG,SAAS,QAAO,MAAK,CAAC,aAAa,KAAK,EAAE,IAAI,CAAC,WAAW,KAAK,EAAE,CAAC;CACrE,GAAG,QAAQ,IAAI,EAAE,GAAG,KAAK,MAAM,MAAM;CACrC,CAAC;KAEI;CACN,MAAM,EAAE,cAAc,gBAAgB,MAAM,OAAO;AAEnD,OAAM,YADW,MAAM,cAAc,EACT,KAAK"}
package/index.d.mts ADDED
@@ -0,0 +1,12 @@
1
+ import { Cli } from "@yongdall/cli-parse";
2
+
3
+ //#region cli/cli/index.d.mts
4
+ declare function loadCommands(): Promise<Record<string, Cli>>;
5
+ /**
6
+ *
7
+ * @param {Record<string, Cli>} commands
8
+ * @param {string[]} argv
9
+ */
10
+ declare function runCommands(commands: Record<string, Cli>, argv: string[]): Promise<void>;
11
+ //#endregion
12
+ export { loadCommands, runCommands };
package/index.mjs ADDED
@@ -0,0 +1,193 @@
1
+ import * as pathFn from "node:path";
2
+ import { fileURLToPath } from "node:url";
3
+ import * as fsPromises from "node:fs/promises";
4
+ import pluginRoots from "@yongdall/plugins";
5
+ import { loadConfigurationWithPath } from "@yongdall/load-configuration";
6
+ import { configRoot } from "@yongdall/root";
7
+ import cliParse from "@yongdall/cli-parse";
8
+
9
+ //#region cli/cli/showHelp.mjs
10
+ /** @import {Cli} from './index.mjs' */
11
+ /**
12
+ *
13
+ * @param {NodeJS.WriteStream} writable
14
+ * @param {string} buffer
15
+ * @returns {Promise<void>}
16
+ */
17
+ function write(writable, buffer) {
18
+ return new Promise((resolve, reject) => {
19
+ writable.write(buffer, (error) => {
20
+ if (error) reject(error);
21
+ else resolve();
22
+ });
23
+ });
24
+ }
25
+ /**
26
+ *
27
+ * @param {Cli.Env} env
28
+ * @param {Record<string, Cli>} commands
29
+ */
30
+ async function showHelp(env, commands) {
31
+ await write(process.stderr, `Usage: npx yongdall <command> [options]\n`);
32
+ await write(process.stderr, `\n命令:\n`);
33
+ for (const [name, command] of Object.entries(commands)) await write(process.stderr, ` ${name}\n ${command.description}\n`);
34
+ await write(process.stderr, `\n公共选项(部分命令有效):\n`);
35
+ await write(process.stderr, ` --development\n 开发模式\n`);
36
+ await write(process.stderr, ` --help\n 显示帮助\n`);
37
+ await write(process.stderr, ` --plugin=<plugin>\n 相关插件\n`);
38
+ await write(process.stderr, ` --force\n 强制执行\n`);
39
+ }
40
+
41
+ //#endregion
42
+ //#region cli/cli/index.mjs
43
+ /** @import { Cli } from '@yongdall/cli-parse' */
44
+ /**
45
+ *
46
+ * @param {string} scriptPath
47
+ * @returns {Cli.Command?}
48
+ */
49
+ function toScriptFn(scriptPath) {
50
+ switch (pathFn.extname(scriptPath)) {
51
+ case ".mjs":
52
+ case ".mts": return (...p) => import(scriptPath).then((v) => {
53
+ const f = v.default;
54
+ if (typeof f !== "function") return;
55
+ return f(...p);
56
+ });
57
+ case ".sh":
58
+ }
59
+ return null;
60
+ }
61
+ /**
62
+ *
63
+ * @param {string} path
64
+ * @returns {AsyncIterableIterator<[name: string, path: string]>}
65
+ */
66
+ async function* loadNodeModulePaths(path) {
67
+ const subNodeModules = pathFn.resolve(path, "node_modules");
68
+ if (!await fsPromises.stat(subNodeModules).then((f) => f.isDirectory(), () => false)) return;
69
+ for await (const name of await fsPromises.readdir(subNodeModules)) {
70
+ const path = pathFn.resolve(subNodeModules, name);
71
+ if (!(await fsPromises.stat(path).catch(() => null))?.isDirectory()) continue;
72
+ if (!name) continue;
73
+ if (name[0] === ".") continue;
74
+ if (name[0] !== "@") {
75
+ yield [name, path];
76
+ continue;
77
+ }
78
+ const scope = name;
79
+ const scopePath = path;
80
+ for await (const name of await fsPromises.readdir(scopePath)) {
81
+ const path = pathFn.resolve(scopePath, name);
82
+ if (!(await fsPromises.stat(path).catch(() => null))?.isDirectory()) continue;
83
+ if (!name) continue;
84
+ if (name[0] === ".") continue;
85
+ if (name[0] === "@") continue;
86
+ yield [`${scope}/${name}`, path];
87
+ }
88
+ }
89
+ }
90
+ /**
91
+ *
92
+ * @param {AsyncIterableIterator<[name: string, path: string]>} nodeModules
93
+ * @returns {AsyncIterableIterator<[name: string, path: string]>}
94
+ */
95
+ async function* filterNodeModules(nodeModules) {
96
+ for await (const nodeModule of nodeModules) {
97
+ const [name, root] = nodeModule;
98
+ const packageJson = await fsPromises.readFile(pathFn.resolve(root, "package.json"), "utf-8").then((v) => JSON.parse(v)).catch(() => null);
99
+ if (!packageJson || typeof packageJson !== "object") continue;
100
+ yield [name, await fsPromises.realpath(root)];
101
+ }
102
+ }
103
+ /**
104
+ *
105
+ * @param {string} root
106
+ */
107
+ function* getPaths(root) {
108
+ for (let path = root;;) {
109
+ yield path;
110
+ const parent = pathFn.dirname(path);
111
+ if (parent === path) break;
112
+ path = parent;
113
+ }
114
+ }
115
+ async function loadAllNodeModulePaths() {
116
+ /** @type {Map<string, {isPlugin: boolean; name: string; path: string}>} */
117
+ const nodeModulePaths = /* @__PURE__ */ new Map();
118
+ for (const [plugin, { root }] of Object.entries(pluginRoots)) nodeModulePaths.set(root, {
119
+ isPlugin: true,
120
+ name: plugin,
121
+ path: root
122
+ });
123
+ const rooPaths = [
124
+ ...getPaths(configRoot),
125
+ ...getPaths(process.cwd()),
126
+ ...getPaths(pathFn.dirname(fileURLToPath(import.meta.url)))
127
+ ];
128
+ for (const path of new Set(rooPaths)) for await (const [name, root] of filterNodeModules(loadNodeModulePaths(path))) {
129
+ if (nodeModulePaths.has(root)) continue;
130
+ nodeModulePaths.set(root, {
131
+ isPlugin: false,
132
+ name,
133
+ path: root
134
+ });
135
+ }
136
+ return nodeModulePaths.values();
137
+ }
138
+ async function loadCommands() {
139
+ /** @type {Record<string, Cli>} */
140
+ const commands = {};
141
+ for (const { path, name, isPlugin } of await loadAllNodeModulePaths()) {
142
+ const result = await loadConfigurationWithPath(pathFn.resolve(path, `cli.yongdall`)) || await loadConfigurationWithPath(pathFn.resolve(path, `yongdall/cli`)) || await loadConfigurationWithPath(pathFn.resolve(path, `cli/yongdall`));
143
+ if (!result) continue;
144
+ const [modulePath, cli] = result;
145
+ if (!cli || typeof cli !== "object") continue;
146
+ /** @type {{commands?: Record<string, any>}} */
147
+ const { commands: moduleCommands } = cli;
148
+ if (!moduleCommands || typeof moduleCommands !== "object") continue;
149
+ for (const [key, script] of Object.entries(moduleCommands)) {
150
+ if (Object.hasOwn(commands, key)) continue;
151
+ if (!script) continue;
152
+ /** @type {Cli.Command | null | string} */
153
+ let exec = typeof script === "object" ? script.exec : script;
154
+ let execPath = modulePath;
155
+ if (typeof exec === "string") {
156
+ execPath = pathFn.resolve(pathFn.dirname(modulePath), exec);
157
+ if (!await fsPromises.stat(execPath).then((f) => f.isFile(), () => false)) continue;
158
+ exec = toScriptFn(execPath);
159
+ }
160
+ const description = typeof script === "object" ? script.description : "";
161
+ if (typeof exec !== "function") continue;
162
+ commands[key] = {
163
+ exec,
164
+ modulePath,
165
+ module: name,
166
+ isPlugin,
167
+ execPath,
168
+ description: typeof description === "string" ? description : ""
169
+ };
170
+ }
171
+ }
172
+ return commands;
173
+ }
174
+ /**
175
+ *
176
+ * @param {Record<string, Cli>} commands
177
+ * @param {string[]} argv
178
+ */
179
+ async function runCommands(commands, argv) {
180
+ const { parameters, ...env } = cliParse(argv);
181
+ const name = parameters.length && parameters[0] !== "--" && parameters.shift();
182
+ const command = name && Object.hasOwn(commands, name) ? commands[name] : null;
183
+ const exec = command && typeof command === "object" && command.exec;
184
+ if (typeof exec !== "function") return showHelp(env, commands);
185
+ return exec({
186
+ parameters,
187
+ ...env
188
+ });
189
+ }
190
+
191
+ //#endregion
192
+ export { loadCommands, runCommands };
193
+ //# sourceMappingURL=index.mjs.map
package/index.mjs.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../cli/cli/showHelp.mjs","../../cli/cli/index.mjs"],"sourcesContent":["/** @import {Cli} from './index.mjs' */\n\n/**\n * \n * @param {NodeJS.WriteStream} writable \n * @param {string} buffer \n * @returns {Promise<void>}\n */\nfunction write(writable, buffer) {\n\treturn new Promise((resolve, reject) => {\n\t\twritable.write(buffer, error => {\n\t\t\tif (error) {\n\t\t\t\treject(error);\n\t\t\t} else {\n\t\t\t\tresolve();\n\t\t\t}\n\t\t});\n\t});\n}\n/**\n * \n * @param {Cli.Env} env \n * @param {Record<string, Cli>} commands \n */\nexport default async function showHelp(env, commands) {\n\tawait write(process.stderr, `Usage: npx yongdall <command> [options]\\n`);\n\tawait write(process.stderr, `\\n命令:\\n`);\n\tfor (const [name, command] of Object.entries(commands)) {\n\t\tawait write(process.stderr, ` ${name}\\n ${command.description}\\n`);\n\t}\n\tawait write(process.stderr, `\\n公共选项(部分命令有效):\\n`);\n\tawait write(process.stderr, ` --development\\n 开发模式\\n`);\n\tawait write(process.stderr, ` --help\\n 显示帮助\\n`);\n\tawait write(process.stderr, ` --plugin=<plugin>\\n 相关插件\\n`);\n\tawait write(process.stderr, ` --force\\n 强制执行\\n`);\n}\n","/** @import { Cli } from '@yongdall/cli-parse' */\n\nimport * as pathFn from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport * as fsPromises from 'node:fs/promises';\nimport pluginRoots from '@yongdall/plugins';\nimport { loadConfigurationWithPath } from '@yongdall/load-configuration';\nimport { configRoot } from '@yongdall/root';\nimport cliParse from '@yongdall/cli-parse';\nimport showHelp from './showHelp.mjs';\n\n/**\n * \n * @param {string} scriptPath \n * @returns {Cli.Command?}\n */\nfunction toScriptFn(scriptPath) {\n\tswitch (pathFn.extname(scriptPath)) {\n\t\tcase '.mjs':\n\t\tcase '.mts':\n\t\t\treturn (...p) => import(scriptPath).then(v => {\n\t\t\t\tconst f = v.default;\n\t\t\t\tif (typeof f !== 'function') { return; }\n\t\t\t\treturn f(...p);\n\t\t\t});\n\t\tcase '.sh':\n\t}\n\treturn null;\n}\n/**\n * \n * @param {string} path \n * @returns {AsyncIterableIterator<[name: string, path: string]>}\n */\nasync function* loadNodeModulePaths(path) {\n\tconst subNodeModules = pathFn.resolve(path, 'node_modules');\n\tif (!await fsPromises.stat(subNodeModules).then(f => f.isDirectory(), () => false)) { return; }\n\tfor await (const name of await fsPromises.readdir(subNodeModules)) {\n\t\tconst path = pathFn.resolve(subNodeModules, name);\n\t\tconst s = await fsPromises.stat(path).catch(() => null);\n\t\tif (!s?.isDirectory()) { continue; }\n\t\tif (!name) { continue; }\n\t\tif (name[0] === '.') { continue; }\n\t\tif (name[0] !== '@') { yield [name, path]; continue; }\n\t\tconst scope = name;\n\t\tconst scopePath = path;\n\n\t\tfor await (const name of await fsPromises.readdir(scopePath)) {\n\t\t\tconst path = pathFn.resolve(scopePath, name);\n\t\t\tconst s = await fsPromises.stat(path).catch(() => null);\n\t\t\tif (!s?.isDirectory()) { continue; }\n\t\t\tif (!name) { continue; }\n\t\t\tif (name[0] === '.') { continue; }\n\t\t\tif (name[0] === '@') { continue; }\n\t\t\tyield [`${scope}/${name}`, path];\n\t\t}\n\t}\n}\n\n/**\n * \n * @param {AsyncIterableIterator<[name: string, path: string]>} nodeModules \n * @returns {AsyncIterableIterator<[name: string, path: string]>}\n */\nasync function* filterNodeModules(nodeModules) {\n\tfor await (const nodeModule of nodeModules) {\n\t\tconst [name, root] = nodeModule;\n\t\tconst packageJson = await fsPromises.readFile(pathFn.resolve(root, 'package.json'), 'utf-8').then(v => JSON.parse(v)).catch(() => null);\n\t\tif (!packageJson || typeof packageJson !== 'object') { continue; }\n\t\tyield [name, await fsPromises.realpath(root)];\n\t}\n\n}\n\n\n/**\n * \n * @param {string} root \n */\nfunction* getPaths(root) {\n\tfor (let path = root; ;) {\n\t\tyield path;\n\t\tconst parent = pathFn.dirname(path);\n\t\tif (parent === path) { break; }\n\t\tpath = parent;\n\t}\n\n}\nasync function loadAllNodeModulePaths() {\n\t/** @type {Map<string, {isPlugin: boolean; name: string; path: string}>} */\n\tconst nodeModulePaths = new Map();\n\tfor (const [plugin, { root }] of Object.entries(pluginRoots)) {\n\t\tnodeModulePaths.set(root, { isPlugin: true, name: plugin, path: root });\n\t}\n\tconst rooPaths = [\n\t\t...getPaths(configRoot),\n\t\t...getPaths(process.cwd()),\n\t\t...getPaths(pathFn.dirname(fileURLToPath(import.meta.url))),\n\t];\n\tfor (const path of new Set(rooPaths)) {\n\t\tfor await (const [name, root] of filterNodeModules(loadNodeModulePaths(path))) {\n\t\t\tif (nodeModulePaths.has(root)) { continue; }\n\t\t\tnodeModulePaths.set(root, { isPlugin: false, name, path: root });\n\t\t}\n\t}\n\treturn nodeModulePaths.values();\n\n}\n\nexport async function loadCommands() {\n\t/** @type {Record<string, Cli>} */\n\tconst commands = {};\n\tfor (const { path, name, isPlugin } of await loadAllNodeModulePaths()) {\n\t\tconst result = await loadConfigurationWithPath(pathFn.resolve(path, `cli.yongdall`))\n\t\t\t|| await loadConfigurationWithPath(pathFn.resolve(path, `yongdall/cli`))\n\t\t\t|| await loadConfigurationWithPath(pathFn.resolve(path, `cli/yongdall`));\n\t\tif (!result) { continue; }\n\t\tconst [modulePath, cli] = result;\n\t\tif (!cli || typeof cli !== 'object') { continue; }\n\t\t/** @type {{commands?: Record<string, any>}} */\n\t\tconst { commands: moduleCommands } = cli;\n\t\tif (!moduleCommands || typeof moduleCommands !== 'object') { continue; }\n\n\t\tfor (const [key, script] of Object.entries(moduleCommands)) {\n\t\t\tif (Object.hasOwn(commands, key)) { continue; }\n\t\t\tif (!script) { continue; }\n\t\t\t/** @type {Cli.Command | null | string} */\n\t\t\tlet exec = typeof script === 'object' ? script.exec : script;\n\t\t\tlet execPath = modulePath;\n\t\t\tif (typeof exec === 'string') {\n\t\t\t\texecPath = pathFn.resolve(pathFn.dirname(modulePath), exec);\n\t\t\t\tif (!await fsPromises.stat(execPath).then(f => f.isFile(), () => false)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\texec = toScriptFn(execPath);\n\t\t\t}\n\t\t\tconst description = typeof script === 'object' ? script.description : '';\n\t\t\tif (typeof exec !== 'function') { continue; }\n\t\t\tcommands[key] = {\n\t\t\t\texec,\n\t\t\t\tmodulePath,\n\t\t\t\tmodule: name,\n\t\t\t\tisPlugin,\n\t\t\t\texecPath,\n\t\t\t\tdescription: typeof description === 'string' ? description : '',\n\t\t\t};\n\t\t}\n\t}\n\treturn commands;\n}\n\n/**\n * \n * @param {Record<string, Cli>} commands \n * @param {string[]} argv \n */\nexport async function runCommands(commands, argv) {\n\tconst {parameters, ...env} = cliParse(argv);\n\tconst name = parameters.length && parameters[0] !== '--' && parameters.shift();\n\tconst command = name && Object.hasOwn(commands, name) ? commands[name] : null;\n\tconst exec = command && typeof command === 'object' && command.exec;\n\tif (typeof exec !== 'function') { return showHelp(env, commands); }\n\treturn exec({parameters, ...env});\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAQA,SAAS,MAAM,UAAU,QAAQ;AAChC,QAAO,IAAI,SAAS,SAAS,WAAW;AACvC,WAAS,MAAM,SAAQ,UAAS;AAC/B,OAAI,MACH,QAAO,MAAM;OAEb,UAAS;IAET;GACD;;;;;;;AAOH,eAA8B,SAAS,KAAK,UAAU;AACrD,OAAM,MAAM,QAAQ,QAAQ,4CAA4C;AACxE,OAAM,MAAM,QAAQ,QAAQ,UAAU;AACtC,MAAK,MAAM,CAAC,MAAM,YAAY,OAAO,QAAQ,SAAS,CACrD,OAAM,MAAM,QAAQ,QAAQ,KAAK,KAAK,QAAQ,QAAQ,YAAY,IAAI;AAEvE,OAAM,MAAM,QAAQ,QAAQ,oBAA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c,QAAO,SAAS,KAAK,SAAS;AAChE,QAAO,KAAK;EAAC;EAAY,GAAG;EAAI,CAAC"}
package/package.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "@yongdall/cli",
3
+ "version": "0.2.0",
4
+ "type": "module",
5
+ "bin": {
6
+ "yongdall": "./bin.mjs"
7
+ },
8
+ "main": "./index.mjs",
9
+ "imports": {
10
+ "#index": "./index.mjs"
11
+ },
12
+ "dependencies": {
13
+ "@yongdall/cli-parse": "^0.2.0",
14
+ "@yongdall/load-configuration": "^0.2.0",
15
+ "@yongdall/plugins": "^0.2.0",
16
+ "@yongdall/root": "^0.2.0"
17
+ },
18
+ "exports": {
19
+ ".": "./index.mjs",
20
+ "./bin": "./bin.mjs"
21
+ }
22
+ }