@icebreakers/monorepo 2.0.7 → 2.0.9

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 +5 -4
  4. package/dist/{chunk-EXEZ5XAV.js → chunk-NHJHKD7Y.js} +103 -39
  5. package/dist/cli.cjs +101 -38
  6. package/dist/cli.js +1 -1
  7. package/dist/index.cjs +103 -38
  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 +7 -6
  12. package/templates/apps/client/package.json +8 -8
  13. package/templates/apps/client/worker/node-entry.ts +1 -0
  14. package/templates/apps/server/package.json +2 -2
  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 +3 -3
@@ -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",
@@ -44,11 +44,12 @@
44
44
  "@changesets/cli": "^2.29.7",
45
45
  "@commitlint/cli": "^20.1.0",
46
46
  "@icebreakers/commitlint-config": "^1.2.1",
47
- "@icebreakers/eslint-config": "^1.5.0",
47
+ "@icebreakers/eslint-config": "^1.5.2",
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
+ "@types/semver": "^7.7.1",
52
53
  "@vitest/coverage-v8": "~3.2.4",
53
54
  "ci-info": "^4.3.1",
54
55
  "cross-env": "^10.1.0",
@@ -68,7 +69,7 @@
68
69
  "tsup": "^8.5.0",
69
70
  "tsx": "^4.20.6",
70
71
  "turbo": "^2.5.8",
71
- "type-fest": "^5.0.1",
72
+ "type-fest": "^5.1.0",
72
73
  "typescript": "^5.9.3",
73
74
  "unbuild": "^3.6.1",
74
75
  "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.9";
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";
@@ -995,15 +1005,16 @@ function isMatch(str, arr) {
995
1005
 
996
1006
  // src/commands/upgrade/index.ts
997
1007
  init_esm_shims();
1008
+ var import_set_value6 = __toESM(require_set_value(), 1);
998
1009
  import { Buffer as Buffer2 } from "buffer";
999
1010
  import process2 from "process";
1000
1011
  import checkbox2 from "@inquirer/checkbox";
1001
1012
  import confirm from "@inquirer/confirm";
1002
1013
  import fs7 from "fs-extra";
1003
- var import_set_value6 = __toESM(require_set_value(), 1);
1004
1014
  import klaw from "klaw";
1005
1015
  import path13 from "pathe";
1006
1016
  import pc3 from "picocolors";
1017
+ import { coerce, gte, minVersion } from "semver";
1007
1018
 
1008
1019
  // src/commands/upgrade/scripts.ts
1009
1020
  init_esm_shims();
@@ -1060,17 +1071,44 @@ function isWorkspace(version2) {
1060
1071
  }
1061
1072
  return false;
1062
1073
  }
1074
+ function parseVersion(input) {
1075
+ if (typeof input !== "string" || input.trim().length === 0) {
1076
+ return null;
1077
+ }
1078
+ return minVersion(input) ?? coerce(input);
1079
+ }
1080
+ function shouldAssignVersion(currentVersion, nextVersion) {
1081
+ if (typeof currentVersion !== "string" || currentVersion.trim().length === 0) {
1082
+ return true;
1083
+ }
1084
+ if (currentVersion === nextVersion) {
1085
+ return false;
1086
+ }
1087
+ const current = parseVersion(currentVersion);
1088
+ const next = parseVersion(nextVersion);
1089
+ if (!current || !next) {
1090
+ return true;
1091
+ }
1092
+ return !gte(current, next);
1093
+ }
1063
1094
  function setPkgJson(sourcePkgJson, targetPkgJson, options) {
1064
- const packageManager = index_default(sourcePkgJson, "packageManager", { default: "" });
1065
- const sourceDeps = index_default(sourcePkgJson, "dependencies", { default: {} });
1066
- const sourceDevDeps = index_default(sourcePkgJson, "devDependencies", { default: {} });
1067
- const targetDeps = { ...index_default(targetPkgJson, "dependencies", { default: {} }) };
1068
- const targetDevDeps = { ...index_default(targetPkgJson, "devDependencies", { default: {} }) };
1095
+ const packageManager = sourcePkgJson.packageManager ?? "";
1096
+ const sourceDeps = sourcePkgJson.dependencies ?? {};
1097
+ const sourceDevDeps = sourcePkgJson.devDependencies ?? {};
1098
+ const targetDeps = { ...targetPkgJson.dependencies ?? {} };
1099
+ const targetDevDeps = { ...targetPkgJson.devDependencies ?? {} };
1069
1100
  if (packageManager) {
1070
1101
  targetPkgJson.packageManager = packageManager;
1071
1102
  }
1072
1103
  for (const [depName, depVersion] of Object.entries(sourceDeps)) {
1073
- if (!isWorkspace(targetDeps[depName])) {
1104
+ if (typeof depVersion !== "string") {
1105
+ continue;
1106
+ }
1107
+ const targetVersion = targetDeps[depName];
1108
+ if (isWorkspace(targetVersion)) {
1109
+ continue;
1110
+ }
1111
+ if (shouldAssignVersion(targetVersion, depVersion)) {
1074
1112
  targetDeps[depName] = depVersion;
1075
1113
  }
1076
1114
  }
@@ -1078,10 +1116,23 @@ function setPkgJson(sourcePkgJson, targetPkgJson, options) {
1078
1116
  targetPkgJson.dependencies = targetDeps;
1079
1117
  }
1080
1118
  for (const [depName, depVersion] of Object.entries(sourceDevDeps)) {
1119
+ if (typeof depVersion !== "string") {
1120
+ continue;
1121
+ }
1081
1122
  if (depName === name) {
1082
- targetDevDeps[depName] = `^${version}`;
1083
- } else if (!isWorkspace(targetDevDeps[depName])) {
1084
- targetDevDeps[depName] = depVersion;
1123
+ const nextVersion = `^${version}`;
1124
+ const targetVersion = targetDevDeps[depName];
1125
+ if (!isWorkspace(targetVersion) && shouldAssignVersion(targetVersion, nextVersion)) {
1126
+ targetDevDeps[depName] = nextVersion;
1127
+ }
1128
+ } else {
1129
+ const targetVersion = targetDevDeps[depName];
1130
+ if (isWorkspace(targetVersion)) {
1131
+ continue;
1132
+ }
1133
+ if (shouldAssignVersion(targetVersion, depVersion)) {
1134
+ targetDevDeps[depName] = depVersion;
1135
+ }
1085
1136
  }
1086
1137
  }
1087
1138
  if (Object.keys(targetDevDeps).length) {
@@ -1181,38 +1232,50 @@ async function upgradeMonorepo(opts) {
1181
1232
  continue;
1182
1233
  }
1183
1234
  const targetPath = path13.resolve(absOutDir, relPath);
1184
- if (relPath === "package.json") {
1185
- if (!await fs7.pathExists(targetPath)) {
1235
+ try {
1236
+ if (relPath === "package.json") {
1237
+ if (!await fs7.pathExists(targetPath)) {
1238
+ continue;
1239
+ }
1240
+ const sourcePkgJson = await fs7.readJson(file.path);
1241
+ const targetPkgJson = await fs7.readJson(targetPath);
1242
+ setPkgJson(sourcePkgJson, targetPkgJson, { scripts: scriptOverrides });
1243
+ const data = `${JSON.stringify(targetPkgJson, void 0, 2)}
1244
+ `;
1245
+ if (await shouldWriteFile(targetPath, { skipOverwrite, source: data, promptLabel: relPath })) {
1246
+ await fs7.outputFile(targetPath, data, "utf8");
1247
+ logger.success(targetPath);
1248
+ }
1186
1249
  continue;
1187
1250
  }
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)}
1251
+ if (relPath === ".changeset/config.json" && repoName) {
1252
+ const changesetJson = await fs7.readJson(file.path);
1253
+ (0, import_set_value6.default)(changesetJson, "changelog.1.repo", repoName);
1254
+ const data = `${JSON.stringify(changesetJson, void 0, 2)}
1192
1255
  `;
1193
- if (await shouldWriteFile(targetPath, { skipOverwrite, source: data, promptLabel: relPath })) {
1194
- await fs7.outputFile(targetPath, data, "utf8");
1195
- logger.success(targetPath);
1256
+ if (await shouldWriteFile(targetPath, { skipOverwrite, source: data, promptLabel: relPath })) {
1257
+ await fs7.outputFile(targetPath, data, "utf8");
1258
+ logger.success(targetPath);
1259
+ }
1260
+ continue;
1196
1261
  }
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");
1262
+ if (relPath === "LICENSE") {
1263
+ const source = await fs7.readFile(file.path);
1264
+ if (await shouldWriteFile(targetPath, { skipOverwrite: true, source, promptLabel: relPath })) {
1265
+ await fs7.copy(file.path, targetPath);
1266
+ logger.success(targetPath);
1267
+ }
1268
+ continue;
1269
+ }
1270
+ if (await shouldWriteFile(targetPath, { skipOverwrite, source: await fs7.readFile(file.path), promptLabel: relPath })) {
1271
+ await fs7.copy(file.path, targetPath);
1206
1272
  logger.success(targetPath);
1207
1273
  }
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);
1274
+ } catch (error) {
1275
+ if (isIgnorableFsError(error)) {
1276
+ continue;
1277
+ }
1278
+ throw error;
1216
1279
  }
1217
1280
  }
1218
1281
  }
@@ -1245,6 +1308,7 @@ export {
1245
1308
  init,
1246
1309
  setVscodeBinaryMirror,
1247
1310
  syncNpmMirror,
1311
+ isIgnorableFsError,
1248
1312
  getFileHash,
1249
1313
  isFileChanged,
1250
1314
  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.9";
609
609
 
610
610
  // src/constants.ts
611
611
  var packageJsonPath = (0, import_node_url.fileURLToPath)(new URL("../package.json", importMetaUrl));
@@ -988,8 +988,19 @@ var import_fs_extra7 = __toESM(require("fs-extra"), 1);
988
988
  var import_klaw = __toESM(require("klaw"), 1);
989
989
  var import_pathe11 = __toESM(require("pathe"), 1);
990
990
  var import_picocolors3 = __toESM(require("picocolors"), 1);
991
+ var import_semver = require("semver");
991
992
  var import_set_value6 = __toESM(require_set_value(), 1);
992
993
 
994
+ // src/utils/fs.ts
995
+ init_cjs_shims();
996
+ function isIgnorableFsError(error) {
997
+ if (!error) {
998
+ return false;
999
+ }
1000
+ const code = error.code;
1001
+ return code === "ENOENT" || code === "EBUSY" || code === "EEXIST";
1002
+ }
1003
+
993
1004
  // src/utils/hash.ts
994
1005
  init_cjs_shims();
995
1006
  var import_node_crypto = __toESM(require("crypto"), 1);
@@ -1078,17 +1089,44 @@ function isWorkspace(version2) {
1078
1089
  }
1079
1090
  return false;
1080
1091
  }
1092
+ function parseVersion(input2) {
1093
+ if (typeof input2 !== "string" || input2.trim().length === 0) {
1094
+ return null;
1095
+ }
1096
+ return (0, import_semver.minVersion)(input2) ?? (0, import_semver.coerce)(input2);
1097
+ }
1098
+ function shouldAssignVersion(currentVersion, nextVersion) {
1099
+ if (typeof currentVersion !== "string" || currentVersion.trim().length === 0) {
1100
+ return true;
1101
+ }
1102
+ if (currentVersion === nextVersion) {
1103
+ return false;
1104
+ }
1105
+ const current = parseVersion(currentVersion);
1106
+ const next = parseVersion(nextVersion);
1107
+ if (!current || !next) {
1108
+ return true;
1109
+ }
1110
+ return !(0, import_semver.gte)(current, next);
1111
+ }
1081
1112
  function setPkgJson(sourcePkgJson, targetPkgJson, options) {
1082
- const packageManager = index_default(sourcePkgJson, "packageManager", { default: "" });
1083
- const sourceDeps = index_default(sourcePkgJson, "dependencies", { default: {} });
1084
- const sourceDevDeps = index_default(sourcePkgJson, "devDependencies", { default: {} });
1085
- const targetDeps = { ...index_default(targetPkgJson, "dependencies", { default: {} }) };
1086
- const targetDevDeps = { ...index_default(targetPkgJson, "devDependencies", { default: {} }) };
1113
+ const packageManager = sourcePkgJson.packageManager ?? "";
1114
+ const sourceDeps = sourcePkgJson.dependencies ?? {};
1115
+ const sourceDevDeps = sourcePkgJson.devDependencies ?? {};
1116
+ const targetDeps = { ...targetPkgJson.dependencies ?? {} };
1117
+ const targetDevDeps = { ...targetPkgJson.devDependencies ?? {} };
1087
1118
  if (packageManager) {
1088
1119
  targetPkgJson.packageManager = packageManager;
1089
1120
  }
1090
1121
  for (const [depName, depVersion] of Object.entries(sourceDeps)) {
1091
- if (!isWorkspace(targetDeps[depName])) {
1122
+ if (typeof depVersion !== "string") {
1123
+ continue;
1124
+ }
1125
+ const targetVersion = targetDeps[depName];
1126
+ if (isWorkspace(targetVersion)) {
1127
+ continue;
1128
+ }
1129
+ if (shouldAssignVersion(targetVersion, depVersion)) {
1092
1130
  targetDeps[depName] = depVersion;
1093
1131
  }
1094
1132
  }
@@ -1096,10 +1134,23 @@ function setPkgJson(sourcePkgJson, targetPkgJson, options) {
1096
1134
  targetPkgJson.dependencies = targetDeps;
1097
1135
  }
1098
1136
  for (const [depName, depVersion] of Object.entries(sourceDevDeps)) {
1137
+ if (typeof depVersion !== "string") {
1138
+ continue;
1139
+ }
1099
1140
  if (depName === name) {
1100
- targetDevDeps[depName] = `^${version}`;
1101
- } else if (!isWorkspace(targetDevDeps[depName])) {
1102
- targetDevDeps[depName] = depVersion;
1141
+ const nextVersion = `^${version}`;
1142
+ const targetVersion = targetDevDeps[depName];
1143
+ if (!isWorkspace(targetVersion) && shouldAssignVersion(targetVersion, nextVersion)) {
1144
+ targetDevDeps[depName] = nextVersion;
1145
+ }
1146
+ } else {
1147
+ const targetVersion = targetDevDeps[depName];
1148
+ if (isWorkspace(targetVersion)) {
1149
+ continue;
1150
+ }
1151
+ if (shouldAssignVersion(targetVersion, depVersion)) {
1152
+ targetDevDeps[depName] = depVersion;
1153
+ }
1103
1154
  }
1104
1155
  }
1105
1156
  if (Object.keys(targetDevDeps).length) {
@@ -1199,38 +1250,50 @@ async function upgradeMonorepo(opts) {
1199
1250
  continue;
1200
1251
  }
1201
1252
  const targetPath = import_pathe11.default.resolve(absOutDir, relPath);
1202
- if (relPath === "package.json") {
1203
- if (!await import_fs_extra7.default.pathExists(targetPath)) {
1253
+ try {
1254
+ if (relPath === "package.json") {
1255
+ if (!await import_fs_extra7.default.pathExists(targetPath)) {
1256
+ continue;
1257
+ }
1258
+ const sourcePkgJson = await import_fs_extra7.default.readJson(file.path);
1259
+ const targetPkgJson = await import_fs_extra7.default.readJson(targetPath);
1260
+ setPkgJson(sourcePkgJson, targetPkgJson, { scripts: scriptOverrides });
1261
+ const data = `${JSON.stringify(targetPkgJson, void 0, 2)}
1262
+ `;
1263
+ if (await shouldWriteFile(targetPath, { skipOverwrite, source: data, promptLabel: relPath })) {
1264
+ await import_fs_extra7.default.outputFile(targetPath, data, "utf8");
1265
+ logger.success(targetPath);
1266
+ }
1204
1267
  continue;
1205
1268
  }
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)}
1269
+ if (relPath === ".changeset/config.json" && repoName) {
1270
+ const changesetJson = await import_fs_extra7.default.readJson(file.path);
1271
+ (0, import_set_value6.default)(changesetJson, "changelog.1.repo", repoName);
1272
+ const data = `${JSON.stringify(changesetJson, void 0, 2)}
1210
1273
  `;
1211
- if (await shouldWriteFile(targetPath, { skipOverwrite, source: data, promptLabel: relPath })) {
1212
- await import_fs_extra7.default.outputFile(targetPath, data, "utf8");
1213
- logger.success(targetPath);
1274
+ if (await shouldWriteFile(targetPath, { skipOverwrite, source: data, promptLabel: relPath })) {
1275
+ await import_fs_extra7.default.outputFile(targetPath, data, "utf8");
1276
+ logger.success(targetPath);
1277
+ }
1278
+ continue;
1214
1279
  }
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");
1280
+ if (relPath === "LICENSE") {
1281
+ const source = await import_fs_extra7.default.readFile(file.path);
1282
+ if (await shouldWriteFile(targetPath, { skipOverwrite: true, source, promptLabel: relPath })) {
1283
+ await import_fs_extra7.default.copy(file.path, targetPath);
1284
+ logger.success(targetPath);
1285
+ }
1286
+ continue;
1287
+ }
1288
+ if (await shouldWriteFile(targetPath, { skipOverwrite, source: await import_fs_extra7.default.readFile(file.path), promptLabel: relPath })) {
1289
+ await import_fs_extra7.default.copy(file.path, targetPath);
1224
1290
  logger.success(targetPath);
1225
1291
  }
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);
1292
+ } catch (error) {
1293
+ if (isIgnorableFsError(error)) {
1294
+ continue;
1295
+ }
1296
+ throw error;
1234
1297
  }
1235
1298
  }
1236
1299
  }
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-NHJHKD7Y.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.9";
641
642
 
642
643
  // src/constants.ts
643
644
  var packageJsonPath = (0, import_node_url.fileURLToPath)(new URL("../package.json", importMetaUrl));
@@ -1020,8 +1021,19 @@ var import_fs_extra7 = __toESM(require("fs-extra"), 1);
1020
1021
  var import_klaw = __toESM(require("klaw"), 1);
1021
1022
  var import_pathe11 = __toESM(require("pathe"), 1);
1022
1023
  var import_picocolors3 = __toESM(require("picocolors"), 1);
1024
+ var import_semver = require("semver");
1023
1025
  var import_set_value6 = __toESM(require_set_value(), 1);
1024
1026
 
1027
+ // src/utils/fs.ts
1028
+ init_cjs_shims();
1029
+ function isIgnorableFsError(error) {
1030
+ if (!error) {
1031
+ return false;
1032
+ }
1033
+ const code = error.code;
1034
+ return code === "ENOENT" || code === "EBUSY" || code === "EEXIST";
1035
+ }
1036
+
1025
1037
  // src/utils/hash.ts
1026
1038
  init_cjs_shims();
1027
1039
  var import_node_crypto = __toESM(require("crypto"), 1);
@@ -1110,17 +1122,44 @@ function isWorkspace(version2) {
1110
1122
  }
1111
1123
  return false;
1112
1124
  }
1125
+ function parseVersion(input) {
1126
+ if (typeof input !== "string" || input.trim().length === 0) {
1127
+ return null;
1128
+ }
1129
+ return (0, import_semver.minVersion)(input) ?? (0, import_semver.coerce)(input);
1130
+ }
1131
+ function shouldAssignVersion(currentVersion, nextVersion) {
1132
+ if (typeof currentVersion !== "string" || currentVersion.trim().length === 0) {
1133
+ return true;
1134
+ }
1135
+ if (currentVersion === nextVersion) {
1136
+ return false;
1137
+ }
1138
+ const current = parseVersion(currentVersion);
1139
+ const next = parseVersion(nextVersion);
1140
+ if (!current || !next) {
1141
+ return true;
1142
+ }
1143
+ return !(0, import_semver.gte)(current, next);
1144
+ }
1113
1145
  function setPkgJson(sourcePkgJson, targetPkgJson, options) {
1114
- const packageManager = index_default(sourcePkgJson, "packageManager", { default: "" });
1115
- const sourceDeps = index_default(sourcePkgJson, "dependencies", { default: {} });
1116
- const sourceDevDeps = index_default(sourcePkgJson, "devDependencies", { default: {} });
1117
- const targetDeps = { ...index_default(targetPkgJson, "dependencies", { default: {} }) };
1118
- const targetDevDeps = { ...index_default(targetPkgJson, "devDependencies", { default: {} }) };
1146
+ const packageManager = sourcePkgJson.packageManager ?? "";
1147
+ const sourceDeps = sourcePkgJson.dependencies ?? {};
1148
+ const sourceDevDeps = sourcePkgJson.devDependencies ?? {};
1149
+ const targetDeps = { ...targetPkgJson.dependencies ?? {} };
1150
+ const targetDevDeps = { ...targetPkgJson.devDependencies ?? {} };
1119
1151
  if (packageManager) {
1120
1152
  targetPkgJson.packageManager = packageManager;
1121
1153
  }
1122
1154
  for (const [depName, depVersion] of Object.entries(sourceDeps)) {
1123
- if (!isWorkspace(targetDeps[depName])) {
1155
+ if (typeof depVersion !== "string") {
1156
+ continue;
1157
+ }
1158
+ const targetVersion = targetDeps[depName];
1159
+ if (isWorkspace(targetVersion)) {
1160
+ continue;
1161
+ }
1162
+ if (shouldAssignVersion(targetVersion, depVersion)) {
1124
1163
  targetDeps[depName] = depVersion;
1125
1164
  }
1126
1165
  }
@@ -1128,10 +1167,23 @@ function setPkgJson(sourcePkgJson, targetPkgJson, options) {
1128
1167
  targetPkgJson.dependencies = targetDeps;
1129
1168
  }
1130
1169
  for (const [depName, depVersion] of Object.entries(sourceDevDeps)) {
1170
+ if (typeof depVersion !== "string") {
1171
+ continue;
1172
+ }
1131
1173
  if (depName === name) {
1132
- targetDevDeps[depName] = `^${version}`;
1133
- } else if (!isWorkspace(targetDevDeps[depName])) {
1134
- targetDevDeps[depName] = depVersion;
1174
+ const nextVersion = `^${version}`;
1175
+ const targetVersion = targetDevDeps[depName];
1176
+ if (!isWorkspace(targetVersion) && shouldAssignVersion(targetVersion, nextVersion)) {
1177
+ targetDevDeps[depName] = nextVersion;
1178
+ }
1179
+ } else {
1180
+ const targetVersion = targetDevDeps[depName];
1181
+ if (isWorkspace(targetVersion)) {
1182
+ continue;
1183
+ }
1184
+ if (shouldAssignVersion(targetVersion, depVersion)) {
1185
+ targetDevDeps[depName] = depVersion;
1186
+ }
1135
1187
  }
1136
1188
  }
1137
1189
  if (Object.keys(targetDevDeps).length) {
@@ -1231,38 +1283,50 @@ async function upgradeMonorepo(opts) {
1231
1283
  continue;
1232
1284
  }
1233
1285
  const targetPath = import_pathe11.default.resolve(absOutDir, relPath);
1234
- if (relPath === "package.json") {
1235
- if (!await import_fs_extra7.default.pathExists(targetPath)) {
1286
+ try {
1287
+ if (relPath === "package.json") {
1288
+ if (!await import_fs_extra7.default.pathExists(targetPath)) {
1289
+ continue;
1290
+ }
1291
+ const sourcePkgJson = await import_fs_extra7.default.readJson(file.path);
1292
+ const targetPkgJson = await import_fs_extra7.default.readJson(targetPath);
1293
+ setPkgJson(sourcePkgJson, targetPkgJson, { scripts: scriptOverrides });
1294
+ const data = `${JSON.stringify(targetPkgJson, void 0, 2)}
1295
+ `;
1296
+ if (await shouldWriteFile(targetPath, { skipOverwrite, source: data, promptLabel: relPath })) {
1297
+ await import_fs_extra7.default.outputFile(targetPath, data, "utf8");
1298
+ logger.success(targetPath);
1299
+ }
1236
1300
  continue;
1237
1301
  }
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)}
1302
+ if (relPath === ".changeset/config.json" && repoName) {
1303
+ const changesetJson = await import_fs_extra7.default.readJson(file.path);
1304
+ (0, import_set_value6.default)(changesetJson, "changelog.1.repo", repoName);
1305
+ const data = `${JSON.stringify(changesetJson, void 0, 2)}
1242
1306
  `;
1243
- if (await shouldWriteFile(targetPath, { skipOverwrite, source: data, promptLabel: relPath })) {
1244
- await import_fs_extra7.default.outputFile(targetPath, data, "utf8");
1245
- logger.success(targetPath);
1307
+ if (await shouldWriteFile(targetPath, { skipOverwrite, source: data, promptLabel: relPath })) {
1308
+ await import_fs_extra7.default.outputFile(targetPath, data, "utf8");
1309
+ logger.success(targetPath);
1310
+ }
1311
+ continue;
1246
1312
  }
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");
1313
+ if (relPath === "LICENSE") {
1314
+ const source = await import_fs_extra7.default.readFile(file.path);
1315
+ if (await shouldWriteFile(targetPath, { skipOverwrite: true, source, promptLabel: relPath })) {
1316
+ await import_fs_extra7.default.copy(file.path, targetPath);
1317
+ logger.success(targetPath);
1318
+ }
1319
+ continue;
1320
+ }
1321
+ if (await shouldWriteFile(targetPath, { skipOverwrite, source: await import_fs_extra7.default.readFile(file.path), promptLabel: relPath })) {
1322
+ await import_fs_extra7.default.copy(file.path, targetPath);
1256
1323
  logger.success(targetPath);
1257
1324
  }
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);
1325
+ } catch (error) {
1326
+ if (isIgnorableFsError(error)) {
1327
+ continue;
1328
+ }
1329
+ throw error;
1266
1330
  }
1267
1331
  }
1268
1332
  }
@@ -1282,6 +1346,7 @@ async function upgradeMonorepo(opts) {
1282
1346
  getWorkspacePackages,
1283
1347
  init,
1284
1348
  isFileChanged,
1349
+ isIgnorableFsError,
1285
1350
  isMatch,
1286
1351
  loadMonorepoConfig,
1287
1352
  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.9";
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.9";
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-NHJHKD7Y.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.9",
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",
@@ -55,6 +55,7 @@
55
55
  "p-queue": "^9.0.0",
56
56
  "pathe": "^2.0.3",
57
57
  "picocolors": "^1.1.1",
58
+ "semver": "^7.7.3",
58
59
  "simple-git": "^3.28.0"
59
60
  },
60
61
  "devDependencies": {
@@ -14,18 +14,18 @@
14
14
  "postinstall": "pnpm cf-typegen"
15
15
  },
16
16
  "dependencies": {
17
- "@faker-js/faker": "^10.0.0",
18
- "@tanstack/vue-query": "^5.90.2",
17
+ "@faker-js/faker": "^10.1.0",
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
- "@cloudflare/vite-plugin": "^1.13.12",
28
+ "@cloudflare/vite-plugin": "^1.13.13",
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.11",
36
+ "hono": "^4.9.12",
37
37
  "tailwindcss": "^4.1.14",
38
38
  "typescript": "~5.9.3",
39
- "unplugin-vue-router": "^0.15.0",
40
- "vite": "^7.1.9",
39
+ "unplugin-vue-router": "^0.16.0",
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.2",
44
+ "wrangler": "^4.43.0",
45
45
  "zod": "^4.1.12"
46
46
  }
47
47
  }
@@ -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,8 +52,8 @@
52
52
  },
53
53
  "devDependencies": {
54
54
  "@hono/node-server": "^1.19.5",
55
- "hono": "^4.9.11",
56
- "wrangler": "^4.42.2",
55
+ "hono": "^4.9.12",
56
+ "wrangler": "^4.43.0",
57
57
  "zod": "^4.1.12"
58
58
  }
59
59
  }
@@ -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
  })
@@ -51,11 +51,11 @@
51
51
  "@vue/tsconfig": "^0.8.1",
52
52
  "jsdom": "^27.0.0",
53
53
  "tailwindcss": "^4.1.14",
54
- "unplugin-vue-router": "^0.15.0",
55
- "vite": "^7.1.9",
54
+ "unplugin-vue-router": "^0.16.0",
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
  }