@icebreakers/monorepo 2.0.8 → 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.
@@ -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
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",
@@ -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.8";
581
+ var version = "2.0.9";
582
582
 
583
583
  // src/constants.ts
584
584
  init_esm_shims();
@@ -1005,15 +1005,16 @@ function isMatch(str, arr) {
1005
1005
 
1006
1006
  // src/commands/upgrade/index.ts
1007
1007
  init_esm_shims();
1008
+ var import_set_value6 = __toESM(require_set_value(), 1);
1008
1009
  import { Buffer as Buffer2 } from "buffer";
1009
1010
  import process2 from "process";
1010
1011
  import checkbox2 from "@inquirer/checkbox";
1011
1012
  import confirm from "@inquirer/confirm";
1012
1013
  import fs7 from "fs-extra";
1013
- var import_set_value6 = __toESM(require_set_value(), 1);
1014
1014
  import klaw from "klaw";
1015
1015
  import path13 from "pathe";
1016
1016
  import pc3 from "picocolors";
1017
+ import { coerce, gte, minVersion } from "semver";
1017
1018
 
1018
1019
  // src/commands/upgrade/scripts.ts
1019
1020
  init_esm_shims();
@@ -1070,17 +1071,44 @@ function isWorkspace(version2) {
1070
1071
  }
1071
1072
  return false;
1072
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
+ }
1073
1094
  function setPkgJson(sourcePkgJson, targetPkgJson, options) {
1074
- const packageManager = index_default(sourcePkgJson, "packageManager", { default: "" });
1075
- const sourceDeps = index_default(sourcePkgJson, "dependencies", { default: {} });
1076
- const sourceDevDeps = index_default(sourcePkgJson, "devDependencies", { default: {} });
1077
- const targetDeps = { ...index_default(targetPkgJson, "dependencies", { default: {} }) };
1078
- 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 ?? {} };
1079
1100
  if (packageManager) {
1080
1101
  targetPkgJson.packageManager = packageManager;
1081
1102
  }
1082
1103
  for (const [depName, depVersion] of Object.entries(sourceDeps)) {
1083
- 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)) {
1084
1112
  targetDeps[depName] = depVersion;
1085
1113
  }
1086
1114
  }
@@ -1088,10 +1116,23 @@ function setPkgJson(sourcePkgJson, targetPkgJson, options) {
1088
1116
  targetPkgJson.dependencies = targetDeps;
1089
1117
  }
1090
1118
  for (const [depName, depVersion] of Object.entries(sourceDevDeps)) {
1119
+ if (typeof depVersion !== "string") {
1120
+ continue;
1121
+ }
1091
1122
  if (depName === name) {
1092
- targetDevDeps[depName] = `^${version}`;
1093
- } else if (!isWorkspace(targetDevDeps[depName])) {
1094
- 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
+ }
1095
1136
  }
1096
1137
  }
1097
1138
  if (Object.keys(targetDevDeps).length) {
package/dist/cli.cjs CHANGED
@@ -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.8";
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,6 +988,7 @@ 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
 
993
994
  // src/utils/fs.ts
@@ -1088,17 +1089,44 @@ function isWorkspace(version2) {
1088
1089
  }
1089
1090
  return false;
1090
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
+ }
1091
1112
  function setPkgJson(sourcePkgJson, targetPkgJson, options) {
1092
- const packageManager = index_default(sourcePkgJson, "packageManager", { default: "" });
1093
- const sourceDeps = index_default(sourcePkgJson, "dependencies", { default: {} });
1094
- const sourceDevDeps = index_default(sourcePkgJson, "devDependencies", { default: {} });
1095
- const targetDeps = { ...index_default(targetPkgJson, "dependencies", { default: {} }) };
1096
- 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 ?? {} };
1097
1118
  if (packageManager) {
1098
1119
  targetPkgJson.packageManager = packageManager;
1099
1120
  }
1100
1121
  for (const [depName, depVersion] of Object.entries(sourceDeps)) {
1101
- 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)) {
1102
1130
  targetDeps[depName] = depVersion;
1103
1131
  }
1104
1132
  }
@@ -1106,10 +1134,23 @@ function setPkgJson(sourcePkgJson, targetPkgJson, options) {
1106
1134
  targetPkgJson.dependencies = targetDeps;
1107
1135
  }
1108
1136
  for (const [depName, depVersion] of Object.entries(sourceDevDeps)) {
1137
+ if (typeof depVersion !== "string") {
1138
+ continue;
1139
+ }
1109
1140
  if (depName === name) {
1110
- targetDevDeps[depName] = `^${version}`;
1111
- } else if (!isWorkspace(targetDevDeps[depName])) {
1112
- 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
+ }
1113
1154
  }
1114
1155
  }
1115
1156
  if (Object.keys(targetDevDeps).length) {
package/dist/cli.js CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  syncNpmMirror,
13
13
  upgradeMonorepo,
14
14
  version
15
- } from "./chunk-4R64J5LE.js";
15
+ } from "./chunk-NHJHKD7Y.js";
16
16
 
17
17
  // src/cli.ts
18
18
  init_esm_shims();
package/dist/index.cjs CHANGED
@@ -638,7 +638,7 @@ var import_node_url = require("url");
638
638
 
639
639
  // package.json
640
640
  var name = "@icebreakers/monorepo";
641
- var version = "2.0.8";
641
+ var version = "2.0.9";
642
642
 
643
643
  // src/constants.ts
644
644
  var packageJsonPath = (0, import_node_url.fileURLToPath)(new URL("../package.json", importMetaUrl));
@@ -1021,6 +1021,7 @@ var import_fs_extra7 = __toESM(require("fs-extra"), 1);
1021
1021
  var import_klaw = __toESM(require("klaw"), 1);
1022
1022
  var import_pathe11 = __toESM(require("pathe"), 1);
1023
1023
  var import_picocolors3 = __toESM(require("picocolors"), 1);
1024
+ var import_semver = require("semver");
1024
1025
  var import_set_value6 = __toESM(require_set_value(), 1);
1025
1026
 
1026
1027
  // src/utils/fs.ts
@@ -1121,17 +1122,44 @@ function isWorkspace(version2) {
1121
1122
  }
1122
1123
  return false;
1123
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
+ }
1124
1145
  function setPkgJson(sourcePkgJson, targetPkgJson, options) {
1125
- const packageManager = index_default(sourcePkgJson, "packageManager", { default: "" });
1126
- const sourceDeps = index_default(sourcePkgJson, "dependencies", { default: {} });
1127
- const sourceDevDeps = index_default(sourcePkgJson, "devDependencies", { default: {} });
1128
- const targetDeps = { ...index_default(targetPkgJson, "dependencies", { default: {} }) };
1129
- 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 ?? {} };
1130
1151
  if (packageManager) {
1131
1152
  targetPkgJson.packageManager = packageManager;
1132
1153
  }
1133
1154
  for (const [depName, depVersion] of Object.entries(sourceDeps)) {
1134
- 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)) {
1135
1163
  targetDeps[depName] = depVersion;
1136
1164
  }
1137
1165
  }
@@ -1139,10 +1167,23 @@ function setPkgJson(sourcePkgJson, targetPkgJson, options) {
1139
1167
  targetPkgJson.dependencies = targetDeps;
1140
1168
  }
1141
1169
  for (const [depName, depVersion] of Object.entries(sourceDevDeps)) {
1170
+ if (typeof depVersion !== "string") {
1171
+ continue;
1172
+ }
1142
1173
  if (depName === name) {
1143
- targetDevDeps[depName] = `^${version}`;
1144
- } else if (!isWorkspace(targetDevDeps[depName])) {
1145
- 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
+ }
1146
1187
  }
1147
1188
  }
1148
1189
  if (Object.keys(targetDevDeps).length) {
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.8";
272
+ var version = "2.0.9";
273
273
 
274
274
  /**
275
275
  * @icebreakers/monorepo 包的根目录,所有模板与资产目录都以此为基准。
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.8";
272
+ var version = "2.0.9";
273
273
 
274
274
  /**
275
275
  * @icebreakers/monorepo 包的根目录,所有模板与资产目录都以此为基准。
package/dist/index.js CHANGED
@@ -28,7 +28,7 @@ import {
28
28
  templatesDir,
29
29
  upgradeMonorepo,
30
30
  version
31
- } from "./chunk-4R64J5LE.js";
31
+ } from "./chunk-NHJHKD7Y.js";
32
32
 
33
33
  // src/index.ts
34
34
  init_esm_shims();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@icebreakers/monorepo",
3
3
  "type": "module",
4
- "version": "2.0.8",
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",
@@ -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,7 +14,7 @@
14
14
  "postinstall": "pnpm cf-typegen"
15
15
  },
16
16
  "dependencies": {
17
- "@faker-js/faker": "^10.0.0",
17
+ "@faker-js/faker": "^10.1.0",
18
18
  "@tanstack/vue-query": "^5.90.3",
19
19
  "@tanstack/vue-table": "^8.21.3",
20
20
  "@tanstack/vue-virtual": "^3.13.12",
@@ -25,7 +25,7 @@
25
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",
@@ -36,12 +36,12 @@
36
36
  "hono": "^4.9.12",
37
37
  "tailwindcss": "^4.1.14",
38
38
  "typescript": "~5.9.3",
39
- "unplugin-vue-router": "^0.15.0",
39
+ "unplugin-vue-router": "^0.16.0",
40
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
  }
@@ -53,7 +53,7 @@
53
53
  "devDependencies": {
54
54
  "@hono/node-server": "^1.19.5",
55
55
  "hono": "^4.9.12",
56
- "wrangler": "^4.42.2",
56
+ "wrangler": "^4.43.0",
57
57
  "zod": "^4.1.12"
58
58
  }
59
59
  }
@@ -51,7 +51,7 @@
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",
54
+ "unplugin-vue-router": "^0.16.0",
55
55
  "vite": "^7.1.10",
56
56
  "vite-plugin-dts": "^4.5.4",
57
57
  "vue": "^3.5.22",