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

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
package/package.json CHANGED
@@ -1,15 +1,24 @@
1
1
  {
2
2
  "name": "@gct-paas/cli",
3
- "version": "0.0.1-dev.2",
3
+ "version": "0.0.1-dev.21",
4
4
  "type": "module",
5
5
  "description": "paas 平台核心包",
6
6
  "bin": {
7
- "gct-build": "dist/bin.mjs"
7
+ "gct-paas": "es/bin.mjs"
8
+ },
9
+ "main": "dist/index.cjs",
10
+ "module": "es/index.mjs",
11
+ "types": "es/index.d.ts",
12
+ "exports": {
13
+ ".": {
14
+ "types": "./es/index.d.ts",
15
+ "import": "./es/index.mjs",
16
+ "require": "./dist/index.cjs"
17
+ }
8
18
  },
9
- "main": "dist/index.mjs",
10
- "types": "dist/index.d.ts",
11
19
  "files": [
12
20
  "dist",
21
+ "es",
13
22
  "CHANGELOG.md",
14
23
  "README.md"
15
24
  ],
@@ -33,53 +42,26 @@
33
42
  "publish:npm": "npm run build && npm publish --access public --registry=https://registry.npmjs.org/"
34
43
  },
35
44
  "dependencies": {
36
- "@babel/core": "^7.26.0",
37
- "@babel/preset-env": "^7.26.0",
38
- "@commitlint/cli": "^19.6.1",
39
- "@commitlint/config-conventional": "^19.6.0",
40
- "@eslint/js": "^9.17.0",
41
- "@rollup/plugin-babel": "^6.0.4",
42
- "@rollup/plugin-commonjs": "^28.0.2",
43
- "@rollup/plugin-eslint": "^9.0.5",
44
- "@rollup/plugin-json": "^6.1.0",
45
- "@rollup/plugin-node-resolve": "^16.0.0",
46
- "@vitejs/plugin-vue": "^5.2.1",
47
- "@vitejs/plugin-vue-jsx": "^4.1.1",
48
- "@vue/compiler-sfc": "^3.5.13",
49
- "chokidar": "^4.0.3",
50
- "commander": "^13.0.0",
51
- "consola": "^3.3.3",
52
- "copy-file": "^11.0.0",
53
- "cpy": "^11.1.0",
54
- "eslint": "^9.17.0",
55
- "eslint-plugin-import": "^2.31.0",
56
- "eslint-plugin-prettier": "^5.2.1",
57
- "eslint-plugin-unused-imports": "^4.1.4",
58
- "eslint-plugin-vue": "^9.32.0",
45
+ "@inquirer/prompts": "^7.3.2",
46
+ "commander": "^13.1.0",
47
+ "consola": "^3.4.0",
48
+ "core-js": "^3.41.0",
59
49
  "fast-glob": "^3.3.3",
60
- "fs-extra": "^11.2.0",
61
- "globals": "^15.14.0",
50
+ "fs-extra": "^11.3.0",
51
+ "got": "^14.4.6",
52
+ "handlebars": "^4.7.8",
53
+ "handlebars-helpers": "^0.10.0",
62
54
  "lodash-es": "^4.17.21",
55
+ "ora": "^8.2.0",
63
56
  "picocolors": "^1.1.1",
64
- "prettier": "^3.4.2",
65
- "rimraf": "^6.0.1",
66
- "rollup": "^4.30.0",
67
- "rollup-plugin-esbuild": "^6.1.1",
68
- "stylelint": "^16.12.0",
69
- "stylelint-config-standard": "^36.0.1",
70
- "stylelint-config-standard-scss": "^14.0.0",
71
- "typescript-eslint": "^8.19.0",
72
- "vite-plugin-dts": "^4.4.0",
73
- "vue-tsc": "^2.2.0"
57
+ "rimraf": "^6.0.1"
74
58
  },
75
59
  "devDependencies": {
76
- "@commitlint/types": "^19.5.0",
77
- "@types/babel__core": "^7.20.5",
78
- "@types/babel__preset-env": "^7.9.7",
79
60
  "@types/fs-extra": "^11.0.4",
80
61
  "@types/lodash-es": "^4.17.12",
81
- "@types/node": "^22.10.5",
82
- "typescript": "^5.7.2",
83
- "unbuild": "^3.2.0"
84
- }
62
+ "@types/node": "^22.13.9",
63
+ "typescript": "^5.8.2",
64
+ "unbuild": "^3.5.0"
65
+ },
66
+ "gitHead": "37b40934f0d80ca67b4dba1c0259e8ca02f9dba5"
85
67
  }
@@ -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,8 +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";
@@ -1,2 +0,0 @@
1
- export const DEV_MODE = "development";
2
- export const PROD_MODE = "production";
@@ -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": "error",
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";
@@ -1,7 +0,0 @@
1
- export * from "./commitlint/index.mjs";
2
- export * from "./eslint/index.mjs";
3
- export * from "./prettier/index.mjs";
4
- export * from "./rollup/index.mjs";
5
- export * from "./stylelint/index.mjs";
6
- export * from "./util/index.mjs";
7
- export * from "./vite/index.mjs";
@@ -1 +0,0 @@
1
- export { definePrettierConfig } from './prettier-config/prettier-config';
@@ -1 +0,0 @@
1
- export { definePrettierConfig } from "./prettier-config/prettier-config.mjs";
@@ -1,22 +0,0 @@
1
- import { Options } from 'prettier';
2
- /**
3
- * 基于基础配置,定义 prettier 配置
4
- *
5
- * @description 提交信息规范,提交格式: type: description
6
- * feat: 新功能(feature)
7
- * fix: 修补bug
8
- * docs: 文档(documentation)
9
- * style: 格式(不影响代码运行的变动)
10
- * refactor: 重构(即不是新增功能,也不是修改bug的代码变动)
11
- * test: 增加测试,或测试变更
12
- * perf : 性能优化
13
- * revert: 撤销上一次的提交
14
- * build: 构建工具或构建过程等的变动,如:关联包升级等
15
- * chore: 其他修改(不在上述类型中的修改)
16
- * release: 发布新版本
17
- *
18
- * @export
19
- * @param {Options} config
20
- * @returns {*} {Options}
21
- */
22
- export declare function definePrettierConfig(config?: Options): Options;
@@ -1,26 +0,0 @@
1
- import { merge } from "lodash-es";
2
- export function definePrettierConfig(config = {}) {
3
- return merge(
4
- {
5
- // 起始格式化间隔
6
- tabWidth: 2,
7
- // 使用单引号
8
- singleQuote: true,
9
- // jsx 中使用单引号
10
- jsxSingleQuote: true,
11
- // 对象中的 key 是否需要引号。as-needed: 只有在必须时才要
12
- quoteProps: "as-needed",
13
- // 每行结尾是否需要分号
14
- trailingComma: "all",
15
- // 括号中参数前后补充空格
16
- bracketSpacing: true,
17
- // 箭头函数,参数是否添加括号
18
- arrowParens: "avoid",
19
- // jsx 元素最后末尾的 > ,换行放置
20
- bracketSameLine: false,
21
- // 设置换行符
22
- endOfLine: "lf"
23
- },
24
- config
25
- );
26
- }
@@ -1,2 +0,0 @@
1
- export { defineRollupConfig } from './rollup-config/dev-config';
2
- export * from './rollup-plugins';
@@ -1,2 +0,0 @@
1
- export { defineRollupConfig } from "./rollup-config/dev-config.mjs";
2
- export * from "./rollup-plugins/index.mjs";
@@ -1,9 +0,0 @@
1
- import { RollupOptions } from 'rollup';
2
- /**
3
- * 开发包基础编译配置
4
- *
5
- * @export
6
- * @param {RollupOptions} [opts={}]
7
- * @returns {*} {RollupOptions}
8
- */
9
- export declare function defineRollupConfig(opts?: RollupOptions): RollupOptions;
@@ -1,98 +0,0 @@
1
- import { defineConfig } from "rollup";
2
- import { merge } from "lodash-es";
3
- import path from "path";
4
- import glob from "fast-glob";
5
- import { nodeResolve } from "@rollup/plugin-node-resolve";
6
- import commonjs from "@rollup/plugin-commonjs";
7
- import json from "@rollup/plugin-json";
8
- import esbuild from "rollup-plugin-esbuild";
9
- import dts from "vite-plugin-dts";
10
- import vue from "@vitejs/plugin-vue";
11
- import vueJsx from "@vitejs/plugin-vue-jsx";
12
- import * as rf from "rimraf";
13
- import cpy from "cpy";
14
- import fs from "fs-extra";
15
- import { copyFile, ignoreCompilerFile } from "../rollup-plugins/index.mjs";
16
- import { PROD_MODE } from "../../constants/index.mjs";
17
- export function defineRollupConfig(opts = {}) {
18
- process.on("SIGINT", () => {
19
- process.exit();
20
- });
21
- const cwd = process.cwd();
22
- const isProd = process.env.NODE_ENV === PROD_MODE;
23
- const rootDir = path.resolve(cwd, "src");
24
- const outDir = path.resolve(cwd, "es");
25
- const assetsDir = path.resolve(cwd, "public");
26
- const externalCompileFileReg = /\.(vue|scss|css|less)+$/;
27
- rf.sync(outDir);
28
- const input = glob.sync("src/**/*.{ts,tsx}", {
29
- cwd,
30
- absolute: true,
31
- onlyFiles: true,
32
- ignore: ["**/*.test.ts", "**/*.test.tsx", "**/*.d.ts"]
33
- });
34
- if (isProd) {
35
- if (fs.pathExistsSync(assetsDir)) {
36
- cpy(assetsDir, outDir);
37
- }
38
- cpy(path.resolve(cwd, "src/**/*.{vue,scss,css,less}"), outDir);
39
- } else {
40
- copyFile([
41
- {
42
- from: assetsDir,
43
- to: outDir
44
- },
45
- {
46
- from: rootDir,
47
- to: outDir,
48
- opts: {
49
- ignored: (file, stats) => {
50
- if (stats && stats.isFile()) {
51
- return !externalCompileFileReg.test(file);
52
- }
53
- return false;
54
- }
55
- }
56
- }
57
- ]);
58
- }
59
- const output = [
60
- {
61
- dir: outDir,
62
- format: "es",
63
- sourcemap: false,
64
- preserveModules: true,
65
- preserveModulesRoot: rootDir,
66
- entryFileNames: "[name].mjs"
67
- }
68
- ];
69
- return merge(
70
- defineConfig({
71
- input,
72
- treeshake: false,
73
- external: ["vue"],
74
- output,
75
- plugins: [
76
- ignoreCompilerFile(externalCompileFileReg),
77
- json(),
78
- nodeResolve({
79
- extensions: [".cjs", ".mjs", ".js", ".ts"]
80
- }),
81
- commonjs(),
82
- esbuild({
83
- logLevel: "verbose",
84
- sourceMap: false,
85
- target: ["esnext"]
86
- }),
87
- vue({
88
- isProduction: false
89
- }),
90
- vueJsx({}),
91
- dts({
92
- outDir: [outDir]
93
- })
94
- ]
95
- }),
96
- opts
97
- );
98
- }
@@ -1,37 +0,0 @@
1
- import * as chokidar from 'chokidar';
2
- /**
3
- * 文件拷贝插件配置参数
4
- *
5
- * @export
6
- * @interface CopyFilePluginOptions
7
- */
8
- export interface CopyFilePluginOptions {
9
- /**
10
- * 源文件
11
- *
12
- * @type {string}
13
- * @memberof CopyFilePluginOptions
14
- */
15
- from: string;
16
- /**
17
- * 目标文件
18
- *
19
- * @type {string}
20
- * @memberof CopyFilePluginOptions
21
- */
22
- to: string;
23
- /**
24
- * chokidar watch 配置
25
- *
26
- * @type {chokidar.ChokidarOptions}
27
- */
28
- opts?: chokidar.ChokidarOptions;
29
- }
30
- /**
31
- * 文件拷贝插件,在开发模式下会监控文件变更,并自动拷贝文件
32
- *
33
- * @export
34
- * @param {CopyFilePluginOptions[]} opts
35
- * @return {*} {Plugin}
36
- */
37
- export declare function copyFile(opts: CopyFilePluginOptions[]): void;
@@ -1,18 +0,0 @@
1
- import { CopyWatch } from "../../util/index.mjs";
2
- export function copyFile(opts) {
3
- if (opts.length === 0) {
4
- return;
5
- }
6
- const arr = [];
7
- opts.forEach((opt) => {
8
- arr.push(new CopyWatch(opt.from, opt.to, opt.opts));
9
- });
10
- process.on("exit", () => {
11
- if (!opts.length) {
12
- return;
13
- }
14
- arr.forEach((item) => {
15
- item.unwatch();
16
- });
17
- });
18
- }
@@ -1,8 +0,0 @@
1
- import { Plugin } from 'rollup';
2
- /**
3
- * 忽略编译的文件类型
4
- *
5
- * @export
6
- * @returns {*} {Plugin}
7
- */
8
- export declare function ignoreCompilerFile(extReg: RegExp): Plugin;
@@ -1,17 +0,0 @@
1
- export function ignoreCompilerFile(extReg) {
2
- return {
3
- name: "gct:ignore-compiler-file",
4
- resolveId(source) {
5
- if (extReg.test(source)) {
6
- return {
7
- id: source,
8
- external: true
9
- };
10
- }
11
- return null;
12
- },
13
- load() {
14
- return null;
15
- }
16
- };
17
- }
@@ -1,2 +0,0 @@
1
- export { copyFile } from './copy-file';
2
- export { ignoreCompilerFile } from './ignore-compiler-file';
@@ -1,2 +0,0 @@
1
- export { copyFile } from "./copy-file.mjs";
2
- export { ignoreCompilerFile } from "./ignore-compiler-file.mjs";
@@ -1 +0,0 @@
1
- export { defineStylelintConfig } from './stylelint-config/stylelint-config';
@@ -1 +0,0 @@
1
- export { defineStylelintConfig } from "./stylelint-config/stylelint-config.mjs";
@@ -1,9 +0,0 @@
1
- import { Config } from 'stylelint';
2
- /**
3
- * 基于基础规则,定义 stylelint 配置
4
- *
5
- * @export
6
- * @param {Config} config
7
- * @returns {*} {Config}
8
- */
9
- export declare function defineStylelintConfig(config?: Config): Config;
@@ -1,21 +0,0 @@
1
- import { merge } from "lodash-es";
2
- export function defineStylelintConfig(config = {}) {
3
- return merge(
4
- {
5
- extends: ["stylelint-config-standard", "stylelint-config-standard-scss"],
6
- rules: {
7
- "annotation-no-unknown": null,
8
- "color-no-invalid-hex": true,
9
- "function-name-case": null,
10
- // 强制样式方法名称小写或大写
11
- "no-duplicate-selectors": null,
12
- "selector-class-pattern": null,
13
- "scss/dollar-variable-pattern": null,
14
- "scss/at-function-pattern": null,
15
- "scss/dollar-variable-empty-line-before": null
16
- // 变量声明之间不可以有空白行
17
- }
18
- },
19
- config
20
- );
21
- }
@@ -1,21 +0,0 @@
1
- export { CopyWatch } from './watcher/watcher';
2
- /**
3
- * win 路径 \\ 转 linux 路径 /
4
- *
5
- * @author chitanda
6
- * @date 2022-01-19 09:01:23
7
- * @export
8
- * @param {string} pathStr
9
- * @return {*} {string}
10
- */
11
- export declare function winToUnixPath(pathStr: string): string;
12
- /**
13
- * linux 路径 / 转 win 路径 \\
14
- *
15
- * @author chitanda
16
- * @date 2022-01-19 10:01:34
17
- * @export
18
- * @param {string} pathStr
19
- * @return {*} {string}
20
- */
21
- export declare function unixToWinPath(pathStr: string): string;
@@ -1,7 +0,0 @@
1
- export { CopyWatch } from "./watcher/watcher.mjs";
2
- export function winToUnixPath(pathStr) {
3
- return pathStr.replace(/\\/g, "/");
4
- }
5
- export function unixToWinPath(pathStr) {
6
- return pathStr.replace(/\//g, "\\");
7
- }