@gct-paas/build 0.0.1-dev.8
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/CHANGELOG.md +14 -0
- package/LICENSE +21 -0
- package/README.md +1 -0
- package/dist/commitlint/commitlint-config/commitlint-config.cjs +15 -0
- package/dist/commitlint/commitlint-config/commitlint-config.d.ts +9 -0
- package/dist/commitlint/index.cjs +12 -0
- package/dist/commitlint/index.d.ts +1 -0
- package/dist/constants/index.cjs +9 -0
- package/dist/constants/index.d.ts +12 -0
- package/dist/eslint/eslint-config/eslint-config.cjs +85 -0
- package/dist/eslint/eslint-config/eslint-config.d.ts +9 -0
- package/dist/eslint/index.cjs +12 -0
- package/dist/eslint/index.d.ts +1 -0
- package/dist/index.cjs +82 -0
- package/dist/index.d.ts +7 -0
- package/dist/prettier/index.cjs +12 -0
- package/dist/prettier/index.d.ts +1 -0
- package/dist/prettier/prettier-config/prettier-config.cjs +29 -0
- package/dist/prettier/prettier-config/prettier-config.d.ts +22 -0
- package/dist/rollup/index.cjs +27 -0
- package/dist/rollup/index.d.ts +2 -0
- package/dist/rollup/rollup-config/dev-config.cjs +93 -0
- package/dist/rollup/rollup-config/dev-config.d.ts +9 -0
- package/dist/rollup/rollup-plugins/copy-file.cjs +24 -0
- package/dist/rollup/rollup-plugins/copy-file.d.ts +37 -0
- package/dist/rollup/rollup-plugins/ignore-compiler-file.cjs +23 -0
- package/dist/rollup/rollup-plugins/ignore-compiler-file.d.ts +8 -0
- package/dist/rollup/rollup-plugins/index.cjs +19 -0
- package/dist/rollup/rollup-plugins/index.d.ts +2 -0
- package/dist/stylelint/index.cjs +12 -0
- package/dist/stylelint/index.d.ts +1 -0
- package/dist/stylelint/stylelint-config/stylelint-config.cjs +24 -0
- package/dist/stylelint/stylelint-config/stylelint-config.d.ts +9 -0
- package/dist/util/index.cjs +20 -0
- package/dist/util/index.d.ts +17 -0
- package/dist/util/watcher/watcher.cjs +99 -0
- package/dist/util/watcher/watcher.d.ts +48 -0
- package/dist/vite/index.cjs +45 -0
- package/dist/vite/index.d.ts +4 -0
- package/dist/vite/vite-config/vite-base-config.cjs +47 -0
- package/dist/vite/vite-config/vite-base-config.d.ts +9 -0
- package/dist/vite/vite-config/vite-config.cjs +40 -0
- package/dist/vite/vite-config/vite-config.d.ts +9 -0
- package/dist/vite/vite-config/vite-dev-config.cjs +23 -0
- package/dist/vite/vite-config/vite-dev-config.d.ts +9 -0
- package/dist/vite/vite-config/vite-plugin-config.cjs +97 -0
- package/dist/vite/vite-config/vite-plugin-config.d.ts +25 -0
- package/es/commitlint/commitlint-config/commitlint-config.d.ts +9 -0
- package/es/commitlint/commitlint-config/commitlint-config.mjs +28 -0
- package/es/commitlint/index.d.ts +1 -0
- package/es/commitlint/index.mjs +1 -0
- package/es/constants/index.d.ts +12 -0
- package/es/constants/index.mjs +24 -0
- package/es/eslint/eslint-config/eslint-config.d.ts +9 -0
- package/es/eslint/eslint-config/eslint-config.mjs +109 -0
- package/es/eslint/index.d.ts +1 -0
- package/es/eslint/index.mjs +1 -0
- package/es/index.d.ts +7 -0
- package/es/index.mjs +7 -0
- package/es/prettier/index.d.ts +1 -0
- package/es/prettier/index.mjs +1 -0
- package/es/prettier/prettier-config/prettier-config.d.ts +22 -0
- package/es/prettier/prettier-config/prettier-config.mjs +26 -0
- package/es/rollup/index.d.ts +2 -0
- package/es/rollup/index.mjs +2 -0
- package/es/rollup/rollup-config/dev-config.d.ts +9 -0
- package/es/rollup/rollup-config/dev-config.mjs +101 -0
- package/es/rollup/rollup-plugins/copy-file.d.ts +37 -0
- package/es/rollup/rollup-plugins/copy-file.mjs +18 -0
- package/es/rollup/rollup-plugins/ignore-compiler-file.d.ts +8 -0
- package/es/rollup/rollup-plugins/ignore-compiler-file.mjs +17 -0
- package/es/rollup/rollup-plugins/index.d.ts +2 -0
- package/es/rollup/rollup-plugins/index.mjs +2 -0
- package/es/stylelint/index.d.ts +1 -0
- package/es/stylelint/index.mjs +1 -0
- package/es/stylelint/stylelint-config/stylelint-config.d.ts +9 -0
- package/es/stylelint/stylelint-config/stylelint-config.mjs +21 -0
- package/es/util/index.d.ts +17 -0
- package/es/util/index.mjs +7 -0
- package/es/util/watcher/watcher.d.ts +48 -0
- package/es/util/watcher/watcher.mjs +95 -0
- package/es/vite/index.d.ts +4 -0
- package/es/vite/index.mjs +8 -0
- package/es/vite/vite-config/vite-base-config.d.ts +9 -0
- package/es/vite/vite-config/vite-base-config.mjs +53 -0
- package/es/vite/vite-config/vite-config.d.ts +9 -0
- package/es/vite/vite-config/vite-config.mjs +36 -0
- package/es/vite/vite-config/vite-dev-config.d.ts +9 -0
- package/es/vite/vite-config/vite-dev-config.mjs +19 -0
- package/es/vite/vite-config/vite-plugin-config.d.ts +25 -0
- package/es/vite/vite-config/vite-plugin-config.mjs +97 -0
- package/package.json +100 -0
package/CHANGELOG.md
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 冠骋信息技术有限公司
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.defineCommitlintConfig = defineCommitlintConfig;
|
|
7
|
+
var _lodashEs = require("lodash-es");
|
|
8
|
+
function defineCommitlintConfig(config = {}) {
|
|
9
|
+
return (0, _lodashEs.merge)({
|
|
10
|
+
extends: ["@commitlint/config-conventional"],
|
|
11
|
+
rules: {
|
|
12
|
+
"type-enum": [2, "always", ["feat", "fix", "docs", "style", "refactor", "test", "perf", "revert", "build", "chore", "release"]]
|
|
13
|
+
}
|
|
14
|
+
}, config);
|
|
15
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "defineCommitlintConfig", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _commitlintConfig.defineCommitlintConfig;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _commitlintConfig = require("./commitlint-config/commitlint-config.cjs");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { defineCommitlintConfig } from './commitlint-config/commitlint-config';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.PROD_MODE = exports.DEV_MODE = exports.DEFAULT_EXTERNAL = void 0;
|
|
7
|
+
const DEV_MODE = exports.DEV_MODE = "development";
|
|
8
|
+
const PROD_MODE = exports.PROD_MODE = "production";
|
|
9
|
+
const DEFAULT_EXTERNAL = exports.DEFAULT_EXTERNAL = ["vue", "vue-router", "vue-i18n", "axios", "dayjs", "lodash-es", "qs", "pinia", "vuedraggable", "sortablejs", "vue-grid-layout", "vant", "ant-design-vue", "@gct-paas/core", "@gct-paas/design", "@gct-paas/design-mobile", "@gct-paas/design-web", "@gct-paas/mobile", "@gct-paas/web", "systemjs"];
|
|
@@ -0,0 +1,12 @@
|
|
|
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[];
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.defineEslintConfig = defineEslintConfig;
|
|
7
|
+
var _js = _interopRequireDefault(require("@eslint/js"));
|
|
8
|
+
var _typescriptEslint = _interopRequireDefault(require("typescript-eslint"));
|
|
9
|
+
var _eslintPluginVue = _interopRequireDefault(require("eslint-plugin-vue"));
|
|
10
|
+
var _recommended = _interopRequireDefault(require("eslint-plugin-prettier/recommended"));
|
|
11
|
+
var _eslintPluginUnusedImports = _interopRequireDefault(require("eslint-plugin-unused-imports"));
|
|
12
|
+
var _eslintPluginImport = _interopRequireDefault(require("eslint-plugin-import"));
|
|
13
|
+
var _globals = _interopRequireDefault(require("globals"));
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
function defineEslintConfig(...configs) {
|
|
16
|
+
return _typescriptEslint.default.config(/** js推荐配置 */
|
|
17
|
+
_js.default.configs.recommended, /** ts推荐配置 */
|
|
18
|
+
_typescriptEslint.default.configs.strict, _typescriptEslint.default.configs.stylistic, /** vue推荐配置 */
|
|
19
|
+
_eslintPluginVue.default.configs["flat/recommended"], _recommended.default, _eslintPluginImport.default.flatConfigs.recommended, _eslintPluginImport.default.flatConfigs.warnings, _eslintPluginImport.default.flatConfigs.errors, _eslintPluginImport.default.flatConfigs.typescript, {
|
|
20
|
+
ignores: ["**/node_modules", "lerna.json", "package.json", "tsconfig.json", "pnpm-lock.yaml", "pnpm-workspace.yaml", "eslint.config.mjs", "**/dist", "**/out", "**/es", "**/lib"],
|
|
21
|
+
files: ["**/*.ts", "**.*.tsx", "**/*.vue"],
|
|
22
|
+
plugins: {
|
|
23
|
+
"unused-imports": _eslintPluginUnusedImports.default
|
|
24
|
+
},
|
|
25
|
+
languageOptions: {
|
|
26
|
+
globals: {
|
|
27
|
+
..._globals.default.browser
|
|
28
|
+
},
|
|
29
|
+
parserOptions: {
|
|
30
|
+
ecmaFeatures: {
|
|
31
|
+
// 全局严格模式
|
|
32
|
+
impliedStrict: true,
|
|
33
|
+
// 启用 jsx
|
|
34
|
+
jsx: true
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
rules: {
|
|
39
|
+
// 基础配置覆盖
|
|
40
|
+
"no-console": "off",
|
|
41
|
+
"no-debugger": "off",
|
|
42
|
+
"no-undef": "off",
|
|
43
|
+
"no-plusplus": ["error", {
|
|
44
|
+
allowForLoopAfterthoughts: true
|
|
45
|
+
}],
|
|
46
|
+
"no-underscore-dangle": "off",
|
|
47
|
+
"no-restricted-syntax": "off",
|
|
48
|
+
"no-continue": "off",
|
|
49
|
+
"no-unused-vars": "off",
|
|
50
|
+
"no-extraneous-class": "off",
|
|
51
|
+
"no-param-reassign": "off",
|
|
52
|
+
"no-useless-constructor": "off",
|
|
53
|
+
"no-empty-function": "off",
|
|
54
|
+
// unused-imports 配置覆盖
|
|
55
|
+
"unused-imports/no-unused-imports": "error",
|
|
56
|
+
"consistent-return": "off",
|
|
57
|
+
"func-names": "off",
|
|
58
|
+
// import 配置覆盖
|
|
59
|
+
"import/no-unresolved": "off",
|
|
60
|
+
"import/extensions": "off",
|
|
61
|
+
"import/prefer-default-export": "off",
|
|
62
|
+
// vue 配置覆盖
|
|
63
|
+
"vue/no-setup-props-destructure": "off",
|
|
64
|
+
"vue/require-default-prop": "off",
|
|
65
|
+
// typescript 配置覆盖
|
|
66
|
+
"@typescript-eslint/no-unused-vars": ["error", {
|
|
67
|
+
argsIgnorePattern: "^_"
|
|
68
|
+
}],
|
|
69
|
+
"@typescript-eslint/no-inferrable-types": "off",
|
|
70
|
+
"@typescript-eslint/no-explicit-any": ["error"],
|
|
71
|
+
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
72
|
+
"@typescript-eslint/no-non-null-assertion": "off",
|
|
73
|
+
"@typescript-eslint/no-extraneous-class": "off",
|
|
74
|
+
// 其他配置覆盖
|
|
75
|
+
"class-methods-use-this": "off",
|
|
76
|
+
"prefer-destructuring": "off"
|
|
77
|
+
}
|
|
78
|
+
}, {
|
|
79
|
+
name: "ts-vue-override",
|
|
80
|
+
files: ["**/*.vue"],
|
|
81
|
+
rules: {
|
|
82
|
+
"@typescript-eslint/no-unused-vars": "off"
|
|
83
|
+
}
|
|
84
|
+
}, ...configs);
|
|
85
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
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;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "defineEslintConfig", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _eslintConfig.defineEslintConfig;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _eslintConfig = require("./eslint-config/eslint-config.cjs");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { defineEslintConfig } from './eslint-config/eslint-config';
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _commitlint = require("./commitlint/index.cjs");
|
|
7
|
+
Object.keys(_commitlint).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _commitlint[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _commitlint[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _eslint = require("./eslint/index.cjs");
|
|
18
|
+
Object.keys(_eslint).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _eslint[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _eslint[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _prettier = require("./prettier/index.cjs");
|
|
29
|
+
Object.keys(_prettier).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _prettier[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _prettier[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
var _rollup = require("./rollup/index.cjs");
|
|
40
|
+
Object.keys(_rollup).forEach(function (key) {
|
|
41
|
+
if (key === "default" || key === "__esModule") return;
|
|
42
|
+
if (key in exports && exports[key] === _rollup[key]) return;
|
|
43
|
+
Object.defineProperty(exports, key, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return _rollup[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
var _stylelint = require("./stylelint/index.cjs");
|
|
51
|
+
Object.keys(_stylelint).forEach(function (key) {
|
|
52
|
+
if (key === "default" || key === "__esModule") return;
|
|
53
|
+
if (key in exports && exports[key] === _stylelint[key]) return;
|
|
54
|
+
Object.defineProperty(exports, key, {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _stylelint[key];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
var _util = require("./util/index.cjs");
|
|
62
|
+
Object.keys(_util).forEach(function (key) {
|
|
63
|
+
if (key === "default" || key === "__esModule") return;
|
|
64
|
+
if (key in exports && exports[key] === _util[key]) return;
|
|
65
|
+
Object.defineProperty(exports, key, {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
get: function () {
|
|
68
|
+
return _util[key];
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
var _vite = require("./vite/index.cjs");
|
|
73
|
+
Object.keys(_vite).forEach(function (key) {
|
|
74
|
+
if (key === "default" || key === "__esModule") return;
|
|
75
|
+
if (key in exports && exports[key] === _vite[key]) return;
|
|
76
|
+
Object.defineProperty(exports, key, {
|
|
77
|
+
enumerable: true,
|
|
78
|
+
get: function () {
|
|
79
|
+
return _vite[key];
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
});
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "definePrettierConfig", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _prettierConfig.definePrettierConfig;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _prettierConfig = require("./prettier-config/prettier-config.cjs");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { definePrettierConfig } from './prettier-config/prettier-config';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.definePrettierConfig = definePrettierConfig;
|
|
7
|
+
var _lodashEs = require("lodash-es");
|
|
8
|
+
function definePrettierConfig(config = {}) {
|
|
9
|
+
return (0, _lodashEs.merge)({
|
|
10
|
+
// 起始格式化间隔
|
|
11
|
+
tabWidth: 2,
|
|
12
|
+
// 使用单引号
|
|
13
|
+
singleQuote: true,
|
|
14
|
+
// jsx 中使用单引号
|
|
15
|
+
jsxSingleQuote: true,
|
|
16
|
+
// 对象中的 key 是否需要引号。as-needed: 只有在必须时才要
|
|
17
|
+
quoteProps: "as-needed",
|
|
18
|
+
// 每行结尾是否需要分号
|
|
19
|
+
trailingComma: "all",
|
|
20
|
+
// 括号中参数前后补充空格
|
|
21
|
+
bracketSpacing: true,
|
|
22
|
+
// 箭头函数,参数是否添加括号
|
|
23
|
+
arrowParens: "avoid",
|
|
24
|
+
// jsx 元素最后末尾的 > ,换行放置
|
|
25
|
+
bracketSameLine: false,
|
|
26
|
+
// 设置换行符
|
|
27
|
+
endOfLine: "lf"
|
|
28
|
+
}, config);
|
|
29
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
defineRollupConfig: true
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "defineRollupConfig", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () {
|
|
12
|
+
return _devConfig.defineRollupConfig;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
var _devConfig = require("./rollup-config/dev-config.cjs");
|
|
16
|
+
var _rollupPlugins = require("./rollup-plugins/index.cjs");
|
|
17
|
+
Object.keys(_rollupPlugins).forEach(function (key) {
|
|
18
|
+
if (key === "default" || key === "__esModule") return;
|
|
19
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
20
|
+
if (key in exports && exports[key] === _rollupPlugins[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _rollupPlugins[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.defineRollupConfig = defineRollupConfig;
|
|
7
|
+
var _rollup = require("rollup");
|
|
8
|
+
var _lodashEs = require("lodash-es");
|
|
9
|
+
var _path = _interopRequireDefault(require("path"));
|
|
10
|
+
var _fastGlob = _interopRequireDefault(require("fast-glob"));
|
|
11
|
+
var _pluginNodeResolve = require("@rollup/plugin-node-resolve");
|
|
12
|
+
var _pluginCommonjs = _interopRequireDefault(require("@rollup/plugin-commonjs"));
|
|
13
|
+
var _pluginJson = _interopRequireDefault(require("@rollup/plugin-json"));
|
|
14
|
+
var _rollupPluginEsbuild = _interopRequireDefault(require("rollup-plugin-esbuild"));
|
|
15
|
+
var _vitePluginDts = _interopRequireDefault(require("vite-plugin-dts"));
|
|
16
|
+
var _pluginVue = _interopRequireDefault(require("@vitejs/plugin-vue"));
|
|
17
|
+
var _pluginVueJsx = _interopRequireDefault(require("@vitejs/plugin-vue-jsx"));
|
|
18
|
+
var rf = _interopRequireWildcard(require("rimraf"));
|
|
19
|
+
var _cpy = _interopRequireDefault(require("cpy"));
|
|
20
|
+
var _fsExtra = _interopRequireDefault(require("fs-extra"));
|
|
21
|
+
var _rollupPlugins = require("../rollup-plugins/index.cjs");
|
|
22
|
+
var _constants = require("../../constants/index.cjs");
|
|
23
|
+
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); }
|
|
24
|
+
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; }
|
|
25
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
26
|
+
function defineRollupConfig(opts = {}) {
|
|
27
|
+
process.on("SIGINT", () => {
|
|
28
|
+
process.exit();
|
|
29
|
+
});
|
|
30
|
+
const cwd = process.cwd();
|
|
31
|
+
const isProd = process.env.NODE_ENV === _constants.PROD_MODE;
|
|
32
|
+
const rootDir = _path.default.resolve(cwd, "src");
|
|
33
|
+
const outDir = _path.default.resolve(cwd, "es");
|
|
34
|
+
const assetsDir = _path.default.resolve(cwd, "public");
|
|
35
|
+
const externalCompileFileReg = /\.(vue|scss|css|less|d\.ts)+$/;
|
|
36
|
+
rf.sync(outDir);
|
|
37
|
+
const input = _fastGlob.default.sync("src/**/*.{ts,tsx}", {
|
|
38
|
+
cwd,
|
|
39
|
+
absolute: true,
|
|
40
|
+
onlyFiles: true,
|
|
41
|
+
ignore: ["**/*.test.ts", "**/*.test.tsx", "**/*.d.ts"]
|
|
42
|
+
});
|
|
43
|
+
if (isProd) {
|
|
44
|
+
if (_fsExtra.default.pathExistsSync(assetsDir)) {
|
|
45
|
+
(0, _cpy.default)(assetsDir, outDir);
|
|
46
|
+
}
|
|
47
|
+
(0, _cpy.default)(_path.default.resolve(cwd, "src/**/*.{vue,scss,css,less,d.ts}"), outDir);
|
|
48
|
+
} else {
|
|
49
|
+
(0, _rollupPlugins.copyFile)([{
|
|
50
|
+
from: assetsDir,
|
|
51
|
+
to: outDir
|
|
52
|
+
}, {
|
|
53
|
+
from: rootDir,
|
|
54
|
+
to: outDir,
|
|
55
|
+
opts: {
|
|
56
|
+
ignored: (file, stats) => {
|
|
57
|
+
if (stats && stats.isFile()) {
|
|
58
|
+
return !externalCompileFileReg.test(file);
|
|
59
|
+
}
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}]);
|
|
64
|
+
}
|
|
65
|
+
const output = [{
|
|
66
|
+
dir: outDir,
|
|
67
|
+
format: "es",
|
|
68
|
+
sourcemap: false,
|
|
69
|
+
preserveModules: true,
|
|
70
|
+
preserveModulesRoot: rootDir,
|
|
71
|
+
entryFileNames: "[name].mjs"
|
|
72
|
+
}];
|
|
73
|
+
return (0, _lodashEs.merge)((0, _rollup.defineConfig)({
|
|
74
|
+
input,
|
|
75
|
+
treeshake: false,
|
|
76
|
+
external: _constants.DEFAULT_EXTERNAL,
|
|
77
|
+
output,
|
|
78
|
+
plugins: [(0, _rollupPlugins.ignoreCompilerFile)(externalCompileFileReg), (0, _pluginJson.default)(), (0, _pluginVue.default)({
|
|
79
|
+
isProduction: false
|
|
80
|
+
}), (0, _pluginVueJsx.default)({}), (0, _pluginNodeResolve.nodeResolve)({
|
|
81
|
+
extensions: [".cjs", ".mjs", ".js", ".ts"]
|
|
82
|
+
}), (0, _pluginCommonjs.default)(), (0, _rollupPluginEsbuild.default)({
|
|
83
|
+
logLevel: "verbose",
|
|
84
|
+
sourceMap: false,
|
|
85
|
+
target: ["esnext"],
|
|
86
|
+
loaders: {
|
|
87
|
+
".vue": "ts"
|
|
88
|
+
}
|
|
89
|
+
}), (0, _vitePluginDts.default)({
|
|
90
|
+
outDir: [outDir]
|
|
91
|
+
})]
|
|
92
|
+
}), opts);
|
|
93
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.copyFile = copyFile;
|
|
7
|
+
var _util = require("../../util/index.cjs");
|
|
8
|
+
function copyFile(opts) {
|
|
9
|
+
if (opts.length === 0) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const arr = [];
|
|
13
|
+
opts.forEach(opt => {
|
|
14
|
+
arr.push(new _util.CopyWatch(opt.from, opt.to, opt.opts));
|
|
15
|
+
});
|
|
16
|
+
process.on("exit", () => {
|
|
17
|
+
if (!opts.length) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
arr.forEach(item => {
|
|
21
|
+
item.unwatch();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
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;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ignoreCompilerFile = ignoreCompilerFile;
|
|
7
|
+
function ignoreCompilerFile(extReg) {
|
|
8
|
+
return {
|
|
9
|
+
name: "gct:ignore-compiler-file",
|
|
10
|
+
resolveId(source) {
|
|
11
|
+
if (extReg.test(source)) {
|
|
12
|
+
return {
|
|
13
|
+
id: source,
|
|
14
|
+
external: true
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
18
|
+
},
|
|
19
|
+
load() {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "copyFile", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _copyFile.copyFile;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "ignoreCompilerFile", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _ignoreCompilerFile.ignoreCompilerFile;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
var _copyFile = require("./copy-file.cjs");
|
|
19
|
+
var _ignoreCompilerFile = require("./ignore-compiler-file.cjs");
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "defineStylelintConfig", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _stylelintConfig.defineStylelintConfig;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _stylelintConfig = require("./stylelint-config/stylelint-config.cjs");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { defineStylelintConfig } from './stylelint-config/stylelint-config';
|