@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.
Files changed (65) hide show
  1. package/dist/bin.d.ts +2 -0
  2. package/dist/commands/index.d.ts +5 -0
  3. package/dist/commands/index.mjs +14 -0
  4. package/dist/core/commitlint/commitlint-config/commitlint-config.d.ts +9 -0
  5. package/dist/core/commitlint/commitlint-config/commitlint-config.mjs +28 -0
  6. package/dist/core/commitlint/index.d.ts +1 -0
  7. package/dist/core/commitlint/index.mjs +1 -0
  8. package/{src/core/constants/index.ts → dist/core/constants/index.d.ts} +2 -2
  9. package/dist/core/constants/index.mjs +2 -0
  10. package/dist/core/eslint/eslint-config/eslint-config.d.ts +9 -0
  11. package/dist/core/eslint/eslint-config/eslint-config.mjs +109 -0
  12. package/dist/core/eslint/index.d.ts +1 -0
  13. package/dist/core/eslint/index.mjs +1 -0
  14. package/dist/core/index.d.ts +7 -0
  15. package/dist/core/index.mjs +7 -0
  16. package/dist/core/prettier/index.d.ts +1 -0
  17. package/dist/core/prettier/index.mjs +1 -0
  18. package/dist/core/prettier/prettier-config/prettier-config.d.ts +22 -0
  19. package/dist/core/prettier/prettier-config/prettier-config.mjs +26 -0
  20. package/dist/core/rollup/index.d.ts +2 -0
  21. package/dist/core/rollup/index.mjs +2 -0
  22. package/dist/core/rollup/rollup-config/dev-config.d.ts +9 -0
  23. package/dist/core/rollup/rollup-config/dev-config.mjs +98 -0
  24. package/dist/core/rollup/rollup-plugins/copy-file.d.ts +37 -0
  25. package/dist/core/rollup/rollup-plugins/copy-file.mjs +18 -0
  26. package/dist/core/rollup/rollup-plugins/ignore-compiler-file.d.ts +8 -0
  27. package/dist/core/rollup/rollup-plugins/ignore-compiler-file.mjs +17 -0
  28. package/dist/core/rollup/rollup-plugins/index.mjs +2 -0
  29. package/dist/core/stylelint/index.d.ts +1 -0
  30. package/dist/core/stylelint/index.mjs +1 -0
  31. package/dist/core/stylelint/stylelint-config/stylelint-config.d.ts +9 -0
  32. package/dist/core/stylelint/stylelint-config/stylelint-config.mjs +21 -0
  33. package/{src/core/util/index.ts → dist/core/util/index.d.ts} +2 -8
  34. package/dist/core/util/index.mjs +7 -0
  35. package/dist/core/util/watcher/watcher.d.ts +61 -0
  36. package/{src/core/util/watcher/watcher.ts → dist/core/util/watcher/watcher.mjs} +33 -54
  37. package/dist/core/vite/index.d.ts +1 -0
  38. package/dist/core/vite/index.mjs +1 -0
  39. package/dist/core/vite/vite-config/vite-config.d.ts +9 -0
  40. package/dist/core/vite/vite-config/vite-config.mjs +47 -0
  41. package/dist/index.d.ts +2 -0
  42. package/dist/interface/i-command/i-command.d.ts +28 -0
  43. package/dist/interface/i-command/i-command.mjs +0 -0
  44. package/dist/interface/index.mjs +1 -0
  45. package/dist/types/index.d.ts +1 -0
  46. package/dist/utils/index.d.ts +1 -0
  47. package/dist/utils/index.mjs +4 -0
  48. package/dist/utils/local-binaries/local-binaries.d.ts +3 -0
  49. package/dist/utils/local-binaries/local-binaries.mjs +11 -0
  50. package/package.json +31 -3
  51. package/src/bin.ts +0 -5
  52. package/src/commands/index.ts +0 -16
  53. package/src/core/index.ts +0 -3
  54. package/src/core/rollup/index.ts +0 -2
  55. package/src/core/rollup/rollup-config/dev-config.ts +0 -135
  56. package/src/core/rollup/rollup-plugins/copy-file.ts +0 -57
  57. package/src/core/rollup/rollup-plugins/ignore-compiler-file.ts +0 -25
  58. package/src/core/vite/index.ts +0 -1
  59. package/src/core/vite/vite-config/vite-config.ts +0 -59
  60. package/src/index.ts +0 -36
  61. package/src/interface/i-command/i-command.ts +0 -29
  62. package/src/utils/index.ts +0 -4
  63. package/src/utils/local-binaries/local-binaries.ts +0 -16
  64. /package/{src/core/rollup/rollup-plugins/index.ts → dist/core/rollup/rollup-plugins/index.d.ts} +0 -0
  65. /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
- }
@@ -1,4 +0,0 @@
1
- export {
2
- localBinExists,
3
- loadLocalBinCommandLoader,
4
- } from './local-binaries/local-binaries';
@@ -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
- }