@gct-paas/build 0.1.4-dev.2 → 0.1.4-dev.3
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/dist/prettier/prettier-config/prettier-config.cjs +2 -2
- package/dist/rollup/rollup-config/dev-config.cjs +1 -2
- package/dist/util/index.cjs +10 -0
- package/dist/util/index.d.ts +12 -0
- package/dist/vite/vite-config/vite-base-config.cjs +2 -1
- package/es/prettier/prettier-config/prettier-config.mjs +2 -2
- package/es/rollup/rollup-config/dev-config.mjs +2 -3
- package/es/util/index.d.ts +12 -0
- package/es/util/index.mjs +9 -0
- package/es/vite/vite-config/vite-base-config.mjs +2 -1
- package/package.json +13 -13
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.definePrettierConfig = definePrettierConfig;
|
|
7
|
-
var
|
|
7
|
+
var _util = require("../../util/index.cjs");
|
|
8
8
|
function definePrettierConfig(config = {}) {
|
|
9
|
-
return (0,
|
|
9
|
+
return (0, _util.mergeConfig)({
|
|
10
10
|
// 起始格式化间隔
|
|
11
11
|
tabWidth: 2,
|
|
12
12
|
// 使用单引号
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.defineRollupConfig = defineRollupConfig;
|
|
7
7
|
var _rollup = require("rollup");
|
|
8
|
-
var _lodashEs = require("lodash-es");
|
|
9
8
|
var _path = _interopRequireDefault(require("path"));
|
|
10
9
|
var _fastGlob = _interopRequireDefault(require("fast-glob"));
|
|
11
10
|
var _pluginNodeResolve = require("@rollup/plugin-node-resolve");
|
|
@@ -80,7 +79,7 @@ function defineRollupConfig(opts = {}) {
|
|
|
80
79
|
preserveModulesRoot: rootDir,
|
|
81
80
|
entryFileNames: "[name].mjs"
|
|
82
81
|
}];
|
|
83
|
-
return (0,
|
|
82
|
+
return (0, _util.mergeConfig)((0, _rollup.defineConfig)({
|
|
84
83
|
input,
|
|
85
84
|
treeshake: false,
|
|
86
85
|
external: _constants.DEFAULT_EXTERNAL,
|
package/dist/util/index.cjs
CHANGED
|
@@ -9,12 +9,22 @@ Object.defineProperty(exports, "CopyWatch", {
|
|
|
9
9
|
return _watcher.CopyWatch;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
+
exports.mergeConfig = mergeConfig;
|
|
12
13
|
exports.unixToWinPath = unixToWinPath;
|
|
13
14
|
exports.winToUnixPath = winToUnixPath;
|
|
15
|
+
var _lodashEs = require("lodash-es");
|
|
14
16
|
var _watcher = require("./watcher/watcher.cjs");
|
|
15
17
|
function winToUnixPath(pathStr) {
|
|
16
18
|
return pathStr.replace(/\\/g, "/");
|
|
17
19
|
}
|
|
18
20
|
function unixToWinPath(pathStr) {
|
|
19
21
|
return pathStr.replace(/\//g, "\\");
|
|
22
|
+
}
|
|
23
|
+
function mergeConfig(obj, obj2) {
|
|
24
|
+
return (0, _lodashEs.mergeWith)(obj, obj2, (objValue, srcValue) => {
|
|
25
|
+
if (Array.isArray(objValue)) {
|
|
26
|
+
return objValue.concat(srcValue);
|
|
27
|
+
}
|
|
28
|
+
return void 0;
|
|
29
|
+
});
|
|
20
30
|
}
|
package/dist/util/index.d.ts
CHANGED
|
@@ -15,3 +15,15 @@ export declare function winToUnixPath(pathStr: string): string;
|
|
|
15
15
|
* @return {*} {string}
|
|
16
16
|
*/
|
|
17
17
|
export declare function unixToWinPath(pathStr: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* 自定义合并配置,数据非替换为 concat 合并
|
|
20
|
+
*
|
|
21
|
+
* @author chitanda
|
|
22
|
+
* @date 2025-08-20 20:08:45
|
|
23
|
+
* @export
|
|
24
|
+
* @template T
|
|
25
|
+
* @param {T} obj
|
|
26
|
+
* @param {U} obj2
|
|
27
|
+
* @returns {*} {T}
|
|
28
|
+
*/
|
|
29
|
+
export declare function mergeConfig<T extends object, U extends object>(obj: T, obj2: U): T & U;
|
|
@@ -11,11 +11,12 @@ var _pluginBabel = require("@rollup/plugin-babel");
|
|
|
11
11
|
var _pluginJson = _interopRequireDefault(require("@rollup/plugin-json"));
|
|
12
12
|
var _path = _interopRequireDefault(require("path"));
|
|
13
13
|
var _constants = require("../../constants/index.cjs");
|
|
14
|
+
var _util = require("../../util/index.cjs");
|
|
14
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
16
|
function defineViteBaseConfig(opts = {}) {
|
|
16
17
|
const cwd = process.cwd();
|
|
17
18
|
const outDir = _path.default.resolve(cwd, "dist");
|
|
18
|
-
return (0,
|
|
19
|
+
return (0, _util.mergeConfig)((0, _vite.defineConfig)({
|
|
19
20
|
css: {
|
|
20
21
|
preprocessorOptions: {
|
|
21
22
|
scss: {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { defineConfig } from "rollup";
|
|
2
|
-
import { merge } from "lodash-es";
|
|
3
2
|
import path from "path";
|
|
4
3
|
import glob from "fast-glob";
|
|
5
4
|
import { nodeResolve } from "@rollup/plugin-node-resolve";
|
|
@@ -15,7 +14,7 @@ import fs from "fs-extra";
|
|
|
15
14
|
import os from "os";
|
|
16
15
|
import { copyFile, ignoreCompilerFile } from "../rollup-plugins/index.mjs";
|
|
17
16
|
import { DEFAULT_EXTERNAL, PROD_MODE } from "../../constants/index.mjs";
|
|
18
|
-
import { winToUnixPath } from "../../util/index.mjs";
|
|
17
|
+
import { mergeConfig, winToUnixPath } from "../../util/index.mjs";
|
|
19
18
|
export function defineRollupConfig(opts = {}) {
|
|
20
19
|
process.on("SIGINT", () => {
|
|
21
20
|
process.exit();
|
|
@@ -79,7 +78,7 @@ export function defineRollupConfig(opts = {}) {
|
|
|
79
78
|
entryFileNames: "[name].mjs"
|
|
80
79
|
}
|
|
81
80
|
];
|
|
82
|
-
return
|
|
81
|
+
return mergeConfig(
|
|
83
82
|
defineConfig({
|
|
84
83
|
input,
|
|
85
84
|
treeshake: false,
|
package/es/util/index.d.ts
CHANGED
|
@@ -15,3 +15,15 @@ export declare function winToUnixPath(pathStr: string): string;
|
|
|
15
15
|
* @return {*} {string}
|
|
16
16
|
*/
|
|
17
17
|
export declare function unixToWinPath(pathStr: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* 自定义合并配置,数据非替换为 concat 合并
|
|
20
|
+
*
|
|
21
|
+
* @author chitanda
|
|
22
|
+
* @date 2025-08-20 20:08:45
|
|
23
|
+
* @export
|
|
24
|
+
* @template T
|
|
25
|
+
* @param {T} obj
|
|
26
|
+
* @param {U} obj2
|
|
27
|
+
* @returns {*} {T}
|
|
28
|
+
*/
|
|
29
|
+
export declare function mergeConfig<T extends object, U extends object>(obj: T, obj2: U): T & U;
|
package/es/util/index.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { mergeWith } from "lodash-es";
|
|
1
2
|
export { CopyWatch } from "./watcher/watcher.mjs";
|
|
2
3
|
export function winToUnixPath(pathStr) {
|
|
3
4
|
return pathStr.replace(/\\/g, "/");
|
|
@@ -5,3 +6,11 @@ export function winToUnixPath(pathStr) {
|
|
|
5
6
|
export function unixToWinPath(pathStr) {
|
|
6
7
|
return pathStr.replace(/\//g, "\\");
|
|
7
8
|
}
|
|
9
|
+
export function mergeConfig(obj, obj2) {
|
|
10
|
+
return mergeWith(obj, obj2, (objValue, srcValue) => {
|
|
11
|
+
if (Array.isArray(objValue)) {
|
|
12
|
+
return objValue.concat(srcValue);
|
|
13
|
+
}
|
|
14
|
+
return void 0;
|
|
15
|
+
});
|
|
16
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { defineConfig
|
|
1
|
+
import { defineConfig } from "vite";
|
|
2
2
|
import vue from "@vitejs/plugin-vue";
|
|
3
3
|
import vueJsx from "@vitejs/plugin-vue-jsx";
|
|
4
4
|
import { babel } from "@rollup/plugin-babel";
|
|
5
5
|
import json from "@rollup/plugin-json";
|
|
6
6
|
import path from "path";
|
|
7
7
|
import { DEFAULT_EXTERNAL } from "../../constants/index.mjs";
|
|
8
|
+
import { mergeConfig } from "../../util/index.mjs";
|
|
8
9
|
export function defineViteBaseConfig(opts = {}) {
|
|
9
10
|
const cwd = process.cwd();
|
|
10
11
|
const outDir = path.resolve(cwd, "dist");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gct-paas/build",
|
|
3
|
-
"version": "0.1.4-dev.
|
|
3
|
+
"version": "0.1.4-dev.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "paas 平台核心包",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -39,13 +39,13 @@
|
|
|
39
39
|
"publish:npm": "npm run build && npm publish --access public --registry=https://registry.npmjs.org/"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@babel/core": "^7.28.
|
|
43
|
-
"@babel/preset-env": "^7.28.
|
|
42
|
+
"@babel/core": "^7.28.3",
|
|
43
|
+
"@babel/preset-env": "^7.28.3",
|
|
44
44
|
"@commitlint/cli": "^19.8.1",
|
|
45
45
|
"@commitlint/config-conventional": "^19.8.1",
|
|
46
46
|
"@eslint/js": "^9.33.0",
|
|
47
|
-
"@gct-paas/scss": "^0.1.4-dev.
|
|
48
|
-
"@inquirer/prompts": "^7.8.
|
|
47
|
+
"@gct-paas/scss": "^0.1.4-dev.3",
|
|
48
|
+
"@inquirer/prompts": "^7.8.3",
|
|
49
49
|
"@rollup/plugin-babel": "^6.0.4",
|
|
50
50
|
"@rollup/plugin-commonjs": "^28.0.6",
|
|
51
51
|
"@rollup/plugin-eslint": "^9.0.5",
|
|
@@ -60,14 +60,14 @@
|
|
|
60
60
|
"consola": "^3.4.2",
|
|
61
61
|
"copy-file": "^11.1.0",
|
|
62
62
|
"core-js": "^3.45.0",
|
|
63
|
-
"cpy": "^12.0.
|
|
63
|
+
"cpy": "^12.0.1",
|
|
64
64
|
"crypto": "^1.0.1",
|
|
65
65
|
"esbuild": "^0.25.9",
|
|
66
66
|
"eslint": "^9.33.0",
|
|
67
67
|
"eslint-config-prettier": "^10.1.8",
|
|
68
68
|
"eslint-plugin-import": "^2.32.0",
|
|
69
69
|
"eslint-plugin-prettier": "^5.5.4",
|
|
70
|
-
"eslint-plugin-unused-imports": "^4.
|
|
70
|
+
"eslint-plugin-unused-imports": "^4.2.0",
|
|
71
71
|
"eslint-plugin-vue": "^10.4.0",
|
|
72
72
|
"fast-glob": "^3.3.3",
|
|
73
73
|
"fs-extra": "^11.3.1",
|
|
@@ -77,12 +77,12 @@
|
|
|
77
77
|
"picocolors": "^1.1.1",
|
|
78
78
|
"prettier": "^3.6.2",
|
|
79
79
|
"rimraf": "^6.0.1",
|
|
80
|
-
"rollup": "^4.46.
|
|
80
|
+
"rollup": "^4.46.4",
|
|
81
81
|
"rollup-plugin-esbuild": "^6.2.1",
|
|
82
82
|
"stylelint": "^16.23.1",
|
|
83
83
|
"stylelint-config-standard-scss": "^15.0.1",
|
|
84
|
-
"typescript-eslint": "^8.
|
|
85
|
-
"vite": "^7.1.
|
|
84
|
+
"typescript-eslint": "^8.40.0",
|
|
85
|
+
"vite": "^7.1.3",
|
|
86
86
|
"vite-plugin-dts": "^4.5.4",
|
|
87
87
|
"vue-eslint-parser": "^10.2.0",
|
|
88
88
|
"vue-tsc": "^3.0.5"
|
|
@@ -93,10 +93,10 @@
|
|
|
93
93
|
"@types/babel__preset-env": "^7.10.0",
|
|
94
94
|
"@types/fs-extra": "^11.0.4",
|
|
95
95
|
"@types/lodash-es": "^4.17.12",
|
|
96
|
-
"@types/node": "^24.
|
|
96
|
+
"@types/node": "^24.3.0",
|
|
97
97
|
"tsx": "^4.20.4",
|
|
98
98
|
"typescript": "^5.9.2",
|
|
99
|
-
"unbuild": "^3.6.
|
|
99
|
+
"unbuild": "^3.6.1"
|
|
100
100
|
},
|
|
101
|
-
"gitHead": "
|
|
101
|
+
"gitHead": "caa65b07a6bbfb27d41911da2f5459567db38b1d"
|
|
102
102
|
}
|