@guanghechen/commander 1.0.1

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/CHANGELOG.md ADDED
@@ -0,0 +1,17 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ ## <small>1.0.1 (2024-09-28)</small>
7
+
8
+ * :art: improve: reuse @guanghechen/cli ([6c8e6a0](https://github.com/guanghechen/node-scaffolds/commit/6c8e6a0))
9
+ * :wrench: chore: fix publish issues ([7316526](https://github.com/guanghechen/node-scaffolds/commit/7316526))
10
+
11
+
12
+
13
+
14
+
15
+ ## <small>1.0.1 (2024-09-28)</small>
16
+
17
+ * :art: improve: reuse @guanghechen/cli ([6c8e6a0](https://github.com/guanghechen/node-scaffolds/commit/6c8e6a0))
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020-2023 guanghechen (https://github.com/guanghechen)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,83 @@
1
+ <header>
2
+ <h1 align="center">
3
+ <a href="https://github.com/guanghechen/node-scaffolds/tree/@guanghechen/commander@1.0.1/packages/commander#readme">@guanghechen/commander</a>
4
+ </h1>
5
+ <div align="center">
6
+ <a href="https://www.npmjs.com/package/@guanghechen/commander">
7
+ <img
8
+ alt="Npm Version"
9
+ src="https://img.shields.io/npm/v/@guanghechen/commander.svg"
10
+ />
11
+ </a>
12
+ <a href="https://www.npmjs.com/package/@guanghechen/commander">
13
+ <img
14
+ alt="Npm Download"
15
+ src="https://img.shields.io/npm/dm/@guanghechen/commander.svg"
16
+ />
17
+ </a>
18
+ <a href="https://www.npmjs.com/package/@guanghechen/commander">
19
+ <img
20
+ alt="Npm License"
21
+ src="https://img.shields.io/npm/l/@guanghechen/commander.svg"
22
+ />
23
+ </a>
24
+ <a href="#install">
25
+ <img
26
+ alt="Module Formats: cjs"
27
+ src="https://img.shields.io/badge/module_formats-cjs-green.svg"
28
+ />
29
+ </a>
30
+ <a href="https://github.com/nodejs/node">
31
+ <img
32
+ alt="Node.js Version"
33
+ src="https://img.shields.io/node/v/@guanghechen/commander"
34
+ />
35
+ </a>
36
+ <a href="https://github.com/facebook/jest">
37
+ <img
38
+ alt="Eslint Version"
39
+ src="https://img.shields.io/npm/dependency-version/@guanghechen/commander/peer/jest"
40
+ />
41
+ </a>
42
+ <a href="https://github.com/facebook/jest">
43
+ <img
44
+ alt="Tested with Jest"
45
+ src="https://img.shields.io/badge/tested_with-jest-9c465e.svg"
46
+ />
47
+ </a>
48
+ <a href="https://github.com/prettier/prettier">
49
+ <img
50
+ alt="Code Style: prettier"
51
+ src="https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square"
52
+ />
53
+ </a>
54
+ </div>
55
+ </header>
56
+ <br/>
57
+
58
+
59
+ Utility functions for creating command programs tools based on [commander.js][].
60
+
61
+ ## Install
62
+
63
+ * npm
64
+
65
+ ```bash
66
+ npm install --save-dev @guanghechen/commander
67
+ ```
68
+
69
+ * yarn
70
+
71
+ ```bash
72
+ yarn add --dev @guanghechen/commander
73
+ ```
74
+
75
+
76
+ ## Related
77
+
78
+ * [commander.js][]
79
+
80
+
81
+ [homepage]: https://github.com/guanghechen/node-scaffolds/tree/@guanghechen/commander@1.0.1/packages/commander#readme
82
+ [commander.js]: https://github.com/tj/commander.js/
83
+
@@ -0,0 +1,175 @@
1
+ 'use strict';
2
+
3
+ var commander = require('commander');
4
+ var exec = require('@guanghechen/exec');
5
+ var select = require('@inquirer/select');
6
+ var commandExists = require('command-exists');
7
+ var cli = require('@guanghechen/cli');
8
+
9
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
10
+
11
+ var select__default = /*#__PURE__*/_interopDefault(select);
12
+ var commandExists__default = /*#__PURE__*/_interopDefault(commandExists);
13
+
14
+ class Command extends commander.Command {
15
+ _actionHandler;
16
+ _optionValues;
17
+ _storeOptionsAsProperties;
18
+ _version;
19
+ _versionOptionName;
20
+ constructor() {
21
+ super();
22
+ this._optionValues = {};
23
+ this._storeOptionsAsProperties = false;
24
+ }
25
+ action(fn) {
26
+ const listener = (args) => {
27
+ const expectedArgsCount = this.registeredArguments.length;
28
+ const actionArgs = [
29
+ args.slice(0, expectedArgsCount),
30
+ this.opts(),
31
+ args.slice(expectedArgsCount),
32
+ this,
33
+ ];
34
+ const actionResult = fn.apply(this, actionArgs);
35
+ return actionResult;
36
+ };
37
+ this._actionHandler = listener;
38
+ return this;
39
+ }
40
+ opts() {
41
+ const nodes = [this];
42
+ for (let parent = this.parent; parent != null; parent = parent.parent) {
43
+ nodes.push(parent);
44
+ }
45
+ const options = {};
46
+ for (let i = nodes.length - 1; i >= 0; --i) {
47
+ const o = nodes[i];
48
+ if (o._storeOptionsAsProperties) {
49
+ for (const option of o.options) {
50
+ const key = option.attributeName();
51
+ options[key] = key === o._versionOptionName ? o._version : o[key];
52
+ }
53
+ }
54
+ else {
55
+ const optionValues = o._optionValues;
56
+ for (const key of Object.getOwnPropertyNames(optionValues)) {
57
+ options[key] = optionValues[key];
58
+ }
59
+ }
60
+ }
61
+ return options;
62
+ }
63
+ }
64
+
65
+ function createMainCommandMounter(create, handle) {
66
+ return (program, opts) => {
67
+ const command = create(handle);
68
+ if (command.name().length <= 0) {
69
+ command.name('__main__');
70
+ }
71
+ program.addCommand(command, { ...opts, isDefault: true });
72
+ };
73
+ }
74
+ function createMainCommandExecutor(create, handle) {
75
+ return (args) => {
76
+ return new Promise(resolve => {
77
+ const wrappedHandler = async (options) => {
78
+ await handle(options);
79
+ resolve();
80
+ };
81
+ const command = create(wrappedHandler);
82
+ command.parse(args);
83
+ });
84
+ };
85
+ }
86
+
87
+ class SubCommand {
88
+ mount(parentCommand, opts) {
89
+ const processor = this;
90
+ const command = this.command(processor);
91
+ parentCommand.addCommand(command, opts);
92
+ }
93
+ execute(parentCommand, rawArgs) {
94
+ return new Promise((resolve, reject) => {
95
+ const processor = {
96
+ process: async (args, options) => {
97
+ try {
98
+ await this.process(args, options);
99
+ resolve();
100
+ }
101
+ catch (error) {
102
+ reject(error);
103
+ }
104
+ },
105
+ };
106
+ const command = this.command(processor);
107
+ parentCommand.addCommand(command);
108
+ parentCommand.parse(rawArgs);
109
+ });
110
+ }
111
+ async process(args, options) {
112
+ const processor = await this.resolveProcessor(args, options);
113
+ await processor.process(args, options);
114
+ }
115
+ }
116
+
117
+ function createTopCommand(commandName, version) {
118
+ const program = new Command();
119
+ program
120
+ .storeOptionsAsProperties(false)
121
+ .version(version)
122
+ .name(commandName)
123
+ .option('--log-encoding <encoding>', 'Encoding of log file.')
124
+ .option('--log-filepath <filepath>', 'Path which the log file is located.')
125
+ .option('--log-level <level>', 'Log level.')
126
+ .option('--log-name <name>', 'Logger name.')
127
+ .option('--log-mode <normal|loose>', 'Log format mode.')
128
+ .option('--log-flight <[[no-]<date|title|colorful|inline>]>', 'Enable / disable logger flights.', (val, acc) => acc.concat(val), [])
129
+ .option('-c, --config-path, --configPath <configPath>', 'config filepaths', (val, acc) => acc.concat(val), [])
130
+ .option('--parastic-config-path, --parasticConfigFilepath <parasticConfigFilepath>', 'parastic config filepath')
131
+ .option('--parastic-config-entry, --parasticConfigEntry <parasticConfigEntry>', 'parastic config filepath')
132
+ .option('--workspace <workspace>', 'The root dir to locate the config files and resolve relative paths');
133
+ return program;
134
+ }
135
+
136
+ const hasGitInstalled = () => commandExists__default.default.sync('git');
137
+ async function installDependencies(params) {
138
+ const { cwd, plopBypass, reporter } = params;
139
+ const hasYarnInstalled = commandExists__default.default.sync('yarn');
140
+ if (!hasYarnInstalled) {
141
+ const hasNpmInstalled = commandExists__default.default.sync('npm');
142
+ if (!hasNpmInstalled)
143
+ return;
144
+ }
145
+ let npmScript;
146
+ if (plopBypass.length > 0) {
147
+ npmScript = plopBypass.shift();
148
+ }
149
+ else {
150
+ npmScript = await select__default.default({
151
+ message: 'npm or yarn?',
152
+ choices: ['npm', 'yarn', 'skip'],
153
+ default: hasYarnInstalled ? 'yarn' : 'npm',
154
+ });
155
+ }
156
+ reporter?.debug?.('npmScript:', npmScript);
157
+ if (npmScript === 'skip')
158
+ return;
159
+ await exec.safeExec({ from: 'installDependencies', cmd: npmScript, args: ['install'], cwd, reporter });
160
+ }
161
+
162
+ exports.Command = Command;
163
+ exports.SubCommand = SubCommand;
164
+ exports.createMainCommandExecutor = createMainCommandExecutor;
165
+ exports.createMainCommandMounter = createMainCommandMounter;
166
+ exports.createTopCommand = createTopCommand;
167
+ exports.hasGitInstalled = hasGitInstalled;
168
+ exports.installDependencies = installDependencies;
169
+ Object.keys(cli).forEach(function (k) {
170
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
171
+ enumerable: true,
172
+ get: function () { return cli[k]; }
173
+ });
174
+ });
175
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1,156 @@
1
+ import { Command as Command$1 } from 'commander';
2
+ import { safeExec } from '@guanghechen/exec';
3
+ import select from '@inquirer/select';
4
+ import commandExists from 'command-exists';
5
+ export * from '@guanghechen/cli';
6
+
7
+ class Command extends Command$1 {
8
+ _actionHandler;
9
+ _optionValues;
10
+ _storeOptionsAsProperties;
11
+ _version;
12
+ _versionOptionName;
13
+ constructor() {
14
+ super();
15
+ this._optionValues = {};
16
+ this._storeOptionsAsProperties = false;
17
+ }
18
+ action(fn) {
19
+ const listener = (args) => {
20
+ const expectedArgsCount = this.registeredArguments.length;
21
+ const actionArgs = [
22
+ args.slice(0, expectedArgsCount),
23
+ this.opts(),
24
+ args.slice(expectedArgsCount),
25
+ this,
26
+ ];
27
+ const actionResult = fn.apply(this, actionArgs);
28
+ return actionResult;
29
+ };
30
+ this._actionHandler = listener;
31
+ return this;
32
+ }
33
+ opts() {
34
+ const nodes = [this];
35
+ for (let parent = this.parent; parent != null; parent = parent.parent) {
36
+ nodes.push(parent);
37
+ }
38
+ const options = {};
39
+ for (let i = nodes.length - 1; i >= 0; --i) {
40
+ const o = nodes[i];
41
+ if (o._storeOptionsAsProperties) {
42
+ for (const option of o.options) {
43
+ const key = option.attributeName();
44
+ options[key] = key === o._versionOptionName ? o._version : o[key];
45
+ }
46
+ }
47
+ else {
48
+ const optionValues = o._optionValues;
49
+ for (const key of Object.getOwnPropertyNames(optionValues)) {
50
+ options[key] = optionValues[key];
51
+ }
52
+ }
53
+ }
54
+ return options;
55
+ }
56
+ }
57
+
58
+ function createMainCommandMounter(create, handle) {
59
+ return (program, opts) => {
60
+ const command = create(handle);
61
+ if (command.name().length <= 0) {
62
+ command.name('__main__');
63
+ }
64
+ program.addCommand(command, { ...opts, isDefault: true });
65
+ };
66
+ }
67
+ function createMainCommandExecutor(create, handle) {
68
+ return (args) => {
69
+ return new Promise(resolve => {
70
+ const wrappedHandler = async (options) => {
71
+ await handle(options);
72
+ resolve();
73
+ };
74
+ const command = create(wrappedHandler);
75
+ command.parse(args);
76
+ });
77
+ };
78
+ }
79
+
80
+ class SubCommand {
81
+ mount(parentCommand, opts) {
82
+ const processor = this;
83
+ const command = this.command(processor);
84
+ parentCommand.addCommand(command, opts);
85
+ }
86
+ execute(parentCommand, rawArgs) {
87
+ return new Promise((resolve, reject) => {
88
+ const processor = {
89
+ process: async (args, options) => {
90
+ try {
91
+ await this.process(args, options);
92
+ resolve();
93
+ }
94
+ catch (error) {
95
+ reject(error);
96
+ }
97
+ },
98
+ };
99
+ const command = this.command(processor);
100
+ parentCommand.addCommand(command);
101
+ parentCommand.parse(rawArgs);
102
+ });
103
+ }
104
+ async process(args, options) {
105
+ const processor = await this.resolveProcessor(args, options);
106
+ await processor.process(args, options);
107
+ }
108
+ }
109
+
110
+ function createTopCommand(commandName, version) {
111
+ const program = new Command();
112
+ program
113
+ .storeOptionsAsProperties(false)
114
+ .version(version)
115
+ .name(commandName)
116
+ .option('--log-encoding <encoding>', 'Encoding of log file.')
117
+ .option('--log-filepath <filepath>', 'Path which the log file is located.')
118
+ .option('--log-level <level>', 'Log level.')
119
+ .option('--log-name <name>', 'Logger name.')
120
+ .option('--log-mode <normal|loose>', 'Log format mode.')
121
+ .option('--log-flight <[[no-]<date|title|colorful|inline>]>', 'Enable / disable logger flights.', (val, acc) => acc.concat(val), [])
122
+ .option('-c, --config-path, --configPath <configPath>', 'config filepaths', (val, acc) => acc.concat(val), [])
123
+ .option('--parastic-config-path, --parasticConfigFilepath <parasticConfigFilepath>', 'parastic config filepath')
124
+ .option('--parastic-config-entry, --parasticConfigEntry <parasticConfigEntry>', 'parastic config filepath')
125
+ .option('--workspace <workspace>', 'The root dir to locate the config files and resolve relative paths');
126
+ return program;
127
+ }
128
+
129
+ const hasGitInstalled = () => commandExists.sync('git');
130
+ async function installDependencies(params) {
131
+ const { cwd, plopBypass, reporter } = params;
132
+ const hasYarnInstalled = commandExists.sync('yarn');
133
+ if (!hasYarnInstalled) {
134
+ const hasNpmInstalled = commandExists.sync('npm');
135
+ if (!hasNpmInstalled)
136
+ return;
137
+ }
138
+ let npmScript;
139
+ if (plopBypass.length > 0) {
140
+ npmScript = plopBypass.shift();
141
+ }
142
+ else {
143
+ npmScript = await select({
144
+ message: 'npm or yarn?',
145
+ choices: ['npm', 'yarn', 'skip'],
146
+ default: hasYarnInstalled ? 'yarn' : 'npm',
147
+ });
148
+ }
149
+ reporter?.debug?.('npmScript:', npmScript);
150
+ if (npmScript === 'skip')
151
+ return;
152
+ await safeExec({ from: 'installDependencies', cmd: npmScript, args: ['install'], cwd, reporter });
153
+ }
154
+
155
+ export { Command, SubCommand, createMainCommandExecutor, createMainCommandMounter, createTopCommand, hasGitInstalled, installDependencies };
156
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,137 @@
1
+ import { ICommandConfigurationOptions } from '@guanghechen/cli';
2
+ export * from '@guanghechen/cli';
3
+ import { Command as Command$1, OptionValues, CommandOptions } from 'commander';
4
+ import { IReporter } from '@guanghechen/reporter.types';
5
+
6
+ /**
7
+ * Callback for handling the command
8
+ *
9
+ * @param args command arguments
10
+ * @param options command options
11
+ * @param extra extra args (neither declared command arguments nor command options)
12
+ * @param self current command
13
+ */
14
+ type ICommandActionCallback<T extends ICommandConfigurationOptions> = (args: string[], options: T, extra: string[], self: Command) => void | Promise<void> | never;
15
+ declare class Command extends Command$1 {
16
+ protected _actionHandler: ((args: string[]) => void) | null | undefined;
17
+ protected _optionValues: object;
18
+ protected _storeOptionsAsProperties: boolean;
19
+ protected _version: string | undefined;
20
+ protected _versionOptionName: string | undefined;
21
+ constructor();
22
+ /**
23
+ * Register callback `fn` for the command.
24
+ *
25
+ * @example
26
+ * program
27
+ * .command('serve')
28
+ * .description('start service')
29
+ * .action(function() {
30
+ * // do work here
31
+ * });
32
+ *
33
+ * @param {Function} fn
34
+ * @return {Command} `this` command for chaining
35
+ */
36
+ action<T extends ICommandConfigurationOptions>(fn: ICommandActionCallback<T>): this;
37
+ opts<T extends OptionValues>(): T;
38
+ }
39
+
40
+ type IMainCommandProcessor<O extends ICommandConfigurationOptions> = (options: O) => void | Promise<void>;
41
+ type IMainCommandCreator<O extends ICommandConfigurationOptions> = (handle?: IMainCommandProcessor<O>) => Command;
42
+ type IMainCommandMounter = (parentCommand: Command, opts?: CommandOptions) => void;
43
+ type IMainCommandExecutor<V = void> = (args: string[]) => Promise<V>;
44
+ /**
45
+ * Create main command mounter
46
+ *
47
+ * @param create main command creator
48
+ * @param handle main command processor
49
+ */
50
+ declare function createMainCommandMounter<O extends ICommandConfigurationOptions>(create: IMainCommandCreator<O>, handle: IMainCommandProcessor<O>): IMainCommandMounter;
51
+ /**
52
+ * Create main command executor
53
+ *
54
+ * @param create main command creator
55
+ * @param handle main command processor
56
+ */
57
+ declare function createMainCommandExecutor<O extends ICommandConfigurationOptions>(create: IMainCommandCreator<O>, handle: IMainCommandProcessor<O>): IMainCommandExecutor;
58
+
59
+ interface ISubCommandOptions extends ICommandConfigurationOptions {
60
+ }
61
+ interface ISubCommandProcessor<O extends ISubCommandOptions> {
62
+ /**
63
+ * Process the command arguments and options.
64
+ * @param args Command arguments.
65
+ * @param options Command options.
66
+ */
67
+ process(args: string[], options: O): Promise<void>;
68
+ }
69
+ interface ISubCommand<O extends ISubCommandOptions> extends ISubCommandProcessor<O> {
70
+ /**
71
+ * Sub command name.
72
+ */
73
+ readonly subCommandName: string;
74
+ /**
75
+ * Sub command alias.
76
+ */
77
+ readonly aliases: string[];
78
+ /**
79
+ * Create an commander instance.
80
+ * @param processor
81
+ */
82
+ command(processor: ISubCommandProcessor<O>): Command;
83
+ /**
84
+ * Create a sub-command instance and execute it immediately.
85
+ * @param args Command arguments.
86
+ * @param options Command options.
87
+ */
88
+ execute(parentCommand: Command, rawArgs: string[]): Promise<void>;
89
+ /**
90
+ * Create a sub-command instance and mount it to the parentCommand.
91
+ * @param parentCommand
92
+ * @param opts
93
+ */
94
+ mount(parentCommand: Command, opts: CommandOptions | undefined): void;
95
+ /**
96
+ * Process the command options and rawArgs.
97
+ * @param args Command arguments.
98
+ * @param options Command options.
99
+ */
100
+ process(args: string[], options: O): Promise<void>;
101
+ /**
102
+ * Resolve a processor for process the command.
103
+ * @param args
104
+ * @param options
105
+ */
106
+ resolveProcessor(args: string[], options: O): Promise<ISubCommandProcessor<O>>;
107
+ }
108
+ declare abstract class SubCommand<O extends ISubCommandOptions> implements ISubCommand<O> {
109
+ abstract subCommandName: string;
110
+ abstract aliases: string[];
111
+ abstract command(processor: ISubCommandProcessor<O>): Command;
112
+ mount(parentCommand: Command, opts: CommandOptions | undefined): void;
113
+ execute(parentCommand: Command, rawArgs: string[]): Promise<void>;
114
+ process(args: string[], options: O): Promise<void>;
115
+ abstract resolveProcessor(args: string[], options: O): Promise<ISubCommandProcessor<O>>;
116
+ }
117
+
118
+ /**
119
+ * Create top command
120
+ * @param commandName
121
+ * @param version
122
+ */
123
+ declare function createTopCommand(commandName: string, version: string): Command;
124
+
125
+ declare const hasGitInstalled: () => boolean;
126
+ interface IInstallDependenciesParams {
127
+ readonly cwd: string;
128
+ readonly plopBypass: string[];
129
+ readonly reporter?: IReporter;
130
+ }
131
+ /**
132
+ * Run `npm/yarn install` to Install node.js dependencies
133
+ */
134
+ declare function installDependencies(params: IInstallDependenciesParams): Promise<void>;
135
+
136
+ export { Command, type ICommandActionCallback, type IInstallDependenciesParams, type IMainCommandCreator, type IMainCommandExecutor, type IMainCommandMounter, type IMainCommandProcessor, type ISubCommand, type ISubCommandOptions, type ISubCommandProcessor, SubCommand, createMainCommandExecutor, createMainCommandMounter, createTopCommand, hasGitInstalled, installDependencies };
137
+ //# sourceMappingURL=index.d.ts.map
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@guanghechen/commander",
3
+ "version": "1.0.1",
4
+ "description": "A wrapper of commander.js with some utilities",
5
+ "author": {
6
+ "name": "guanghechen",
7
+ "url": "https://github.com/guanghechen/"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/guanghechen/node-scaffolds/tree/@guanghechen/commander@1.0.0",
12
+ "directory": "packages/commander"
13
+ },
14
+ "homepage": "https://github.com/guanghechen/node-scaffolds/tree/@guanghechen/commander@1.0.0/packages/commander#readme",
15
+ "keywords": [
16
+ "commander"
17
+ ],
18
+ "type": "module",
19
+ "exports": {
20
+ ".": {
21
+ "source": "./src/index.ts",
22
+ "import": "./lib/esm/index.mjs",
23
+ "require": "./lib/cjs/index.cjs",
24
+ "types": "./lib/types/index.d.ts"
25
+ }
26
+ },
27
+ "source": "./src/index.ts",
28
+ "main": "./lib/cjs/index.cjs",
29
+ "module": "./lib/esm/index.mjs",
30
+ "types": "./lib/types/index.d.ts",
31
+ "license": "MIT",
32
+ "engines": {
33
+ "node": ">= 18.0.0"
34
+ },
35
+ "files": [
36
+ "lib/",
37
+ "!lib/**/*.map",
38
+ "package.json",
39
+ "CHANGELOG.md",
40
+ "LICENSE",
41
+ "README.md"
42
+ ],
43
+ "dependencies": {
44
+ "@guanghechen/cli": "^1.0.1",
45
+ "@guanghechen/exec": "^1.0.6",
46
+ "@guanghechen/reporter.types": "^1.0.4",
47
+ "@inquirer/select": "^3.0.1",
48
+ "command-exists": "^1.2.9",
49
+ "commander": "^12.1.0"
50
+ },
51
+ "devDependencies": {
52
+ "@types/js-yaml": "^4.0.9"
53
+ },
54
+ "gitHead": "0b05e2e41ca5e5bebf4cd88c9eef1d80b36460a1"
55
+ }