@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.
- package/LICENSE +21 -0
- package/dist/actions/gen-api/api-manage.cjs +46 -0
- package/dist/actions/gen-api/api-manage.d.ts +36 -0
- package/dist/actions/gen-api/gen-api.cjs +157 -0
- package/dist/actions/gen-api/gen-api.d.ts +58 -0
- package/dist/actions/gen-api/model-manage.cjs +127 -0
- package/dist/actions/gen-api/model-manage.d.ts +124 -0
- package/dist/actions/index.cjs +12 -0
- package/dist/actions/index.d.ts +1 -0
- package/dist/bin.cjs +5 -0
- package/dist/commands/gen-api/gen-api.cjs +16 -0
- package/dist/commands/gen-api/gen-api.d.ts +44 -0
- package/dist/commands/index.cjs +23 -0
- package/dist/core/handlebars/constant/index.cjs +8 -0
- package/dist/core/handlebars/constant/index.d.ts +2 -0
- package/dist/core/handlebars/handlebars-engine.cjs +134 -0
- package/dist/core/handlebars/handlebars-engine.d.ts +74 -0
- package/dist/core/handlebars/helpers/and/and.cjs +21 -0
- package/dist/core/handlebars/helpers/and/and.d.ts +13 -0
- package/dist/core/handlebars/helpers/camel-case/camel-case.cjs +20 -0
- package/dist/core/handlebars/helpers/camel-case/camel-case.d.ts +13 -0
- package/dist/core/handlebars/helpers/concat/concat.cjs +17 -0
- package/dist/core/handlebars/helpers/concat/concat.d.ts +13 -0
- package/dist/core/handlebars/helpers/eq/eq.cjs +19 -0
- package/dist/core/handlebars/helpers/eq/eq.d.ts +14 -0
- package/dist/core/handlebars/helpers/format-import/format-import.cjs +41 -0
- package/dist/core/handlebars/helpers/format-import/format-import.d.ts +13 -0
- package/dist/core/handlebars/helpers/format-import-item/format-import-item.cjs +40 -0
- package/dist/core/handlebars/helpers/format-import-item/format-import-item.d.ts +13 -0
- package/dist/core/handlebars/helpers/format-js-type/format-js-type.cjs +41 -0
- package/dist/core/handlebars/helpers/format-js-type/format-js-type.d.ts +14 -0
- package/dist/core/handlebars/helpers/gt/gt.cjs +19 -0
- package/dist/core/handlebars/helpers/gt/gt.d.ts +14 -0
- package/dist/core/handlebars/helpers/gte/gte.cjs +19 -0
- package/dist/core/handlebars/helpers/gte/gte.d.ts +14 -0
- package/dist/core/handlebars/helpers/helper-base.cjs +19 -0
- package/dist/core/handlebars/helpers/helper-base.d.ts +22 -0
- package/dist/core/handlebars/helpers/includes/includes.cjs +18 -0
- package/dist/core/handlebars/helpers/includes/includes.d.ts +13 -0
- package/dist/core/handlebars/helpers/index.cjs +52 -0
- package/dist/core/handlebars/helpers/index.d.ts +6 -0
- package/dist/core/handlebars/helpers/json/json.cjs +16 -0
- package/dist/core/handlebars/helpers/json/json.d.ts +13 -0
- package/dist/core/handlebars/helpers/lower-case/lower-case.cjs +19 -0
- package/dist/core/handlebars/helpers/lower-case/lower-case.d.ts +13 -0
- package/dist/core/handlebars/helpers/lt/lt.cjs +19 -0
- package/dist/core/handlebars/helpers/lt/lt.d.ts +14 -0
- package/dist/core/handlebars/helpers/lte/lte.cjs +19 -0
- package/dist/core/handlebars/helpers/lte/lte.d.ts +14 -0
- package/dist/core/handlebars/helpers/neq/neq.cjs +19 -0
- package/dist/core/handlebars/helpers/neq/neq.d.ts +14 -0
- package/dist/core/handlebars/helpers/not/not.cjs +21 -0
- package/dist/core/handlebars/helpers/not/not.d.ts +14 -0
- package/dist/core/handlebars/helpers/not-includes/not-includes.cjs +18 -0
- package/dist/core/handlebars/helpers/not-includes/not-includes.d.ts +13 -0
- package/dist/core/handlebars/helpers/or/or.cjs +23 -0
- package/dist/core/handlebars/helpers/or/or.d.ts +13 -0
- package/dist/core/handlebars/helpers/pascal-case/pascal-case.cjs +20 -0
- package/dist/core/handlebars/helpers/pascal-case/pascal-case.d.ts +13 -0
- package/dist/core/handlebars/helpers/snake-case/snake-case.cjs +20 -0
- package/dist/core/handlebars/helpers/snake-case/snake-case.d.ts +13 -0
- package/dist/core/handlebars/helpers/spinal-case/spinal-case.cjs +20 -0
- package/dist/core/handlebars/helpers/spinal-case/spinal-case.d.ts +13 -0
- package/dist/core/handlebars/helpers/upper-case/upper-case.cjs +19 -0
- package/dist/core/handlebars/helpers/upper-case/upper-case.d.ts +13 -0
- package/dist/core/handlebars/index.cjs +27 -0
- package/dist/core/handlebars/index.d.ts +2 -0
- package/dist/core/handlebars/utils/helper/helper.cjs +41 -0
- package/dist/core/handlebars/utils/helper/helper.d.ts +33 -0
- package/dist/core/handlebars/utils/index.cjs +20 -0
- package/dist/core/handlebars/utils/index.d.ts +17 -0
- package/dist/core/index.cjs +27 -0
- package/dist/core/index.d.ts +2 -7
- package/dist/core/interface/index.cjs +1 -0
- package/dist/core/interface/index.d.ts +1 -0
- package/dist/index.cjs +47 -0
- package/dist/interface/i-command/i-command.cjs +1 -0
- package/dist/interface/i-command/i-command.d.ts +0 -6
- package/dist/interface/index.cjs +16 -0
- package/dist/utils/index.cjs +18 -0
- package/dist/utils/local-binaries/local-binaries.cjs +19 -0
- package/es/actions/gen-api/api-manage.d.ts +36 -0
- package/es/actions/gen-api/api-manage.mjs +38 -0
- package/es/actions/gen-api/gen-api.d.ts +58 -0
- package/es/actions/gen-api/gen-api.mjs +164 -0
- package/es/actions/gen-api/model-manage.d.ts +124 -0
- package/es/actions/gen-api/model-manage.mjs +126 -0
- package/es/actions/index.d.ts +1 -0
- package/es/actions/index.mjs +1 -0
- package/es/bin.d.ts +2 -0
- package/es/commands/gen-api/gen-api.d.ts +44 -0
- package/es/commands/gen-api/gen-api.mjs +15 -0
- package/es/commands/index.d.ts +5 -0
- package/{dist → es}/commands/index.mjs +2 -0
- package/es/core/handlebars/constant/index.d.ts +2 -0
- package/es/core/handlebars/constant/index.mjs +2 -0
- package/es/core/handlebars/handlebars-engine.d.ts +74 -0
- package/es/core/handlebars/handlebars-engine.mjs +122 -0
- package/es/core/handlebars/helpers/and/and.d.ts +13 -0
- package/es/core/handlebars/helpers/and/and.mjs +14 -0
- package/es/core/handlebars/helpers/camel-case/camel-case.d.ts +13 -0
- package/es/core/handlebars/helpers/camel-case/camel-case.mjs +13 -0
- package/es/core/handlebars/helpers/concat/concat.d.ts +13 -0
- package/es/core/handlebars/helpers/concat/concat.mjs +10 -0
- package/es/core/handlebars/helpers/eq/eq.d.ts +14 -0
- package/es/core/handlebars/helpers/eq/eq.mjs +12 -0
- package/es/core/handlebars/helpers/format-import/format-import.d.ts +13 -0
- package/es/core/handlebars/helpers/format-import/format-import.mjs +34 -0
- package/es/core/handlebars/helpers/format-import-item/format-import-item.d.ts +13 -0
- package/es/core/handlebars/helpers/format-import-item/format-import-item.mjs +33 -0
- package/es/core/handlebars/helpers/format-js-type/format-js-type.d.ts +14 -0
- package/es/core/handlebars/helpers/format-js-type/format-js-type.mjs +34 -0
- package/es/core/handlebars/helpers/gt/gt.d.ts +14 -0
- package/es/core/handlebars/helpers/gt/gt.mjs +12 -0
- package/es/core/handlebars/helpers/gte/gte.d.ts +14 -0
- package/es/core/handlebars/helpers/gte/gte.mjs +12 -0
- package/es/core/handlebars/helpers/helper-base.d.ts +22 -0
- package/es/core/handlebars/helpers/helper-base.mjs +11 -0
- package/es/core/handlebars/helpers/includes/includes.d.ts +13 -0
- package/es/core/handlebars/helpers/includes/includes.mjs +11 -0
- package/es/core/handlebars/helpers/index.d.ts +6 -0
- package/es/core/handlebars/helpers/index.mjs +46 -0
- package/es/core/handlebars/helpers/json/json.d.ts +13 -0
- package/es/core/handlebars/helpers/json/json.mjs +13 -0
- package/es/core/handlebars/helpers/lower-case/lower-case.d.ts +13 -0
- package/es/core/handlebars/helpers/lower-case/lower-case.mjs +12 -0
- package/es/core/handlebars/helpers/lt/lt.d.ts +14 -0
- package/es/core/handlebars/helpers/lt/lt.mjs +12 -0
- package/es/core/handlebars/helpers/lte/lte.d.ts +14 -0
- package/es/core/handlebars/helpers/lte/lte.mjs +12 -0
- package/es/core/handlebars/helpers/neq/neq.d.ts +14 -0
- package/es/core/handlebars/helpers/neq/neq.mjs +12 -0
- package/es/core/handlebars/helpers/not/not.d.ts +14 -0
- package/es/core/handlebars/helpers/not/not.mjs +12 -0
- package/es/core/handlebars/helpers/not-includes/not-includes.d.ts +13 -0
- package/es/core/handlebars/helpers/not-includes/not-includes.mjs +11 -0
- package/es/core/handlebars/helpers/or/or.d.ts +13 -0
- package/es/core/handlebars/helpers/or/or.mjs +16 -0
- package/es/core/handlebars/helpers/pascal-case/pascal-case.d.ts +13 -0
- package/es/core/handlebars/helpers/pascal-case/pascal-case.mjs +13 -0
- package/es/core/handlebars/helpers/snake-case/snake-case.d.ts +13 -0
- package/es/core/handlebars/helpers/snake-case/snake-case.mjs +13 -0
- package/es/core/handlebars/helpers/spinal-case/spinal-case.d.ts +13 -0
- package/es/core/handlebars/helpers/spinal-case/spinal-case.mjs +13 -0
- package/es/core/handlebars/helpers/upper-case/upper-case.d.ts +13 -0
- package/es/core/handlebars/helpers/upper-case/upper-case.mjs +12 -0
- package/es/core/handlebars/index.d.ts +2 -0
- package/es/core/handlebars/index.mjs +2 -0
- package/es/core/handlebars/utils/helper/helper.d.ts +33 -0
- package/es/core/handlebars/utils/helper/helper.mjs +54 -0
- package/es/core/handlebars/utils/index.d.ts +17 -0
- package/es/core/handlebars/utils/index.mjs +7 -0
- package/es/core/index.d.ts +2 -0
- package/es/core/index.mjs +2 -0
- package/es/core/interface/index.d.ts +1 -0
- package/es/index.d.ts +2 -0
- package/es/interface/i-command/i-command.d.ts +22 -0
- package/es/interface/i-command/i-command.mjs +0 -0
- package/es/interface/index.d.ts +1 -0
- package/es/types/index.d.ts +1 -0
- package/es/utils/index.d.ts +1 -0
- package/es/utils/local-binaries/local-binaries.d.ts +3 -0
- package/package.json +28 -46
- package/dist/core/commitlint/commitlint-config/commitlint-config.d.ts +0 -9
- package/dist/core/commitlint/commitlint-config/commitlint-config.mjs +0 -28
- package/dist/core/commitlint/index.d.ts +0 -1
- package/dist/core/commitlint/index.mjs +0 -1
- package/dist/core/constants/index.d.ts +0 -8
- package/dist/core/constants/index.mjs +0 -2
- package/dist/core/eslint/eslint-config/eslint-config.d.ts +0 -9
- package/dist/core/eslint/eslint-config/eslint-config.mjs +0 -109
- package/dist/core/eslint/index.d.ts +0 -1
- package/dist/core/eslint/index.mjs +0 -1
- package/dist/core/index.mjs +0 -7
- package/dist/core/prettier/index.d.ts +0 -1
- package/dist/core/prettier/index.mjs +0 -1
- package/dist/core/prettier/prettier-config/prettier-config.d.ts +0 -22
- package/dist/core/prettier/prettier-config/prettier-config.mjs +0 -26
- package/dist/core/rollup/index.d.ts +0 -2
- package/dist/core/rollup/index.mjs +0 -2
- package/dist/core/rollup/rollup-config/dev-config.d.ts +0 -9
- package/dist/core/rollup/rollup-config/dev-config.mjs +0 -98
- package/dist/core/rollup/rollup-plugins/copy-file.d.ts +0 -37
- package/dist/core/rollup/rollup-plugins/copy-file.mjs +0 -18
- package/dist/core/rollup/rollup-plugins/ignore-compiler-file.d.ts +0 -8
- package/dist/core/rollup/rollup-plugins/ignore-compiler-file.mjs +0 -17
- package/dist/core/rollup/rollup-plugins/index.d.ts +0 -2
- package/dist/core/rollup/rollup-plugins/index.mjs +0 -2
- package/dist/core/stylelint/index.d.ts +0 -1
- package/dist/core/stylelint/index.mjs +0 -1
- package/dist/core/stylelint/stylelint-config/stylelint-config.d.ts +0 -9
- package/dist/core/stylelint/stylelint-config/stylelint-config.mjs +0 -21
- package/dist/core/util/index.d.ts +0 -21
- package/dist/core/util/index.mjs +0 -7
- package/dist/core/util/watcher/watcher.d.ts +0 -61
- package/dist/core/util/watcher/watcher.mjs +0 -108
- package/dist/core/vite/index.d.ts +0 -1
- package/dist/core/vite/index.mjs +0 -1
- package/dist/core/vite/vite-config/vite-config.d.ts +0 -9
- package/dist/core/vite/vite-config/vite-config.mjs +0 -47
- /package/{dist → es}/bin.mjs +0 -0
- /package/{dist/interface/i-command/i-command.mjs → es/core/interface/index.mjs} +0 -0
- /package/{dist → es}/index.mjs +0 -0
- /package/{dist → es}/interface/index.mjs +0 -0
- /package/{dist → es}/utils/index.mjs +0 -0
- /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.
|
|
3
|
+
"version": "0.0.1-dev.20",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "paas 平台核心包",
|
|
6
6
|
"bin": {
|
|
7
|
-
"gct-
|
|
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
|
-
"@
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
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.
|
|
61
|
-
"
|
|
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
|
-
"
|
|
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.
|
|
82
|
-
"typescript": "^5.
|
|
83
|
-
"unbuild": "^3.
|
|
84
|
-
}
|
|
62
|
+
"@types/node": "^22.13.9",
|
|
63
|
+
"typescript": "^5.8.2",
|
|
64
|
+
"unbuild": "^3.5.0"
|
|
65
|
+
},
|
|
66
|
+
"gitHead": "9266f204c9c400c60c3aeffe6981eed0992fc243"
|
|
85
67
|
}
|
|
@@ -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,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";
|
package/dist/core/index.mjs
DELETED
|
@@ -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,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,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 +0,0 @@
|
|
|
1
|
-
export { defineStylelintConfig } from './stylelint-config/stylelint-config';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { defineStylelintConfig } from "./stylelint-config/stylelint-config.mjs";
|
|
@@ -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;
|