nuxt-gin-tools 0.2.18 → 0.2.19
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/README.md +78 -0
- package/commands/pack.d.ts +5 -53
- package/commands/pack.js +118 -3
- package/package.json +3 -2
- package/src/pack.d.ts +55 -0
- package/src/pack.js +7 -0
package/README.md
CHANGED
|
@@ -43,6 +43,19 @@ nuxt-gin install
|
|
|
43
43
|
nuxt-gin dev
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
+
常用变体:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# 只跑前端
|
|
50
|
+
nuxt-gin dev --skip-go
|
|
51
|
+
|
|
52
|
+
# 只跑 Go 监听
|
|
53
|
+
nuxt-gin dev --skip-nuxt
|
|
54
|
+
|
|
55
|
+
# 跳过预清理/预安装
|
|
56
|
+
nuxt-gin dev --no-cleanup
|
|
57
|
+
```
|
|
58
|
+
|
|
46
59
|
## 命令说明
|
|
47
60
|
|
|
48
61
|
### `nuxt-gin dev`
|
|
@@ -53,6 +66,12 @@ nuxt-gin dev
|
|
|
53
66
|
|
|
54
67
|
Go 监听规则来自 `.go-watch.json`(见下文)。
|
|
55
68
|
|
|
69
|
+
可用参数:
|
|
70
|
+
|
|
71
|
+
- `--skip-go`:只启动 Nuxt
|
|
72
|
+
- `--skip-nuxt`:只启动 Go
|
|
73
|
+
- `--no-cleanup`:跳过 develop 前的 cleanup/install 检查
|
|
74
|
+
|
|
56
75
|
### `nuxt-gin install`
|
|
57
76
|
|
|
58
77
|
- 总是执行:`npx nuxt prepare`
|
|
@@ -68,6 +87,53 @@ Go 监听规则来自 `.go-watch.json`(见下文)。
|
|
|
68
87
|
|
|
69
88
|
执行工具链内置的构建与打包逻辑。
|
|
70
89
|
|
|
90
|
+
可用参数:
|
|
91
|
+
|
|
92
|
+
- `--skip-go`:跳过 Go 构建
|
|
93
|
+
- `--skip-nuxt`:跳过 Nuxt 静态构建
|
|
94
|
+
- `--binary-name <name>`:自定义 `.build/.server` 下的 Go 二进制名称
|
|
95
|
+
|
|
96
|
+
### `pack.config.ts` / `pack.config.json`
|
|
97
|
+
|
|
98
|
+
`nuxt-gin build` 会自动读取项目根目录中的打包配置,优先级如下:
|
|
99
|
+
|
|
100
|
+
1. `pack.config.ts`
|
|
101
|
+
2. `pack.config.js`
|
|
102
|
+
3. `pack.config.cjs`
|
|
103
|
+
4. `pack.config.mjs`
|
|
104
|
+
5. `pack.config.json`
|
|
105
|
+
|
|
106
|
+
如果同时存在多个配置文件,会输出 `warn`,并按上面的优先级选择第一个。
|
|
107
|
+
|
|
108
|
+
推荐使用 `pack.config.ts`:
|
|
109
|
+
|
|
110
|
+
```ts
|
|
111
|
+
import createPackConfig from 'nuxt-gin-tools/src/pack';
|
|
112
|
+
|
|
113
|
+
export default createPackConfig({
|
|
114
|
+
zipName: 'server.7z',
|
|
115
|
+
extraFilesGlobs: ['prisma/**'],
|
|
116
|
+
packageJson: {
|
|
117
|
+
private: true,
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
兼容旧的 `pack.config.json`:
|
|
123
|
+
|
|
124
|
+
```json
|
|
125
|
+
{
|
|
126
|
+
"zipName": "server.7z",
|
|
127
|
+
"extraFilesGlobs": ["prisma/**"]
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
配置校验规则:
|
|
132
|
+
|
|
133
|
+
- 明显的类型错误会直接 `error` 并终止打包
|
|
134
|
+
- 可继续执行但可能有歧义的情况会输出 `warn`
|
|
135
|
+
- 例如 `zipPath` 与 `zipName` 同时出现时,会提示 `zipPath` 优先生效
|
|
136
|
+
|
|
71
137
|
### `nuxt-gin cleanup`
|
|
72
138
|
|
|
73
139
|
清理由工具链生成的临时目录和产物。
|
|
@@ -76,6 +142,17 @@ Go 监听规则来自 `.go-watch.json`(见下文)。
|
|
|
76
142
|
|
|
77
143
|
执行项目约定的更新逻辑。
|
|
78
144
|
|
|
145
|
+
默认策略偏保守:
|
|
146
|
+
|
|
147
|
+
- Node:`pnpm update`
|
|
148
|
+
- Go:`go get -u=patch ./... && go mod tidy`
|
|
149
|
+
|
|
150
|
+
可用参数:
|
|
151
|
+
|
|
152
|
+
- `--latest`:切换为更激进的升级策略
|
|
153
|
+
- `--skip-go`:跳过 Go 依赖更新
|
|
154
|
+
- `--skip-node`:跳过 Node 依赖更新
|
|
155
|
+
|
|
79
156
|
## 配置
|
|
80
157
|
|
|
81
158
|
### 1) `server.config.json`
|
|
@@ -148,3 +225,4 @@ NUXT_GIN_WATCH_CONFIG=/path/to/.go-watch.json
|
|
|
148
225
|
|
|
149
226
|
- Go 侧热更新已不再依赖 Air。
|
|
150
227
|
- 当前方案为:`chokidar` 监听文件变化 + 重启 `go run main.go`。
|
|
228
|
+
- 打包时会按当前平台生成可执行文件名:Windows 默认 `.exe`,Linux/macOS 默认无扩展名。
|
package/commands/pack.d.ts
CHANGED
|
@@ -1,56 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export interface PackConfig extends BuildOptions {
|
|
3
|
-
/**
|
|
4
|
-
* 额外需要打包的文件映射
|
|
5
|
-
* key: 源文件路径(相对于项目根目录或绝对路径)
|
|
6
|
-
* value: 打包后对应位置(相对于服务器构建目录或绝对路径)
|
|
7
|
-
*/
|
|
8
|
-
extraFiles?: Record<string, string>;
|
|
9
|
-
/**
|
|
10
|
-
* 额外需要打包的文件 Glob(相对于项目根目录)
|
|
11
|
-
*/
|
|
12
|
-
extraFilesGlobs?: string[];
|
|
13
|
-
/**
|
|
14
|
-
* 排除文件/目录 Glob(相对于项目根目录)
|
|
15
|
-
*/
|
|
16
|
-
exclude?: string[];
|
|
17
|
-
/**
|
|
18
|
-
* 打包输出 zip 名称(相对于默认 zip 目录)
|
|
19
|
-
*/
|
|
20
|
-
zipName?: string;
|
|
21
|
-
/**
|
|
22
|
-
* 打包输出 zip 路径(相对于项目根目录或绝对路径)
|
|
23
|
-
*/
|
|
24
|
-
zipPath?: string;
|
|
25
|
-
/**
|
|
26
|
-
* 服务器构建输出目录(相对于项目根目录或绝对路径)
|
|
27
|
-
*/
|
|
28
|
-
serverPath?: string;
|
|
29
|
-
/**
|
|
30
|
-
* 打包前钩子
|
|
31
|
-
*/
|
|
32
|
-
beforePack?: () => Promise<void> | void;
|
|
33
|
-
/**
|
|
34
|
-
* 打包后钩子
|
|
35
|
-
*/
|
|
36
|
-
afterPack?: (zipPath: string) => Promise<void> | void;
|
|
37
|
-
/**
|
|
38
|
-
* 是否清理 dist
|
|
39
|
-
*/
|
|
40
|
-
cleanDist?: boolean;
|
|
41
|
-
/**
|
|
42
|
-
* 是否写入启动脚本和 package.json
|
|
43
|
-
*/
|
|
44
|
-
writeScripts?: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* 写入/覆盖 package.json 内容
|
|
47
|
-
*/
|
|
48
|
-
packageJson?: Record<string, unknown>;
|
|
49
|
-
/**
|
|
50
|
-
* 复制时是否覆盖同名文件
|
|
51
|
-
*/
|
|
52
|
-
overwrite?: boolean;
|
|
53
|
-
}
|
|
1
|
+
import type { PackConfig } from "../src/pack";
|
|
54
2
|
/**
|
|
55
3
|
* 生成相对于服务器构建目录的绝对路径
|
|
56
4
|
* @param relativePath - 相对路径
|
|
@@ -61,6 +9,10 @@ export declare const ZIP_PATH: string;
|
|
|
61
9
|
export declare const SERVER_PATH: string;
|
|
62
10
|
export declare const ORIGINAL_DIST_PATH: string;
|
|
63
11
|
export declare const PACK_CONFIG_PATH: string;
|
|
12
|
+
export declare const PACK_CONFIG_TS_PATH: string;
|
|
13
|
+
export declare const PACK_CONFIG_JS_PATH: string;
|
|
14
|
+
export declare const PACK_CONFIG_CJS_PATH: string;
|
|
15
|
+
export declare const PACK_CONFIG_MJS_PATH: string;
|
|
64
16
|
export declare const BUILD_EXECUTABLE: string;
|
|
65
17
|
export declare const SERVER_EXECUTABLE: string;
|
|
66
18
|
export declare const PACKAGE_JSON_CONTENT: {
|
package/commands/pack.js
CHANGED
|
@@ -45,7 +45,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
45
45
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
46
46
|
};
|
|
47
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
-
exports.FILES_TO_COPY = exports.PACKAGE_JSON_CONTENT = exports.SERVER_EXECUTABLE = exports.BUILD_EXECUTABLE = exports.PACK_CONFIG_PATH = exports.ORIGINAL_DIST_PATH = exports.SERVER_PATH = exports.ZIP_PATH = void 0;
|
|
48
|
+
exports.FILES_TO_COPY = exports.PACKAGE_JSON_CONTENT = exports.SERVER_EXECUTABLE = exports.BUILD_EXECUTABLE = exports.PACK_CONFIG_MJS_PATH = exports.PACK_CONFIG_CJS_PATH = exports.PACK_CONFIG_JS_PATH = exports.PACK_CONFIG_TS_PATH = exports.PACK_CONFIG_PATH = exports.ORIGINAL_DIST_PATH = exports.SERVER_PATH = exports.ZIP_PATH = void 0;
|
|
49
49
|
exports.builtPath = builtPath;
|
|
50
50
|
exports.buildAndPack = buildAndPack;
|
|
51
51
|
// 导入项目构建工具,用于执行 Nuxt 项目的构建流程
|
|
@@ -58,6 +58,7 @@ const FS = __importStar(require("fs-extra"));
|
|
|
58
58
|
const Path = __importStar(require("path"));
|
|
59
59
|
const os = __importStar(require("os"));
|
|
60
60
|
const fast_glob_1 = __importDefault(require("fast-glob"));
|
|
61
|
+
const { createJiti } = require("jiti");
|
|
61
62
|
/**
|
|
62
63
|
* 生成相对于服务器构建目录的绝对路径
|
|
63
64
|
* @param relativePath - 相对路径
|
|
@@ -73,6 +74,10 @@ exports.SERVER_PATH = Path.resolve(process.cwd(), ".build/production/server");
|
|
|
73
74
|
// 定义原始 dist 目录路径,用于清理操作
|
|
74
75
|
exports.ORIGINAL_DIST_PATH = Path.resolve(process.cwd(), "dist");
|
|
75
76
|
exports.PACK_CONFIG_PATH = Path.resolve(process.cwd(), "pack.config.json");
|
|
77
|
+
exports.PACK_CONFIG_TS_PATH = Path.resolve(process.cwd(), "pack.config.ts");
|
|
78
|
+
exports.PACK_CONFIG_JS_PATH = Path.resolve(process.cwd(), "pack.config.js");
|
|
79
|
+
exports.PACK_CONFIG_CJS_PATH = Path.resolve(process.cwd(), "pack.config.cjs");
|
|
80
|
+
exports.PACK_CONFIG_MJS_PATH = Path.resolve(process.cwd(), "pack.config.mjs");
|
|
76
81
|
exports.BUILD_EXECUTABLE = os.platform() === "win32" ? "production.exe" : "production";
|
|
77
82
|
exports.SERVER_EXECUTABLE = os.platform() === "win32" ? "server-production.exe" : "server-production"; // 根据操作系统选择可执行文件名
|
|
78
83
|
// 定义打包后项目的 package.json 内容
|
|
@@ -90,6 +95,94 @@ const DEFAULT_FILES_TO_COPY = {
|
|
|
90
95
|
};
|
|
91
96
|
// 兼容旧导出:默认构建目录下的绝对目标路径
|
|
92
97
|
exports.FILES_TO_COPY = Object.fromEntries(Object.entries(DEFAULT_FILES_TO_COPY).map(([src, dest]) => [src, builtPath(dest)]));
|
|
98
|
+
function warnPackConfig(message) {
|
|
99
|
+
console.warn(`[nuxt-gin-tools][pack] WARN: ${message}`);
|
|
100
|
+
}
|
|
101
|
+
function errorPackConfig(message) {
|
|
102
|
+
throw new Error(`[nuxt-gin-tools][pack] ${message}`);
|
|
103
|
+
}
|
|
104
|
+
function isPlainObject(value) {
|
|
105
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
106
|
+
}
|
|
107
|
+
function validateStringArray(fieldName, value, issues) {
|
|
108
|
+
if (value === undefined) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
if (!Array.isArray(value)) {
|
|
112
|
+
issues.push({ level: "error", message: `${fieldName} must be an array of strings` });
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
for (const item of value) {
|
|
116
|
+
if (typeof item !== "string") {
|
|
117
|
+
issues.push({ level: "error", message: `${fieldName} must contain only strings` });
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
function validateStringRecord(fieldName, value, issues) {
|
|
123
|
+
if (value === undefined) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
if (!isPlainObject(value)) {
|
|
127
|
+
issues.push({ level: "error", message: `${fieldName} must be an object of string to string` });
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
for (const [key, item] of Object.entries(value)) {
|
|
131
|
+
if (typeof key !== "string" || typeof item !== "string") {
|
|
132
|
+
issues.push({ level: "error", message: `${fieldName} must be an object of string to string` });
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
function validatePackConfig(config, sourcePath) {
|
|
138
|
+
if (!isPlainObject(config)) {
|
|
139
|
+
errorPackConfig(`${Path.basename(sourcePath)} must export an object`);
|
|
140
|
+
}
|
|
141
|
+
const issues = [];
|
|
142
|
+
const typedConfig = config;
|
|
143
|
+
const stringFields = ["binaryName", "zipName", "zipPath", "serverPath"];
|
|
144
|
+
for (const field of stringFields) {
|
|
145
|
+
const value = typedConfig[field];
|
|
146
|
+
if (value !== undefined && typeof value !== "string") {
|
|
147
|
+
issues.push({ level: "error", message: `${field} must be a string` });
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
const booleanFields = ["skipGo", "skipNuxt", "cleanDist", "writeScripts", "overwrite"];
|
|
151
|
+
for (const field of booleanFields) {
|
|
152
|
+
const value = typedConfig[field];
|
|
153
|
+
if (value !== undefined && typeof value !== "boolean") {
|
|
154
|
+
issues.push({ level: "error", message: `${field} must be a boolean` });
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
validateStringArray("extraFilesGlobs", typedConfig.extraFilesGlobs, issues);
|
|
158
|
+
validateStringArray("exclude", typedConfig.exclude, issues);
|
|
159
|
+
validateStringRecord("extraFiles", typedConfig.extraFiles, issues);
|
|
160
|
+
if (typedConfig.packageJson !== undefined && !isPlainObject(typedConfig.packageJson)) {
|
|
161
|
+
issues.push({ level: "error", message: `packageJson must be an object` });
|
|
162
|
+
}
|
|
163
|
+
if (typedConfig.beforePack !== undefined && typeof typedConfig.beforePack !== "function") {
|
|
164
|
+
issues.push({ level: "error", message: `beforePack must be a function` });
|
|
165
|
+
}
|
|
166
|
+
if (typedConfig.afterPack !== undefined && typeof typedConfig.afterPack !== "function") {
|
|
167
|
+
issues.push({ level: "error", message: `afterPack must be a function` });
|
|
168
|
+
}
|
|
169
|
+
if (typedConfig.zipName !== undefined && typedConfig.zipPath !== undefined) {
|
|
170
|
+
issues.push({ level: "warn", message: `zipPath and zipName are both set; zipPath takes precedence` });
|
|
171
|
+
}
|
|
172
|
+
if (typedConfig.skipGo === true && typedConfig.skipNuxt === true) {
|
|
173
|
+
issues.push({ level: "warn", message: `skipGo and skipNuxt are both true; build step will be skipped` });
|
|
174
|
+
}
|
|
175
|
+
for (const issue of issues) {
|
|
176
|
+
if (issue.level === "warn") {
|
|
177
|
+
warnPackConfig(`${Path.basename(sourcePath)}: ${issue.message}`);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
const errors = issues.filter((issue) => issue.level === "error");
|
|
181
|
+
if (errors.length > 0) {
|
|
182
|
+
errorPackConfig(`${Path.basename(sourcePath)} is invalid:\n- ${errors.map((item) => item.message).join("\n- ")}`);
|
|
183
|
+
}
|
|
184
|
+
return config;
|
|
185
|
+
}
|
|
93
186
|
/**
|
|
94
187
|
* 写入启动脚本和 package.json 文件到构建目录
|
|
95
188
|
*/
|
|
@@ -148,10 +241,32 @@ function mergePackageJson(base, override) {
|
|
|
148
241
|
return Object.assign(Object.assign(Object.assign({}, base), override), { scripts: Object.assign(Object.assign({}, baseScripts), overrideScripts) });
|
|
149
242
|
}
|
|
150
243
|
function readPackConfigFromCwd() {
|
|
151
|
-
|
|
244
|
+
const candidates = [
|
|
245
|
+
exports.PACK_CONFIG_TS_PATH,
|
|
246
|
+
exports.PACK_CONFIG_JS_PATH,
|
|
247
|
+
exports.PACK_CONFIG_CJS_PATH,
|
|
248
|
+
exports.PACK_CONFIG_MJS_PATH,
|
|
249
|
+
exports.PACK_CONFIG_PATH,
|
|
250
|
+
].filter((configPath) => FS.existsSync(configPath));
|
|
251
|
+
if (candidates.length === 0) {
|
|
152
252
|
return undefined;
|
|
153
253
|
}
|
|
154
|
-
|
|
254
|
+
if (candidates.length > 1) {
|
|
255
|
+
warnPackConfig(`multiple pack config files found (${candidates.map((item) => Path.basename(item)).join(", ")}); using ${Path.basename(candidates[0])}`);
|
|
256
|
+
}
|
|
257
|
+
const selectedPath = candidates[0];
|
|
258
|
+
let loadedConfig;
|
|
259
|
+
if (selectedPath.endsWith(".json")) {
|
|
260
|
+
loadedConfig = FS.readJSONSync(selectedPath);
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
const jiti = createJiti(__filename, { moduleCache: false, interopDefault: true });
|
|
264
|
+
loadedConfig = jiti(selectedPath);
|
|
265
|
+
}
|
|
266
|
+
const normalizedConfig = isPlainObject(loadedConfig) && "default" in loadedConfig
|
|
267
|
+
? loadedConfig.default
|
|
268
|
+
: loadedConfig;
|
|
269
|
+
return validatePackConfig(normalizedConfig, selectedPath);
|
|
155
270
|
}
|
|
156
271
|
function resolveServerPath(config) {
|
|
157
272
|
if (!(config === null || config === void 0 ? void 0 : config.serverPath)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-gin-tools",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.19",
|
|
4
4
|
"description": "This project is used as a dependency for [nuxt-gin-starter](https://github.com/RapboyGao/nuxt-gin-starter.git)",
|
|
5
5
|
"bin": {
|
|
6
6
|
"nuxt-gin": "index.js"
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"chokidar": "^3.6.0",
|
|
19
19
|
"concurrently": "^9.2.0",
|
|
20
20
|
"fast-glob": "^3.3.3",
|
|
21
|
-
"fs-extra": "^11.3.0"
|
|
21
|
+
"fs-extra": "^11.3.0",
|
|
22
|
+
"jiti": "^2.6.1"
|
|
22
23
|
},
|
|
23
24
|
"devDependencies": {
|
|
24
25
|
"@types/fs-extra": "^11.0.4",
|
package/src/pack.d.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { BuildOptions } from "../commands/builder";
|
|
2
|
+
export interface PackConfig extends BuildOptions {
|
|
3
|
+
/**
|
|
4
|
+
* 额外需要打包的文件映射
|
|
5
|
+
* key: 源文件路径(相对于项目根目录或绝对路径)
|
|
6
|
+
* value: 打包后对应位置(相对于服务器构建目录或绝对路径)
|
|
7
|
+
*/
|
|
8
|
+
extraFiles?: Record<string, string>;
|
|
9
|
+
/**
|
|
10
|
+
* 额外需要打包的文件 Glob(相对于项目根目录)
|
|
11
|
+
*/
|
|
12
|
+
extraFilesGlobs?: string[];
|
|
13
|
+
/**
|
|
14
|
+
* 排除文件/目录 Glob(相对于项目根目录)
|
|
15
|
+
*/
|
|
16
|
+
exclude?: string[];
|
|
17
|
+
/**
|
|
18
|
+
* 打包输出 zip 名称(相对于默认 zip 目录)
|
|
19
|
+
*/
|
|
20
|
+
zipName?: string;
|
|
21
|
+
/**
|
|
22
|
+
* 打包输出 zip 路径(相对于项目根目录或绝对路径)
|
|
23
|
+
*/
|
|
24
|
+
zipPath?: string;
|
|
25
|
+
/**
|
|
26
|
+
* 服务器构建输出目录(相对于项目根目录或绝对路径)
|
|
27
|
+
*/
|
|
28
|
+
serverPath?: string;
|
|
29
|
+
/**
|
|
30
|
+
* 打包前钩子
|
|
31
|
+
*/
|
|
32
|
+
beforePack?: () => Promise<void> | void;
|
|
33
|
+
/**
|
|
34
|
+
* 打包后钩子
|
|
35
|
+
*/
|
|
36
|
+
afterPack?: (zipPath: string) => Promise<void> | void;
|
|
37
|
+
/**
|
|
38
|
+
* 是否清理 dist
|
|
39
|
+
*/
|
|
40
|
+
cleanDist?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* 是否写入启动脚本和 package.json
|
|
43
|
+
*/
|
|
44
|
+
writeScripts?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* 写入/覆盖 package.json 内容
|
|
47
|
+
*/
|
|
48
|
+
packageJson?: Record<string, unknown>;
|
|
49
|
+
/**
|
|
50
|
+
* 复制时是否覆盖同名文件
|
|
51
|
+
*/
|
|
52
|
+
overwrite?: boolean;
|
|
53
|
+
}
|
|
54
|
+
export declare function createPackConfig(config: PackConfig): PackConfig;
|
|
55
|
+
export default createPackConfig;
|