@gct-paas/cli 0.0.1-dev.2 → 0.0.1-dev.20

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 (206) hide show
  1. package/LICENSE +21 -0
  2. package/dist/actions/gen-api/api-manage.cjs +46 -0
  3. package/dist/actions/gen-api/api-manage.d.ts +36 -0
  4. package/dist/actions/gen-api/gen-api.cjs +157 -0
  5. package/dist/actions/gen-api/gen-api.d.ts +58 -0
  6. package/dist/actions/gen-api/model-manage.cjs +127 -0
  7. package/dist/actions/gen-api/model-manage.d.ts +124 -0
  8. package/dist/actions/index.cjs +12 -0
  9. package/dist/actions/index.d.ts +1 -0
  10. package/dist/bin.cjs +5 -0
  11. package/dist/commands/gen-api/gen-api.cjs +16 -0
  12. package/dist/commands/gen-api/gen-api.d.ts +44 -0
  13. package/dist/commands/index.cjs +23 -0
  14. package/dist/core/handlebars/constant/index.cjs +8 -0
  15. package/dist/core/handlebars/constant/index.d.ts +2 -0
  16. package/dist/core/handlebars/handlebars-engine.cjs +134 -0
  17. package/dist/core/handlebars/handlebars-engine.d.ts +74 -0
  18. package/dist/core/handlebars/helpers/and/and.cjs +21 -0
  19. package/dist/core/handlebars/helpers/and/and.d.ts +13 -0
  20. package/dist/core/handlebars/helpers/camel-case/camel-case.cjs +20 -0
  21. package/dist/core/handlebars/helpers/camel-case/camel-case.d.ts +13 -0
  22. package/dist/core/handlebars/helpers/concat/concat.cjs +17 -0
  23. package/dist/core/handlebars/helpers/concat/concat.d.ts +13 -0
  24. package/dist/core/handlebars/helpers/eq/eq.cjs +19 -0
  25. package/dist/core/handlebars/helpers/eq/eq.d.ts +14 -0
  26. package/dist/core/handlebars/helpers/format-import/format-import.cjs +41 -0
  27. package/dist/core/handlebars/helpers/format-import/format-import.d.ts +13 -0
  28. package/dist/core/handlebars/helpers/format-import-item/format-import-item.cjs +40 -0
  29. package/dist/core/handlebars/helpers/format-import-item/format-import-item.d.ts +13 -0
  30. package/dist/core/handlebars/helpers/format-js-type/format-js-type.cjs +41 -0
  31. package/dist/core/handlebars/helpers/format-js-type/format-js-type.d.ts +14 -0
  32. package/dist/core/handlebars/helpers/gt/gt.cjs +19 -0
  33. package/dist/core/handlebars/helpers/gt/gt.d.ts +14 -0
  34. package/dist/core/handlebars/helpers/gte/gte.cjs +19 -0
  35. package/dist/core/handlebars/helpers/gte/gte.d.ts +14 -0
  36. package/dist/core/handlebars/helpers/helper-base.cjs +19 -0
  37. package/dist/core/handlebars/helpers/helper-base.d.ts +22 -0
  38. package/dist/core/handlebars/helpers/includes/includes.cjs +18 -0
  39. package/dist/core/handlebars/helpers/includes/includes.d.ts +13 -0
  40. package/dist/core/handlebars/helpers/index.cjs +52 -0
  41. package/dist/core/handlebars/helpers/index.d.ts +6 -0
  42. package/dist/core/handlebars/helpers/json/json.cjs +16 -0
  43. package/dist/core/handlebars/helpers/json/json.d.ts +13 -0
  44. package/dist/core/handlebars/helpers/lower-case/lower-case.cjs +19 -0
  45. package/dist/core/handlebars/helpers/lower-case/lower-case.d.ts +13 -0
  46. package/dist/core/handlebars/helpers/lt/lt.cjs +19 -0
  47. package/dist/core/handlebars/helpers/lt/lt.d.ts +14 -0
  48. package/dist/core/handlebars/helpers/lte/lte.cjs +19 -0
  49. package/dist/core/handlebars/helpers/lte/lte.d.ts +14 -0
  50. package/dist/core/handlebars/helpers/neq/neq.cjs +19 -0
  51. package/dist/core/handlebars/helpers/neq/neq.d.ts +14 -0
  52. package/dist/core/handlebars/helpers/not/not.cjs +21 -0
  53. package/dist/core/handlebars/helpers/not/not.d.ts +14 -0
  54. package/dist/core/handlebars/helpers/not-includes/not-includes.cjs +18 -0
  55. package/dist/core/handlebars/helpers/not-includes/not-includes.d.ts +13 -0
  56. package/dist/core/handlebars/helpers/or/or.cjs +23 -0
  57. package/dist/core/handlebars/helpers/or/or.d.ts +13 -0
  58. package/dist/core/handlebars/helpers/pascal-case/pascal-case.cjs +20 -0
  59. package/dist/core/handlebars/helpers/pascal-case/pascal-case.d.ts +13 -0
  60. package/dist/core/handlebars/helpers/snake-case/snake-case.cjs +20 -0
  61. package/dist/core/handlebars/helpers/snake-case/snake-case.d.ts +13 -0
  62. package/dist/core/handlebars/helpers/spinal-case/spinal-case.cjs +20 -0
  63. package/dist/core/handlebars/helpers/spinal-case/spinal-case.d.ts +13 -0
  64. package/dist/core/handlebars/helpers/upper-case/upper-case.cjs +19 -0
  65. package/dist/core/handlebars/helpers/upper-case/upper-case.d.ts +13 -0
  66. package/dist/core/handlebars/index.cjs +27 -0
  67. package/dist/core/handlebars/index.d.ts +2 -0
  68. package/dist/core/handlebars/utils/helper/helper.cjs +41 -0
  69. package/dist/core/handlebars/utils/helper/helper.d.ts +33 -0
  70. package/dist/core/handlebars/utils/index.cjs +20 -0
  71. package/dist/core/handlebars/utils/index.d.ts +17 -0
  72. package/dist/core/index.cjs +27 -0
  73. package/dist/core/index.d.ts +2 -7
  74. package/dist/core/interface/index.cjs +1 -0
  75. package/dist/core/interface/index.d.ts +1 -0
  76. package/dist/index.cjs +47 -0
  77. package/dist/interface/i-command/i-command.cjs +1 -0
  78. package/dist/interface/i-command/i-command.d.ts +0 -6
  79. package/dist/interface/index.cjs +16 -0
  80. package/dist/utils/index.cjs +18 -0
  81. package/dist/utils/local-binaries/local-binaries.cjs +19 -0
  82. package/es/actions/gen-api/api-manage.d.ts +36 -0
  83. package/es/actions/gen-api/api-manage.mjs +38 -0
  84. package/es/actions/gen-api/gen-api.d.ts +58 -0
  85. package/es/actions/gen-api/gen-api.mjs +164 -0
  86. package/es/actions/gen-api/model-manage.d.ts +124 -0
  87. package/es/actions/gen-api/model-manage.mjs +126 -0
  88. package/es/actions/index.d.ts +1 -0
  89. package/es/actions/index.mjs +1 -0
  90. package/es/bin.d.ts +2 -0
  91. package/es/commands/gen-api/gen-api.d.ts +44 -0
  92. package/es/commands/gen-api/gen-api.mjs +15 -0
  93. package/es/commands/index.d.ts +5 -0
  94. package/{dist → es}/commands/index.mjs +2 -0
  95. package/es/core/handlebars/constant/index.d.ts +2 -0
  96. package/es/core/handlebars/constant/index.mjs +2 -0
  97. package/es/core/handlebars/handlebars-engine.d.ts +74 -0
  98. package/es/core/handlebars/handlebars-engine.mjs +122 -0
  99. package/es/core/handlebars/helpers/and/and.d.ts +13 -0
  100. package/es/core/handlebars/helpers/and/and.mjs +14 -0
  101. package/es/core/handlebars/helpers/camel-case/camel-case.d.ts +13 -0
  102. package/es/core/handlebars/helpers/camel-case/camel-case.mjs +13 -0
  103. package/es/core/handlebars/helpers/concat/concat.d.ts +13 -0
  104. package/es/core/handlebars/helpers/concat/concat.mjs +10 -0
  105. package/es/core/handlebars/helpers/eq/eq.d.ts +14 -0
  106. package/es/core/handlebars/helpers/eq/eq.mjs +12 -0
  107. package/es/core/handlebars/helpers/format-import/format-import.d.ts +13 -0
  108. package/es/core/handlebars/helpers/format-import/format-import.mjs +34 -0
  109. package/es/core/handlebars/helpers/format-import-item/format-import-item.d.ts +13 -0
  110. package/es/core/handlebars/helpers/format-import-item/format-import-item.mjs +33 -0
  111. package/es/core/handlebars/helpers/format-js-type/format-js-type.d.ts +14 -0
  112. package/es/core/handlebars/helpers/format-js-type/format-js-type.mjs +34 -0
  113. package/es/core/handlebars/helpers/gt/gt.d.ts +14 -0
  114. package/es/core/handlebars/helpers/gt/gt.mjs +12 -0
  115. package/es/core/handlebars/helpers/gte/gte.d.ts +14 -0
  116. package/es/core/handlebars/helpers/gte/gte.mjs +12 -0
  117. package/es/core/handlebars/helpers/helper-base.d.ts +22 -0
  118. package/es/core/handlebars/helpers/helper-base.mjs +11 -0
  119. package/es/core/handlebars/helpers/includes/includes.d.ts +13 -0
  120. package/es/core/handlebars/helpers/includes/includes.mjs +11 -0
  121. package/es/core/handlebars/helpers/index.d.ts +6 -0
  122. package/es/core/handlebars/helpers/index.mjs +46 -0
  123. package/es/core/handlebars/helpers/json/json.d.ts +13 -0
  124. package/es/core/handlebars/helpers/json/json.mjs +13 -0
  125. package/es/core/handlebars/helpers/lower-case/lower-case.d.ts +13 -0
  126. package/es/core/handlebars/helpers/lower-case/lower-case.mjs +12 -0
  127. package/es/core/handlebars/helpers/lt/lt.d.ts +14 -0
  128. package/es/core/handlebars/helpers/lt/lt.mjs +12 -0
  129. package/es/core/handlebars/helpers/lte/lte.d.ts +14 -0
  130. package/es/core/handlebars/helpers/lte/lte.mjs +12 -0
  131. package/es/core/handlebars/helpers/neq/neq.d.ts +14 -0
  132. package/es/core/handlebars/helpers/neq/neq.mjs +12 -0
  133. package/es/core/handlebars/helpers/not/not.d.ts +14 -0
  134. package/es/core/handlebars/helpers/not/not.mjs +12 -0
  135. package/es/core/handlebars/helpers/not-includes/not-includes.d.ts +13 -0
  136. package/es/core/handlebars/helpers/not-includes/not-includes.mjs +11 -0
  137. package/es/core/handlebars/helpers/or/or.d.ts +13 -0
  138. package/es/core/handlebars/helpers/or/or.mjs +16 -0
  139. package/es/core/handlebars/helpers/pascal-case/pascal-case.d.ts +13 -0
  140. package/es/core/handlebars/helpers/pascal-case/pascal-case.mjs +13 -0
  141. package/es/core/handlebars/helpers/snake-case/snake-case.d.ts +13 -0
  142. package/es/core/handlebars/helpers/snake-case/snake-case.mjs +13 -0
  143. package/es/core/handlebars/helpers/spinal-case/spinal-case.d.ts +13 -0
  144. package/es/core/handlebars/helpers/spinal-case/spinal-case.mjs +13 -0
  145. package/es/core/handlebars/helpers/upper-case/upper-case.d.ts +13 -0
  146. package/es/core/handlebars/helpers/upper-case/upper-case.mjs +12 -0
  147. package/es/core/handlebars/index.d.ts +2 -0
  148. package/es/core/handlebars/index.mjs +2 -0
  149. package/es/core/handlebars/utils/helper/helper.d.ts +33 -0
  150. package/es/core/handlebars/utils/helper/helper.mjs +54 -0
  151. package/es/core/handlebars/utils/index.d.ts +17 -0
  152. package/es/core/handlebars/utils/index.mjs +7 -0
  153. package/es/core/index.d.ts +2 -0
  154. package/es/core/index.mjs +2 -0
  155. package/es/core/interface/index.d.ts +1 -0
  156. package/es/index.d.ts +2 -0
  157. package/es/interface/i-command/i-command.d.ts +22 -0
  158. package/es/interface/i-command/i-command.mjs +0 -0
  159. package/es/interface/index.d.ts +1 -0
  160. package/es/types/index.d.ts +1 -0
  161. package/es/utils/index.d.ts +1 -0
  162. package/es/utils/local-binaries/local-binaries.d.ts +3 -0
  163. package/package.json +28 -46
  164. package/dist/core/commitlint/commitlint-config/commitlint-config.d.ts +0 -9
  165. package/dist/core/commitlint/commitlint-config/commitlint-config.mjs +0 -28
  166. package/dist/core/commitlint/index.d.ts +0 -1
  167. package/dist/core/commitlint/index.mjs +0 -1
  168. package/dist/core/constants/index.d.ts +0 -8
  169. package/dist/core/constants/index.mjs +0 -2
  170. package/dist/core/eslint/eslint-config/eslint-config.d.ts +0 -9
  171. package/dist/core/eslint/eslint-config/eslint-config.mjs +0 -109
  172. package/dist/core/eslint/index.d.ts +0 -1
  173. package/dist/core/eslint/index.mjs +0 -1
  174. package/dist/core/index.mjs +0 -7
  175. package/dist/core/prettier/index.d.ts +0 -1
  176. package/dist/core/prettier/index.mjs +0 -1
  177. package/dist/core/prettier/prettier-config/prettier-config.d.ts +0 -22
  178. package/dist/core/prettier/prettier-config/prettier-config.mjs +0 -26
  179. package/dist/core/rollup/index.d.ts +0 -2
  180. package/dist/core/rollup/index.mjs +0 -2
  181. package/dist/core/rollup/rollup-config/dev-config.d.ts +0 -9
  182. package/dist/core/rollup/rollup-config/dev-config.mjs +0 -98
  183. package/dist/core/rollup/rollup-plugins/copy-file.d.ts +0 -37
  184. package/dist/core/rollup/rollup-plugins/copy-file.mjs +0 -18
  185. package/dist/core/rollup/rollup-plugins/ignore-compiler-file.d.ts +0 -8
  186. package/dist/core/rollup/rollup-plugins/ignore-compiler-file.mjs +0 -17
  187. package/dist/core/rollup/rollup-plugins/index.d.ts +0 -2
  188. package/dist/core/rollup/rollup-plugins/index.mjs +0 -2
  189. package/dist/core/stylelint/index.d.ts +0 -1
  190. package/dist/core/stylelint/index.mjs +0 -1
  191. package/dist/core/stylelint/stylelint-config/stylelint-config.d.ts +0 -9
  192. package/dist/core/stylelint/stylelint-config/stylelint-config.mjs +0 -21
  193. package/dist/core/util/index.d.ts +0 -21
  194. package/dist/core/util/index.mjs +0 -7
  195. package/dist/core/util/watcher/watcher.d.ts +0 -61
  196. package/dist/core/util/watcher/watcher.mjs +0 -108
  197. package/dist/core/vite/index.d.ts +0 -1
  198. package/dist/core/vite/index.mjs +0 -1
  199. package/dist/core/vite/vite-config/vite-config.d.ts +0 -9
  200. package/dist/core/vite/vite-config/vite-config.mjs +0 -47
  201. /package/{dist → es}/bin.mjs +0 -0
  202. /package/{dist/interface/i-command/i-command.mjs → es/core/interface/index.mjs} +0 -0
  203. /package/{dist → es}/index.mjs +0 -0
  204. /package/{dist → es}/interface/index.mjs +0 -0
  205. /package/{dist → es}/utils/index.mjs +0 -0
  206. /package/{dist → es}/utils/local-binaries/local-binaries.mjs +0 -0
@@ -1,61 +0,0 @@
1
- import * as chokidar from 'chokidar';
2
- import fs from 'fs-extra';
3
- import { EventName } from 'chokidar/handler';
4
- /**
5
- * 文件监控类
6
- *
7
- * @author chitanda
8
- * @date 2022-05-24 14:05:22
9
- * @export
10
- * @class CopyWatch
11
- */
12
- export declare class CopyWatch {
13
- dir: string;
14
- copyDir: string;
15
- protected w: chokidar.FSWatcher;
16
- /**
17
- * Creates an instance of CopyWatch.
18
- *
19
- * @author chitanda
20
- * @date 2022-05-24 14:05:28
21
- * @param {string[]} dir 需要监控的目录
22
- * @param {string} copyDir 需要拷贝到的目录
23
- */
24
- constructor(dir: string, copyDir: string, opts?: chokidar.ChokidarOptions);
25
- /**
26
- * 初始化
27
- *
28
- * @author chitanda
29
- * @date 2022-05-24 14:05:34
30
- * @protected
31
- */
32
- protected init(): void;
33
- /**
34
- * 文件监控变更
35
- *
36
- * @author chitanda
37
- * @date 2022-05-24 14:05:18
38
- * @protected
39
- * @param {("add" | "addDir" | "change" | "unlink" | "unlinkDir")} eventName
40
- * @param {string} pathStr
41
- * @param {(fs.Stats)} [stats]
42
- */
43
- protected watchAll(eventName: EventName, pathStr: string, stats?: fs.Stats): void;
44
- /**
45
- * 文件监控异常
46
- *
47
- * @author chitanda
48
- * @date 2022-05-24 14:05:13
49
- * @protected
50
- * @param {string} path
51
- * @param {(fs.Stats | undefined)} [stats]
52
- */
53
- protected watchErr(err: unknown): void;
54
- /**
55
- * 停止监控
56
- *
57
- * @author chitanda
58
- * @date 2022-05-24 14:05:06
59
- */
60
- unwatch(): void;
61
- }
@@ -1,108 +0,0 @@
1
- import * as chokidar from "chokidar";
2
- import path from "path";
3
- import * as rimraf from "rimraf";
4
- import { copyFileSync } from "copy-file";
5
- import consola from "consola";
6
- import colors from "picocolors";
7
- import { merge } from "lodash-es";
8
- export class CopyWatch {
9
- /**
10
- * Creates an instance of CopyWatch.
11
- *
12
- * @author chitanda
13
- * @date 2022-05-24 14:05:28
14
- * @param {string[]} dir 需要监控的目录
15
- * @param {string} copyDir 需要拷贝到的目录
16
- */
17
- constructor(dir, copyDir, opts = {}) {
18
- this.dir = dir;
19
- this.copyDir = copyDir;
20
- this.w = chokidar.watch(
21
- this.dir,
22
- merge(
23
- {
24
- awaitWriteFinish: {
25
- stabilityThreshold: 300
26
- // 等待0.3秒防抖
27
- }
28
- },
29
- opts
30
- )
31
- );
32
- consola.debug(`\u62F7\u8D1D\u76D1\u63A7\u6587\u4EF6\u5939: ${this.dir}`);
33
- this.init();
34
- }
35
- w;
36
- /**
37
- * 初始化
38
- *
39
- * @author chitanda
40
- * @date 2022-05-24 14:05:34
41
- * @protected
42
- */
43
- init() {
44
- this.watchAll = this.watchAll.bind(this);
45
- this.watchErr = this.watchErr.bind(this);
46
- this.w.on("all", this.watchAll);
47
- this.w.on("error", this.watchErr);
48
- }
49
- /**
50
- * 文件监控变更
51
- *
52
- * @author chitanda
53
- * @date 2022-05-24 14:05:18
54
- * @protected
55
- * @param {("add" | "addDir" | "change" | "unlink" | "unlinkDir")} eventName
56
- * @param {string} pathStr
57
- * @param {(fs.Stats)} [stats]
58
- */
59
- watchAll(eventName, pathStr, stats) {
60
- if (stats && stats.size <= 0) {
61
- return;
62
- }
63
- const cwd = process.cwd();
64
- const source = path.resolve(cwd, pathStr);
65
- const target = path.resolve(this.copyDir, path.relative(this.dir, pathStr));
66
- switch (eventName) {
67
- case "add":
68
- case "change":
69
- consola.info(
70
- `\u62F7\u8D1D\u6587\u4EF6: ${colors.cyan(source)} => ${colors.cyan(target)}`
71
- );
72
- copyFileSync(source, target);
73
- break;
74
- case "addDir":
75
- break;
76
- case "unlink":
77
- case "unlinkDir":
78
- consola.info(`\u5220\u9664\u6587\u4EF6\u6216\u76EE\u5F55: ${target}`);
79
- rimraf.sync(target);
80
- break;
81
- default:
82
- }
83
- }
84
- /**
85
- * 文件监控异常
86
- *
87
- * @author chitanda
88
- * @date 2022-05-24 14:05:13
89
- * @protected
90
- * @param {string} path
91
- * @param {(fs.Stats | undefined)} [stats]
92
- */
93
- watchErr(err) {
94
- consola.error(`\u76D1\u63A7\u6587\u4EF6\u53D1\u751F\u9519\u8BEF: ${err}`);
95
- }
96
- /**
97
- * 停止监控
98
- *
99
- * @author chitanda
100
- * @date 2022-05-24 14:05:06
101
- */
102
- unwatch() {
103
- this.w.off("all", this.watchAll);
104
- this.w.off("error", this.watchErr);
105
- this.w.unwatch(this.dir);
106
- this.w.close();
107
- }
108
- }
@@ -1 +0,0 @@
1
- export { defineViteConfig } from './vite-config/vite-config';
@@ -1 +0,0 @@
1
- export { defineViteConfig } from "./vite-config/vite-config.mjs";
@@ -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,47 +0,0 @@
1
- import { defineConfig, mergeConfig } from "vite";
2
- import vue from "@vitejs/plugin-vue";
3
- import vueJsx from "@vitejs/plugin-vue-jsx";
4
- import { babel } from "@rollup/plugin-babel";
5
- import path from "path";
6
- import * as rf from "rimraf";
7
- export function defineViteConfig(opts = {}) {
8
- const cwd = process.cwd();
9
- const outDir = path.resolve(cwd, "dist");
10
- rf.sync(outDir);
11
- return mergeConfig(
12
- defineConfig({
13
- build: {
14
- outDir,
15
- lib: {
16
- entry: path.resolve(cwd, "src/index.ts"),
17
- formats: ["system", "cjs"]
18
- }
19
- },
20
- plugins: [
21
- vue(),
22
- vueJsx(),
23
- babel({
24
- babelHelpers: "bundled",
25
- presets: [
26
- [
27
- "@babel/preset-env",
28
- {
29
- useBuiltIns: "usage",
30
- corejs: 3,
31
- bugfixes: true,
32
- babelHelpers: "bundled",
33
- targets: {
34
- chrome: ">=85",
35
- edge: ">=85",
36
- firefox: ">=79",
37
- safari: ">=14.1"
38
- }
39
- }
40
- ]
41
- ]
42
- })
43
- ]
44
- }),
45
- opts
46
- );
47
- }
File without changes
File without changes
File without changes
File without changes