@icebreakers/monorepo 2.0.9 → 2.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/package.json +1 -1
- package/dist/{chunk-NHJHKD7Y.js → chunk-T3OVPIEE.js} +270 -142
- package/dist/cli.cjs +254 -135
- package/dist/cli.js +1 -1
- package/dist/index.cjs +266 -135
- package/dist/index.d.cts +16 -2
- package/dist/index.d.ts +16 -2
- package/dist/index.js +7 -1
- package/package.json +1 -2
- package/templates/apps/client/package.json +3 -3
- package/templates/apps/client/wrangler.jsonc +1 -1
- package/templates/apps/server/package.json +1 -1
- package/templates/apps/server/wrangler.jsonc +1 -1
- package/templates/packages/vue-lib-template/package.json +1 -1
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.
|
|
31
|
+
// ../../node_modules/.pnpm/tsup@8.5.0_@microsoft+api-extractor@7.52.12_@types+node@24.8.0__jiti@2.6.1_postcss@8.5._ab94ebbbd28243190e5d9689f774411e/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.
|
|
34
|
+
"../../node_modules/.pnpm/tsup@8.5.0_@microsoft+api-extractor@7.52.12_@types+node@24.8.0__jiti@2.6.1_postcss@8.5._ab94ebbbd28243190e5d9689f774411e/node_modules/tsup/assets/cjs_shims.js"() {
|
|
35
35
|
"use strict";
|
|
36
36
|
getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
|
|
37
37
|
importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
@@ -605,7 +605,7 @@ var import_node_url = require("url");
|
|
|
605
605
|
|
|
606
606
|
// package.json
|
|
607
607
|
var name = "@icebreakers/monorepo";
|
|
608
|
-
var version = "2.0.
|
|
608
|
+
var version = "2.0.11";
|
|
609
609
|
|
|
610
610
|
// src/constants.ts
|
|
611
611
|
var packageJsonPath = (0, import_node_url.fileURLToPath)(new URL("../package.json", importMetaUrl));
|
|
@@ -619,6 +619,82 @@ init_cjs_shims();
|
|
|
619
619
|
var import_consola = require("consola");
|
|
620
620
|
var logger = (0, import_consola.createConsola)();
|
|
621
621
|
|
|
622
|
+
// src/utils/fs.ts
|
|
623
|
+
init_cjs_shims();
|
|
624
|
+
function isIgnorableFsError(error) {
|
|
625
|
+
if (!error) {
|
|
626
|
+
return false;
|
|
627
|
+
}
|
|
628
|
+
const code = error.code;
|
|
629
|
+
return code === "ENOENT" || code === "EBUSY" || code === "EEXIST";
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
// src/utils/gitignore.ts
|
|
633
|
+
init_cjs_shims();
|
|
634
|
+
var publishBasename = "gitignore";
|
|
635
|
+
var workspaceBasename = ".gitignore";
|
|
636
|
+
function detectSeparator(input2) {
|
|
637
|
+
if (input2.includes("\\") && !input2.includes("/")) {
|
|
638
|
+
return "\\";
|
|
639
|
+
}
|
|
640
|
+
return "/";
|
|
641
|
+
}
|
|
642
|
+
function replaceBasename(input2, from, to) {
|
|
643
|
+
if (!input2) {
|
|
644
|
+
return input2;
|
|
645
|
+
}
|
|
646
|
+
const separator = detectSeparator(input2);
|
|
647
|
+
const normalized = input2.replace(/[\\/]/g, separator);
|
|
648
|
+
const hasTrailingSeparator = normalized.endsWith(separator);
|
|
649
|
+
const segments = normalized.split(separator);
|
|
650
|
+
if (hasTrailingSeparator && segments[segments.length - 1] === "") {
|
|
651
|
+
segments.pop();
|
|
652
|
+
}
|
|
653
|
+
const lastIndex = segments.length - 1;
|
|
654
|
+
if (lastIndex >= 0 && segments[lastIndex] === from) {
|
|
655
|
+
segments[lastIndex] = to;
|
|
656
|
+
const rebuilt = segments.join(separator);
|
|
657
|
+
return hasTrailingSeparator ? `${rebuilt}${separator}` : rebuilt;
|
|
658
|
+
}
|
|
659
|
+
return input2;
|
|
660
|
+
}
|
|
661
|
+
function toWorkspaceGitignorePath(input2) {
|
|
662
|
+
return replaceBasename(input2, publishBasename, workspaceBasename);
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
// src/utils/hash.ts
|
|
666
|
+
init_cjs_shims();
|
|
667
|
+
var import_node_crypto = __toESM(require("crypto"), 1);
|
|
668
|
+
function getFileHash(data) {
|
|
669
|
+
const hashSum = import_node_crypto.default.createHash("md5");
|
|
670
|
+
hashSum.update(data);
|
|
671
|
+
return hashSum.digest("hex");
|
|
672
|
+
}
|
|
673
|
+
function isFileChanged(src, dest) {
|
|
674
|
+
try {
|
|
675
|
+
const currentHash = getFileHash(src);
|
|
676
|
+
const previousHash = getFileHash(dest);
|
|
677
|
+
return currentHash !== previousHash;
|
|
678
|
+
} catch (err) {
|
|
679
|
+
logger.error("Error calculating file hash:", err);
|
|
680
|
+
return false;
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
// src/utils/regexp.ts
|
|
685
|
+
init_cjs_shims();
|
|
686
|
+
function escapeStringRegexp(str) {
|
|
687
|
+
return str.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
|
|
688
|
+
}
|
|
689
|
+
function isMatch(str, arr) {
|
|
690
|
+
for (const reg of arr) {
|
|
691
|
+
if (reg.test(str)) {
|
|
692
|
+
return true;
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
return false;
|
|
696
|
+
}
|
|
697
|
+
|
|
622
698
|
// src/commands/create.ts
|
|
623
699
|
var templateMap = {
|
|
624
700
|
"tsup": "packages/tsup-template",
|
|
@@ -678,7 +754,7 @@ async function createNewProject(options) {
|
|
|
678
754
|
const shouldSkip = (src) => import_pathe4.default.basename(src) === ".DS_Store";
|
|
679
755
|
const copyTasks = filelist.filter((filename) => filename !== "package.json").map(async (filename) => {
|
|
680
756
|
const sourcePath = import_pathe4.default.resolve(from, filename);
|
|
681
|
-
const targetPath = import_pathe4.default.resolve(to, filename
|
|
757
|
+
const targetPath = import_pathe4.default.resolve(to, toWorkspaceGitignorePath(filename));
|
|
682
758
|
await import_fs_extra2.default.copy(sourcePath, targetPath, {
|
|
683
759
|
filter(src) {
|
|
684
760
|
if (shouldSkip(src)) {
|
|
@@ -980,60 +1056,105 @@ ${Array.from(set7).map((x) => `- ${import_picocolors2.default.green(x ?? "")}`).
|
|
|
980
1056
|
|
|
981
1057
|
// src/commands/upgrade/index.ts
|
|
982
1058
|
init_cjs_shims();
|
|
983
|
-
var import_node_buffer = require("buffer");
|
|
984
1059
|
var import_node_process2 = __toESM(require("process"), 1);
|
|
985
|
-
var
|
|
986
|
-
var
|
|
987
|
-
var import_fs_extra7 = __toESM(require("fs-extra"), 1);
|
|
1060
|
+
var import_checkbox3 = __toESM(require("@inquirer/checkbox"), 1);
|
|
1061
|
+
var import_fs_extra8 = __toESM(require("fs-extra"), 1);
|
|
988
1062
|
var import_klaw = __toESM(require("klaw"), 1);
|
|
989
1063
|
var import_pathe11 = __toESM(require("pathe"), 1);
|
|
990
|
-
var import_picocolors3 = __toESM(require("picocolors"), 1);
|
|
991
|
-
var import_semver = require("semver");
|
|
992
1064
|
var import_set_value6 = __toESM(require_set_value(), 1);
|
|
993
1065
|
|
|
994
|
-
// src/
|
|
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
|
-
|
|
1004
|
-
// src/utils/hash.ts
|
|
1066
|
+
// src/commands/upgrade/overwrite.ts
|
|
1005
1067
|
init_cjs_shims();
|
|
1006
|
-
var
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1068
|
+
var import_node_buffer = require("buffer");
|
|
1069
|
+
var import_checkbox2 = __toESM(require("@inquirer/checkbox"), 1);
|
|
1070
|
+
var import_fs_extra7 = __toESM(require("fs-extra"), 1);
|
|
1071
|
+
var import_picocolors3 = __toESM(require("picocolors"), 1);
|
|
1072
|
+
function asBuffer(data) {
|
|
1073
|
+
return typeof data === "string" ? import_node_buffer.Buffer.from(data) : data;
|
|
1011
1074
|
}
|
|
1012
|
-
function
|
|
1075
|
+
async function evaluateWriteIntent(targetPath, options) {
|
|
1076
|
+
const { skipOverwrite, source } = options;
|
|
1077
|
+
const exists = await import_fs_extra7.default.pathExists(targetPath);
|
|
1078
|
+
if (!exists) {
|
|
1079
|
+
return {
|
|
1080
|
+
type: "write",
|
|
1081
|
+
reason: "missing"
|
|
1082
|
+
};
|
|
1083
|
+
}
|
|
1084
|
+
if (skipOverwrite) {
|
|
1085
|
+
return {
|
|
1086
|
+
type: "skip",
|
|
1087
|
+
reason: "skipOverwrite"
|
|
1088
|
+
};
|
|
1089
|
+
}
|
|
1090
|
+
const src = asBuffer(source);
|
|
1091
|
+
let destSize = 0;
|
|
1013
1092
|
try {
|
|
1014
|
-
const
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1093
|
+
const stat = await import_fs_extra7.default.stat(targetPath);
|
|
1094
|
+
destSize = stat.size;
|
|
1095
|
+
} catch {
|
|
1096
|
+
return {
|
|
1097
|
+
type: "write",
|
|
1098
|
+
reason: "missing"
|
|
1099
|
+
};
|
|
1020
1100
|
}
|
|
1101
|
+
if (destSize !== src.length) {
|
|
1102
|
+
return {
|
|
1103
|
+
type: "prompt",
|
|
1104
|
+
reason: "changed"
|
|
1105
|
+
};
|
|
1106
|
+
}
|
|
1107
|
+
const dest = await import_fs_extra7.default.readFile(targetPath);
|
|
1108
|
+
if (!isFileChanged(src, dest)) {
|
|
1109
|
+
return {
|
|
1110
|
+
type: "skip",
|
|
1111
|
+
reason: "identical"
|
|
1112
|
+
};
|
|
1113
|
+
}
|
|
1114
|
+
return {
|
|
1115
|
+
type: "prompt",
|
|
1116
|
+
reason: "changed"
|
|
1117
|
+
};
|
|
1021
1118
|
}
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1119
|
+
async function scheduleOverwrite(intent, options) {
|
|
1120
|
+
const { relPath, targetPath, action, pending } = options;
|
|
1121
|
+
if (intent.type === "write") {
|
|
1122
|
+
await action();
|
|
1123
|
+
return;
|
|
1124
|
+
}
|
|
1125
|
+
if (intent.type === "prompt") {
|
|
1126
|
+
pending.push({
|
|
1127
|
+
relPath,
|
|
1128
|
+
targetPath,
|
|
1129
|
+
action
|
|
1130
|
+
});
|
|
1131
|
+
}
|
|
1027
1132
|
}
|
|
1028
|
-
function
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1133
|
+
async function flushPendingOverwrites(pending) {
|
|
1134
|
+
if (!pending.length) {
|
|
1135
|
+
return;
|
|
1136
|
+
}
|
|
1137
|
+
const selected = await (0, import_checkbox2.default)({
|
|
1138
|
+
message: "\u68C0\u6D4B\u5230\u4EE5\u4E0B\u6587\u4EF6\u5185\u5BB9\u4E0E\u5F53\u524D\u4ED3\u5E93\u4E0D\u540C\uFF0C\u9009\u62E9\u9700\u8981\u8986\u76D6\u7684\u6587\u4EF6",
|
|
1139
|
+
choices: pending.map((item) => ({
|
|
1140
|
+
name: import_picocolors3.default.greenBright(item.relPath),
|
|
1141
|
+
value: item.targetPath,
|
|
1142
|
+
checked: false
|
|
1143
|
+
})),
|
|
1144
|
+
loop: false
|
|
1145
|
+
});
|
|
1146
|
+
const selectedSet = new Set(selected);
|
|
1147
|
+
for (const item of pending) {
|
|
1148
|
+
if (selectedSet.has(item.targetPath)) {
|
|
1149
|
+
await item.action();
|
|
1032
1150
|
}
|
|
1033
1151
|
}
|
|
1034
|
-
return false;
|
|
1035
1152
|
}
|
|
1036
1153
|
|
|
1154
|
+
// src/commands/upgrade/pkg-json.ts
|
|
1155
|
+
init_cjs_shims();
|
|
1156
|
+
var import_semver = require("semver");
|
|
1157
|
+
|
|
1037
1158
|
// src/commands/upgrade/scripts.ts
|
|
1038
1159
|
init_cjs_shims();
|
|
1039
1160
|
var scripts = {
|
|
@@ -1045,44 +1166,7 @@ var scripts = {
|
|
|
1045
1166
|
};
|
|
1046
1167
|
var scriptsEntries = Object.entries(scripts);
|
|
1047
1168
|
|
|
1048
|
-
// src/commands/upgrade/
|
|
1049
|
-
init_cjs_shims();
|
|
1050
|
-
function getAssetTargets(raw) {
|
|
1051
|
-
const list = [
|
|
1052
|
-
".changeset",
|
|
1053
|
-
".husky",
|
|
1054
|
-
".vscode",
|
|
1055
|
-
".editorconfig",
|
|
1056
|
-
".gitattributes",
|
|
1057
|
-
".gitignore",
|
|
1058
|
-
".npmrc",
|
|
1059
|
-
"commitlint.config.ts",
|
|
1060
|
-
"eslint.config.js",
|
|
1061
|
-
"lint-staged.config.js",
|
|
1062
|
-
"stylelint.config.js",
|
|
1063
|
-
"monorepo.config.ts",
|
|
1064
|
-
"package.json",
|
|
1065
|
-
// pnpm
|
|
1066
|
-
"pnpm-workspace.yaml",
|
|
1067
|
-
// base tsconfig
|
|
1068
|
-
"tsconfig.json",
|
|
1069
|
-
// turbo
|
|
1070
|
-
"turbo.json",
|
|
1071
|
-
// vitest
|
|
1072
|
-
"vitest.config.ts",
|
|
1073
|
-
// 'vitest.workspace.ts',
|
|
1074
|
-
// #region docker
|
|
1075
|
-
"Dockerfile",
|
|
1076
|
-
".dockerignore"
|
|
1077
|
-
// #endregion
|
|
1078
|
-
];
|
|
1079
|
-
if (!raw) {
|
|
1080
|
-
list.push(".github", "LICENSE", "renovate.json", "SECURITY.md", "CODE_OF_CONDUCT.md", "CONTRIBUTING.md", "netlify.toml");
|
|
1081
|
-
}
|
|
1082
|
-
return list;
|
|
1083
|
-
}
|
|
1084
|
-
|
|
1085
|
-
// src/commands/upgrade/index.ts
|
|
1169
|
+
// src/commands/upgrade/pkg-json.ts
|
|
1086
1170
|
function isWorkspace(version2) {
|
|
1087
1171
|
if (typeof version2 === "string") {
|
|
1088
1172
|
return version2.startsWith("workspace:");
|
|
@@ -1165,38 +1249,45 @@ function setPkgJson(sourcePkgJson, targetPkgJson, options) {
|
|
|
1165
1249
|
targetPkgJson.scripts = scripts2;
|
|
1166
1250
|
}
|
|
1167
1251
|
}
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
function
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1252
|
+
|
|
1253
|
+
// src/commands/upgrade/targets.ts
|
|
1254
|
+
init_cjs_shims();
|
|
1255
|
+
function getAssetTargets(raw) {
|
|
1256
|
+
const list = [
|
|
1257
|
+
".changeset",
|
|
1258
|
+
".husky",
|
|
1259
|
+
".vscode",
|
|
1260
|
+
".editorconfig",
|
|
1261
|
+
".gitattributes",
|
|
1262
|
+
".gitignore",
|
|
1263
|
+
".npmrc",
|
|
1264
|
+
"commitlint.config.ts",
|
|
1265
|
+
"eslint.config.js",
|
|
1266
|
+
"lint-staged.config.js",
|
|
1267
|
+
"stylelint.config.js",
|
|
1268
|
+
"monorepo.config.ts",
|
|
1269
|
+
"package.json",
|
|
1270
|
+
// pnpm
|
|
1271
|
+
"pnpm-workspace.yaml",
|
|
1272
|
+
// base tsconfig
|
|
1273
|
+
"tsconfig.json",
|
|
1274
|
+
// turbo
|
|
1275
|
+
"turbo.json",
|
|
1276
|
+
// vitest
|
|
1277
|
+
"vitest.config.ts",
|
|
1278
|
+
// 'vitest.workspace.ts',
|
|
1279
|
+
// #region docker
|
|
1280
|
+
"Dockerfile",
|
|
1281
|
+
".dockerignore"
|
|
1282
|
+
// #endregion
|
|
1283
|
+
];
|
|
1284
|
+
if (!raw) {
|
|
1285
|
+
list.push(".github", "LICENSE", "renovate.json", "SECURITY.md", "CODE_OF_CONDUCT.md", "CONTRIBUTING.md", "netlify.toml");
|
|
1197
1286
|
}
|
|
1198
|
-
return
|
|
1287
|
+
return list;
|
|
1199
1288
|
}
|
|
1289
|
+
|
|
1290
|
+
// src/commands/upgrade/index.ts
|
|
1200
1291
|
async function upgradeMonorepo(opts) {
|
|
1201
1292
|
const cwd2 = opts.cwd ?? import_node_process2.default.cwd();
|
|
1202
1293
|
const upgradeConfig = await resolveCommandConfig("upgrade", cwd2);
|
|
@@ -1217,7 +1308,7 @@ async function upgradeMonorepo(opts) {
|
|
|
1217
1308
|
const mergeTargets = upgradeConfig == null ? void 0 : upgradeConfig.mergeTargets;
|
|
1218
1309
|
let targets = configTargets.length ? mergeTargets === false ? [...configTargets] : Array.from(/* @__PURE__ */ new Set([...baseTargets, ...configTargets])) : baseTargets;
|
|
1219
1310
|
if (merged.interactive) {
|
|
1220
|
-
targets = await (0,
|
|
1311
|
+
targets = await (0, import_checkbox3.default)({
|
|
1221
1312
|
message: "\u9009\u62E9\u4F60\u9700\u8981\u7684\u6587\u4EF6",
|
|
1222
1313
|
choices: targets.map((x) => {
|
|
1223
1314
|
return {
|
|
@@ -1233,62 +1324,89 @@ async function upgradeMonorepo(opts) {
|
|
|
1233
1324
|
const skipChangesetMarkdown = (upgradeConfig == null ? void 0 : upgradeConfig.skipChangesetMarkdown) ?? true;
|
|
1234
1325
|
const scriptOverrides = upgradeConfig == null ? void 0 : upgradeConfig.scripts;
|
|
1235
1326
|
const skipOverwrite = merged.skipOverwrite;
|
|
1327
|
+
const pendingOverwrites = [];
|
|
1236
1328
|
for await (const file of (0, import_klaw.default)(assetsDir, {
|
|
1237
1329
|
filter(p) {
|
|
1238
|
-
const
|
|
1239
|
-
return isMatch(
|
|
1330
|
+
const rel = toWorkspaceGitignorePath(import_pathe11.default.relative(assetsDir, p));
|
|
1331
|
+
return isMatch(rel, regexpArr);
|
|
1240
1332
|
}
|
|
1241
1333
|
})) {
|
|
1242
1334
|
if (!file.stats.isFile()) {
|
|
1243
1335
|
continue;
|
|
1244
1336
|
}
|
|
1245
|
-
|
|
1246
|
-
if (relPath === "gitignore") {
|
|
1247
|
-
relPath = ".gitignore";
|
|
1248
|
-
}
|
|
1337
|
+
const relPath = toWorkspaceGitignorePath(import_pathe11.default.relative(assetsDir, file.path));
|
|
1249
1338
|
if (skipChangesetMarkdown && relPath.startsWith(".changeset/") && relPath.endsWith(".md")) {
|
|
1250
1339
|
continue;
|
|
1251
1340
|
}
|
|
1252
1341
|
const targetPath = import_pathe11.default.resolve(absOutDir, relPath);
|
|
1253
1342
|
try {
|
|
1254
1343
|
if (relPath === "package.json") {
|
|
1255
|
-
if (!await
|
|
1344
|
+
if (!await import_fs_extra8.default.pathExists(targetPath)) {
|
|
1256
1345
|
continue;
|
|
1257
1346
|
}
|
|
1258
|
-
const sourcePkgJson = await
|
|
1259
|
-
const targetPkgJson = await
|
|
1347
|
+
const sourcePkgJson = await import_fs_extra8.default.readJson(file.path);
|
|
1348
|
+
const targetPkgJson = await import_fs_extra8.default.readJson(targetPath);
|
|
1260
1349
|
setPkgJson(sourcePkgJson, targetPkgJson, { scripts: scriptOverrides });
|
|
1261
1350
|
const data = `${JSON.stringify(targetPkgJson, void 0, 2)}
|
|
1262
1351
|
`;
|
|
1263
|
-
|
|
1264
|
-
|
|
1352
|
+
const intent2 = await evaluateWriteIntent(targetPath, { skipOverwrite, source: data });
|
|
1353
|
+
const action2 = async () => {
|
|
1354
|
+
await import_fs_extra8.default.outputFile(targetPath, data, "utf8");
|
|
1265
1355
|
logger.success(targetPath);
|
|
1266
|
-
}
|
|
1356
|
+
};
|
|
1357
|
+
await scheduleOverwrite(intent2, {
|
|
1358
|
+
relPath,
|
|
1359
|
+
targetPath,
|
|
1360
|
+
action: action2,
|
|
1361
|
+
pending: pendingOverwrites
|
|
1362
|
+
});
|
|
1267
1363
|
continue;
|
|
1268
1364
|
}
|
|
1269
1365
|
if (relPath === ".changeset/config.json" && repoName) {
|
|
1270
|
-
const changesetJson = await
|
|
1366
|
+
const changesetJson = await import_fs_extra8.default.readJson(file.path);
|
|
1271
1367
|
(0, import_set_value6.default)(changesetJson, "changelog.1.repo", repoName);
|
|
1272
1368
|
const data = `${JSON.stringify(changesetJson, void 0, 2)}
|
|
1273
1369
|
`;
|
|
1274
|
-
|
|
1275
|
-
|
|
1370
|
+
const intent2 = await evaluateWriteIntent(targetPath, { skipOverwrite, source: data });
|
|
1371
|
+
const action2 = async () => {
|
|
1372
|
+
await import_fs_extra8.default.outputFile(targetPath, data, "utf8");
|
|
1276
1373
|
logger.success(targetPath);
|
|
1277
|
-
}
|
|
1374
|
+
};
|
|
1375
|
+
await scheduleOverwrite(intent2, {
|
|
1376
|
+
relPath,
|
|
1377
|
+
targetPath,
|
|
1378
|
+
action: action2,
|
|
1379
|
+
pending: pendingOverwrites
|
|
1380
|
+
});
|
|
1278
1381
|
continue;
|
|
1279
1382
|
}
|
|
1280
1383
|
if (relPath === "LICENSE") {
|
|
1281
|
-
const
|
|
1282
|
-
|
|
1283
|
-
|
|
1384
|
+
const source2 = await import_fs_extra8.default.readFile(file.path);
|
|
1385
|
+
const intent2 = await evaluateWriteIntent(targetPath, { skipOverwrite: true, source: source2 });
|
|
1386
|
+
const action2 = async () => {
|
|
1387
|
+
await import_fs_extra8.default.outputFile(targetPath, source2);
|
|
1284
1388
|
logger.success(targetPath);
|
|
1285
|
-
}
|
|
1389
|
+
};
|
|
1390
|
+
await scheduleOverwrite(intent2, {
|
|
1391
|
+
relPath,
|
|
1392
|
+
targetPath,
|
|
1393
|
+
action: action2,
|
|
1394
|
+
pending: pendingOverwrites
|
|
1395
|
+
});
|
|
1286
1396
|
continue;
|
|
1287
1397
|
}
|
|
1288
|
-
|
|
1289
|
-
|
|
1398
|
+
const source = await import_fs_extra8.default.readFile(file.path);
|
|
1399
|
+
const intent = await evaluateWriteIntent(targetPath, { skipOverwrite, source });
|
|
1400
|
+
const action = async () => {
|
|
1401
|
+
await import_fs_extra8.default.outputFile(targetPath, source);
|
|
1290
1402
|
logger.success(targetPath);
|
|
1291
|
-
}
|
|
1403
|
+
};
|
|
1404
|
+
await scheduleOverwrite(intent, {
|
|
1405
|
+
relPath,
|
|
1406
|
+
targetPath,
|
|
1407
|
+
action,
|
|
1408
|
+
pending: pendingOverwrites
|
|
1409
|
+
});
|
|
1292
1410
|
} catch (error) {
|
|
1293
1411
|
if (isIgnorableFsError(error)) {
|
|
1294
1412
|
continue;
|
|
@@ -1296,6 +1414,7 @@ async function upgradeMonorepo(opts) {
|
|
|
1296
1414
|
throw error;
|
|
1297
1415
|
}
|
|
1298
1416
|
}
|
|
1417
|
+
await flushPendingOverwrites(pendingOverwrites);
|
|
1299
1418
|
}
|
|
1300
1419
|
|
|
1301
1420
|
// src/cli/program.ts
|