@icebreakers/monorepo 3.2.4 → 3.2.6
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/dist/cli.cjs +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.cjs +2 -1
- package/dist/index.d.cts +304 -4
- package/dist/index.d.mts +304 -4
- package/dist/index.mjs +1 -1
- package/dist/{upgrade-BI_dD_HR.cjs → upgrade-BpiSZThJ.cjs} +66 -66
- package/dist/{upgrade-BnOc9MKM.mjs → upgrade-C8CPHZxP.mjs} +86 -86
- package/package.json +6 -6
|
@@ -22,7 +22,7 @@ import klaw from "klaw";
|
|
|
22
22
|
import { Buffer as Buffer$1 } from "node:buffer";
|
|
23
23
|
import { coerce, gte, minVersion } from "semver";
|
|
24
24
|
|
|
25
|
-
//#region
|
|
25
|
+
//#region \0rolldown/runtime.js
|
|
26
26
|
var __create = Object.create;
|
|
27
27
|
var __defProp$1 = Object.defineProperty;
|
|
28
28
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -61,9 +61,9 @@ var join = /* @__PURE__ */ __name((segs, joinChar, options) => {
|
|
|
61
61
|
if (typeof options.join === "function") return options.join(segs);
|
|
62
62
|
return segs[0] + joinChar + segs[1];
|
|
63
63
|
}, "join");
|
|
64
|
-
var split = /* @__PURE__ */ __name((path
|
|
65
|
-
if (typeof options.split === "function") return options.split(path
|
|
66
|
-
return path
|
|
64
|
+
var split = /* @__PURE__ */ __name((path, splitChar, options) => {
|
|
65
|
+
if (typeof options.split === "function") return options.split(path);
|
|
66
|
+
return path.split(splitChar);
|
|
67
67
|
}, "split");
|
|
68
68
|
var isValid = /* @__PURE__ */ __name((key, target = {}, options) => {
|
|
69
69
|
if (typeof options?.isValid === "function") return options.isValid(key, target);
|
|
@@ -72,17 +72,17 @@ var isValid = /* @__PURE__ */ __name((key, target = {}, options) => {
|
|
|
72
72
|
var isValidObject = /* @__PURE__ */ __name((v) => {
|
|
73
73
|
return isObject(v) || typeof v === "function";
|
|
74
74
|
}, "isValidObject");
|
|
75
|
-
var index_default = /* @__PURE__ */ __name((target, path
|
|
75
|
+
var index_default = /* @__PURE__ */ __name((target, path, options = {}) => {
|
|
76
76
|
if (!isObject(options)) options = { default: options };
|
|
77
77
|
if (!isValidObject(target)) return typeof options.default !== "undefined" ? options.default : target;
|
|
78
|
-
if (typeof path
|
|
79
|
-
const pathIsArray = Array.isArray(path
|
|
80
|
-
const pathIsString = typeof path
|
|
78
|
+
if (typeof path === "number") path = String(path);
|
|
79
|
+
const pathIsArray = Array.isArray(path);
|
|
80
|
+
const pathIsString = typeof path === "string";
|
|
81
81
|
const splitChar = options.separator || ".";
|
|
82
82
|
const joinChar = options.joinChar || (typeof splitChar === "string" ? splitChar : ".");
|
|
83
83
|
if (!pathIsString && !pathIsArray) return target;
|
|
84
|
-
if (target[path
|
|
85
|
-
const segs = pathIsArray ? path
|
|
84
|
+
if (target[path] !== void 0) return isValid(path, target, options) ? target[path] : options.default;
|
|
85
|
+
const segs = pathIsArray ? path : split(path, splitChar, options);
|
|
86
86
|
const len = segs.length;
|
|
87
87
|
let idx = 0;
|
|
88
88
|
do {
|
|
@@ -367,7 +367,7 @@ var require_is_primitive = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
367
367
|
* Released under the MIT License.
|
|
368
368
|
*/
|
|
369
369
|
var require_isobject = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
370
|
-
module.exports = function isObject
|
|
370
|
+
module.exports = function isObject(val) {
|
|
371
371
|
return val != null && typeof val === "object" && Array.isArray(val) === false;
|
|
372
372
|
};
|
|
373
373
|
}));
|
|
@@ -385,7 +385,7 @@ var require_is_plain_object = /* @__PURE__ */ __commonJSMin(((exports, module) =
|
|
|
385
385
|
function isObjectObject(o) {
|
|
386
386
|
return isObject(o) === true && Object.prototype.toString.call(o) === "[object Object]";
|
|
387
387
|
}
|
|
388
|
-
module.exports = function isPlainObject
|
|
388
|
+
module.exports = function isPlainObject(o) {
|
|
389
389
|
var ctor, prot;
|
|
390
390
|
if (isObjectObject(o) === false) return false;
|
|
391
391
|
ctor = o.constructor;
|
|
@@ -419,12 +419,12 @@ var require_set_value = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
419
419
|
if (!isPrimitive(key)) throw new TypeError("Object keys must be strings or symbols");
|
|
420
420
|
if (isUnsafeKey(key)) throw new Error(`Cannot set unsafe key: "${key}"`);
|
|
421
421
|
};
|
|
422
|
-
const toStringKey = (input
|
|
423
|
-
return Array.isArray(input
|
|
422
|
+
const toStringKey = (input) => {
|
|
423
|
+
return Array.isArray(input) ? input.flat().map(String).join(",") : input;
|
|
424
424
|
};
|
|
425
|
-
const createMemoKey = (input
|
|
426
|
-
if (typeof input
|
|
427
|
-
let key = input
|
|
425
|
+
const createMemoKey = (input, options) => {
|
|
426
|
+
if (typeof input !== "string" || !options) return input;
|
|
427
|
+
let key = input + ";";
|
|
428
428
|
if (options.arrays !== void 0) key += `arrays=${options.arrays};`;
|
|
429
429
|
if (options.separator !== void 0) key += `separator=${options.separator};`;
|
|
430
430
|
if (options.split !== void 0) key += `split=${options.split};`;
|
|
@@ -432,28 +432,28 @@ var require_set_value = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
432
432
|
if (options.preservePaths !== void 0) key += `preservePaths=${options.preservePaths};`;
|
|
433
433
|
return key;
|
|
434
434
|
};
|
|
435
|
-
const memoize = (input
|
|
436
|
-
const key = toStringKey(options ? createMemoKey(input
|
|
435
|
+
const memoize = (input, options, fn) => {
|
|
436
|
+
const key = toStringKey(options ? createMemoKey(input, options) : input);
|
|
437
437
|
validateKey(key);
|
|
438
438
|
const value = setValue.cache.get(key) || fn();
|
|
439
439
|
setValue.cache.set(key, value);
|
|
440
440
|
return value;
|
|
441
441
|
};
|
|
442
|
-
const splitString = (input
|
|
442
|
+
const splitString = (input, options = {}) => {
|
|
443
443
|
const sep = options.separator || ".";
|
|
444
444
|
const preserve = sep === "/" ? false : options.preservePaths;
|
|
445
|
-
if (typeof input
|
|
445
|
+
if (typeof input === "string" && preserve !== false && /\//.test(input)) return [input];
|
|
446
446
|
const parts = [];
|
|
447
447
|
let part = "";
|
|
448
|
-
const push = (part
|
|
448
|
+
const push = (part) => {
|
|
449
449
|
let number;
|
|
450
|
-
if (part
|
|
451
|
-
else parts.push(part
|
|
450
|
+
if (part.trim() !== "" && Number.isInteger(number = Number(part))) parts.push(number);
|
|
451
|
+
else parts.push(part);
|
|
452
452
|
};
|
|
453
|
-
for (let i = 0; i < input
|
|
454
|
-
const value = input
|
|
453
|
+
for (let i = 0; i < input.length; i++) {
|
|
454
|
+
const value = input[i];
|
|
455
455
|
if (value === "\\") {
|
|
456
|
-
part += input
|
|
456
|
+
part += input[++i];
|
|
457
457
|
continue;
|
|
458
458
|
}
|
|
459
459
|
if (value === sep) {
|
|
@@ -466,11 +466,11 @@ var require_set_value = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
466
466
|
if (part) push(part);
|
|
467
467
|
return parts;
|
|
468
468
|
};
|
|
469
|
-
const split = (input
|
|
470
|
-
if (options && typeof options.split === "function") return options.split(input
|
|
471
|
-
if (typeof input
|
|
472
|
-
if (Array.isArray(input
|
|
473
|
-
return memoize(input
|
|
469
|
+
const split = (input, options) => {
|
|
470
|
+
if (options && typeof options.split === "function") return options.split(input);
|
|
471
|
+
if (typeof input === "symbol") return [input];
|
|
472
|
+
if (Array.isArray(input)) return input;
|
|
473
|
+
return memoize(input, options, () => splitString(input, options));
|
|
474
474
|
};
|
|
475
475
|
const assignProp = (obj, prop, value, options) => {
|
|
476
476
|
validateKey(prop);
|
|
@@ -482,9 +482,9 @@ var require_set_value = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
482
482
|
} else obj[prop] = value;
|
|
483
483
|
return obj;
|
|
484
484
|
};
|
|
485
|
-
const setValue = (target, path
|
|
486
|
-
if (!path
|
|
487
|
-
const keys = split(path
|
|
485
|
+
const setValue = (target, path, value, options) => {
|
|
486
|
+
if (!path || !isObject(target)) return target;
|
|
487
|
+
const keys = split(path, options);
|
|
488
488
|
let obj = target;
|
|
489
489
|
for (let i = 0; i < keys.length; i++) {
|
|
490
490
|
const key = keys[i];
|
|
@@ -552,14 +552,14 @@ async function loadMonorepoConfig(cwd) {
|
|
|
552
552
|
/**
|
|
553
553
|
* 获取命令对应的合并配置,若未配置则返回空对象,保证调用端逻辑简单。
|
|
554
554
|
*/
|
|
555
|
-
async function resolveCommandConfig(name
|
|
556
|
-
return ((await loadMonorepoConfig(cwd)).commands ?? {})[name
|
|
555
|
+
async function resolveCommandConfig(name, cwd) {
|
|
556
|
+
return ((await loadMonorepoConfig(cwd)).commands ?? {})[name] ?? {};
|
|
557
557
|
}
|
|
558
558
|
|
|
559
559
|
//#endregion
|
|
560
560
|
//#region package.json
|
|
561
561
|
var name = "@icebreakers/monorepo";
|
|
562
|
-
var version = "3.2.
|
|
562
|
+
var version = "3.2.6";
|
|
563
563
|
|
|
564
564
|
//#endregion
|
|
565
565
|
//#region src/constants.ts
|
|
@@ -641,10 +641,10 @@ async function cleanProjects(cwd, overrides) {
|
|
|
641
641
|
const cleanConfig = mergeCleanConfig(await resolveCommandConfig("clean", cwd), overrides);
|
|
642
642
|
const { packages, workspaceDir } = await getWorkspaceData(cwd, cleanConfig?.includePrivate ?? true ? { ignorePrivatePackage: false } : void 0);
|
|
643
643
|
const filteredPackages = packages.filter((pkg) => {
|
|
644
|
-
const name
|
|
645
|
-
if (!name
|
|
644
|
+
const name = pkg.manifest.name ?? "";
|
|
645
|
+
if (!name) return true;
|
|
646
646
|
if (!cleanConfig?.ignorePackages?.length) return true;
|
|
647
|
-
return !cleanConfig.ignorePackages.includes(name
|
|
647
|
+
return !cleanConfig.ignorePackages.includes(name);
|
|
648
648
|
});
|
|
649
649
|
let cleanDirs = [];
|
|
650
650
|
if (cleanConfig?.autoConfirm) cleanDirs = filteredPackages.map((pkg) => pkg.rootDir);
|
|
@@ -664,20 +664,20 @@ async function cleanProjects(cwd, overrides) {
|
|
|
664
664
|
});
|
|
665
665
|
const readmeZh = path.resolve(workspaceDir, "README.zh-CN.md");
|
|
666
666
|
const qoderDir = path.resolve(workspaceDir, ".qoder");
|
|
667
|
-
const skillTargets
|
|
667
|
+
const skillTargets = Object.values(getSkillTargetPaths());
|
|
668
668
|
const candidates = Array.from(new Set([
|
|
669
669
|
...cleanDirs.filter(Boolean),
|
|
670
670
|
readmeZh,
|
|
671
671
|
qoderDir,
|
|
672
|
-
...skillTargets
|
|
672
|
+
...skillTargets
|
|
673
673
|
]));
|
|
674
674
|
await Promise.all(candidates.map(async (dir) => {
|
|
675
675
|
if (await fs.pathExists(dir)) await fs.remove(dir);
|
|
676
676
|
}));
|
|
677
|
-
const name
|
|
678
|
-
const pkgJson = await fs.readJson(name
|
|
677
|
+
const name = path.resolve(workspaceDir, "package.json");
|
|
678
|
+
const pkgJson = await fs.readJson(name);
|
|
679
679
|
(0, import_set_value.default)(pkgJson, "devDependencies.@icebreakers/monorepo", cleanConfig?.pinnedVersion ?? "latest", { preservePaths: false });
|
|
680
|
-
await fs.outputJson(name
|
|
680
|
+
await fs.outputJson(name, pkgJson, { spaces: 2 });
|
|
681
681
|
}
|
|
682
682
|
|
|
683
683
|
//#endregion
|
|
@@ -805,7 +805,7 @@ async function createNewProject(options) {
|
|
|
805
805
|
const createConfig = await resolveCommandConfig("create", cwd);
|
|
806
806
|
const renameJson = options?.renameJson ?? createConfig?.renameJson ?? false;
|
|
807
807
|
const rawName = options?.name ?? createConfig?.name;
|
|
808
|
-
const name
|
|
808
|
+
const name = typeof rawName === "string" ? rawName.trim() : void 0;
|
|
809
809
|
const requestedTemplate = options?.type ?? createConfig?.type ?? createConfig?.defaultTemplate ?? defaultTemplate;
|
|
810
810
|
const templateDefinitions = getTemplateMap(createConfig?.templateMap);
|
|
811
811
|
const templatesRoot = createConfig?.templatesDir ? path.resolve(cwd, createConfig.templatesDir) : templatesDir;
|
|
@@ -814,7 +814,7 @@ async function createNewProject(options) {
|
|
|
814
814
|
const templateDefinition = templateDefinitions[bundlerName];
|
|
815
815
|
if (!templateDefinition) throw new Error(`未找到名为 ${bundlerName} 的模板,请检查 monorepo.config.ts`);
|
|
816
816
|
const from = path.join(templatesRoot, templateDefinition.source);
|
|
817
|
-
const targetName = name
|
|
817
|
+
const targetName = name && name.length > 0 ? name : templateDefinition.target;
|
|
818
818
|
const to = path.join(cwd, targetName);
|
|
819
819
|
if (await fs.pathExists(to)) throw new Error(`${pc.red("目标目录已存在")}: ${path.relative(cwd, to)}`);
|
|
820
820
|
await fs.ensureDir(to);
|
|
@@ -828,7 +828,7 @@ async function createNewProject(options) {
|
|
|
828
828
|
if (hasPackageJson) {
|
|
829
829
|
const sourceJson = await fs.readJson(sourceJsonPath);
|
|
830
830
|
(0, import_set_value.default)(sourceJson, "version", "0.0.0");
|
|
831
|
-
(0, import_set_value.default)(sourceJson, "name", name
|
|
831
|
+
(0, import_set_value.default)(sourceJson, "name", name?.startsWith("@") ? name : path.basename(targetName));
|
|
832
832
|
await applyGitMetadata(sourceJson, cwd, to);
|
|
833
833
|
await fs.outputJson(path.resolve(to, renameJson ? "package.mock.json" : "package.json"), sourceJson, { spaces: 2 });
|
|
834
834
|
}
|
|
@@ -1143,15 +1143,15 @@ async function syncNpmMirror(cwd, options) {
|
|
|
1143
1143
|
...options ?? {}
|
|
1144
1144
|
});
|
|
1145
1145
|
logger.info(`[当前工作区Repo]:\n${packages.map((x) => `- ${pc.green(x.manifest.name)} : ${path.relative(workspaceDir, x.rootDir)}`).join("\n")}\n`);
|
|
1146
|
-
const set
|
|
1146
|
+
const set = new Set(packages.map((x) => x.manifest.name));
|
|
1147
1147
|
if (packageFilter?.length) {
|
|
1148
|
-
for (const name
|
|
1148
|
+
for (const name of Array.from(set)) if (!name || !packageFilter.includes(name)) set.delete(name);
|
|
1149
1149
|
}
|
|
1150
|
-
logger.info(`[即将同步的包]:\n${Array.from(set
|
|
1150
|
+
logger.info(`[即将同步的包]:\n${Array.from(set).map((x) => `- ${pc.green(x ?? "")}`).join("\n")}\n`);
|
|
1151
1151
|
const queue = new PQueue({ concurrency: configConcurrency ?? Math.max(os.cpus().length, 1) });
|
|
1152
1152
|
const template = configCommand ?? "cnpm sync {name}";
|
|
1153
1153
|
const tasks = [];
|
|
1154
|
-
for (const pkgName of set
|
|
1154
|
+
for (const pkgName of set) {
|
|
1155
1155
|
if (!pkgName) continue;
|
|
1156
1156
|
tasks.push(queue.add(async () => {
|
|
1157
1157
|
return execaCommand(renderCommand(template, pkgName), { stdio: "inherit" });
|
|
@@ -1242,17 +1242,17 @@ const scriptsEntries = Object.entries(scripts);
|
|
|
1242
1242
|
//#endregion
|
|
1243
1243
|
//#region src/commands/upgrade/pkg-json.ts
|
|
1244
1244
|
const NON_OVERRIDABLE_PREFIXES = ["workspace:", "catalog:"];
|
|
1245
|
-
function parseVersion(input
|
|
1246
|
-
if (typeof input
|
|
1245
|
+
function parseVersion(input) {
|
|
1246
|
+
if (typeof input !== "string" || input.trim().length === 0) return null;
|
|
1247
1247
|
try {
|
|
1248
|
-
return minVersion(input
|
|
1248
|
+
return minVersion(input) ?? coerce(input);
|
|
1249
1249
|
} catch {
|
|
1250
1250
|
return null;
|
|
1251
1251
|
}
|
|
1252
1252
|
}
|
|
1253
|
-
function hasNonOverridablePrefix(version
|
|
1254
|
-
if (typeof version
|
|
1255
|
-
return NON_OVERRIDABLE_PREFIXES.some((prefix) => version
|
|
1253
|
+
function hasNonOverridablePrefix(version) {
|
|
1254
|
+
if (typeof version !== "string") return false;
|
|
1255
|
+
return NON_OVERRIDABLE_PREFIXES.some((prefix) => version.startsWith(prefix));
|
|
1256
1256
|
}
|
|
1257
1257
|
function shouldAssignVersion(currentVersion, nextVersion) {
|
|
1258
1258
|
if (typeof currentVersion !== "string" || currentVersion.trim().length === 0) return true;
|
|
@@ -1297,9 +1297,9 @@ function setPkgJson(sourcePkgJson, targetPkgJson, options) {
|
|
|
1297
1297
|
if (Object.keys(targetDevDeps).length) targetPkgJson.devDependencies = targetDevDeps;
|
|
1298
1298
|
const scriptPairs = options?.scripts ? Object.entries(options.scripts) : scriptsEntries;
|
|
1299
1299
|
if (scriptPairs.length) {
|
|
1300
|
-
const scripts
|
|
1301
|
-
for (const [scriptName, scriptCmd] of scriptPairs) scripts
|
|
1302
|
-
targetPkgJson.scripts = scripts
|
|
1300
|
+
const scripts = { ...targetPkgJson.scripts ?? {} };
|
|
1301
|
+
for (const [scriptName, scriptCmd] of scriptPairs) scripts[scriptName] = scriptCmd;
|
|
1302
|
+
targetPkgJson.scripts = scripts;
|
|
1303
1303
|
}
|
|
1304
1304
|
}
|
|
1305
1305
|
|
|
@@ -1392,7 +1392,7 @@ async function upgradeMonorepo(opts) {
|
|
|
1392
1392
|
})
|
|
1393
1393
|
});
|
|
1394
1394
|
const regexpArr = targets.map((x) => {
|
|
1395
|
-
return
|
|
1395
|
+
return new RegExp(`^${escapeStringRegexp(x)}`);
|
|
1396
1396
|
});
|
|
1397
1397
|
const skipChangesetMarkdown = upgradeConfig?.skipChangesetMarkdown ?? true;
|
|
1398
1398
|
const scriptOverrides = upgradeConfig?.scripts;
|
|
@@ -1418,15 +1418,15 @@ async function upgradeMonorepo(opts) {
|
|
|
1418
1418
|
const targetPkgJson = await fs.readJson(targetPath);
|
|
1419
1419
|
setPkgJson(sourcePkgJson, targetPkgJson, scriptOverrides ? { scripts: scriptOverrides } : void 0);
|
|
1420
1420
|
const data = `${JSON.stringify(targetPkgJson, void 0, 2)}\n`;
|
|
1421
|
-
const intent
|
|
1422
|
-
const action
|
|
1421
|
+
const intent = await evaluateWriteIntent(targetPath, buildWriteIntentOptions(data));
|
|
1422
|
+
const action = async () => {
|
|
1423
1423
|
await fs.outputFile(targetPath, data, "utf8");
|
|
1424
1424
|
logger.success(targetPath);
|
|
1425
1425
|
};
|
|
1426
|
-
await scheduleOverwrite(intent
|
|
1426
|
+
await scheduleOverwrite(intent, {
|
|
1427
1427
|
relPath,
|
|
1428
1428
|
targetPath,
|
|
1429
|
-
action
|
|
1429
|
+
action,
|
|
1430
1430
|
pending: pendingOverwrites
|
|
1431
1431
|
});
|
|
1432
1432
|
continue;
|
|
@@ -1437,15 +1437,15 @@ async function upgradeMonorepo(opts) {
|
|
|
1437
1437
|
const targetManifest = exists ? normalizeWorkspaceManifest(YAML.parse(await fs.readFile(targetPath, "utf8"))) : normalizeWorkspaceManifest({});
|
|
1438
1438
|
const mergedManifest = exists ? mergeWorkspaceManifest(sourceManifest, targetManifest) : sourceManifest;
|
|
1439
1439
|
const data = YAML.stringify(mergedManifest, { singleQuote: true });
|
|
1440
|
-
const intent
|
|
1441
|
-
const action
|
|
1440
|
+
const intent = await evaluateWriteIntent(targetPath, buildWriteIntentOptions(data));
|
|
1441
|
+
const action = async () => {
|
|
1442
1442
|
await fs.outputFile(targetPath, data, "utf8");
|
|
1443
1443
|
logger.success(targetPath);
|
|
1444
1444
|
};
|
|
1445
|
-
await scheduleOverwrite(intent
|
|
1445
|
+
await scheduleOverwrite(intent, {
|
|
1446
1446
|
relPath,
|
|
1447
1447
|
targetPath,
|
|
1448
|
-
action
|
|
1448
|
+
action,
|
|
1449
1449
|
pending: pendingOverwrites
|
|
1450
1450
|
});
|
|
1451
1451
|
continue;
|
|
@@ -1454,48 +1454,48 @@ async function upgradeMonorepo(opts) {
|
|
|
1454
1454
|
const changesetJson = await fs.readJson(file.path);
|
|
1455
1455
|
(0, import_set_value.default)(changesetJson, "changelog.1.repo", repoName);
|
|
1456
1456
|
const data = `${JSON.stringify(changesetJson, void 0, 2)}\n`;
|
|
1457
|
-
const intent
|
|
1458
|
-
const action
|
|
1457
|
+
const intent = await evaluateWriteIntent(targetPath, buildWriteIntentOptions(data));
|
|
1458
|
+
const action = async () => {
|
|
1459
1459
|
await fs.outputFile(targetPath, data, "utf8");
|
|
1460
1460
|
logger.success(targetPath);
|
|
1461
1461
|
};
|
|
1462
|
-
await scheduleOverwrite(intent
|
|
1462
|
+
await scheduleOverwrite(intent, {
|
|
1463
1463
|
relPath,
|
|
1464
1464
|
targetPath,
|
|
1465
|
-
action
|
|
1465
|
+
action,
|
|
1466
1466
|
pending: pendingOverwrites
|
|
1467
1467
|
});
|
|
1468
1468
|
continue;
|
|
1469
1469
|
}
|
|
1470
1470
|
if (relPath === "LICENSE") {
|
|
1471
|
-
const source
|
|
1472
|
-
const intent
|
|
1471
|
+
const source = await fs.readFile(file.path);
|
|
1472
|
+
const intent = await evaluateWriteIntent(targetPath, {
|
|
1473
1473
|
skipOverwrite: true,
|
|
1474
|
-
source
|
|
1474
|
+
source
|
|
1475
1475
|
});
|
|
1476
|
-
const action
|
|
1477
|
-
await fs.outputFile(targetPath, source
|
|
1476
|
+
const action = async () => {
|
|
1477
|
+
await fs.outputFile(targetPath, source);
|
|
1478
1478
|
logger.success(targetPath);
|
|
1479
1479
|
};
|
|
1480
|
-
await scheduleOverwrite(intent
|
|
1480
|
+
await scheduleOverwrite(intent, {
|
|
1481
1481
|
relPath,
|
|
1482
1482
|
targetPath,
|
|
1483
|
-
action
|
|
1483
|
+
action,
|
|
1484
1484
|
pending: pendingOverwrites
|
|
1485
1485
|
});
|
|
1486
1486
|
continue;
|
|
1487
1487
|
}
|
|
1488
1488
|
if (relPath === ".github/ISSUE_TEMPLATE/config.yml") {
|
|
1489
1489
|
const data = updateIssueTemplateConfig(await fs.readFile(file.path, "utf8"), repoName);
|
|
1490
|
-
const intent
|
|
1491
|
-
const action
|
|
1490
|
+
const intent = await evaluateWriteIntent(targetPath, buildWriteIntentOptions(data));
|
|
1491
|
+
const action = async () => {
|
|
1492
1492
|
await fs.outputFile(targetPath, data);
|
|
1493
1493
|
logger.success(targetPath);
|
|
1494
1494
|
};
|
|
1495
|
-
await scheduleOverwrite(intent
|
|
1495
|
+
await scheduleOverwrite(intent, {
|
|
1496
1496
|
relPath,
|
|
1497
1497
|
targetPath,
|
|
1498
|
-
action
|
|
1498
|
+
action,
|
|
1499
1499
|
pending: pendingOverwrites
|
|
1500
1500
|
});
|
|
1501
1501
|
continue;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icebreakers/monorepo",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.2.
|
|
4
|
+
"version": "3.2.6",
|
|
5
5
|
"description": "The icebreaker's monorepo manager",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -57,11 +57,11 @@
|
|
|
57
57
|
"node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@pnpm/find-workspace-dir": "^1000.1.
|
|
60
|
+
"@pnpm/find-workspace-dir": "^1000.1.4",
|
|
61
61
|
"@pnpm/logger": "^1001.0.1",
|
|
62
62
|
"@pnpm/types": "^1001.3.0",
|
|
63
|
-
"@pnpm/worker": "^1000.6.
|
|
64
|
-
"@pnpm/workspace.find-packages": "^1000.0.
|
|
63
|
+
"@pnpm/worker": "^1000.6.4",
|
|
64
|
+
"@pnpm/workspace.find-packages": "^1000.0.57",
|
|
65
65
|
"@pnpm/workspace.read-manifest": "^1000.2.10",
|
|
66
66
|
"c12": "^3.3.3",
|
|
67
67
|
"comment-json": "^4.5.1",
|
|
@@ -72,10 +72,10 @@
|
|
|
72
72
|
"p-queue": "^9.1.0",
|
|
73
73
|
"pathe": "^2.0.3",
|
|
74
74
|
"picocolors": "^1.1.1",
|
|
75
|
-
"semver": "^7.7.
|
|
75
|
+
"semver": "^7.7.4",
|
|
76
76
|
"simple-git": "^3.30.0",
|
|
77
77
|
"yaml": "^2.8.2",
|
|
78
|
-
"@icebreakers/monorepo-templates": "0.1.
|
|
78
|
+
"@icebreakers/monorepo-templates": "0.1.6"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@types/klaw": "^3.0.7",
|