@icebreakers/monorepo 2.0.7 → 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.
Files changed (29) hide show
  1. package/assets/.github/workflows/ci.yml +1 -1
  2. package/assets/.github/workflows/release.yml +1 -1
  3. package/assets/package.json +3 -3
  4. package/dist/{chunk-EXEZ5XAV.js → chunk-4R64J5LE.js} +52 -29
  5. package/dist/cli.cjs +51 -29
  6. package/dist/cli.js +1 -1
  7. package/dist/index.cjs +53 -29
  8. package/dist/index.d.cts +9 -2
  9. package/dist/index.d.ts +9 -2
  10. package/dist/index.js +3 -1
  11. package/package.json +6 -6
  12. package/templates/apps/client/package.json +4 -4
  13. package/templates/apps/client/worker/node-entry.ts +1 -0
  14. package/templates/apps/server/package.json +1 -1
  15. package/templates/apps/server/src/node-entry.ts +1 -0
  16. package/templates/apps/website/why/examples/0.npm-basic-package/index.js +1 -0
  17. package/templates/apps/website/why/examples/1.npm-basic-package/index.cjs +1 -0
  18. package/templates/apps/website/why/examples/1.npm-basic-package/index.js +1 -0
  19. package/templates/apps/website/why/examples/2.npm-basic-package/src/index.ts +1 -0
  20. package/templates/apps/website/why/examples/3.npm-basic-package/src/index.ts +1 -0
  21. package/templates/apps/website/why/examples/usage-cjs/cjs.cjs +1 -0
  22. package/templates/apps/website/why/examples/usage-cjs/esm.mjs +1 -0
  23. package/templates/apps/website/why/examples/usage-cjs/index.js +1 -0
  24. package/templates/apps/website/why/examples/usage-esm/cjs.cjs +1 -0
  25. package/templates/apps/website/why/examples/usage-esm/esm.mjs +1 -0
  26. package/templates/apps/website/why/examples/usage-esm/index.js +1 -0
  27. package/templates/packages/tsup-template/test/index.test.ts +12 -1
  28. package/templates/packages/unbuild-template/test/index.test.ts +12 -1
  29. package/templates/packages/vue-lib-template/package.json +2 -2
@@ -34,7 +34,7 @@ jobs:
34
34
  - uses: pnpm/action-setup@v4
35
35
 
36
36
  - name: Setup Node.js environment
37
- uses: actions/setup-node@v5
37
+ uses: actions/setup-node@v6
38
38
  with:
39
39
  node-version: ${{ matrix.node-version }}
40
40
  cache: pnpm
@@ -27,7 +27,7 @@ jobs:
27
27
  - uses: pnpm/action-setup@v4
28
28
 
29
29
  - name: Setup Node.js environment
30
- uses: actions/setup-node@v5
30
+ uses: actions/setup-node@v6
31
31
  with:
32
32
  node-version: 22
33
33
  cache: pnpm
@@ -3,7 +3,7 @@
3
3
  "type": "module",
4
4
  "version": "0.0.0",
5
5
  "private": true,
6
- "packageManager": "pnpm@10.18.2",
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.1",
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",
@@ -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.1",
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.1__jiti@2.6.1_postcss@8.5._774264c818cedeeab3a8372a2229f237/node_modules/tsup/assets/esm_shims.js
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.1__jiti@2.6.1_postcss@8.5._774264c818cedeeab3a8372a2229f237/node_modules/tsup/assets/esm_shims.js"() {
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.7";
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,38 +1191,50 @@ async function upgradeMonorepo(opts) {
1181
1191
  continue;
1182
1192
  }
1183
1193
  const targetPath = path13.resolve(absOutDir, relPath);
1184
- if (relPath === "package.json") {
1185
- if (!await fs7.pathExists(targetPath)) {
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
- const sourcePkgJson = await fs7.readJson(file.path);
1189
- const targetPkgJson = await fs7.readJson(targetPath);
1190
- setPkgJson(sourcePkgJson, targetPkgJson, { scripts: scriptOverrides });
1191
- const data = `${JSON.stringify(targetPkgJson, void 0, 2)}
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
- if (await shouldWriteFile(targetPath, { skipOverwrite, source: data, promptLabel: relPath })) {
1194
- await fs7.outputFile(targetPath, data, "utf8");
1195
- logger.success(targetPath);
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
- continue;
1198
- }
1199
- if (relPath === ".changeset/config.json" && repoName) {
1200
- const changesetJson = await fs7.readJson(file.path);
1201
- (0, import_set_value6.default)(changesetJson, "changelog.1.repo", repoName);
1202
- const data = `${JSON.stringify(changesetJson, void 0, 2)}
1203
- `;
1204
- if (await shouldWriteFile(targetPath, { skipOverwrite, source: data, promptLabel: relPath })) {
1205
- await fs7.outputFile(targetPath, data, "utf8");
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
- continue;
1209
- }
1210
- if (relPath === "LICENSE" && await fs7.pathExists(targetPath)) {
1211
- continue;
1212
- }
1213
- if (await shouldWriteFile(targetPath, { skipOverwrite, source: await fs7.readFile(file.path), promptLabel: relPath })) {
1214
- await fs7.copy(file.path, targetPath);
1215
- logger.success(targetPath);
1233
+ } catch (error) {
1234
+ if (isIgnorableFsError(error)) {
1235
+ continue;
1236
+ }
1237
+ throw error;
1216
1238
  }
1217
1239
  }
1218
1240
  }
@@ -1245,6 +1267,7 @@ export {
1245
1267
  init,
1246
1268
  setVscodeBinaryMirror,
1247
1269
  syncNpmMirror,
1270
+ isIgnorableFsError,
1248
1271
  getFileHash,
1249
1272
  isFileChanged,
1250
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.1__jiti@2.6.1_postcss@8.5._774264c818cedeeab3a8372a2229f237/node_modules/tsup/assets/cjs_shims.js
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.1__jiti@2.6.1_postcss@8.5._774264c818cedeeab3a8372a2229f237/node_modules/tsup/assets/cjs_shims.js"() {
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.7";
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,38 +1209,50 @@ async function upgradeMonorepo(opts) {
1199
1209
  continue;
1200
1210
  }
1201
1211
  const targetPath = import_pathe11.default.resolve(absOutDir, relPath);
1202
- if (relPath === "package.json") {
1203
- if (!await import_fs_extra7.default.pathExists(targetPath)) {
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
- const sourcePkgJson = await import_fs_extra7.default.readJson(file.path);
1207
- const targetPkgJson = await import_fs_extra7.default.readJson(targetPath);
1208
- setPkgJson(sourcePkgJson, targetPkgJson, { scripts: scriptOverrides });
1209
- const data = `${JSON.stringify(targetPkgJson, void 0, 2)}
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
- if (await shouldWriteFile(targetPath, { skipOverwrite, source: data, promptLabel: relPath })) {
1212
- await import_fs_extra7.default.outputFile(targetPath, data, "utf8");
1213
- logger.success(targetPath);
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
- continue;
1216
- }
1217
- if (relPath === ".changeset/config.json" && repoName) {
1218
- const changesetJson = await import_fs_extra7.default.readJson(file.path);
1219
- (0, import_set_value6.default)(changesetJson, "changelog.1.repo", repoName);
1220
- const data = `${JSON.stringify(changesetJson, void 0, 2)}
1221
- `;
1222
- if (await shouldWriteFile(targetPath, { skipOverwrite, source: data, promptLabel: relPath })) {
1223
- await import_fs_extra7.default.outputFile(targetPath, data, "utf8");
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
- continue;
1227
- }
1228
- if (relPath === "LICENSE" && await import_fs_extra7.default.pathExists(targetPath)) {
1229
- continue;
1230
- }
1231
- if (await shouldWriteFile(targetPath, { skipOverwrite, source: await import_fs_extra7.default.readFile(file.path), promptLabel: relPath })) {
1232
- await import_fs_extra7.default.copy(file.path, targetPath);
1233
- logger.success(targetPath);
1251
+ } catch (error) {
1252
+ if (isIgnorableFsError(error)) {
1253
+ continue;
1254
+ }
1255
+ throw error;
1234
1256
  }
1235
1257
  }
1236
1258
  }
package/dist/cli.js CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  syncNpmMirror,
13
13
  upgradeMonorepo,
14
14
  version
15
- } from "./chunk-EXEZ5XAV.js";
15
+ } from "./chunk-4R64J5LE.js";
16
16
 
17
17
  // src/cli.ts
18
18
  init_esm_shims();
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.1__jiti@2.6.1_postcss@8.5._774264c818cedeeab3a8372a2229f237/node_modules/tsup/assets/cjs_shims.js
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.1__jiti@2.6.1_postcss@8.5._774264c818cedeeab3a8372a2229f237/node_modules/tsup/assets/cjs_shims.js"() {
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.7";
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,38 +1242,50 @@ async function upgradeMonorepo(opts) {
1231
1242
  continue;
1232
1243
  }
1233
1244
  const targetPath = import_pathe11.default.resolve(absOutDir, relPath);
1234
- if (relPath === "package.json") {
1235
- if (!await import_fs_extra7.default.pathExists(targetPath)) {
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
- const sourcePkgJson = await import_fs_extra7.default.readJson(file.path);
1239
- const targetPkgJson = await import_fs_extra7.default.readJson(targetPath);
1240
- setPkgJson(sourcePkgJson, targetPkgJson, { scripts: scriptOverrides });
1241
- const data = `${JSON.stringify(targetPkgJson, void 0, 2)}
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
- if (await shouldWriteFile(targetPath, { skipOverwrite, source: data, promptLabel: relPath })) {
1244
- await import_fs_extra7.default.outputFile(targetPath, data, "utf8");
1245
- logger.success(targetPath);
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
- continue;
1248
- }
1249
- if (relPath === ".changeset/config.json" && repoName) {
1250
- const changesetJson = await import_fs_extra7.default.readJson(file.path);
1251
- (0, import_set_value6.default)(changesetJson, "changelog.1.repo", repoName);
1252
- const data = `${JSON.stringify(changesetJson, void 0, 2)}
1253
- `;
1254
- if (await shouldWriteFile(targetPath, { skipOverwrite, source: data, promptLabel: relPath })) {
1255
- await import_fs_extra7.default.outputFile(targetPath, data, "utf8");
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
- continue;
1259
- }
1260
- if (relPath === "LICENSE" && await import_fs_extra7.default.pathExists(targetPath)) {
1261
- continue;
1262
- }
1263
- if (await shouldWriteFile(targetPath, { skipOverwrite, source: await import_fs_extra7.default.readFile(file.path), promptLabel: relPath })) {
1264
- await import_fs_extra7.default.copy(file.path, targetPath);
1265
- logger.success(targetPath);
1284
+ } catch (error) {
1285
+ if (isIgnorableFsError(error)) {
1286
+ continue;
1287
+ }
1288
+ throw error;
1266
1289
  }
1267
1290
  }
1268
1291
  }
@@ -1282,6 +1305,7 @@ async function upgradeMonorepo(opts) {
1282
1305
  getWorkspacePackages,
1283
1306
  init,
1284
1307
  isFileChanged,
1308
+ isIgnorableFsError,
1285
1309
  isMatch,
1286
1310
  loadMonorepoConfig,
1287
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.7";
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.7";
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-EXEZ5XAV.js";
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.7",
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.2.4",
38
- "@inquirer/confirm": "^5.1.18",
39
- "@inquirer/input": "^4.2.4",
40
- "@inquirer/select": "^4.3.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
42
  "@pnpm/logger": "^1001.0.1",
43
43
  "@pnpm/types": "^1000.8.0",
44
44
  "@pnpm/worker": "^1000.2.0",
45
- "@pnpm/workspace.find-packages": "^1000.0.40",
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,14 +15,14 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "@faker-js/faker": "^10.0.0",
18
- "@tanstack/vue-query": "^5.90.2",
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.5.1"
25
+ "vue-router": "^4.6.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@cloudflare/vite-plugin": "^1.13.12",
@@ -33,11 +33,11 @@
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.11",
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.9",
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",
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-console */
1
2
  import { serve } from '@hono/node-server'
2
3
  import { logger } from 'hono/logger'
3
4
  import { app } from './app'
@@ -52,7 +52,7 @@
52
52
  },
53
53
  "devDependencies": {
54
54
  "@hono/node-server": "^1.19.5",
55
- "hono": "^4.9.11",
55
+ "hono": "^4.9.12",
56
56
  "wrangler": "^4.42.2",
57
57
  "zod": "^4.1.12"
58
58
  }
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-console */
1
2
  import { serve } from '@hono/node-server'
2
3
  import { logger } from 'hono/logger'
3
4
  import { app } from './app'
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-console */
1
2
  console.log(`load ${__filename}`)
2
3
 
3
4
  function sayHello() {
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-console */
1
2
  console.log(`cjs load ${__filename}`)
2
3
 
3
4
  function sayHello() {
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-console */
1
2
  console.log(`esm load ${import.meta.filename}`)
2
3
 
3
4
  export function sayHello() {
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-console */
1
2
  export function sayHello() {
2
3
  const message = 'hello world typescript'
3
4
  console.log(message)
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-console */
1
2
  export function sayHello() {
2
3
  const message = 'hello world typescript'
3
4
  console.log(message)
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-console */
1
2
  console.log(__dirname)
2
3
  console.log(import.meta.dirname)
3
4
  console.log(require)
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-console */
1
2
  console.log(__dirname)
2
3
  console.log(import.meta.dirname)
3
4
  console.log(require)
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-console */
1
2
  // import c from 'chalk'
2
3
  // const c = require('chalk')
3
4
  const { sayHello } = require('icebreaker-npm-basic-package')
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-console */
1
2
  console.log(__dirname)
2
3
  console.log(import.meta.dirname)
3
4
  console.log(require)
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-console */
1
2
  console.log(__dirname)
2
3
  console.log(import.meta.dirname)
3
4
  console.log(require)
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-console */
1
2
  import c from 'chalk'
2
3
  import { sayHello } from 'icebreaker-npm-basic-package'
3
4
  import { sayHello as sayHello2 } from 'icebreaker-npm-basic-package-multiple-exports'
@@ -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.9",
55
+ "vite": "^7.1.10",
56
56
  "vite-plugin-dts": "^4.5.4",
57
57
  "vue": "^3.5.22",
58
- "vue-router": "^4.5.1",
58
+ "vue-router": "^4.6.0",
59
59
  "vue-tsc": "^3.1.1"
60
60
  }
61
61
  }