@icebreakers/monorepo 3.2.12 → 3.2.13

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 CHANGED
@@ -1,4 +1,4 @@
1
- const require_upgrade = require('./upgrade-DR2Sqzg5.cjs');
1
+ const require_upgrade = require('./upgrade-DjOZstRC.cjs');
2
2
  let node_process = require("node:process");
3
3
  node_process = require_upgrade.__toESM(node_process);
4
4
  let _icebreakers_monorepo_templates = require("@icebreakers/monorepo-templates");
package/dist/cli.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { C as syncSkills, F as generateAgenticTemplate, I as generateAgenticTemplates, L as loadAgenticTasks, M as resolveCommandConfig, N as createTimestampFolderName, O as name, P as defaultAgenticBaseDir, R as logger, S as skillTargets, _ as getCreateChoices, b as cleanProjects, g as defaultTemplate, h as createNewProject, i as init, k as version, n as syncNpmMirror, r as setVscodeBinaryMirror, t as upgradeMonorepo } from "./upgrade-CPqyPuV5.mjs";
1
+ import { C as syncSkills, F as generateAgenticTemplate, I as generateAgenticTemplates, L as loadAgenticTasks, M as resolveCommandConfig, N as createTimestampFolderName, O as name, P as defaultAgenticBaseDir, R as logger, S as skillTargets, _ as getCreateChoices, b as cleanProjects, g as defaultTemplate, h as createNewProject, i as init, k as version, n as syncNpmMirror, r as setVscodeBinaryMirror, t as upgradeMonorepo } from "./upgrade-DiPTZW6J.mjs";
2
2
  import process from "node:process";
3
3
  import { input, program, select } from "@icebreakers/monorepo-templates";
4
4
 
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_upgrade = require('./upgrade-DR2Sqzg5.cjs');
2
+ const require_upgrade = require('./upgrade-DjOZstRC.cjs');
3
3
  let _icebreakers_monorepo_templates = require("@icebreakers/monorepo-templates");
4
4
 
5
5
  exports.GitClient = require_upgrade.GitClient;
package/dist/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { A as defineMonorepoConfig, B as getWorkspacePackages, C as syncSkills, D as templatesDir, E as rootDir, F as generateAgenticTemplate, I as generateAgenticTemplates, L as loadAgenticTasks, M as resolveCommandConfig, N as createTimestampFolderName, O as name, P as defaultAgenticBaseDir, R as logger, S as skillTargets, T as packageDir, V as GitClient, _ as getCreateChoices, a as escapeStringRegexp, b as cleanProjects, c as isFileChanged, d as toWorkspaceGitignorePath, f as updateIssueTemplateConfig, h as createNewProject, i as init, j as loadMonorepoConfig, k as version, l as isGitignoreFile, m as createContext, n as syncNpmMirror, o as isMatch, p as isIgnorableFsError, r as setVscodeBinaryMirror, s as getFileHash, t as upgradeMonorepo, u as toPublishGitignorePath, v as getTemplateMap, w as assetsDir, x as getSkillTargetPaths, y as templateMap, z as getWorkspaceData } from "./upgrade-CPqyPuV5.mjs";
1
+ import { A as defineMonorepoConfig, B as getWorkspacePackages, C as syncSkills, D as templatesDir, E as rootDir, F as generateAgenticTemplate, I as generateAgenticTemplates, L as loadAgenticTasks, M as resolveCommandConfig, N as createTimestampFolderName, O as name, P as defaultAgenticBaseDir, R as logger, S as skillTargets, T as packageDir, V as GitClient, _ as getCreateChoices, a as escapeStringRegexp, b as cleanProjects, c as isFileChanged, d as toWorkspaceGitignorePath, f as updateIssueTemplateConfig, h as createNewProject, i as init, j as loadMonorepoConfig, k as version, l as isGitignoreFile, m as createContext, n as syncNpmMirror, o as isMatch, p as isIgnorableFsError, r as setVscodeBinaryMirror, s as getFileHash, t as upgradeMonorepo, u as toPublishGitignorePath, v as getTemplateMap, w as assetsDir, x as getSkillTargetPaths, y as templateMap, z as getWorkspaceData } from "./upgrade-DiPTZW6J.mjs";
2
2
 
3
3
  export { GitClient, assetsDir, cleanProjects, createContext, createNewProject, createTimestampFolderName, defaultAgenticBaseDir, defineMonorepoConfig, escapeStringRegexp, generateAgenticTemplate, generateAgenticTemplates, getCreateChoices, getFileHash, getSkillTargetPaths, getTemplateMap, getWorkspaceData, getWorkspacePackages, init, isFileChanged, isGitignoreFile, isIgnorableFsError, isMatch, loadAgenticTasks, loadMonorepoConfig, logger, name, packageDir, resolveCommandConfig, rootDir, setVscodeBinaryMirror, skillTargets, syncNpmMirror, syncSkills, templateMap, templatesDir, toPublishGitignorePath, toWorkspaceGitignorePath, updateIssueTemplateConfig, upgradeMonorepo, version };
@@ -559,7 +559,7 @@ async function resolveCommandConfig(name, cwd) {
559
559
  //#endregion
560
560
  //#region package.json
561
561
  var name = "@icebreakers/monorepo";
562
- var version = "3.2.12";
562
+ var version = "3.2.13";
563
563
 
564
564
  //#endregion
565
565
  //#region src/constants.ts
@@ -1164,11 +1164,11 @@ async function syncNpmMirror(cwd, options) {
1164
1164
 
1165
1165
  //#endregion
1166
1166
  //#region src/commands/upgrade/agents.ts
1167
- function normalizeEol(input) {
1167
+ function normalizeEol$1(input) {
1168
1168
  return input.replace(/\r\n/g, "\n");
1169
1169
  }
1170
1170
  function normalizeComparableContent(input) {
1171
- return normalizeEol(input).trimEnd();
1171
+ return normalizeEol$1(input).trimEnd();
1172
1172
  }
1173
1173
  function normalizeHeadingKey(line) {
1174
1174
  return line.replace(/^##\s+/, "").trim().toLowerCase();
@@ -1188,7 +1188,7 @@ function trimEdgeEmptyLines(lines) {
1188
1188
  return next;
1189
1189
  }
1190
1190
  function parseMarkdownByH2(content) {
1191
- const lines = normalizeEol(content).split("\n");
1191
+ const lines = normalizeEol$1(content).split("\n");
1192
1192
  const preamble = [];
1193
1193
  const sections = [];
1194
1194
  let current;
@@ -1214,8 +1214,8 @@ function parseMarkdownByH2(content) {
1214
1214
  };
1215
1215
  }
1216
1216
  function mergePlainText(source, target) {
1217
- const sourceLines = trimEdgeEmptyLines(normalizeEol(source).split("\n"));
1218
- const result = trimEdgeEmptyLines(normalizeEol(target).split("\n"));
1217
+ const sourceLines = trimEdgeEmptyLines(normalizeEol$1(source).split("\n"));
1218
+ const result = trimEdgeEmptyLines(normalizeEol$1(target).split("\n"));
1219
1219
  const seen = new Set(result);
1220
1220
  for (const line of sourceLines) {
1221
1221
  if (!line.trim()) continue;
@@ -1461,6 +1461,35 @@ function mergeWorkspaceManifest(source, target) {
1461
1461
 
1462
1462
  //#endregion
1463
1463
  //#region src/commands/upgrade/index.ts
1464
+ function normalizeEol(input) {
1465
+ return input.replace(/\r\n/g, "\n");
1466
+ }
1467
+ function normalizeGitignoreLine(line) {
1468
+ const trimmed = line.trim();
1469
+ if (!trimmed) return "";
1470
+ if (trimmed.startsWith("#")) return `#${trimmed.slice(1).trim()}`;
1471
+ return trimmed;
1472
+ }
1473
+ function isTextEquivalent(left, right) {
1474
+ return normalizeEol(left).trimEnd() === normalizeEol(right).trimEnd();
1475
+ }
1476
+ function mergeGitignore(source, target) {
1477
+ const sourceLines = normalizeEol(source).split("\n");
1478
+ const result = normalizeEol(target).split("\n");
1479
+ const seen = new Set(result.map((line) => normalizeGitignoreLine(line)).filter(Boolean));
1480
+ for (const line of sourceLines) {
1481
+ const normalized = normalizeGitignoreLine(line);
1482
+ if (!normalized || seen.has(normalized)) continue;
1483
+ seen.add(normalized);
1484
+ result.push(line);
1485
+ }
1486
+ while (result.length) {
1487
+ const last = result.at(-1);
1488
+ if (last === void 0 || last.trim().length > 0) break;
1489
+ result.pop();
1490
+ }
1491
+ return `${result.join("\n")}\n`;
1492
+ }
1464
1493
  /**
1465
1494
  * 将 assets 目录的模版文件同步到工程中,实现一键升级脚手架能力。
1466
1495
  */
@@ -1551,6 +1580,25 @@ async function upgradeMonorepo(opts) {
1551
1580
  });
1552
1581
  continue;
1553
1582
  }
1583
+ if (relPath === ".gitignore") {
1584
+ const source = await fs.readFile(file.path, "utf8");
1585
+ const exists = await fs.pathExists(targetPath);
1586
+ const target = exists ? await fs.readFile(targetPath, "utf8") : "";
1587
+ const data = exists ? mergeGitignore(source, target) : source;
1588
+ if (exists && isTextEquivalent(target, data)) continue;
1589
+ const intent = await evaluateWriteIntent(targetPath, buildWriteIntentOptions(data));
1590
+ const action = async () => {
1591
+ await fs.outputFile(targetPath, data, "utf8");
1592
+ logger.success(targetPath);
1593
+ };
1594
+ await scheduleOverwrite(intent, {
1595
+ relPath,
1596
+ targetPath,
1597
+ action,
1598
+ pending: pendingOverwrites
1599
+ });
1600
+ continue;
1601
+ }
1554
1602
  if (relPath === "AGENTS.md") {
1555
1603
  const source = await fs.readFile(file.path, "utf8");
1556
1604
  const exists = await fs.pathExists(targetPath);
@@ -570,7 +570,7 @@ async function resolveCommandConfig(name, cwd) {
570
570
  //#endregion
571
571
  //#region package.json
572
572
  var name = "@icebreakers/monorepo";
573
- var version = "3.2.12";
573
+ var version = "3.2.13";
574
574
 
575
575
  //#endregion
576
576
  //#region src/constants.ts
@@ -1175,11 +1175,11 @@ async function syncNpmMirror(cwd, options) {
1175
1175
 
1176
1176
  //#endregion
1177
1177
  //#region src/commands/upgrade/agents.ts
1178
- function normalizeEol(input) {
1178
+ function normalizeEol$1(input) {
1179
1179
  return input.replace(/\r\n/g, "\n");
1180
1180
  }
1181
1181
  function normalizeComparableContent(input) {
1182
- return normalizeEol(input).trimEnd();
1182
+ return normalizeEol$1(input).trimEnd();
1183
1183
  }
1184
1184
  function normalizeHeadingKey(line) {
1185
1185
  return line.replace(/^##\s+/, "").trim().toLowerCase();
@@ -1199,7 +1199,7 @@ function trimEdgeEmptyLines(lines) {
1199
1199
  return next;
1200
1200
  }
1201
1201
  function parseMarkdownByH2(content) {
1202
- const lines = normalizeEol(content).split("\n");
1202
+ const lines = normalizeEol$1(content).split("\n");
1203
1203
  const preamble = [];
1204
1204
  const sections = [];
1205
1205
  let current;
@@ -1225,8 +1225,8 @@ function parseMarkdownByH2(content) {
1225
1225
  };
1226
1226
  }
1227
1227
  function mergePlainText(source, target) {
1228
- const sourceLines = trimEdgeEmptyLines(normalizeEol(source).split("\n"));
1229
- const result = trimEdgeEmptyLines(normalizeEol(target).split("\n"));
1228
+ const sourceLines = trimEdgeEmptyLines(normalizeEol$1(source).split("\n"));
1229
+ const result = trimEdgeEmptyLines(normalizeEol$1(target).split("\n"));
1230
1230
  const seen = new Set(result);
1231
1231
  for (const line of sourceLines) {
1232
1232
  if (!line.trim()) continue;
@@ -1472,6 +1472,35 @@ function mergeWorkspaceManifest(source, target) {
1472
1472
 
1473
1473
  //#endregion
1474
1474
  //#region src/commands/upgrade/index.ts
1475
+ function normalizeEol(input) {
1476
+ return input.replace(/\r\n/g, "\n");
1477
+ }
1478
+ function normalizeGitignoreLine(line) {
1479
+ const trimmed = line.trim();
1480
+ if (!trimmed) return "";
1481
+ if (trimmed.startsWith("#")) return `#${trimmed.slice(1).trim()}`;
1482
+ return trimmed;
1483
+ }
1484
+ function isTextEquivalent(left, right) {
1485
+ return normalizeEol(left).trimEnd() === normalizeEol(right).trimEnd();
1486
+ }
1487
+ function mergeGitignore(source, target) {
1488
+ const sourceLines = normalizeEol(source).split("\n");
1489
+ const result = normalizeEol(target).split("\n");
1490
+ const seen = new Set(result.map((line) => normalizeGitignoreLine(line)).filter(Boolean));
1491
+ for (const line of sourceLines) {
1492
+ const normalized = normalizeGitignoreLine(line);
1493
+ if (!normalized || seen.has(normalized)) continue;
1494
+ seen.add(normalized);
1495
+ result.push(line);
1496
+ }
1497
+ while (result.length) {
1498
+ const last = result.at(-1);
1499
+ if (last === void 0 || last.trim().length > 0) break;
1500
+ result.pop();
1501
+ }
1502
+ return `${result.join("\n")}\n`;
1503
+ }
1475
1504
  /**
1476
1505
  * 将 assets 目录的模版文件同步到工程中,实现一键升级脚手架能力。
1477
1506
  */
@@ -1562,6 +1591,25 @@ async function upgradeMonorepo(opts) {
1562
1591
  });
1563
1592
  continue;
1564
1593
  }
1594
+ if (relPath === ".gitignore") {
1595
+ const source = await fs_extra.default.readFile(file.path, "utf8");
1596
+ const exists = await fs_extra.default.pathExists(targetPath);
1597
+ const target = exists ? await fs_extra.default.readFile(targetPath, "utf8") : "";
1598
+ const data = exists ? mergeGitignore(source, target) : source;
1599
+ if (exists && isTextEquivalent(target, data)) continue;
1600
+ const intent = await evaluateWriteIntent(targetPath, buildWriteIntentOptions(data));
1601
+ const action = async () => {
1602
+ await fs_extra.default.outputFile(targetPath, data, "utf8");
1603
+ logger.success(targetPath);
1604
+ };
1605
+ await scheduleOverwrite(intent, {
1606
+ relPath,
1607
+ targetPath,
1608
+ action,
1609
+ pending: pendingOverwrites
1610
+ });
1611
+ continue;
1612
+ }
1565
1613
  if (relPath === "AGENTS.md") {
1566
1614
  const source = await fs_extra.default.readFile(file.path, "utf8");
1567
1615
  const exists = await fs_extra.default.pathExists(targetPath);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@icebreakers/monorepo",
3
3
  "type": "module",
4
- "version": "3.2.12",
4
+ "version": "3.2.13",
5
5
  "description": "The icebreaker's monorepo manager",
6
6
  "author": "ice breaker <hi@sonofmagic.top>",
7
7
  "license": "MIT",
@@ -64,7 +64,7 @@
64
64
  "@pnpm/workspace.find-packages": "^1000.0.62",
65
65
  "@pnpm/workspace.read-manifest": "^1000.2.10",
66
66
  "c12": "^3.3.3",
67
- "comment-json": "^4.5.1",
67
+ "comment-json": "^4.6.1",
68
68
  "consola": "^3.4.2",
69
69
  "fs-extra": "^11.3.3",
70
70
  "git-url-parse": "^16.1.0",