@gct-paas/cli 0.0.1-dev.7.2 → 0.0.1-dev.9

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 (125) hide show
  1. package/dist/commands/index.cjs +0 -6
  2. package/dist/index.cjs +1 -1
  3. package/es/commands/index.mjs +0 -6
  4. package/es/index.mjs +1 -1
  5. package/package.json +11 -53
  6. package/dist/commands/create-template/create-template.cjs +0 -37
  7. package/dist/commands/create-template/create-template.d.ts +0 -6
  8. package/dist/commands/update-template/update-template.cjs +0 -25
  9. package/dist/commands/update-template/update-template.d.ts +0 -6
  10. package/dist/commands/zip/zip.cjs +0 -16
  11. package/dist/commands/zip/zip.d.ts +0 -21
  12. package/dist/core/commitlint/commitlint-config/commitlint-config.cjs +0 -15
  13. package/dist/core/commitlint/commitlint-config/commitlint-config.d.ts +0 -9
  14. package/dist/core/commitlint/index.cjs +0 -12
  15. package/dist/core/commitlint/index.d.ts +0 -1
  16. package/dist/core/constants/index.cjs +0 -9
  17. package/dist/core/constants/index.d.ts +0 -12
  18. package/dist/core/eslint/eslint-config/eslint-config.cjs +0 -85
  19. package/dist/core/eslint/eslint-config/eslint-config.d.ts +0 -9
  20. package/dist/core/eslint/index.cjs +0 -12
  21. package/dist/core/eslint/index.d.ts +0 -1
  22. package/dist/core/index.cjs +0 -93
  23. package/dist/core/index.d.ts +0 -8
  24. package/dist/core/prettier/index.cjs +0 -12
  25. package/dist/core/prettier/index.d.ts +0 -1
  26. package/dist/core/prettier/prettier-config/prettier-config.cjs +0 -29
  27. package/dist/core/prettier/prettier-config/prettier-config.d.ts +0 -22
  28. package/dist/core/rollup/index.cjs +0 -27
  29. package/dist/core/rollup/index.d.ts +0 -2
  30. package/dist/core/rollup/rollup-config/dev-config.cjs +0 -93
  31. package/dist/core/rollup/rollup-config/dev-config.d.ts +0 -9
  32. package/dist/core/rollup/rollup-plugins/copy-file.cjs +0 -24
  33. package/dist/core/rollup/rollup-plugins/copy-file.d.ts +0 -37
  34. package/dist/core/rollup/rollup-plugins/ignore-compiler-file.cjs +0 -23
  35. package/dist/core/rollup/rollup-plugins/ignore-compiler-file.d.ts +0 -8
  36. package/dist/core/rollup/rollup-plugins/index.cjs +0 -19
  37. package/dist/core/rollup/rollup-plugins/index.d.ts +0 -2
  38. package/dist/core/stylelint/index.cjs +0 -12
  39. package/dist/core/stylelint/index.d.ts +0 -1
  40. package/dist/core/stylelint/stylelint-config/stylelint-config.cjs +0 -24
  41. package/dist/core/stylelint/stylelint-config/stylelint-config.d.ts +0 -9
  42. package/dist/core/template/actions/create-template.cjs +0 -53
  43. package/dist/core/template/actions/create-template.d.ts +0 -16
  44. package/dist/core/template/actions/update-template.cjs +0 -71
  45. package/dist/core/template/actions/update-template.d.ts +0 -18
  46. package/dist/core/template/actions/zip.cjs +0 -25
  47. package/dist/core/template/actions/zip.d.ts +0 -9
  48. package/dist/core/template/constant/index.cjs +0 -7
  49. package/dist/core/template/constant/index.d.ts +0 -1
  50. package/dist/core/template/index.cjs +0 -26
  51. package/dist/core/template/index.d.ts +0 -3
  52. package/dist/core/util/index.cjs +0 -20
  53. package/dist/core/util/index.d.ts +0 -17
  54. package/dist/core/util/watcher/watcher.cjs +0 -99
  55. package/dist/core/util/watcher/watcher.d.ts +0 -48
  56. package/dist/core/vite/index.cjs +0 -45
  57. package/dist/core/vite/index.d.ts +0 -4
  58. package/dist/core/vite/vite-config/vite-base-config.cjs +0 -47
  59. package/dist/core/vite/vite-config/vite-base-config.d.ts +0 -9
  60. package/dist/core/vite/vite-config/vite-config.cjs +0 -35
  61. package/dist/core/vite/vite-config/vite-config.d.ts +0 -9
  62. package/dist/core/vite/vite-config/vite-dev-config.cjs +0 -23
  63. package/dist/core/vite/vite-config/vite-dev-config.d.ts +0 -9
  64. package/dist/core/vite/vite-config/vite-plugin-config.cjs +0 -97
  65. package/dist/core/vite/vite-config/vite-plugin-config.d.ts +0 -25
  66. package/es/commands/create-template/create-template.d.ts +0 -6
  67. package/es/commands/create-template/create-template.mjs +0 -29
  68. package/es/commands/update-template/update-template.d.ts +0 -6
  69. package/es/commands/update-template/update-template.mjs +0 -17
  70. package/es/commands/zip/zip.d.ts +0 -21
  71. package/es/commands/zip/zip.mjs +0 -9
  72. package/es/core/commitlint/commitlint-config/commitlint-config.d.ts +0 -9
  73. package/es/core/commitlint/commitlint-config/commitlint-config.mjs +0 -28
  74. package/es/core/commitlint/index.d.ts +0 -1
  75. package/es/core/commitlint/index.mjs +0 -1
  76. package/es/core/constants/index.d.ts +0 -12
  77. package/es/core/constants/index.mjs +0 -24
  78. package/es/core/eslint/eslint-config/eslint-config.d.ts +0 -9
  79. package/es/core/eslint/eslint-config/eslint-config.mjs +0 -109
  80. package/es/core/eslint/index.d.ts +0 -1
  81. package/es/core/eslint/index.mjs +0 -1
  82. package/es/core/index.d.ts +0 -8
  83. package/es/core/index.mjs +0 -8
  84. package/es/core/prettier/index.d.ts +0 -1
  85. package/es/core/prettier/index.mjs +0 -1
  86. package/es/core/prettier/prettier-config/prettier-config.d.ts +0 -22
  87. package/es/core/prettier/prettier-config/prettier-config.mjs +0 -26
  88. package/es/core/rollup/index.d.ts +0 -2
  89. package/es/core/rollup/index.mjs +0 -2
  90. package/es/core/rollup/rollup-config/dev-config.d.ts +0 -9
  91. package/es/core/rollup/rollup-config/dev-config.mjs +0 -101
  92. package/es/core/rollup/rollup-plugins/copy-file.d.ts +0 -37
  93. package/es/core/rollup/rollup-plugins/copy-file.mjs +0 -18
  94. package/es/core/rollup/rollup-plugins/ignore-compiler-file.d.ts +0 -8
  95. package/es/core/rollup/rollup-plugins/ignore-compiler-file.mjs +0 -17
  96. package/es/core/rollup/rollup-plugins/index.d.ts +0 -2
  97. package/es/core/rollup/rollup-plugins/index.mjs +0 -2
  98. package/es/core/stylelint/index.d.ts +0 -1
  99. package/es/core/stylelint/index.mjs +0 -1
  100. package/es/core/stylelint/stylelint-config/stylelint-config.d.ts +0 -9
  101. package/es/core/stylelint/stylelint-config/stylelint-config.mjs +0 -21
  102. package/es/core/template/actions/create-template.d.ts +0 -16
  103. package/es/core/template/actions/create-template.mjs +0 -43
  104. package/es/core/template/actions/update-template.d.ts +0 -18
  105. package/es/core/template/actions/update-template.mjs +0 -61
  106. package/es/core/template/actions/zip.d.ts +0 -9
  107. package/es/core/template/actions/zip.mjs +0 -13
  108. package/es/core/template/constant/index.d.ts +0 -1
  109. package/es/core/template/constant/index.mjs +0 -1
  110. package/es/core/template/index.d.ts +0 -3
  111. package/es/core/template/index.mjs +0 -3
  112. package/es/core/util/index.d.ts +0 -17
  113. package/es/core/util/index.mjs +0 -7
  114. package/es/core/util/watcher/watcher.d.ts +0 -48
  115. package/es/core/util/watcher/watcher.mjs +0 -97
  116. package/es/core/vite/index.d.ts +0 -4
  117. package/es/core/vite/index.mjs +0 -8
  118. package/es/core/vite/vite-config/vite-base-config.d.ts +0 -9
  119. package/es/core/vite/vite-config/vite-base-config.mjs +0 -53
  120. package/es/core/vite/vite-config/vite-config.d.ts +0 -9
  121. package/es/core/vite/vite-config/vite-config.mjs +0 -31
  122. package/es/core/vite/vite-config/vite-dev-config.d.ts +0 -9
  123. package/es/core/vite/vite-config/vite-dev-config.mjs +0 -19
  124. package/es/core/vite/vite-config/vite-plugin-config.d.ts +0 -25
  125. package/es/core/vite/vite-config/vite-plugin-config.mjs +0 -97
@@ -1,48 +0,0 @@
1
- import * as chokidar from 'chokidar';
2
- import fs from 'fs-extra';
3
- import { EventName } from 'chokidar/handler';
4
- /**
5
- * 文件监控类
6
- *
7
- * @export
8
- * @class CopyWatch
9
- */
10
- export declare class CopyWatch {
11
- dir: string;
12
- copyDir: string;
13
- protected w: chokidar.FSWatcher;
14
- /**
15
- * Creates an instance of CopyWatch.
16
- *
17
- * @param {string[]} dir 需要监控的目录
18
- * @param {string} copyDir 需要拷贝到的目录
19
- */
20
- constructor(dir: string, copyDir: string, opts?: chokidar.ChokidarOptions);
21
- /**
22
- * 初始化
23
- *
24
- * @protected
25
- */
26
- protected init(): void;
27
- /**
28
- * 文件监控变更
29
- *
30
- * @protected
31
- * @param {("add" | "addDir" | "change" | "unlink" | "unlinkDir")} eventName
32
- * @param {string} pathStr
33
- * @param {(fs.Stats)} [stats]
34
- */
35
- protected watchAll(eventName: EventName, pathStr: string, stats?: fs.Stats): void;
36
- /**
37
- * 文件监控异常
38
- *
39
- * @protected
40
- * @param {string} path
41
- * @param {(fs.Stats | undefined)} [stats]
42
- */
43
- protected watchErr(err: unknown): void;
44
- /**
45
- * 停止监控
46
- */
47
- unwatch(): void;
48
- }
@@ -1,45 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "defineDesignPluginViteConfig", {
7
- enumerable: true,
8
- get: function () {
9
- return _vitePluginConfig.defineDesignPluginViteConfig;
10
- }
11
- });
12
- Object.defineProperty(exports, "defineDevViteConfig", {
13
- enumerable: true,
14
- get: function () {
15
- return _viteDevConfig.defineDevViteConfig;
16
- }
17
- });
18
- Object.defineProperty(exports, "defineMobilePluginViteConfig", {
19
- enumerable: true,
20
- get: function () {
21
- return _vitePluginConfig.defineMobilePluginViteConfig;
22
- }
23
- });
24
- Object.defineProperty(exports, "defineViteBaseConfig", {
25
- enumerable: true,
26
- get: function () {
27
- return _viteBaseConfig.defineViteBaseConfig;
28
- }
29
- });
30
- Object.defineProperty(exports, "defineViteConfig", {
31
- enumerable: true,
32
- get: function () {
33
- return _viteConfig.defineViteConfig;
34
- }
35
- });
36
- Object.defineProperty(exports, "defineWebPluginViteConfig", {
37
- enumerable: true,
38
- get: function () {
39
- return _vitePluginConfig.defineWebPluginViteConfig;
40
- }
41
- });
42
- var _viteBaseConfig = require("./vite-config/vite-base-config.cjs");
43
- var _viteConfig = require("./vite-config/vite-config.cjs");
44
- var _viteDevConfig = require("./vite-config/vite-dev-config.cjs");
45
- var _vitePluginConfig = require("./vite-config/vite-plugin-config.cjs");
@@ -1,4 +0,0 @@
1
- export { defineViteBaseConfig } from './vite-config/vite-base-config';
2
- export { defineViteConfig } from './vite-config/vite-config';
3
- export { defineDevViteConfig } from './vite-config/vite-dev-config';
4
- export { defineDesignPluginViteConfig, defineMobilePluginViteConfig, defineWebPluginViteConfig, } from './vite-config/vite-plugin-config';
@@ -1,47 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.defineViteBaseConfig = defineViteBaseConfig;
7
- var _vite = require("vite");
8
- var _pluginVue = _interopRequireDefault(require("@vitejs/plugin-vue"));
9
- var _pluginVueJsx = _interopRequireDefault(require("@vitejs/plugin-vue-jsx"));
10
- var _pluginBabel = require("@rollup/plugin-babel");
11
- var _pluginJson = _interopRequireDefault(require("@rollup/plugin-json"));
12
- var _path = _interopRequireDefault(require("path"));
13
- var _constants = require("../../constants/index.cjs");
14
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
- function defineViteBaseConfig(opts = {}) {
16
- const cwd = process.cwd();
17
- const outDir = _path.default.resolve(cwd, "dist");
18
- return (0, _vite.mergeConfig)((0, _vite.defineConfig)({
19
- css: {
20
- preprocessorOptions: {
21
- scss: {
22
- additionalData: `@use "@gct-paas/scss/style/global.scss" as *;`
23
- }
24
- }
25
- },
26
- build: {
27
- outDir,
28
- rollupOptions: {
29
- external: _constants.DEFAULT_EXTERNAL
30
- }
31
- },
32
- plugins: [(0, _pluginJson.default)(), (0, _pluginVue.default)(), (0, _pluginVueJsx.default)(), (0, _pluginBabel.babel)({
33
- babelHelpers: "bundled",
34
- presets: [["@babel/preset-env", {
35
- useBuiltIns: "usage",
36
- corejs: 3,
37
- bugfixes: true,
38
- targets: {
39
- chrome: "85",
40
- edge: "85",
41
- firefox: "79",
42
- safari: "14.1"
43
- }
44
- }]]
45
- })]
46
- }), opts);
47
- }
@@ -1,9 +0,0 @@
1
- import { UserConfig } from 'vite';
2
- /**
3
- * 构建 vite 通用配置,基于此配置构建其他 vite 配置
4
- *
5
- * @export
6
- * @param {UserConfig} [opts={}]
7
- * @returns {*} {UserConfig}
8
- */
9
- export declare function defineViteBaseConfig(opts?: UserConfig): UserConfig;
@@ -1,35 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.defineViteConfig = defineViteConfig;
7
- var _vite = require("vite");
8
- var _path = _interopRequireDefault(require("path"));
9
- var rf = _interopRequireWildcard(require("rimraf"));
10
- var _viteBaseConfig = require("./vite-base-config.cjs");
11
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
12
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
13
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
- function defineViteConfig(opts = {}) {
15
- const cwd = process.cwd();
16
- const outDir = _path.default.resolve(cwd, "dist");
17
- rf.sync(outDir);
18
- return (0, _vite.mergeConfig)((0, _viteBaseConfig.defineViteBaseConfig)((0, _vite.defineConfig)({
19
- build: {
20
- lib: {
21
- entry: _path.default.resolve(cwd, "src/index.ts"),
22
- formats: ["system", "cjs"],
23
- fileName(format) {
24
- if (format === "system" || format === "systemjs") {
25
- return `[name].system.min.js`;
26
- }
27
- if (format === "cjs" || format === "commonjs") {
28
- return `[name].min.cjs`;
29
- }
30
- return `[name].${format}.min.js`;
31
- }
32
- }
33
- }
34
- })), opts);
35
- }
@@ -1,9 +0,0 @@
1
- import { UserConfig } from 'vite';
2
- /**
3
- * 构建 vite 通用配置,基于此配置构建其他 vite 配置
4
- *
5
- * @export
6
- * @param {UserConfig} [opts={}]
7
- * @returns {*} {UserConfig}
8
- */
9
- export declare function defineViteConfig(opts?: UserConfig): UserConfig;
@@ -1,23 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.defineDevViteConfig = defineDevViteConfig;
7
- var _vite = require("vite");
8
- var _pluginVue = _interopRequireDefault(require("@vitejs/plugin-vue"));
9
- var _pluginVueJsx = _interopRequireDefault(require("@vitejs/plugin-vue-jsx"));
10
- var _pluginJson = _interopRequireDefault(require("@rollup/plugin-json"));
11
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
- function defineDevViteConfig(opts = {}) {
13
- return (0, _vite.mergeConfig)((0, _vite.defineConfig)({
14
- css: {
15
- preprocessorOptions: {
16
- scss: {
17
- additionalData: `@use "@gct-paas/scss/style/global.scss" as *;`
18
- }
19
- }
20
- },
21
- plugins: [(0, _pluginJson.default)(), (0, _pluginVue.default)(), (0, _pluginVueJsx.default)()]
22
- }), opts);
23
- }
@@ -1,9 +0,0 @@
1
- import { UserConfig } from 'vite';
2
- /**
3
- * 构建本地开发 vite 通用配置,基于此配置构建其他 vite 配置
4
- *
5
- * @export
6
- * @param {UserConfig} [opts={}]
7
- * @returns {*} {UserConfig}
8
- */
9
- export declare function defineDevViteConfig(opts?: UserConfig): UserConfig;
@@ -1,97 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.defineDesignPluginViteConfig = defineDesignPluginViteConfig;
7
- exports.defineMobilePluginViteConfig = defineMobilePluginViteConfig;
8
- exports.defineWebPluginViteConfig = defineWebPluginViteConfig;
9
- var _vite = require("vite");
10
- var _path = _interopRequireDefault(require("path"));
11
- var _viteBaseConfig = require("./vite-base-config.cjs");
12
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
- const formats = ["system", "cjs"];
14
- function formatFileName(format) {
15
- if (format === "system" || format === "systemjs") {
16
- return `[name].system.min.js`;
17
- }
18
- if (format === "cjs" || format === "commonjs") {
19
- return `[name].min.cjs`;
20
- }
21
- return `[name].${format}.min.js`;
22
- }
23
- function assetFileNames(assetInfo, name) {
24
- if (assetInfo.names.length > 0 && assetInfo.names[0].endsWith(".css")) {
25
- return name + ".min.css";
26
- }
27
- return assetInfo.names[0];
28
- }
29
- function defineDesignPluginViteConfig(opts = {}) {
30
- const cwd = process.cwd();
31
- const designEntry = _path.default.resolve(cwd, "src/index.ts");
32
- return (0, _vite.mergeConfig)((0, _viteBaseConfig.defineViteBaseConfig)({
33
- build: {
34
- emptyOutDir: false,
35
- rollupOptions: {
36
- output: {
37
- assetFileNames: assetInfo => {
38
- return assetFileNames(assetInfo, "design");
39
- }
40
- }
41
- },
42
- lib: {
43
- entry: {
44
- design: designEntry
45
- },
46
- formats,
47
- fileName: formatFileName
48
- }
49
- }
50
- }), opts);
51
- }
52
- function defineMobilePluginViteConfig(opts = {}) {
53
- const cwd = process.cwd();
54
- const mobileEntry = _path.default.resolve(cwd, "src/index.ts");
55
- return (0, _vite.mergeConfig)((0, _viteBaseConfig.defineViteBaseConfig)({
56
- build: {
57
- emptyOutDir: false,
58
- rollupOptions: {
59
- output: {
60
- assetFileNames: assetInfo => {
61
- return assetFileNames(assetInfo, "mobile");
62
- }
63
- }
64
- },
65
- lib: {
66
- entry: {
67
- mobile: mobileEntry
68
- },
69
- formats,
70
- fileName: formatFileName
71
- }
72
- }
73
- }), opts);
74
- }
75
- function defineWebPluginViteConfig(opts = {}) {
76
- const cwd = process.cwd();
77
- const webEntry = _path.default.resolve(cwd, "src/index.ts");
78
- return (0, _vite.mergeConfig)((0, _viteBaseConfig.defineViteBaseConfig)({
79
- build: {
80
- emptyOutDir: false,
81
- rollupOptions: {
82
- output: {
83
- assetFileNames: assetInfo => {
84
- return assetFileNames(assetInfo, "web");
85
- }
86
- }
87
- },
88
- lib: {
89
- entry: {
90
- web: webEntry
91
- },
92
- formats,
93
- fileName: formatFileName
94
- }
95
- }
96
- }), opts);
97
- }
@@ -1,25 +0,0 @@
1
- import { UserConfig } from 'vite';
2
- /**
3
- * 设计端构建配置
4
- *
5
- * @export
6
- * @param {UserConfig} [opts={}]
7
- * @returns {*} {UserConfig}
8
- */
9
- export declare function defineDesignPluginViteConfig(opts?: UserConfig): UserConfig;
10
- /**
11
- * 移动端插件构建配置
12
- *
13
- * @export
14
- * @param {UserConfig} [opts={}]
15
- * @returns {*} {UserConfig}
16
- */
17
- export declare function defineMobilePluginViteConfig(opts?: UserConfig): UserConfig;
18
- /**
19
- * 网页端插件构建配置
20
- *
21
- * @export
22
- * @param {UserConfig} [opts={}]
23
- * @returns {*} {UserConfig}
24
- */
25
- export declare function defineWebPluginViteConfig(opts?: UserConfig): UserConfig;
@@ -1,6 +0,0 @@
1
- import { Command } from 'commander';
2
- import { ICommand } from '../../interface';
3
- export declare class CreateTemplateCommand implements ICommand {
4
- load(program: Command): void;
5
- action(): Promise<void>;
6
- }
@@ -1,29 +0,0 @@
1
- import fse from "fs-extra";
2
- import ora from "ora";
3
- import { confirm, input } from "@inquirer/prompts";
4
- import { CreateTemplateAction } from "../../core/index.mjs";
5
- export class CreateTemplateCommand {
6
- load(program) {
7
- program.command("create-template").description("\u57FA\u4E8E\u6A21\u677F\u521B\u5EFA paas \u5E73\u53F0\u63D2\u4EF6").action(this.action.bind(this));
8
- }
9
- async action() {
10
- const cwd = process.cwd();
11
- const child = fse.readdirSync(cwd);
12
- if (child.length > 0) {
13
- const bol = await confirm({
14
- message: "\u5F53\u524D\u76EE\u5F55\u4E0D\u4E3A\u7A7A\uFF0C\u7EE7\u7EED\u5C06\u53EF\u80FD\u8986\u76D6\u5DF2\u6709\u6587\u4EF6\uFF0C\u662F\u5426\u7EE7\u7EED\u521B\u5EFA\uFF1F",
15
- default: false
16
- });
17
- if (bol === false) {
18
- process.exit();
19
- }
20
- }
21
- const name = await input({
22
- message: "\u8BF7\u8F93\u5165\u63D2\u4EF6\u540D\u79F0",
23
- default: "gct-plugin"
24
- });
25
- const spinner = ora("\u521D\u59CB\u5316\u63D2\u4EF6").start();
26
- await new CreateTemplateAction().run(process.cwd(), name);
27
- spinner.succeed("\u521D\u59CB\u5316\u5B8C\u6210");
28
- }
29
- }
@@ -1,6 +0,0 @@
1
- import { Command } from 'commander';
2
- import { ICommand } from '../../interface';
3
- export declare class UpdateTemplateCommand implements ICommand {
4
- load(program: Command): void;
5
- action(): Promise<void>;
6
- }
@@ -1,17 +0,0 @@
1
- import ora from "ora";
2
- import { confirm } from "@inquirer/prompts";
3
- import { UpdateTemplateAction } from "../../core/index.mjs";
4
- export class UpdateTemplateCommand {
5
- load(program) {
6
- program.command("update-template").description("paas \u5E73\u53F0\u63D2\u4EF6\u589E\u91CF\u66F4\u65B0").action(this.action.bind(this));
7
- }
8
- async action() {
9
- const overwrite = await confirm({
10
- message: "\u66F4\u65B0\u65F6\u9009\u62E9\u4E0D\u8986\u76D6\uFF0C\u53EF\u4FDD\u7559\u5DF2\u4FEE\u6539\u7684\u6587\u4EF6\u800C\u4E0D\u88AB\u65B0\u7248\u672C\u66FF\u6362\u3002\u662F\u5426\u8986\u76D6\u66F4\u65B0\uFF1F",
11
- default: false
12
- });
13
- const spinner = ora("\u589E\u91CF\u66F4\u65B0\u63D2\u4EF6").start();
14
- await new UpdateTemplateAction().run(process.cwd(), overwrite);
15
- spinner.succeed("\u66F4\u65B0\u5B8C\u6210");
16
- }
17
- }
@@ -1,21 +0,0 @@
1
- import { Command } from 'commander';
2
- import { ICommand } from '../../interface';
3
- interface ZipCommandParams {
4
- /**
5
- * 待压缩目录
6
- *
7
- * @type {string}
8
- */
9
- folder: string;
10
- /**
11
- * 输出文件名
12
- *
13
- * @type {string}
14
- */
15
- output: string;
16
- }
17
- export declare class ZipCommand implements ICommand {
18
- load(program: Command): void;
19
- action(args: ZipCommandParams): Promise<void>;
20
- }
21
- export {};
@@ -1,9 +0,0 @@
1
- import { ZipAction } from "../../core/index.mjs";
2
- export class ZipCommand {
3
- load(program) {
4
- program.command("zip").description("zip \u538B\u7F29\u76EE\u5F55").option("--folder <folder-path>", "\u5F85\u538B\u7F29\u76EE\u5F55").option("--output <output-file>", "\u8F93\u51FA\u6587\u4EF6\u540D").action(this.action.bind(this));
5
- }
6
- async action(args) {
7
- new ZipAction().run(process.cwd(), args.folder, args.output);
8
- }
9
- }
@@ -1,9 +0,0 @@
1
- import type { UserConfig } from '@commitlint/types';
2
- /**
3
- * 基于基础配置,定义 commitlint 配置
4
- *
5
- * @export
6
- * @param {UserConfig} [config={}]
7
- * @returns {*} {UserConfig}
8
- */
9
- export declare function defineCommitlintConfig(config?: UserConfig): UserConfig;
@@ -1,28 +0,0 @@
1
- import { merge } from "lodash-es";
2
- export function defineCommitlintConfig(config = {}) {
3
- return merge(
4
- {
5
- extends: ["@commitlint/config-conventional"],
6
- rules: {
7
- "type-enum": [
8
- 2,
9
- "always",
10
- [
11
- "feat",
12
- "fix",
13
- "docs",
14
- "style",
15
- "refactor",
16
- "test",
17
- "perf",
18
- "revert",
19
- "build",
20
- "chore",
21
- "release"
22
- ]
23
- ]
24
- }
25
- },
26
- config
27
- );
28
- }
@@ -1 +0,0 @@
1
- export { defineCommitlintConfig } from './commitlint-config/commitlint-config';
@@ -1 +0,0 @@
1
- export { defineCommitlintConfig } from "./commitlint-config/commitlint-config.mjs";
@@ -1,12 +0,0 @@
1
- /**
2
- * 开发模式标识,匹配环境变量中的 NODE_ENV
3
- */
4
- export declare const DEV_MODE = "development";
5
- /**
6
- * 生产编译模式标识,匹配环境变量中的 NODE_ENV
7
- */
8
- export declare const PROD_MODE = "production";
9
- /**
10
- * 默认需要忽略编译的外部依赖
11
- */
12
- export declare const DEFAULT_EXTERNAL: string[];
@@ -1,24 +0,0 @@
1
- export const DEV_MODE = "development";
2
- export const PROD_MODE = "production";
3
- export const DEFAULT_EXTERNAL = [
4
- "vue",
5
- "vue-router",
6
- "vue-i18n",
7
- "axios",
8
- "dayjs",
9
- "lodash-es",
10
- "qs",
11
- "pinia",
12
- "vuedraggable",
13
- "sortablejs",
14
- "vue-grid-layout",
15
- "vant",
16
- "ant-design-vue",
17
- "@gct-paas/core",
18
- "@gct-paas/design",
19
- "@gct-paas/design-mobile",
20
- "@gct-paas/design-web",
21
- "@gct-paas/mobile",
22
- "@gct-paas/web",
23
- "systemjs"
24
- ];
@@ -1,9 +0,0 @@
1
- import { ConfigArray, InfiniteDepthConfigWithExtends } from 'typescript-eslint';
2
- /**
3
- * 基于基础规则,定义 eslint 配置
4
- *
5
- * @export
6
- * @param {...InfiniteDepthConfigWithExtends[]} configs
7
- * @returns {*} {ConfigArray}
8
- */
9
- export declare function defineEslintConfig(...configs: InfiniteDepthConfigWithExtends[]): ConfigArray;
@@ -1,109 +0,0 @@
1
- import eslint from "@eslint/js";
2
- import tsEslint from "typescript-eslint";
3
- import eslintPluginVue from "eslint-plugin-vue";
4
- import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
5
- import unusedImports from "eslint-plugin-unused-imports";
6
- import eslintPluginImport from "eslint-plugin-import";
7
- import globals from "globals";
8
- export function defineEslintConfig(...configs) {
9
- return tsEslint.config(
10
- /** js推荐配置 */
11
- eslint.configs.recommended,
12
- /** ts推荐配置 */
13
- tsEslint.configs.strict,
14
- tsEslint.configs.stylistic,
15
- /** vue推荐配置 */
16
- eslintPluginVue.configs["flat/recommended"],
17
- eslintPluginPrettierRecommended,
18
- eslintPluginImport.flatConfigs.recommended,
19
- eslintPluginImport.flatConfigs.warnings,
20
- eslintPluginImport.flatConfigs.errors,
21
- eslintPluginImport.flatConfigs.typescript,
22
- {
23
- ignores: [
24
- "**/node_modules",
25
- "lerna.json",
26
- "package.json",
27
- "tsconfig.json",
28
- "pnpm-lock.yaml",
29
- "pnpm-workspace.yaml",
30
- "eslint.config.mjs",
31
- "**/dist",
32
- "**/out",
33
- "**/es",
34
- "**/lib"
35
- ],
36
- files: ["**/*.ts", "**.*.tsx", "**/*.vue"],
37
- plugins: {
38
- "unused-imports": unusedImports
39
- },
40
- languageOptions: {
41
- globals: {
42
- ...globals.browser
43
- },
44
- parserOptions: {
45
- ecmaFeatures: {
46
- // 全局严格模式
47
- impliedStrict: true,
48
- // 启用 jsx
49
- jsx: true
50
- }
51
- }
52
- },
53
- rules: {
54
- // 基础配置覆盖
55
- "no-console": "off",
56
- "no-debugger": "off",
57
- "no-undef": "off",
58
- "no-plusplus": [
59
- "error",
60
- {
61
- allowForLoopAfterthoughts: true
62
- }
63
- ],
64
- "no-underscore-dangle": "off",
65
- "no-restricted-syntax": "off",
66
- "no-continue": "off",
67
- "no-unused-vars": "off",
68
- "no-extraneous-class": "off",
69
- "no-param-reassign": "off",
70
- "no-useless-constructor": "off",
71
- "no-empty-function": "off",
72
- // unused-imports 配置覆盖
73
- "unused-imports/no-unused-imports": "error",
74
- "consistent-return": "off",
75
- "func-names": "off",
76
- // import 配置覆盖
77
- "import/no-unresolved": "off",
78
- "import/extensions": "off",
79
- "import/prefer-default-export": "off",
80
- // vue 配置覆盖
81
- "vue/no-setup-props-destructure": "off",
82
- "vue/require-default-prop": "off",
83
- // typescript 配置覆盖
84
- "@typescript-eslint/no-unused-vars": [
85
- "error",
86
- {
87
- argsIgnorePattern: "^_"
88
- }
89
- ],
90
- "@typescript-eslint/no-inferrable-types": "off",
91
- "@typescript-eslint/no-explicit-any": ["error"],
92
- "@typescript-eslint/explicit-module-boundary-types": "off",
93
- "@typescript-eslint/no-non-null-assertion": "off",
94
- "@typescript-eslint/no-extraneous-class": "off",
95
- // 其他配置覆盖
96
- "class-methods-use-this": "off",
97
- "prefer-destructuring": "off"
98
- }
99
- },
100
- {
101
- name: "ts-vue-override",
102
- files: ["**/*.vue"],
103
- rules: {
104
- "@typescript-eslint/no-unused-vars": "off"
105
- }
106
- },
107
- ...configs
108
- );
109
- }
@@ -1 +0,0 @@
1
- export { defineEslintConfig } from './eslint-config/eslint-config';
@@ -1 +0,0 @@
1
- export { defineEslintConfig } from "./eslint-config/eslint-config.mjs";