@gct-paas/cli 0.0.1-dev.0 → 0.0.1-dev.2
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/bin.d.ts +2 -0
- package/dist/commands/index.d.ts +5 -0
- package/dist/commands/index.mjs +14 -0
- package/dist/core/commitlint/commitlint-config/commitlint-config.d.ts +9 -0
- package/dist/core/commitlint/commitlint-config/commitlint-config.mjs +28 -0
- package/dist/core/commitlint/index.d.ts +1 -0
- package/dist/core/commitlint/index.mjs +1 -0
- package/{src/core/constants/index.ts → dist/core/constants/index.d.ts} +2 -2
- package/dist/core/constants/index.mjs +2 -0
- package/dist/core/eslint/eslint-config/eslint-config.d.ts +9 -0
- package/dist/core/eslint/eslint-config/eslint-config.mjs +109 -0
- package/dist/core/eslint/index.d.ts +1 -0
- package/dist/core/eslint/index.mjs +1 -0
- package/dist/core/index.d.ts +7 -0
- package/dist/core/index.mjs +7 -0
- package/dist/core/prettier/index.d.ts +1 -0
- package/dist/core/prettier/index.mjs +1 -0
- package/dist/core/prettier/prettier-config/prettier-config.d.ts +22 -0
- package/dist/core/prettier/prettier-config/prettier-config.mjs +26 -0
- package/dist/core/rollup/index.d.ts +2 -0
- package/dist/core/rollup/index.mjs +2 -0
- package/dist/core/rollup/rollup-config/dev-config.d.ts +9 -0
- package/dist/core/rollup/rollup-config/dev-config.mjs +98 -0
- package/dist/core/rollup/rollup-plugins/copy-file.d.ts +37 -0
- package/dist/core/rollup/rollup-plugins/copy-file.mjs +18 -0
- package/dist/core/rollup/rollup-plugins/ignore-compiler-file.d.ts +8 -0
- package/dist/core/rollup/rollup-plugins/ignore-compiler-file.mjs +17 -0
- package/dist/core/rollup/rollup-plugins/index.mjs +2 -0
- package/dist/core/stylelint/index.d.ts +1 -0
- package/dist/core/stylelint/index.mjs +1 -0
- package/dist/core/stylelint/stylelint-config/stylelint-config.d.ts +9 -0
- package/dist/core/stylelint/stylelint-config/stylelint-config.mjs +21 -0
- package/{src/core/util/index.ts → dist/core/util/index.d.ts} +2 -8
- package/dist/core/util/index.mjs +7 -0
- package/dist/core/util/watcher/watcher.d.ts +61 -0
- package/{src/core/util/watcher/watcher.ts → dist/core/util/watcher/watcher.mjs} +33 -54
- package/dist/core/vite/index.d.ts +1 -0
- package/dist/core/vite/index.mjs +1 -0
- package/dist/core/vite/vite-config/vite-config.d.ts +9 -0
- package/dist/core/vite/vite-config/vite-config.mjs +47 -0
- package/dist/index.d.ts +2 -0
- package/dist/interface/i-command/i-command.d.ts +28 -0
- package/dist/interface/i-command/i-command.mjs +0 -0
- package/dist/interface/index.mjs +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.mjs +4 -0
- package/dist/utils/local-binaries/local-binaries.d.ts +3 -0
- package/dist/utils/local-binaries/local-binaries.mjs +11 -0
- package/package.json +31 -3
- package/src/bin.ts +0 -5
- package/src/commands/index.ts +0 -16
- package/src/core/index.ts +0 -3
- package/src/core/rollup/index.ts +0 -2
- package/src/core/rollup/rollup-config/dev-config.ts +0 -135
- package/src/core/rollup/rollup-plugins/copy-file.ts +0 -57
- package/src/core/rollup/rollup-plugins/ignore-compiler-file.ts +0 -25
- package/src/core/vite/index.ts +0 -1
- package/src/core/vite/vite-config/vite-config.ts +0 -59
- package/src/index.ts +0 -36
- package/src/interface/i-command/i-command.ts +0 -29
- package/src/utils/index.ts +0 -4
- package/src/utils/local-binaries/local-binaries.ts +0 -16
- /package/{src/core/rollup/rollup-plugins/index.ts → dist/core/rollup/rollup-plugins/index.d.ts} +0 -0
- /package/{src/interface/index.ts → dist/interface/index.d.ts} +0 -0
package/src/index.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { program } from 'commander';
|
|
2
|
-
import { CommandLoader } from './commands';
|
|
3
|
-
import { loadLocalBinCommandLoader, localBinExists } from './utils';
|
|
4
|
-
import pkg from '../package.json' with { type: 'json' };
|
|
5
|
-
|
|
6
|
-
export async function bootstrap(): Promise<void> {
|
|
7
|
-
// 监控 ctrl + c 停止进程,触发 exit 事件
|
|
8
|
-
process.on('SIGINT', () => {
|
|
9
|
-
process.exit();
|
|
10
|
-
});
|
|
11
|
-
// 初始化命令行
|
|
12
|
-
program
|
|
13
|
-
.version(pkg.version, '-v, --version', '查看当前版本')
|
|
14
|
-
.usage('<command> [options]')
|
|
15
|
-
.helpOption('-h, --help', '获取帮助信息')
|
|
16
|
-
.configureOutput({
|
|
17
|
-
// Visibly override write routines as example!
|
|
18
|
-
writeErr: str => process.stdout.write(`[ERR] ${str}`),
|
|
19
|
-
// Highlight errors in color.
|
|
20
|
-
outputError: (str, write) => write(`\x1b[31m${str}\x1b[0m`),
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
if (localBinExists()) {
|
|
24
|
-
const localCommandLoader = loadLocalBinCommandLoader();
|
|
25
|
-
localCommandLoader.load(program);
|
|
26
|
-
} else {
|
|
27
|
-
CommandLoader.load(program);
|
|
28
|
-
}
|
|
29
|
-
program.parse(process.argv);
|
|
30
|
-
|
|
31
|
-
if (!process.argv.slice(2).length) {
|
|
32
|
-
program.outputHelp();
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export * from './core';
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 命令项
|
|
5
|
-
*
|
|
6
|
-
* @author chitanda
|
|
7
|
-
* @date 2021-12-18 15:12:13
|
|
8
|
-
* @export
|
|
9
|
-
* @interface ICommand
|
|
10
|
-
*/
|
|
11
|
-
export interface ICommand {
|
|
12
|
-
/**
|
|
13
|
-
* 加载命令
|
|
14
|
-
*
|
|
15
|
-
* @author chitanda
|
|
16
|
-
* @date 2021-12-18 15:12:22
|
|
17
|
-
* @param {Command} program
|
|
18
|
-
*/
|
|
19
|
-
load(program: Command): void;
|
|
20
|
-
/**
|
|
21
|
-
* 执行行为
|
|
22
|
-
*
|
|
23
|
-
* @author chitanda
|
|
24
|
-
* @date 2021-12-21 16:12:22
|
|
25
|
-
* @param {...unknown[]} args
|
|
26
|
-
* @return {*} {(void | Promise<void>)}
|
|
27
|
-
*/
|
|
28
|
-
action(...args: unknown[]): void | Promise<void>;
|
|
29
|
-
}
|
package/src/utils/index.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { join, posix } from 'path';
|
|
2
|
-
import fs from 'fs-extra';
|
|
3
|
-
import { CommandLoader } from '../../commands/index';
|
|
4
|
-
|
|
5
|
-
const localBinPathSegments = [process.cwd(), 'node_modules', '@nestjs', 'cli'];
|
|
6
|
-
|
|
7
|
-
export function localBinExists(): boolean {
|
|
8
|
-
return fs.existsSync(join(...localBinPathSegments));
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function loadLocalBinCommandLoader(): typeof CommandLoader {
|
|
12
|
-
const path = posix.join(...localBinPathSegments, 'commands');
|
|
13
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
14
|
-
const commandsFile = require(path);
|
|
15
|
-
return commandsFile.CommandLoader;
|
|
16
|
-
}
|
/package/{src/core/rollup/rollup-plugins/index.ts → dist/core/rollup/rollup-plugins/index.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|