@icebreakers/monorepo 3.1.7 → 3.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/package.json +1 -1
- package/dist/cli.cjs +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.cjs +2 -1
- package/dist/index.d.cts +12 -1
- package/dist/index.d.mts +12 -1
- package/dist/index.mjs +2 -2
- package/dist/{upgrade-BnrzVPeg.cjs → upgrade-DEBWprtr.cjs} +92 -15
- package/dist/{upgrade-DmdJLHLb.mjs → upgrade-DjrKVY-g.mjs} +74 -3
- package/package.json +1 -1
- package/templates/apps/client/package.json +1 -1
- package/templates/packages/vue-lib-template/package.json +1 -1
package/assets/package.json
CHANGED
package/dist/cli.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_upgrade = require('./upgrade-
|
|
1
|
+
const require_upgrade = require('./upgrade-DEBWprtr.cjs');
|
|
2
2
|
let node_process = require("node:process");
|
|
3
3
|
node_process = require_upgrade.__toESM(node_process);
|
|
4
4
|
let __inquirer_input = require("@inquirer/input");
|
package/dist/cli.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as createTimestampFolderName, E as cleanProjects, F as logger, M as generateAgenticTemplate, N as generateAgenticTemplates, P as loadAgenticTasks, T as version, c as getCreateChoices, i as init, j as defaultAgenticBaseDir, k as resolveCommandConfig, n as syncNpmMirror, o as createNewProject, r as setVscodeBinaryMirror, s as defaultTemplate, t as upgradeMonorepo, w as name } from "./upgrade-DjrKVY-g.mjs";
|
|
2
2
|
import process from "node:process";
|
|
3
3
|
import input from "@inquirer/input";
|
|
4
4
|
import select from "@inquirer/select";
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_upgrade = require('./upgrade-
|
|
1
|
+
const require_upgrade = require('./upgrade-DEBWprtr.cjs');
|
|
2
2
|
|
|
3
3
|
exports.GitClient = require_upgrade.GitClient;
|
|
4
4
|
exports.assetsDir = require_upgrade.assetsDir;
|
|
@@ -39,6 +39,7 @@ exports.templateMap = require_upgrade.templateMap;
|
|
|
39
39
|
exports.templatesDir = require_upgrade.templatesDir;
|
|
40
40
|
exports.toPublishGitignorePath = require_upgrade.toPublishGitignorePath;
|
|
41
41
|
exports.toWorkspaceGitignorePath = require_upgrade.toWorkspaceGitignorePath;
|
|
42
|
+
exports.updateIssueTemplateConfig = require_upgrade.updateIssueTemplateConfig;
|
|
42
43
|
exports.upgradeMonorepo = require_upgrade.upgradeMonorepo;
|
|
43
44
|
Object.defineProperty(exports, 'version', {
|
|
44
45
|
enumerable: true,
|
package/dist/index.d.cts
CHANGED
|
@@ -325,6 +325,11 @@ interface InitCommandConfig {
|
|
|
325
325
|
* @default false
|
|
326
326
|
*/
|
|
327
327
|
skipChangeset?: boolean;
|
|
328
|
+
/**
|
|
329
|
+
* 是否跳过 Issue 模版 discussions 链接的更新。
|
|
330
|
+
* @default false
|
|
331
|
+
*/
|
|
332
|
+
skipIssueTemplateConfig?: boolean;
|
|
328
333
|
}
|
|
329
334
|
/**
|
|
330
335
|
* `monorepo mirror` 命令配置,可增加额外的环境变量镜像。
|
|
@@ -533,6 +538,12 @@ declare const logger: consola0.ConsolaInstance;
|
|
|
533
538
|
*/
|
|
534
539
|
declare function isIgnorableFsError(error: unknown): error is NodeJS.ErrnoException;
|
|
535
540
|
//#endregion
|
|
541
|
+
//#region src/utils/github.d.ts
|
|
542
|
+
/**
|
|
543
|
+
* 将 Issue 模版里的 discussions 链接同步为当前仓库的 discussions 地址。
|
|
544
|
+
*/
|
|
545
|
+
declare function updateIssueTemplateConfig(source: string, repoName?: string): string;
|
|
546
|
+
//#endregion
|
|
536
547
|
//#region src/utils/gitignore.d.ts
|
|
537
548
|
/**
|
|
538
549
|
* Map a workspace path (containing `.gitignore`) to its packaged variant.
|
|
@@ -568,4 +579,4 @@ declare function escapeStringRegexp(str: string): string;
|
|
|
568
579
|
*/
|
|
569
580
|
declare function isMatch(str: string, arr: RegExp[]): boolean;
|
|
570
581
|
//#endregion
|
|
571
|
-
export { AgenticTemplateFormat, AgenticTemplateTask, type AiCommandConfig, type CleanCommandConfig, type CliOpts, type ConfigValues, Context, type CreateChoiceOption, type CreateCommandConfig, CreateNewProjectOptions, GenerateAgenticTemplateOptions, type GetWorkspacePackagesOptions, GitClient, type InitCommandConfig, type MirrorCommandConfig, type MonorepoConfig, type PackageJson, type SimpleGit, type SimpleGitOptions, type SyncCommandConfig, type UpgradeCommandConfig, assetsDir, cleanProjects, createContext, createNewProject, createTimestampFolderName, defaultAgenticBaseDir, defineMonorepoConfig, escapeStringRegexp, generateAgenticTemplate, generateAgenticTemplates, getCreateChoices, getFileHash, getTemplateMap, getWorkspaceData, getWorkspacePackages, init, isFileChanged, isGitignoreFile, isIgnorableFsError, isMatch, loadAgenticTasks, loadMonorepoConfig, logger, name, packageDir, resolveCommandConfig, rootDir, setVscodeBinaryMirror, syncNpmMirror, templateMap, templatesDir, toPublishGitignorePath, toWorkspaceGitignorePath, upgradeMonorepo, version };
|
|
582
|
+
export { AgenticTemplateFormat, AgenticTemplateTask, type AiCommandConfig, type CleanCommandConfig, type CliOpts, type ConfigValues, Context, type CreateChoiceOption, type CreateCommandConfig, CreateNewProjectOptions, GenerateAgenticTemplateOptions, type GetWorkspacePackagesOptions, GitClient, type InitCommandConfig, type MirrorCommandConfig, type MonorepoConfig, type PackageJson, type SimpleGit, type SimpleGitOptions, type SyncCommandConfig, type UpgradeCommandConfig, assetsDir, cleanProjects, createContext, createNewProject, createTimestampFolderName, defaultAgenticBaseDir, defineMonorepoConfig, escapeStringRegexp, generateAgenticTemplate, generateAgenticTemplates, getCreateChoices, getFileHash, getTemplateMap, getWorkspaceData, getWorkspacePackages, init, isFileChanged, isGitignoreFile, isIgnorableFsError, isMatch, loadAgenticTasks, loadMonorepoConfig, logger, name, packageDir, resolveCommandConfig, rootDir, setVscodeBinaryMirror, syncNpmMirror, templateMap, templatesDir, toPublishGitignorePath, toWorkspaceGitignorePath, updateIssueTemplateConfig, upgradeMonorepo, version };
|
package/dist/index.d.mts
CHANGED
|
@@ -325,6 +325,11 @@ interface InitCommandConfig {
|
|
|
325
325
|
* @default false
|
|
326
326
|
*/
|
|
327
327
|
skipChangeset?: boolean;
|
|
328
|
+
/**
|
|
329
|
+
* 是否跳过 Issue 模版 discussions 链接的更新。
|
|
330
|
+
* @default false
|
|
331
|
+
*/
|
|
332
|
+
skipIssueTemplateConfig?: boolean;
|
|
328
333
|
}
|
|
329
334
|
/**
|
|
330
335
|
* `monorepo mirror` 命令配置,可增加额外的环境变量镜像。
|
|
@@ -533,6 +538,12 @@ declare const logger: consola0.ConsolaInstance;
|
|
|
533
538
|
*/
|
|
534
539
|
declare function isIgnorableFsError(error: unknown): error is NodeJS.ErrnoException;
|
|
535
540
|
//#endregion
|
|
541
|
+
//#region src/utils/github.d.ts
|
|
542
|
+
/**
|
|
543
|
+
* 将 Issue 模版里的 discussions 链接同步为当前仓库的 discussions 地址。
|
|
544
|
+
*/
|
|
545
|
+
declare function updateIssueTemplateConfig(source: string, repoName?: string): string;
|
|
546
|
+
//#endregion
|
|
536
547
|
//#region src/utils/gitignore.d.ts
|
|
537
548
|
/**
|
|
538
549
|
* Map a workspace path (containing `.gitignore`) to its packaged variant.
|
|
@@ -568,4 +579,4 @@ declare function escapeStringRegexp(str: string): string;
|
|
|
568
579
|
*/
|
|
569
580
|
declare function isMatch(str: string, arr: RegExp[]): boolean;
|
|
570
581
|
//#endregion
|
|
571
|
-
export { type AgenticTemplateFormat, type AgenticTemplateTask, type AiCommandConfig, type CleanCommandConfig, type CliOpts, type ConfigValues, Context, type CreateChoiceOption, type CreateCommandConfig, type CreateNewProjectOptions, type GenerateAgenticTemplateOptions, type GetWorkspacePackagesOptions, GitClient, type InitCommandConfig, type MirrorCommandConfig, type MonorepoConfig, type PackageJson, type SimpleGit, type SimpleGitOptions, type SyncCommandConfig, type UpgradeCommandConfig, assetsDir, cleanProjects, createContext, createNewProject, createTimestampFolderName, defaultAgenticBaseDir, defineMonorepoConfig, escapeStringRegexp, generateAgenticTemplate, generateAgenticTemplates, getCreateChoices, getFileHash, getTemplateMap, getWorkspaceData, getWorkspacePackages, init, isFileChanged, isGitignoreFile, isIgnorableFsError, isMatch, loadAgenticTasks, loadMonorepoConfig, logger, name, packageDir, resolveCommandConfig, rootDir, setVscodeBinaryMirror, syncNpmMirror, templateMap, templatesDir, toPublishGitignorePath, toWorkspaceGitignorePath, upgradeMonorepo, version };
|
|
582
|
+
export { type AgenticTemplateFormat, type AgenticTemplateTask, type AiCommandConfig, type CleanCommandConfig, type CliOpts, type ConfigValues, Context, type CreateChoiceOption, type CreateCommandConfig, type CreateNewProjectOptions, type GenerateAgenticTemplateOptions, type GetWorkspacePackagesOptions, GitClient, type InitCommandConfig, type MirrorCommandConfig, type MonorepoConfig, type PackageJson, type SimpleGit, type SimpleGitOptions, type SyncCommandConfig, type UpgradeCommandConfig, assetsDir, cleanProjects, createContext, createNewProject, createTimestampFolderName, defaultAgenticBaseDir, defineMonorepoConfig, escapeStringRegexp, generateAgenticTemplate, generateAgenticTemplates, getCreateChoices, getFileHash, getTemplateMap, getWorkspaceData, getWorkspacePackages, init, isFileChanged, isGitignoreFile, isIgnorableFsError, isMatch, loadAgenticTasks, loadMonorepoConfig, logger, name, packageDir, resolveCommandConfig, rootDir, setVscodeBinaryMirror, syncNpmMirror, templateMap, templatesDir, toPublishGitignorePath, toWorkspaceGitignorePath, updateIssueTemplateConfig, upgradeMonorepo, version };
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as createTimestampFolderName, C as templatesDir, D as defineMonorepoConfig, E as cleanProjects, F as logger, I as getWorkspaceData, L as getWorkspacePackages, M as generateAgenticTemplate, N as generateAgenticTemplates, O as loadMonorepoConfig, P as loadAgenticTasks, R as GitClient, S as rootDir, T as version, _ as toWorkspaceGitignorePath, a as createContext, b as assetsDir, c as getCreateChoices, d as escapeStringRegexp, f as isMatch, g as toPublishGitignorePath, h as isGitignoreFile, i as init, j as defaultAgenticBaseDir, k as resolveCommandConfig, l as getTemplateMap, m as isFileChanged, n as syncNpmMirror, o as createNewProject, p as getFileHash, r as setVscodeBinaryMirror, t as upgradeMonorepo, u as templateMap, v as updateIssueTemplateConfig, w as name, x as packageDir, y as isIgnorableFsError } from "./upgrade-DjrKVY-g.mjs";
|
|
2
2
|
|
|
3
|
-
export { GitClient, assetsDir, cleanProjects, createContext, createNewProject, createTimestampFolderName, defaultAgenticBaseDir, defineMonorepoConfig, escapeStringRegexp, generateAgenticTemplate, generateAgenticTemplates, getCreateChoices, getFileHash, getTemplateMap, getWorkspaceData, getWorkspacePackages, init, isFileChanged, isGitignoreFile, isIgnorableFsError, isMatch, loadAgenticTasks, loadMonorepoConfig, logger, name, packageDir, resolveCommandConfig, rootDir, setVscodeBinaryMirror, syncNpmMirror, templateMap, templatesDir, toPublishGitignorePath, toWorkspaceGitignorePath, upgradeMonorepo, version };
|
|
3
|
+
export { GitClient, assetsDir, cleanProjects, createContext, createNewProject, createTimestampFolderName, defaultAgenticBaseDir, defineMonorepoConfig, escapeStringRegexp, generateAgenticTemplate, generateAgenticTemplates, getCreateChoices, getFileHash, getTemplateMap, getWorkspaceData, getWorkspacePackages, init, isFileChanged, isGitignoreFile, isIgnorableFsError, isMatch, loadAgenticTasks, loadMonorepoConfig, logger, name, packageDir, resolveCommandConfig, rootDir, setVscodeBinaryMirror, syncNpmMirror, templateMap, templatesDir, toPublishGitignorePath, toWorkspaceGitignorePath, updateIssueTemplateConfig, upgradeMonorepo, version };
|
|
@@ -47,6 +47,8 @@ picocolors = __toESM(picocolors);
|
|
|
47
47
|
let node_path = require("node:path");
|
|
48
48
|
node_path = __toESM(node_path);
|
|
49
49
|
let node_url = require("node:url");
|
|
50
|
+
let yaml = require("yaml");
|
|
51
|
+
yaml = __toESM(yaml);
|
|
50
52
|
let node_crypto = require("node:crypto");
|
|
51
53
|
node_crypto = __toESM(node_crypto);
|
|
52
54
|
require("@pnpm/types");
|
|
@@ -58,8 +60,6 @@ let p_queue = require("p-queue");
|
|
|
58
60
|
p_queue = __toESM(p_queue);
|
|
59
61
|
let klaw = require("klaw");
|
|
60
62
|
klaw = __toESM(klaw);
|
|
61
|
-
let yaml = require("yaml");
|
|
62
|
-
yaml = __toESM(yaml);
|
|
63
63
|
let node_buffer = require("node:buffer");
|
|
64
64
|
let semver = require("semver");
|
|
65
65
|
|
|
@@ -74,9 +74,9 @@ var join = /* @__PURE__ */ __name((segs, joinChar, options) => {
|
|
|
74
74
|
if (typeof options.join === "function") return options.join(segs);
|
|
75
75
|
return segs[0] + joinChar + segs[1];
|
|
76
76
|
}, "join");
|
|
77
|
-
var split$1 = /* @__PURE__ */ __name((path$
|
|
78
|
-
if (typeof options.split === "function") return options.split(path$
|
|
79
|
-
return path$
|
|
77
|
+
var split$1 = /* @__PURE__ */ __name((path$14, splitChar, options) => {
|
|
78
|
+
if (typeof options.split === "function") return options.split(path$14);
|
|
79
|
+
return path$14.split(splitChar);
|
|
80
80
|
}, "split");
|
|
81
81
|
var isValid = /* @__PURE__ */ __name((key, target = {}, options) => {
|
|
82
82
|
if (typeof options?.isValid === "function") return options.isValid(key, target);
|
|
@@ -85,17 +85,17 @@ var isValid = /* @__PURE__ */ __name((key, target = {}, options) => {
|
|
|
85
85
|
var isValidObject = /* @__PURE__ */ __name((v) => {
|
|
86
86
|
return isObject$2(v) || typeof v === "function";
|
|
87
87
|
}, "isValidObject");
|
|
88
|
-
var index_default = /* @__PURE__ */ __name((target, path$
|
|
88
|
+
var index_default = /* @__PURE__ */ __name((target, path$14, options = {}) => {
|
|
89
89
|
if (!isObject$2(options)) options = { default: options };
|
|
90
90
|
if (!isValidObject(target)) return typeof options.default !== "undefined" ? options.default : target;
|
|
91
|
-
if (typeof path$
|
|
92
|
-
const pathIsArray = Array.isArray(path$
|
|
93
|
-
const pathIsString = typeof path$
|
|
91
|
+
if (typeof path$14 === "number") path$14 = String(path$14);
|
|
92
|
+
const pathIsArray = Array.isArray(path$14);
|
|
93
|
+
const pathIsString = typeof path$14 === "string";
|
|
94
94
|
const splitChar = options.separator || ".";
|
|
95
95
|
const joinChar = options.joinChar || (typeof splitChar === "string" ? splitChar : ".");
|
|
96
96
|
if (!pathIsString && !pathIsArray) return target;
|
|
97
|
-
if (target[path$
|
|
98
|
-
const segs = pathIsArray ? path$
|
|
97
|
+
if (target[path$14] !== void 0) return isValid(path$14, target, options) ? target[path$14] : options.default;
|
|
98
|
+
const segs = pathIsArray ? path$14 : split$1(path$14, splitChar, options);
|
|
99
99
|
const len = segs.length;
|
|
100
100
|
let idx = 0;
|
|
101
101
|
do {
|
|
@@ -494,9 +494,9 @@ var require_set_value = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
494
494
|
} else obj[prop] = value;
|
|
495
495
|
return obj;
|
|
496
496
|
};
|
|
497
|
-
const setValue = (target, path$
|
|
498
|
-
if (!path$
|
|
499
|
-
const keys = split(path$
|
|
497
|
+
const setValue = (target, path$14, value, options) => {
|
|
498
|
+
if (!path$14 || !isObject(target)) return target;
|
|
499
|
+
const keys = split(path$14, options);
|
|
500
500
|
let obj = target;
|
|
501
501
|
for (let i = 0; i < keys.length; i++) {
|
|
502
502
|
const key = keys[i];
|
|
@@ -619,7 +619,7 @@ async function cleanProjects(cwd, overrides) {
|
|
|
619
619
|
//#endregion
|
|
620
620
|
//#region package.json
|
|
621
621
|
var name = "@icebreakers/monorepo";
|
|
622
|
-
var version = "3.1.
|
|
622
|
+
var version = "3.1.8";
|
|
623
623
|
|
|
624
624
|
//#endregion
|
|
625
625
|
//#region src/constants.ts
|
|
@@ -657,6 +657,43 @@ function isIgnorableFsError(error) {
|
|
|
657
657
|
return code === "ENOENT" || code === "EBUSY" || code === "EEXIST";
|
|
658
658
|
}
|
|
659
659
|
|
|
660
|
+
//#endregion
|
|
661
|
+
//#region src/utils/github.ts
|
|
662
|
+
/**
|
|
663
|
+
* 将 Issue 模版里的 discussions 链接同步为当前仓库的 discussions 地址。
|
|
664
|
+
*/
|
|
665
|
+
function updateIssueTemplateConfig(source, repoName) {
|
|
666
|
+
if (!repoName) return source;
|
|
667
|
+
let doc;
|
|
668
|
+
try {
|
|
669
|
+
doc = (0, yaml.parseDocument)(source);
|
|
670
|
+
} catch {
|
|
671
|
+
return source;
|
|
672
|
+
}
|
|
673
|
+
const contactLinks = doc.get("contact_links");
|
|
674
|
+
if (!(0, yaml.isSeq)(contactLinks)) return source;
|
|
675
|
+
const nextUrl = `https://github.com/${repoName}/discussions`;
|
|
676
|
+
let changed = false;
|
|
677
|
+
contactLinks.items.forEach((_, index) => {
|
|
678
|
+
const url = doc.getIn([
|
|
679
|
+
"contact_links",
|
|
680
|
+
index,
|
|
681
|
+
"url"
|
|
682
|
+
]);
|
|
683
|
+
if (typeof url !== "string") return;
|
|
684
|
+
if (!url.includes("/discussions")) return;
|
|
685
|
+
if (url === nextUrl) return;
|
|
686
|
+
doc.setIn([
|
|
687
|
+
"contact_links",
|
|
688
|
+
index,
|
|
689
|
+
"url"
|
|
690
|
+
], nextUrl);
|
|
691
|
+
changed = true;
|
|
692
|
+
});
|
|
693
|
+
if (!changed) return source;
|
|
694
|
+
return doc.toString();
|
|
695
|
+
}
|
|
696
|
+
|
|
660
697
|
//#endregion
|
|
661
698
|
//#region src/utils/gitignore.ts
|
|
662
699
|
/**
|
|
@@ -914,6 +951,21 @@ async function setChangeset_default(ctx) {
|
|
|
914
951
|
}
|
|
915
952
|
}
|
|
916
953
|
|
|
954
|
+
//#endregion
|
|
955
|
+
//#region src/commands/init/setIssueTemplateConfig.ts
|
|
956
|
+
/**
|
|
957
|
+
* 同步 Issue 模版里的 discussions 链接到当前仓库。
|
|
958
|
+
*/
|
|
959
|
+
async function setIssueTemplateConfig_default(ctx) {
|
|
960
|
+
const repoName = ctx.gitUrl?.full_name;
|
|
961
|
+
if (!repoName) return;
|
|
962
|
+
const configPath = pathe.default.resolve(ctx.cwd, ".github/ISSUE_TEMPLATE/config.yml");
|
|
963
|
+
if (!await fs_extra.default.pathExists(configPath)) return;
|
|
964
|
+
const source = await fs_extra.default.readFile(configPath, "utf8");
|
|
965
|
+
const next = updateIssueTemplateConfig(source, repoName);
|
|
966
|
+
if (next !== source) await fs_extra.default.writeFile(configPath, next, "utf8");
|
|
967
|
+
}
|
|
968
|
+
|
|
917
969
|
//#endregion
|
|
918
970
|
//#region src/commands/init/setPkgJson.ts
|
|
919
971
|
var import_set_value$2 = /* @__PURE__ */ __toESM(require_set_value(), 1);
|
|
@@ -998,6 +1050,7 @@ async function init(cwd) {
|
|
|
998
1050
|
if (!initConfig.skipChangeset) await setChangeset_default(ctx);
|
|
999
1051
|
if (!initConfig.skipPkgJson) await setPkgJson_default(ctx);
|
|
1000
1052
|
if (!initConfig.skipReadme) await setReadme_default(ctx);
|
|
1053
|
+
if (!initConfig.skipIssueTemplateConfig) await setIssueTemplateConfig_default(ctx);
|
|
1001
1054
|
}
|
|
1002
1055
|
|
|
1003
1056
|
//#endregion
|
|
@@ -1443,6 +1496,24 @@ async function upgradeMonorepo(opts) {
|
|
|
1443
1496
|
});
|
|
1444
1497
|
continue;
|
|
1445
1498
|
}
|
|
1499
|
+
if (relPath === ".github/ISSUE_TEMPLATE/config.yml") {
|
|
1500
|
+
const data = updateIssueTemplateConfig(await fs_extra.default.readFile(file.path, "utf8"), repoName);
|
|
1501
|
+
const intent$1 = await evaluateWriteIntent(targetPath, {
|
|
1502
|
+
skipOverwrite,
|
|
1503
|
+
source: data
|
|
1504
|
+
});
|
|
1505
|
+
const action$1 = async () => {
|
|
1506
|
+
await fs_extra.default.outputFile(targetPath, data);
|
|
1507
|
+
logger.success(targetPath);
|
|
1508
|
+
};
|
|
1509
|
+
await scheduleOverwrite(intent$1, {
|
|
1510
|
+
relPath,
|
|
1511
|
+
targetPath,
|
|
1512
|
+
action: action$1,
|
|
1513
|
+
pending: pendingOverwrites
|
|
1514
|
+
});
|
|
1515
|
+
continue;
|
|
1516
|
+
}
|
|
1446
1517
|
const source = await fs_extra.default.readFile(file.path);
|
|
1447
1518
|
const intent = await evaluateWriteIntent(targetPath, {
|
|
1448
1519
|
skipOverwrite,
|
|
@@ -1683,6 +1754,12 @@ Object.defineProperty(exports, 'toWorkspaceGitignorePath', {
|
|
|
1683
1754
|
return toWorkspaceGitignorePath;
|
|
1684
1755
|
}
|
|
1685
1756
|
});
|
|
1757
|
+
Object.defineProperty(exports, 'updateIssueTemplateConfig', {
|
|
1758
|
+
enumerable: true,
|
|
1759
|
+
get: function () {
|
|
1760
|
+
return updateIssueTemplateConfig;
|
|
1761
|
+
}
|
|
1762
|
+
});
|
|
1686
1763
|
Object.defineProperty(exports, 'upgradeMonorepo', {
|
|
1687
1764
|
enumerable: true,
|
|
1688
1765
|
get: function () {
|
|
@@ -12,6 +12,7 @@ import { loadConfig } from "c12";
|
|
|
12
12
|
import pc from "picocolors";
|
|
13
13
|
import path$1 from "node:path";
|
|
14
14
|
import { fileURLToPath } from "node:url";
|
|
15
|
+
import YAML, { isSeq, parseDocument } from "yaml";
|
|
15
16
|
import crypto from "node:crypto";
|
|
16
17
|
import "@pnpm/types";
|
|
17
18
|
import { parse, stringify } from "comment-json";
|
|
@@ -19,7 +20,6 @@ import os from "node:os";
|
|
|
19
20
|
import { execaCommand } from "execa";
|
|
20
21
|
import PQueue from "p-queue";
|
|
21
22
|
import klaw from "klaw";
|
|
22
|
-
import YAML from "yaml";
|
|
23
23
|
import { Buffer as Buffer$1 } from "node:buffer";
|
|
24
24
|
import { coerce, gte, minVersion } from "semver";
|
|
25
25
|
|
|
@@ -607,7 +607,7 @@ async function cleanProjects(cwd, overrides) {
|
|
|
607
607
|
//#endregion
|
|
608
608
|
//#region package.json
|
|
609
609
|
var name = "@icebreakers/monorepo";
|
|
610
|
-
var version = "3.1.
|
|
610
|
+
var version = "3.1.8";
|
|
611
611
|
|
|
612
612
|
//#endregion
|
|
613
613
|
//#region src/constants.ts
|
|
@@ -645,6 +645,43 @@ function isIgnorableFsError(error) {
|
|
|
645
645
|
return code === "ENOENT" || code === "EBUSY" || code === "EEXIST";
|
|
646
646
|
}
|
|
647
647
|
|
|
648
|
+
//#endregion
|
|
649
|
+
//#region src/utils/github.ts
|
|
650
|
+
/**
|
|
651
|
+
* 将 Issue 模版里的 discussions 链接同步为当前仓库的 discussions 地址。
|
|
652
|
+
*/
|
|
653
|
+
function updateIssueTemplateConfig(source, repoName) {
|
|
654
|
+
if (!repoName) return source;
|
|
655
|
+
let doc;
|
|
656
|
+
try {
|
|
657
|
+
doc = parseDocument(source);
|
|
658
|
+
} catch {
|
|
659
|
+
return source;
|
|
660
|
+
}
|
|
661
|
+
const contactLinks = doc.get("contact_links");
|
|
662
|
+
if (!isSeq(contactLinks)) return source;
|
|
663
|
+
const nextUrl = `https://github.com/${repoName}/discussions`;
|
|
664
|
+
let changed = false;
|
|
665
|
+
contactLinks.items.forEach((_, index) => {
|
|
666
|
+
const url = doc.getIn([
|
|
667
|
+
"contact_links",
|
|
668
|
+
index,
|
|
669
|
+
"url"
|
|
670
|
+
]);
|
|
671
|
+
if (typeof url !== "string") return;
|
|
672
|
+
if (!url.includes("/discussions")) return;
|
|
673
|
+
if (url === nextUrl) return;
|
|
674
|
+
doc.setIn([
|
|
675
|
+
"contact_links",
|
|
676
|
+
index,
|
|
677
|
+
"url"
|
|
678
|
+
], nextUrl);
|
|
679
|
+
changed = true;
|
|
680
|
+
});
|
|
681
|
+
if (!changed) return source;
|
|
682
|
+
return doc.toString();
|
|
683
|
+
}
|
|
684
|
+
|
|
648
685
|
//#endregion
|
|
649
686
|
//#region src/utils/gitignore.ts
|
|
650
687
|
/**
|
|
@@ -902,6 +939,21 @@ async function setChangeset_default(ctx) {
|
|
|
902
939
|
}
|
|
903
940
|
}
|
|
904
941
|
|
|
942
|
+
//#endregion
|
|
943
|
+
//#region src/commands/init/setIssueTemplateConfig.ts
|
|
944
|
+
/**
|
|
945
|
+
* 同步 Issue 模版里的 discussions 链接到当前仓库。
|
|
946
|
+
*/
|
|
947
|
+
async function setIssueTemplateConfig_default(ctx) {
|
|
948
|
+
const repoName = ctx.gitUrl?.full_name;
|
|
949
|
+
if (!repoName) return;
|
|
950
|
+
const configPath = path.resolve(ctx.cwd, ".github/ISSUE_TEMPLATE/config.yml");
|
|
951
|
+
if (!await fs.pathExists(configPath)) return;
|
|
952
|
+
const source = await fs.readFile(configPath, "utf8");
|
|
953
|
+
const next = updateIssueTemplateConfig(source, repoName);
|
|
954
|
+
if (next !== source) await fs.writeFile(configPath, next, "utf8");
|
|
955
|
+
}
|
|
956
|
+
|
|
905
957
|
//#endregion
|
|
906
958
|
//#region src/commands/init/setPkgJson.ts
|
|
907
959
|
var import_set_value$2 = /* @__PURE__ */ __toESM(require_set_value(), 1);
|
|
@@ -986,6 +1038,7 @@ async function init(cwd) {
|
|
|
986
1038
|
if (!initConfig.skipChangeset) await setChangeset_default(ctx);
|
|
987
1039
|
if (!initConfig.skipPkgJson) await setPkgJson_default(ctx);
|
|
988
1040
|
if (!initConfig.skipReadme) await setReadme_default(ctx);
|
|
1041
|
+
if (!initConfig.skipIssueTemplateConfig) await setIssueTemplateConfig_default(ctx);
|
|
989
1042
|
}
|
|
990
1043
|
|
|
991
1044
|
//#endregion
|
|
@@ -1431,6 +1484,24 @@ async function upgradeMonorepo(opts) {
|
|
|
1431
1484
|
});
|
|
1432
1485
|
continue;
|
|
1433
1486
|
}
|
|
1487
|
+
if (relPath === ".github/ISSUE_TEMPLATE/config.yml") {
|
|
1488
|
+
const data = updateIssueTemplateConfig(await fs.readFile(file.path, "utf8"), repoName);
|
|
1489
|
+
const intent$1 = await evaluateWriteIntent(targetPath, {
|
|
1490
|
+
skipOverwrite,
|
|
1491
|
+
source: data
|
|
1492
|
+
});
|
|
1493
|
+
const action$1 = async () => {
|
|
1494
|
+
await fs.outputFile(targetPath, data);
|
|
1495
|
+
logger.success(targetPath);
|
|
1496
|
+
};
|
|
1497
|
+
await scheduleOverwrite(intent$1, {
|
|
1498
|
+
relPath,
|
|
1499
|
+
targetPath,
|
|
1500
|
+
action: action$1,
|
|
1501
|
+
pending: pendingOverwrites
|
|
1502
|
+
});
|
|
1503
|
+
continue;
|
|
1504
|
+
}
|
|
1434
1505
|
const source = await fs.readFile(file.path);
|
|
1435
1506
|
const intent = await evaluateWriteIntent(targetPath, {
|
|
1436
1507
|
skipOverwrite,
|
|
@@ -1455,4 +1526,4 @@ async function upgradeMonorepo(opts) {
|
|
|
1455
1526
|
}
|
|
1456
1527
|
|
|
1457
1528
|
//#endregion
|
|
1458
|
-
export {
|
|
1529
|
+
export { createTimestampFolderName as A, templatesDir as C, defineMonorepoConfig as D, cleanProjects as E, logger as F, getWorkspaceData as I, getWorkspacePackages as L, generateAgenticTemplate as M, generateAgenticTemplates as N, loadMonorepoConfig as O, loadAgenticTasks as P, GitClient as R, rootDir as S, version as T, toWorkspaceGitignorePath as _, createContext as a, assetsDir as b, getCreateChoices as c, escapeStringRegexp as d, isMatch as f, toPublishGitignorePath as g, isGitignoreFile as h, init as i, defaultAgenticBaseDir as j, resolveCommandConfig as k, getTemplateMap as l, isFileChanged as m, syncNpmMirror as n, createNewProject as o, getFileHash as p, setVscodeBinaryMirror as r, defaultTemplate as s, upgradeMonorepo as t, templateMap as u, updateIssueTemplateConfig as v, name as w, packageDir as x, isIgnorableFsError as y };
|
package/package.json
CHANGED