@icebreakers/monorepo 2.0.6 → 2.0.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/assets/.github/workflows/ci.yml +1 -1
- package/assets/.github/workflows/release.yml +1 -1
- package/assets/package.json +4 -4
- package/dist/{chunk-PYHLZLUK.js → chunk-4R64J5LE.js} +52 -26
- package/dist/cli.cjs +51 -26
- package/dist/cli.js +1 -1
- package/dist/index.cjs +53 -26
- package/dist/index.d.cts +9 -2
- package/dist/index.d.ts +9 -2
- package/dist/index.js +3 -1
- package/package.json +8 -8
- package/templates/apps/client/package.json +6 -6
- package/templates/apps/client/worker/node-entry.ts +1 -0
- package/templates/apps/server/package.json +2 -2
- package/templates/apps/server/src/node-entry.ts +1 -0
- package/templates/apps/website/why/examples/0.npm-basic-package/index.js +1 -0
- package/templates/apps/website/why/examples/1.npm-basic-package/index.cjs +1 -0
- package/templates/apps/website/why/examples/1.npm-basic-package/index.js +1 -0
- package/templates/apps/website/why/examples/2.npm-basic-package/src/index.ts +1 -0
- package/templates/apps/website/why/examples/3.npm-basic-package/src/index.ts +1 -0
- package/templates/apps/website/why/examples/usage-cjs/cjs.cjs +1 -0
- package/templates/apps/website/why/examples/usage-cjs/esm.mjs +1 -0
- package/templates/apps/website/why/examples/usage-cjs/index.js +1 -0
- package/templates/apps/website/why/examples/usage-esm/cjs.cjs +1 -0
- package/templates/apps/website/why/examples/usage-esm/esm.mjs +1 -0
- package/templates/apps/website/why/examples/usage-esm/index.js +1 -0
- package/templates/packages/tsup-template/test/index.test.ts +12 -1
- package/templates/packages/unbuild-template/test/index.test.ts +12 -1
- package/templates/packages/vue-lib-template/package.json +2 -2
package/assets/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"type": "module",
|
|
4
4
|
"version": "0.0.0",
|
|
5
5
|
"private": true,
|
|
6
|
-
"packageManager": "pnpm@10.18.
|
|
6
|
+
"packageManager": "pnpm@10.18.3",
|
|
7
7
|
"author": "ice breaker <1324318532@qq.com>",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@icebreakers/monorepo": "workspace:*",
|
|
49
49
|
"@icebreakers/stylelint-config": "^1.2.1",
|
|
50
50
|
"@types/fs-extra": "^11.0.4",
|
|
51
|
-
"@types/node": "^24.7.
|
|
51
|
+
"@types/node": "^24.7.2",
|
|
52
52
|
"@vitest/coverage-v8": "~3.2.4",
|
|
53
53
|
"ci-info": "^4.3.1",
|
|
54
54
|
"cross-env": "^10.1.0",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"execa": "^9.6.0",
|
|
59
59
|
"fs-extra": "^11.3.2",
|
|
60
60
|
"husky": "^9.1.7",
|
|
61
|
-
"lint-staged": "^16.2.
|
|
61
|
+
"lint-staged": "^16.2.4",
|
|
62
62
|
"only-allow": "^1.2.1",
|
|
63
63
|
"pathe": "^2.0.3",
|
|
64
64
|
"pkg-types": "^2.3.0",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"tsup": "^8.5.0",
|
|
69
69
|
"tsx": "^4.20.6",
|
|
70
70
|
"turbo": "^2.5.8",
|
|
71
|
-
"type-fest": "^5.0
|
|
71
|
+
"type-fest": "^5.1.0",
|
|
72
72
|
"typescript": "^5.9.3",
|
|
73
73
|
"unbuild": "^3.6.1",
|
|
74
74
|
"vitest": "~3.2.4",
|
|
@@ -27,11 +27,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
mod
|
|
28
28
|
));
|
|
29
29
|
|
|
30
|
-
// ../../node_modules/.pnpm/tsup@8.5.0_@microsoft+api-extractor@7.52.12_@types+node@24.7.
|
|
30
|
+
// ../../node_modules/.pnpm/tsup@8.5.0_@microsoft+api-extractor@7.52.12_@types+node@24.7.2__jiti@2.6.1_postcss@8.5._3d4ae7d8e5b6f496c0110ecf5a7e8328/node_modules/tsup/assets/esm_shims.js
|
|
31
31
|
import path from "path";
|
|
32
32
|
import { fileURLToPath } from "url";
|
|
33
33
|
var init_esm_shims = __esm({
|
|
34
|
-
"../../node_modules/.pnpm/tsup@8.5.0_@microsoft+api-extractor@7.52.12_@types+node@24.7.
|
|
34
|
+
"../../node_modules/.pnpm/tsup@8.5.0_@microsoft+api-extractor@7.52.12_@types+node@24.7.2__jiti@2.6.1_postcss@8.5._3d4ae7d8e5b6f496c0110ecf5a7e8328/node_modules/tsup/assets/esm_shims.js"() {
|
|
35
35
|
"use strict";
|
|
36
36
|
}
|
|
37
37
|
});
|
|
@@ -578,7 +578,7 @@ async function cleanProjects(cwd) {
|
|
|
578
578
|
|
|
579
579
|
// package.json
|
|
580
580
|
var name = "@icebreakers/monorepo";
|
|
581
|
-
var version = "2.0.
|
|
581
|
+
var version = "2.0.8";
|
|
582
582
|
|
|
583
583
|
// src/constants.ts
|
|
584
584
|
init_esm_shims();
|
|
@@ -960,6 +960,16 @@ ${Array.from(set7).map((x) => `- ${pc2.green(x ?? "")}`).join("\n")}
|
|
|
960
960
|
await Promise.all(tasks);
|
|
961
961
|
}
|
|
962
962
|
|
|
963
|
+
// src/utils/fs.ts
|
|
964
|
+
init_esm_shims();
|
|
965
|
+
function isIgnorableFsError(error) {
|
|
966
|
+
if (!error) {
|
|
967
|
+
return false;
|
|
968
|
+
}
|
|
969
|
+
const code = error.code;
|
|
970
|
+
return code === "ENOENT" || code === "EBUSY" || code === "EEXIST";
|
|
971
|
+
}
|
|
972
|
+
|
|
963
973
|
// src/utils/hash.ts
|
|
964
974
|
init_esm_shims();
|
|
965
975
|
import crypto from "crypto";
|
|
@@ -1181,35 +1191,50 @@ async function upgradeMonorepo(opts) {
|
|
|
1181
1191
|
continue;
|
|
1182
1192
|
}
|
|
1183
1193
|
const targetPath = path13.resolve(absOutDir, relPath);
|
|
1184
|
-
|
|
1185
|
-
if (
|
|
1194
|
+
try {
|
|
1195
|
+
if (relPath === "package.json") {
|
|
1196
|
+
if (!await fs7.pathExists(targetPath)) {
|
|
1197
|
+
continue;
|
|
1198
|
+
}
|
|
1199
|
+
const sourcePkgJson = await fs7.readJson(file.path);
|
|
1200
|
+
const targetPkgJson = await fs7.readJson(targetPath);
|
|
1201
|
+
setPkgJson(sourcePkgJson, targetPkgJson, { scripts: scriptOverrides });
|
|
1202
|
+
const data = `${JSON.stringify(targetPkgJson, void 0, 2)}
|
|
1203
|
+
`;
|
|
1204
|
+
if (await shouldWriteFile(targetPath, { skipOverwrite, source: data, promptLabel: relPath })) {
|
|
1205
|
+
await fs7.outputFile(targetPath, data, "utf8");
|
|
1206
|
+
logger.success(targetPath);
|
|
1207
|
+
}
|
|
1186
1208
|
continue;
|
|
1187
1209
|
}
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1210
|
+
if (relPath === ".changeset/config.json" && repoName) {
|
|
1211
|
+
const changesetJson = await fs7.readJson(file.path);
|
|
1212
|
+
(0, import_set_value6.default)(changesetJson, "changelog.1.repo", repoName);
|
|
1213
|
+
const data = `${JSON.stringify(changesetJson, void 0, 2)}
|
|
1192
1214
|
`;
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1215
|
+
if (await shouldWriteFile(targetPath, { skipOverwrite, source: data, promptLabel: relPath })) {
|
|
1216
|
+
await fs7.outputFile(targetPath, data, "utf8");
|
|
1217
|
+
logger.success(targetPath);
|
|
1218
|
+
}
|
|
1219
|
+
continue;
|
|
1196
1220
|
}
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1221
|
+
if (relPath === "LICENSE") {
|
|
1222
|
+
const source = await fs7.readFile(file.path);
|
|
1223
|
+
if (await shouldWriteFile(targetPath, { skipOverwrite: true, source, promptLabel: relPath })) {
|
|
1224
|
+
await fs7.copy(file.path, targetPath);
|
|
1225
|
+
logger.success(targetPath);
|
|
1226
|
+
}
|
|
1227
|
+
continue;
|
|
1228
|
+
}
|
|
1229
|
+
if (await shouldWriteFile(targetPath, { skipOverwrite, source: await fs7.readFile(file.path), promptLabel: relPath })) {
|
|
1230
|
+
await fs7.copy(file.path, targetPath);
|
|
1206
1231
|
logger.success(targetPath);
|
|
1207
1232
|
}
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1233
|
+
} catch (error) {
|
|
1234
|
+
if (isIgnorableFsError(error)) {
|
|
1235
|
+
continue;
|
|
1236
|
+
}
|
|
1237
|
+
throw error;
|
|
1213
1238
|
}
|
|
1214
1239
|
}
|
|
1215
1240
|
}
|
|
@@ -1242,6 +1267,7 @@ export {
|
|
|
1242
1267
|
init,
|
|
1243
1268
|
setVscodeBinaryMirror,
|
|
1244
1269
|
syncNpmMirror,
|
|
1270
|
+
isIgnorableFsError,
|
|
1245
1271
|
getFileHash,
|
|
1246
1272
|
isFileChanged,
|
|
1247
1273
|
escapeStringRegexp,
|
package/dist/cli.cjs
CHANGED
|
@@ -28,10 +28,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
mod
|
|
29
29
|
));
|
|
30
30
|
|
|
31
|
-
// ../../node_modules/.pnpm/tsup@8.5.0_@microsoft+api-extractor@7.52.12_@types+node@24.7.
|
|
31
|
+
// ../../node_modules/.pnpm/tsup@8.5.0_@microsoft+api-extractor@7.52.12_@types+node@24.7.2__jiti@2.6.1_postcss@8.5._3d4ae7d8e5b6f496c0110ecf5a7e8328/node_modules/tsup/assets/cjs_shims.js
|
|
32
32
|
var getImportMetaUrl, importMetaUrl;
|
|
33
33
|
var init_cjs_shims = __esm({
|
|
34
|
-
"../../node_modules/.pnpm/tsup@8.5.0_@microsoft+api-extractor@7.52.12_@types+node@24.7.
|
|
34
|
+
"../../node_modules/.pnpm/tsup@8.5.0_@microsoft+api-extractor@7.52.12_@types+node@24.7.2__jiti@2.6.1_postcss@8.5._3d4ae7d8e5b6f496c0110ecf5a7e8328/node_modules/tsup/assets/cjs_shims.js"() {
|
|
35
35
|
"use strict";
|
|
36
36
|
getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
|
|
37
37
|
importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
@@ -605,7 +605,7 @@ var import_node_url = require("url");
|
|
|
605
605
|
|
|
606
606
|
// package.json
|
|
607
607
|
var name = "@icebreakers/monorepo";
|
|
608
|
-
var version = "2.0.
|
|
608
|
+
var version = "2.0.8";
|
|
609
609
|
|
|
610
610
|
// src/constants.ts
|
|
611
611
|
var packageJsonPath = (0, import_node_url.fileURLToPath)(new URL("../package.json", importMetaUrl));
|
|
@@ -990,6 +990,16 @@ var import_pathe11 = __toESM(require("pathe"), 1);
|
|
|
990
990
|
var import_picocolors3 = __toESM(require("picocolors"), 1);
|
|
991
991
|
var import_set_value6 = __toESM(require_set_value(), 1);
|
|
992
992
|
|
|
993
|
+
// src/utils/fs.ts
|
|
994
|
+
init_cjs_shims();
|
|
995
|
+
function isIgnorableFsError(error) {
|
|
996
|
+
if (!error) {
|
|
997
|
+
return false;
|
|
998
|
+
}
|
|
999
|
+
const code = error.code;
|
|
1000
|
+
return code === "ENOENT" || code === "EBUSY" || code === "EEXIST";
|
|
1001
|
+
}
|
|
1002
|
+
|
|
993
1003
|
// src/utils/hash.ts
|
|
994
1004
|
init_cjs_shims();
|
|
995
1005
|
var import_node_crypto = __toESM(require("crypto"), 1);
|
|
@@ -1199,35 +1209,50 @@ async function upgradeMonorepo(opts) {
|
|
|
1199
1209
|
continue;
|
|
1200
1210
|
}
|
|
1201
1211
|
const targetPath = import_pathe11.default.resolve(absOutDir, relPath);
|
|
1202
|
-
|
|
1203
|
-
if (
|
|
1212
|
+
try {
|
|
1213
|
+
if (relPath === "package.json") {
|
|
1214
|
+
if (!await import_fs_extra7.default.pathExists(targetPath)) {
|
|
1215
|
+
continue;
|
|
1216
|
+
}
|
|
1217
|
+
const sourcePkgJson = await import_fs_extra7.default.readJson(file.path);
|
|
1218
|
+
const targetPkgJson = await import_fs_extra7.default.readJson(targetPath);
|
|
1219
|
+
setPkgJson(sourcePkgJson, targetPkgJson, { scripts: scriptOverrides });
|
|
1220
|
+
const data = `${JSON.stringify(targetPkgJson, void 0, 2)}
|
|
1221
|
+
`;
|
|
1222
|
+
if (await shouldWriteFile(targetPath, { skipOverwrite, source: data, promptLabel: relPath })) {
|
|
1223
|
+
await import_fs_extra7.default.outputFile(targetPath, data, "utf8");
|
|
1224
|
+
logger.success(targetPath);
|
|
1225
|
+
}
|
|
1204
1226
|
continue;
|
|
1205
1227
|
}
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1228
|
+
if (relPath === ".changeset/config.json" && repoName) {
|
|
1229
|
+
const changesetJson = await import_fs_extra7.default.readJson(file.path);
|
|
1230
|
+
(0, import_set_value6.default)(changesetJson, "changelog.1.repo", repoName);
|
|
1231
|
+
const data = `${JSON.stringify(changesetJson, void 0, 2)}
|
|
1210
1232
|
`;
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1233
|
+
if (await shouldWriteFile(targetPath, { skipOverwrite, source: data, promptLabel: relPath })) {
|
|
1234
|
+
await import_fs_extra7.default.outputFile(targetPath, data, "utf8");
|
|
1235
|
+
logger.success(targetPath);
|
|
1236
|
+
}
|
|
1237
|
+
continue;
|
|
1214
1238
|
}
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1239
|
+
if (relPath === "LICENSE") {
|
|
1240
|
+
const source = await import_fs_extra7.default.readFile(file.path);
|
|
1241
|
+
if (await shouldWriteFile(targetPath, { skipOverwrite: true, source, promptLabel: relPath })) {
|
|
1242
|
+
await import_fs_extra7.default.copy(file.path, targetPath);
|
|
1243
|
+
logger.success(targetPath);
|
|
1244
|
+
}
|
|
1245
|
+
continue;
|
|
1246
|
+
}
|
|
1247
|
+
if (await shouldWriteFile(targetPath, { skipOverwrite, source: await import_fs_extra7.default.readFile(file.path), promptLabel: relPath })) {
|
|
1248
|
+
await import_fs_extra7.default.copy(file.path, targetPath);
|
|
1224
1249
|
logger.success(targetPath);
|
|
1225
1250
|
}
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1251
|
+
} catch (error) {
|
|
1252
|
+
if (isIgnorableFsError(error)) {
|
|
1253
|
+
continue;
|
|
1254
|
+
}
|
|
1255
|
+
throw error;
|
|
1231
1256
|
}
|
|
1232
1257
|
}
|
|
1233
1258
|
}
|
package/dist/cli.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -33,10 +33,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
33
33
|
));
|
|
34
34
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
35
35
|
|
|
36
|
-
// ../../node_modules/.pnpm/tsup@8.5.0_@microsoft+api-extractor@7.52.12_@types+node@24.7.
|
|
36
|
+
// ../../node_modules/.pnpm/tsup@8.5.0_@microsoft+api-extractor@7.52.12_@types+node@24.7.2__jiti@2.6.1_postcss@8.5._3d4ae7d8e5b6f496c0110ecf5a7e8328/node_modules/tsup/assets/cjs_shims.js
|
|
37
37
|
var getImportMetaUrl, importMetaUrl;
|
|
38
38
|
var init_cjs_shims = __esm({
|
|
39
|
-
"../../node_modules/.pnpm/tsup@8.5.0_@microsoft+api-extractor@7.52.12_@types+node@24.7.
|
|
39
|
+
"../../node_modules/.pnpm/tsup@8.5.0_@microsoft+api-extractor@7.52.12_@types+node@24.7.2__jiti@2.6.1_postcss@8.5._3d4ae7d8e5b6f496c0110ecf5a7e8328/node_modules/tsup/assets/cjs_shims.js"() {
|
|
40
40
|
"use strict";
|
|
41
41
|
getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
|
|
42
42
|
importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
@@ -239,6 +239,7 @@ __export(index_exports, {
|
|
|
239
239
|
getWorkspacePackages: () => getWorkspacePackages,
|
|
240
240
|
init: () => init,
|
|
241
241
|
isFileChanged: () => isFileChanged,
|
|
242
|
+
isIgnorableFsError: () => isIgnorableFsError,
|
|
242
243
|
isMatch: () => isMatch,
|
|
243
244
|
loadMonorepoConfig: () => loadMonorepoConfig,
|
|
244
245
|
logger: () => logger,
|
|
@@ -637,7 +638,7 @@ var import_node_url = require("url");
|
|
|
637
638
|
|
|
638
639
|
// package.json
|
|
639
640
|
var name = "@icebreakers/monorepo";
|
|
640
|
-
var version = "2.0.
|
|
641
|
+
var version = "2.0.8";
|
|
641
642
|
|
|
642
643
|
// src/constants.ts
|
|
643
644
|
var packageJsonPath = (0, import_node_url.fileURLToPath)(new URL("../package.json", importMetaUrl));
|
|
@@ -1022,6 +1023,16 @@ var import_pathe11 = __toESM(require("pathe"), 1);
|
|
|
1022
1023
|
var import_picocolors3 = __toESM(require("picocolors"), 1);
|
|
1023
1024
|
var import_set_value6 = __toESM(require_set_value(), 1);
|
|
1024
1025
|
|
|
1026
|
+
// src/utils/fs.ts
|
|
1027
|
+
init_cjs_shims();
|
|
1028
|
+
function isIgnorableFsError(error) {
|
|
1029
|
+
if (!error) {
|
|
1030
|
+
return false;
|
|
1031
|
+
}
|
|
1032
|
+
const code = error.code;
|
|
1033
|
+
return code === "ENOENT" || code === "EBUSY" || code === "EEXIST";
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1025
1036
|
// src/utils/hash.ts
|
|
1026
1037
|
init_cjs_shims();
|
|
1027
1038
|
var import_node_crypto = __toESM(require("crypto"), 1);
|
|
@@ -1231,35 +1242,50 @@ async function upgradeMonorepo(opts) {
|
|
|
1231
1242
|
continue;
|
|
1232
1243
|
}
|
|
1233
1244
|
const targetPath = import_pathe11.default.resolve(absOutDir, relPath);
|
|
1234
|
-
|
|
1235
|
-
if (
|
|
1245
|
+
try {
|
|
1246
|
+
if (relPath === "package.json") {
|
|
1247
|
+
if (!await import_fs_extra7.default.pathExists(targetPath)) {
|
|
1248
|
+
continue;
|
|
1249
|
+
}
|
|
1250
|
+
const sourcePkgJson = await import_fs_extra7.default.readJson(file.path);
|
|
1251
|
+
const targetPkgJson = await import_fs_extra7.default.readJson(targetPath);
|
|
1252
|
+
setPkgJson(sourcePkgJson, targetPkgJson, { scripts: scriptOverrides });
|
|
1253
|
+
const data = `${JSON.stringify(targetPkgJson, void 0, 2)}
|
|
1254
|
+
`;
|
|
1255
|
+
if (await shouldWriteFile(targetPath, { skipOverwrite, source: data, promptLabel: relPath })) {
|
|
1256
|
+
await import_fs_extra7.default.outputFile(targetPath, data, "utf8");
|
|
1257
|
+
logger.success(targetPath);
|
|
1258
|
+
}
|
|
1236
1259
|
continue;
|
|
1237
1260
|
}
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1261
|
+
if (relPath === ".changeset/config.json" && repoName) {
|
|
1262
|
+
const changesetJson = await import_fs_extra7.default.readJson(file.path);
|
|
1263
|
+
(0, import_set_value6.default)(changesetJson, "changelog.1.repo", repoName);
|
|
1264
|
+
const data = `${JSON.stringify(changesetJson, void 0, 2)}
|
|
1242
1265
|
`;
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1266
|
+
if (await shouldWriteFile(targetPath, { skipOverwrite, source: data, promptLabel: relPath })) {
|
|
1267
|
+
await import_fs_extra7.default.outputFile(targetPath, data, "utf8");
|
|
1268
|
+
logger.success(targetPath);
|
|
1269
|
+
}
|
|
1270
|
+
continue;
|
|
1246
1271
|
}
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1272
|
+
if (relPath === "LICENSE") {
|
|
1273
|
+
const source = await import_fs_extra7.default.readFile(file.path);
|
|
1274
|
+
if (await shouldWriteFile(targetPath, { skipOverwrite: true, source, promptLabel: relPath })) {
|
|
1275
|
+
await import_fs_extra7.default.copy(file.path, targetPath);
|
|
1276
|
+
logger.success(targetPath);
|
|
1277
|
+
}
|
|
1278
|
+
continue;
|
|
1279
|
+
}
|
|
1280
|
+
if (await shouldWriteFile(targetPath, { skipOverwrite, source: await import_fs_extra7.default.readFile(file.path), promptLabel: relPath })) {
|
|
1281
|
+
await import_fs_extra7.default.copy(file.path, targetPath);
|
|
1256
1282
|
logger.success(targetPath);
|
|
1257
1283
|
}
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1284
|
+
} catch (error) {
|
|
1285
|
+
if (isIgnorableFsError(error)) {
|
|
1286
|
+
continue;
|
|
1287
|
+
}
|
|
1288
|
+
throw error;
|
|
1263
1289
|
}
|
|
1264
1290
|
}
|
|
1265
1291
|
}
|
|
@@ -1279,6 +1305,7 @@ async function upgradeMonorepo(opts) {
|
|
|
1279
1305
|
getWorkspacePackages,
|
|
1280
1306
|
init,
|
|
1281
1307
|
isFileChanged,
|
|
1308
|
+
isIgnorableFsError,
|
|
1282
1309
|
isMatch,
|
|
1283
1310
|
loadMonorepoConfig,
|
|
1284
1311
|
logger,
|
package/dist/index.d.cts
CHANGED
|
@@ -269,7 +269,7 @@ declare function syncNpmMirror(cwd: string, options?: GetWorkspacePackagesOption
|
|
|
269
269
|
declare function upgradeMonorepo(opts: CliOpts): Promise<void>;
|
|
270
270
|
|
|
271
271
|
var name = "@icebreakers/monorepo";
|
|
272
|
-
var version = "2.0.
|
|
272
|
+
var version = "2.0.8";
|
|
273
273
|
|
|
274
274
|
/**
|
|
275
275
|
* @icebreakers/monorepo 包的根目录,所有模板与资产目录都以此为基准。
|
|
@@ -321,6 +321,13 @@ type Context = Awaited<ReturnType<typeof createContext>>;
|
|
|
321
321
|
*/
|
|
322
322
|
declare const logger: consola.ConsolaInstance;
|
|
323
323
|
|
|
324
|
+
/**
|
|
325
|
+
* 判断是否为可忽略的文件系统错误。
|
|
326
|
+
* - ENOENT: 文件已被删除
|
|
327
|
+
* - EBUSY: Windows 中资源被系统占用
|
|
328
|
+
*/
|
|
329
|
+
declare function isIgnorableFsError(error: unknown): error is NodeJS.ErrnoException;
|
|
330
|
+
|
|
324
331
|
/**
|
|
325
332
|
* 生成给定二进制内容的 md5 摘要,用于快速比较文件内容。
|
|
326
333
|
*/
|
|
@@ -339,4 +346,4 @@ declare function escapeStringRegexp(str: string): string;
|
|
|
339
346
|
*/
|
|
340
347
|
declare function isMatch(str: string, arr: RegExp[]): boolean;
|
|
341
348
|
|
|
342
|
-
export { type CleanCommandConfig, type CliOpts, type Context, type CreateChoiceOption, type CreateCommandConfig, type CreateNewProjectOptions, type GetWorkspacePackagesOptions, GitClient, type InitCommandConfig, type MirrorCommandConfig, type MonorepoConfig, type SyncCommandConfig, type UpgradeCommandConfig, assetsDir, cleanProjects, createContext, createNewProject, defineMonorepoConfig, escapeStringRegexp, getCreateChoices, getFileHash, getTemplateMap, getWorkspaceData, getWorkspacePackages, init, isFileChanged, isMatch, loadMonorepoConfig, logger, name, packageDir, resolveCommandConfig, rootDir, setVscodeBinaryMirror, syncNpmMirror, templateMap, templatesDir, upgradeMonorepo, version };
|
|
349
|
+
export { type CleanCommandConfig, type CliOpts, type Context, type CreateChoiceOption, type CreateCommandConfig, type CreateNewProjectOptions, type GetWorkspacePackagesOptions, GitClient, type InitCommandConfig, type MirrorCommandConfig, type MonorepoConfig, type SyncCommandConfig, type UpgradeCommandConfig, assetsDir, cleanProjects, createContext, createNewProject, defineMonorepoConfig, escapeStringRegexp, getCreateChoices, getFileHash, getTemplateMap, getWorkspaceData, getWorkspacePackages, init, isFileChanged, isIgnorableFsError, isMatch, loadMonorepoConfig, logger, name, packageDir, resolveCommandConfig, rootDir, setVscodeBinaryMirror, syncNpmMirror, templateMap, templatesDir, upgradeMonorepo, version };
|
package/dist/index.d.ts
CHANGED
|
@@ -269,7 +269,7 @@ declare function syncNpmMirror(cwd: string, options?: GetWorkspacePackagesOption
|
|
|
269
269
|
declare function upgradeMonorepo(opts: CliOpts): Promise<void>;
|
|
270
270
|
|
|
271
271
|
var name = "@icebreakers/monorepo";
|
|
272
|
-
var version = "2.0.
|
|
272
|
+
var version = "2.0.8";
|
|
273
273
|
|
|
274
274
|
/**
|
|
275
275
|
* @icebreakers/monorepo 包的根目录,所有模板与资产目录都以此为基准。
|
|
@@ -321,6 +321,13 @@ type Context = Awaited<ReturnType<typeof createContext>>;
|
|
|
321
321
|
*/
|
|
322
322
|
declare const logger: consola.ConsolaInstance;
|
|
323
323
|
|
|
324
|
+
/**
|
|
325
|
+
* 判断是否为可忽略的文件系统错误。
|
|
326
|
+
* - ENOENT: 文件已被删除
|
|
327
|
+
* - EBUSY: Windows 中资源被系统占用
|
|
328
|
+
*/
|
|
329
|
+
declare function isIgnorableFsError(error: unknown): error is NodeJS.ErrnoException;
|
|
330
|
+
|
|
324
331
|
/**
|
|
325
332
|
* 生成给定二进制内容的 md5 摘要,用于快速比较文件内容。
|
|
326
333
|
*/
|
|
@@ -339,4 +346,4 @@ declare function escapeStringRegexp(str: string): string;
|
|
|
339
346
|
*/
|
|
340
347
|
declare function isMatch(str: string, arr: RegExp[]): boolean;
|
|
341
348
|
|
|
342
|
-
export { type CleanCommandConfig, type CliOpts, type Context, type CreateChoiceOption, type CreateCommandConfig, type CreateNewProjectOptions, type GetWorkspacePackagesOptions, GitClient, type InitCommandConfig, type MirrorCommandConfig, type MonorepoConfig, type SyncCommandConfig, type UpgradeCommandConfig, assetsDir, cleanProjects, createContext, createNewProject, defineMonorepoConfig, escapeStringRegexp, getCreateChoices, getFileHash, getTemplateMap, getWorkspaceData, getWorkspacePackages, init, isFileChanged, isMatch, loadMonorepoConfig, logger, name, packageDir, resolveCommandConfig, rootDir, setVscodeBinaryMirror, syncNpmMirror, templateMap, templatesDir, upgradeMonorepo, version };
|
|
349
|
+
export { type CleanCommandConfig, type CliOpts, type Context, type CreateChoiceOption, type CreateCommandConfig, type CreateNewProjectOptions, type GetWorkspacePackagesOptions, GitClient, type InitCommandConfig, type MirrorCommandConfig, type MonorepoConfig, type SyncCommandConfig, type UpgradeCommandConfig, assetsDir, cleanProjects, createContext, createNewProject, defineMonorepoConfig, escapeStringRegexp, getCreateChoices, getFileHash, getTemplateMap, getWorkspaceData, getWorkspacePackages, init, isFileChanged, isIgnorableFsError, isMatch, loadMonorepoConfig, logger, name, packageDir, resolveCommandConfig, rootDir, setVscodeBinaryMirror, syncNpmMirror, templateMap, templatesDir, upgradeMonorepo, version };
|
package/dist/index.js
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
init,
|
|
15
15
|
init_esm_shims,
|
|
16
16
|
isFileChanged,
|
|
17
|
+
isIgnorableFsError,
|
|
17
18
|
isMatch,
|
|
18
19
|
loadMonorepoConfig,
|
|
19
20
|
logger,
|
|
@@ -27,7 +28,7 @@ import {
|
|
|
27
28
|
templatesDir,
|
|
28
29
|
upgradeMonorepo,
|
|
29
30
|
version
|
|
30
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-4R64J5LE.js";
|
|
31
32
|
|
|
32
33
|
// src/index.ts
|
|
33
34
|
init_esm_shims();
|
|
@@ -46,6 +47,7 @@ export {
|
|
|
46
47
|
getWorkspacePackages,
|
|
47
48
|
init,
|
|
48
49
|
isFileChanged,
|
|
50
|
+
isIgnorableFsError,
|
|
49
51
|
isMatch,
|
|
50
52
|
loadMonorepoConfig,
|
|
51
53
|
logger,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icebreakers/monorepo",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.8",
|
|
5
5
|
"description": "The icebreaker's monorepo manager",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -34,15 +34,15 @@
|
|
|
34
34
|
"templates"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@inquirer/checkbox": "^4.
|
|
38
|
-
"@inquirer/confirm": "^5.1.
|
|
39
|
-
"@inquirer/input": "^4.2.
|
|
40
|
-
"@inquirer/select": "^4.
|
|
37
|
+
"@inquirer/checkbox": "^4.3.0",
|
|
38
|
+
"@inquirer/confirm": "^5.1.19",
|
|
39
|
+
"@inquirer/input": "^4.2.5",
|
|
40
|
+
"@inquirer/select": "^4.4.0",
|
|
41
41
|
"@pnpm/find-workspace-dir": "^1000.1.3",
|
|
42
|
-
"@pnpm/logger": "^1001.0.
|
|
42
|
+
"@pnpm/logger": "^1001.0.1",
|
|
43
43
|
"@pnpm/types": "^1000.8.0",
|
|
44
|
-
"@pnpm/worker": "^1000.
|
|
45
|
-
"@pnpm/workspace.find-packages": "^1000.0.
|
|
44
|
+
"@pnpm/worker": "^1000.2.0",
|
|
45
|
+
"@pnpm/workspace.find-packages": "^1000.0.41",
|
|
46
46
|
"@pnpm/workspace.read-manifest": "^1000.2.4",
|
|
47
47
|
"c12": "^3.3.0",
|
|
48
48
|
"commander": "^14.0.1",
|
|
@@ -15,17 +15,17 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@faker-js/faker": "^10.0.0",
|
|
18
|
-
"@tanstack/vue-query": "^5.90.
|
|
18
|
+
"@tanstack/vue-query": "^5.90.3",
|
|
19
19
|
"@tanstack/vue-table": "^8.21.3",
|
|
20
20
|
"@tanstack/vue-virtual": "^3.13.12",
|
|
21
21
|
"@trpc/client": "^11.6.0",
|
|
22
22
|
"pinia": "^3.0.3",
|
|
23
23
|
"vue": "^3.5.22",
|
|
24
24
|
"vue-i18n": "^11.1.12",
|
|
25
|
-
"vue-router": "^4.
|
|
25
|
+
"vue-router": "^4.6.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@cloudflare/vite-plugin": "^1.13.
|
|
28
|
+
"@cloudflare/vite-plugin": "^1.13.12",
|
|
29
29
|
"@hono/node-server": "^1.19.5",
|
|
30
30
|
"@hono/trpc-server": "^0.4.0",
|
|
31
31
|
"@tailwindcss/vite": "^4.1.14",
|
|
@@ -33,15 +33,15 @@
|
|
|
33
33
|
"@vitejs/plugin-vue": "^6.0.1",
|
|
34
34
|
"@vitejs/plugin-vue-jsx": "^5.1.1",
|
|
35
35
|
"@vue/tsconfig": "^0.8.1",
|
|
36
|
-
"hono": "^4.9.
|
|
36
|
+
"hono": "^4.9.12",
|
|
37
37
|
"tailwindcss": "^4.1.14",
|
|
38
38
|
"typescript": "~5.9.3",
|
|
39
39
|
"unplugin-vue-router": "^0.15.0",
|
|
40
|
-
"vite": "^7.1.
|
|
40
|
+
"vite": "^7.1.10",
|
|
41
41
|
"vite-plugin-vue-devtools": "^8.0.2",
|
|
42
42
|
"vite-tsconfig-paths": "^5.1.4",
|
|
43
43
|
"vue-tsc": "3.1.1",
|
|
44
|
-
"wrangler": "^4.42.
|
|
44
|
+
"wrangler": "^4.42.2",
|
|
45
45
|
"zod": "^4.1.12"
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -1,7 +1,18 @@
|
|
|
1
|
-
import { bar } from '@/index'
|
|
1
|
+
import { bar, getDirname, xx } from '@/index'
|
|
2
2
|
|
|
3
3
|
describe('index', () => {
|
|
4
4
|
it('foo bar', () => {
|
|
5
5
|
expect(bar()).toBe('foo')
|
|
6
6
|
})
|
|
7
|
+
|
|
8
|
+
it('getDirname returns a directory path', () => {
|
|
9
|
+
const dirname = getDirname()
|
|
10
|
+
expect(typeof dirname).toBe('string')
|
|
11
|
+
expect(dirname.length).toBeGreaterThan(0)
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
it('xx enum exposes numeric indices', () => {
|
|
15
|
+
expect(xx.id).toBe(0)
|
|
16
|
+
expect(xx.dd).toBe(1)
|
|
17
|
+
})
|
|
7
18
|
})
|
|
@@ -1,7 +1,18 @@
|
|
|
1
|
-
import { foo } from '@/index'
|
|
1
|
+
import { foo, format, getDirname } from '@/index'
|
|
2
2
|
|
|
3
3
|
describe('index', () => {
|
|
4
4
|
it('foo bar', () => {
|
|
5
5
|
expect(foo()).toBe('bar')
|
|
6
6
|
})
|
|
7
|
+
|
|
8
|
+
it('format uppercases alphabetical characters', () => {
|
|
9
|
+
expect(format('abc-123')).toBe('ABC-123')
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
it('getDirname exposes template directory path', () => {
|
|
13
|
+
const dirname = getDirname()
|
|
14
|
+
expect(typeof dirname).toBe('string')
|
|
15
|
+
expect(dirname.length).toBeGreaterThan(0)
|
|
16
|
+
expect(dirname).toContain('unbuild-template')
|
|
17
|
+
})
|
|
7
18
|
})
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
"jsdom": "^27.0.0",
|
|
53
53
|
"tailwindcss": "^4.1.14",
|
|
54
54
|
"unplugin-vue-router": "^0.15.0",
|
|
55
|
-
"vite": "^7.1.
|
|
55
|
+
"vite": "^7.1.10",
|
|
56
56
|
"vite-plugin-dts": "^4.5.4",
|
|
57
57
|
"vue": "^3.5.22",
|
|
58
|
-
"vue-router": "^4.
|
|
58
|
+
"vue-router": "^4.6.0",
|
|
59
59
|
"vue-tsc": "^3.1.1"
|
|
60
60
|
}
|
|
61
61
|
}
|