@ariestools/toolchain 9.1.0 → 9.1.1

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/bin/xy.mjs CHANGED
@@ -20532,13 +20532,13 @@ async function fetchAllRegistryInfo(packageNames, options = {}) {
20532
20532
  return await fetchAllRegistryInfoDirect(packageNames, options);
20533
20533
  }
20534
20534
  //#endregion
20535
- //#region ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.2.0/node_modules/@inquirer/core/dist/lib/key.js
20535
+ //#region ../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.2.0/node_modules/@inquirer/core/dist/lib/key.js
20536
20536
  const isUpKey = (key, keybindings = []) => key.name === "up" || keybindings.includes("vim") && key.name === "k" || keybindings.includes("emacs") && key.ctrl && key.name === "p";
20537
20537
  const isDownKey = (key, keybindings = []) => key.name === "down" || keybindings.includes("vim") && key.name === "j" || keybindings.includes("emacs") && key.ctrl && key.name === "n";
20538
20538
  const isSpaceKey = (key) => key.name === "space";
20539
20539
  const isEnterKey = (key) => key.name === "enter" || key.name === "return";
20540
20540
  //#endregion
20541
- //#region ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.2.0/node_modules/@inquirer/core/dist/lib/errors.js
20541
+ //#region ../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.2.0/node_modules/@inquirer/core/dist/lib/errors.js
20542
20542
  var AbortPromptError = class extends Error {
20543
20543
  name = "AbortPromptError";
20544
20544
  message = "Prompt was aborted";
@@ -20561,7 +20561,7 @@ var ValidationError = class extends Error {
20561
20561
  name = "ValidationError";
20562
20562
  };
20563
20563
  //#endregion
20564
- //#region ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.2.0/node_modules/@inquirer/core/dist/lib/hook-engine.js
20564
+ //#region ../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.2.0/node_modules/@inquirer/core/dist/lib/hook-engine.js
20565
20565
  const hookStorage = new AsyncLocalStorage();
20566
20566
  function createStore(rl) {
20567
20567
  return {
@@ -20657,15 +20657,20 @@ const effectScheduler = {
20657
20657
  }
20658
20658
  };
20659
20659
  //#endregion
20660
- //#region ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.2.0/node_modules/@inquirer/core/dist/lib/use-state.js
20660
+ //#region ../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.2.0/node_modules/@inquirer/core/dist/lib/use-state.js
20661
20661
  function isFactory(value) {
20662
20662
  return typeof value === "function";
20663
20663
  }
20664
+ function isReducer(value) {
20665
+ return typeof value === "function";
20666
+ }
20664
20667
  function useState(defaultValue) {
20665
20668
  return withPointer((pointer) => {
20666
20669
  const setState = AsyncResource.bind(function setState(newValue) {
20667
- if (pointer.get() !== newValue) {
20668
- pointer.set(newValue);
20670
+ const currentValue = pointer.get();
20671
+ const nextValue = isReducer(newValue) ? newValue(currentValue) : newValue;
20672
+ if (!Object.is(currentValue, nextValue)) {
20673
+ pointer.set(nextValue);
20669
20674
  handleChange();
20670
20675
  }
20671
20676
  });
@@ -20676,7 +20681,7 @@ function useState(defaultValue) {
20676
20681
  });
20677
20682
  }
20678
20683
  //#endregion
20679
- //#region ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.2.0/node_modules/@inquirer/core/dist/lib/use-effect.js
20684
+ //#region ../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.2.0/node_modules/@inquirer/core/dist/lib/use-effect.js
20680
20685
  function useEffect(cb, depArray) {
20681
20686
  withPointer((pointer) => {
20682
20687
  const oldDeps = pointer.get();
@@ -20685,12 +20690,12 @@ function useEffect(cb, depArray) {
20685
20690
  });
20686
20691
  }
20687
20692
  //#endregion
20688
- //#region ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.2.0/node_modules/@inquirer/core/dist/lib/use-ref.js
20693
+ //#region ../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.2.0/node_modules/@inquirer/core/dist/lib/use-ref.js
20689
20694
  function useRef(val) {
20690
20695
  return useState({ current: val })[0];
20691
20696
  }
20692
20697
  //#endregion
20693
- //#region ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.2.0/node_modules/@inquirer/core/dist/lib/use-keypress.js
20698
+ //#region ../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.2.0/node_modules/@inquirer/core/dist/lib/use-keypress.js
20694
20699
  function useKeypress(userHandler) {
20695
20700
  const signal = useRef(userHandler);
20696
20701
  signal.current = userHandler;
@@ -21018,7 +21023,7 @@ function wrapAnsi$1(string, columns, options) {
21018
21023
  return String(string).normalize().split(CRLF_OR_LF).map((line) => exec$2(line, columns, options)).join("\n");
21019
21024
  }
21020
21025
  //#endregion
21021
- //#region ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.2.0/node_modules/@inquirer/core/dist/lib/utils.js
21026
+ //#region ../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.2.0/node_modules/@inquirer/core/dist/lib/utils.js
21022
21027
  var import_cli_width = /* @__PURE__ */ __toESM(require_cli_width(), 1);
21023
21028
  /**
21024
21029
  * Force line returns at specific width. This function is ANSI code friendly and it'll
@@ -21358,7 +21363,7 @@ const eraseLine = "\x1B[2K";
21358
21363
  /** Erase the specified number of lines above the cursor */
21359
21364
  const eraseLines = (lines) => lines > 0 ? (eraseLine + cursorUp(1)).repeat(lines - 1) + "\x1B[2K\x1B[G" : "";
21360
21365
  //#endregion
21361
- //#region ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.2.0/node_modules/@inquirer/core/dist/lib/screen-manager.js
21366
+ //#region ../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.2.0/node_modules/@inquirer/core/dist/lib/screen-manager.js
21362
21367
  const height = (content) => content.split("\n").length;
21363
21368
  const lastLine = (content) => content.split("\n").pop() ?? "";
21364
21369
  var ScreenManager = class {
@@ -21415,7 +21420,7 @@ var ScreenManager = class {
21415
21420
  }
21416
21421
  };
21417
21422
  //#endregion
21418
- //#region ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.2.0/node_modules/@inquirer/core/dist/lib/promise-polyfill.js
21423
+ //#region ../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.2.0/node_modules/@inquirer/core/dist/lib/promise-polyfill.js
21419
21424
  var PromisePolyfill = class extends Promise {
21420
21425
  static withResolver() {
21421
21426
  let resolve;
@@ -21431,7 +21436,7 @@ var PromisePolyfill = class extends Promise {
21431
21436
  }
21432
21437
  };
21433
21438
  //#endregion
21434
- //#region ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.2.0/node_modules/@inquirer/core/dist/lib/create-prompt.js
21439
+ //#region ../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.2.0/node_modules/@inquirer/core/dist/lib/create-prompt.js
21435
21440
  var import_lib = /* @__PURE__ */ __toESM(require_lib(), 1);
21436
21441
  const nativeSetImmediate = globalThis.setImmediate;
21437
21442
  function getCallSites() {
@@ -35283,7 +35288,7 @@ var init_main = __esmMin((() => {
35283
35288
  exec$1 = x;
35284
35289
  }));
35285
35290
  //#endregion
35286
- //#region ../../node_modules/.pnpm/@publint+pack@0.1.6/node_modules/@publint/pack/src/node/utils.js
35291
+ //#region ../../node_modules/.pnpm/@publint+pack@0.1.7/node_modules/@publint/pack/src/node/utils.js
35287
35292
  /**
35288
35293
  * @param {string} packageManager
35289
35294
  * @returns {string[]}
@@ -35306,7 +35311,7 @@ async function getTempPackDir() {
35306
35311
  }
35307
35312
  var init_utils$2 = __esmMin((() => {}));
35308
35313
  //#endregion
35309
- //#region ../../node_modules/.pnpm/@publint+pack@0.1.6/node_modules/@publint/pack/src/node/pack.js
35314
+ //#region ../../node_modules/.pnpm/@publint+pack@0.1.7/node_modules/@publint/pack/src/node/pack.js
35310
35315
  /** @type {import('../index.d.ts').pack} */
35311
35316
  async function pack(dir, opts) {
35312
35317
  const packageManager = opts?.packageManager ?? "npm";
@@ -35344,7 +35349,7 @@ var init_pack = __esmMin((() => {
35344
35349
  init_utils$2();
35345
35350
  }));
35346
35351
  //#endregion
35347
- //#region ../../node_modules/.pnpm/@publint+pack@0.1.6/node_modules/@publint/pack/src/node/pack-as-json.js
35352
+ //#region ../../node_modules/.pnpm/@publint+pack@0.1.7/node_modules/@publint/pack/src/node/pack-as-json.js
35348
35353
  /** @type {import('../index.d.ts').packAsJson} */
35349
35354
  async function packAsJson(dir, opts) {
35350
35355
  const packageManager = opts?.packageManager ?? "npm";
@@ -35403,7 +35408,7 @@ var init_pack_as_json = __esmMin((() => {
35403
35408
  init_utils$2();
35404
35409
  }));
35405
35410
  //#endregion
35406
- //#region ../../node_modules/.pnpm/@publint+pack@0.1.6/node_modules/@publint/pack/src/shared/buffer-stream.js
35411
+ //#region ../../node_modules/.pnpm/@publint+pack@0.1.7/node_modules/@publint/pack/src/shared/buffer-stream.js
35407
35412
  /**
35408
35413
  * @param {ReadableStream<Uint8Array>} readableStream
35409
35414
  * @returns {Promise<ArrayBuffer>}
@@ -35413,7 +35418,7 @@ async function readableStreamToArrayBuffer(readableStream) {
35413
35418
  }
35414
35419
  var init_buffer_stream = __esmMin((() => {}));
35415
35420
  //#endregion
35416
- //#region ../../node_modules/.pnpm/@publint+pack@0.1.6/node_modules/@publint/pack/src/shared/parse-tar.js
35421
+ //#region ../../node_modules/.pnpm/@publint+pack@0.1.7/node_modules/@publint/pack/src/shared/parse-tar.js
35417
35422
  /**
35418
35423
  * @param {ArrayBuffer} buffer
35419
35424
  * @returns {import('../index.d.ts').TarballFile[]}
@@ -35423,11 +35428,11 @@ function parseTar(buffer) {
35423
35428
  /** @type {import('../index.d.ts').TarballFile[]} */
35424
35429
  const files = [];
35425
35430
  let offset = 0;
35426
- while (offset < buffer.byteLength) {
35427
- const type = read(buffer, decoder, offset + 156, 1);
35428
- if (type === "\0") break;
35431
+ while (offset + 512 <= buffer.byteLength) {
35429
35432
  const size = parseInt(read(buffer, decoder, offset + 124, 12), 8);
35430
- if (type === "0") {
35433
+ if (Number.isNaN(size)) break;
35434
+ const type = read(buffer, decoder, offset + 156, 1);
35435
+ if (type === "0" || type === "\0") {
35431
35436
  const name = read(buffer, decoder, offset, 100).split("\0", 1)[0];
35432
35437
  const data = new Uint8Array(buffer, offset + 512, size);
35433
35438
  files.push({
@@ -35457,7 +35462,7 @@ function getFilesRootDir(files) {
35457
35462
  }
35458
35463
  var init_parse_tar = __esmMin((() => {}));
35459
35464
  //#endregion
35460
- //#region ../../node_modules/.pnpm/@publint+pack@0.1.6/node_modules/@publint/pack/src/node/unpack.js
35465
+ //#region ../../node_modules/.pnpm/@publint+pack@0.1.7/node_modules/@publint/pack/src/node/unpack.js
35461
35466
  /** @type {import('../index.d.ts').unpack} */
35462
35467
  async function unpack(tarball) {
35463
35468
  /** @type {ArrayBuffer} */
@@ -35478,7 +35483,7 @@ var init_unpack = __esmMin((() => {
35478
35483
  init_parse_tar();
35479
35484
  }));
35480
35485
  //#endregion
35481
- //#region ../../node_modules/.pnpm/@publint+pack@0.1.6/node_modules/@publint/pack/src/node/pack-as-list.js
35486
+ //#region ../../node_modules/.pnpm/@publint+pack@0.1.7/node_modules/@publint/pack/src/node/pack-as-list.js
35482
35487
  /** @type {import('../index.d.ts').packAsList} */
35483
35488
  async function packAsList(dir, opts) {
35484
35489
  const packageManager = opts?.packageManager ?? "npm";
@@ -35562,7 +35567,7 @@ var init_pack_as_list = __esmMin((() => {
35562
35567
  init_utils$2();
35563
35568
  }));
35564
35569
  //#endregion
35565
- //#region ../../node_modules/.pnpm/@publint+pack@0.1.6/node_modules/@publint/pack/src/node/get-pack-directory.js
35570
+ //#region ../../node_modules/.pnpm/@publint+pack@0.1.7/node_modules/@publint/pack/src/node/get-pack-directory.js
35566
35571
  /** @type {import('../index.d.ts').getPackDirectory} */
35567
35572
  async function getPackDirectory(dir, packageManager) {
35568
35573
  if (packageManager === "pnpm") try {
@@ -35574,7 +35579,7 @@ async function getPackDirectory(dir, packageManager) {
35574
35579
  }
35575
35580
  var init_get_pack_directory = __esmMin((() => {}));
35576
35581
  //#endregion
35577
- //#region ../../node_modules/.pnpm/@publint+pack@0.1.6/node_modules/@publint/pack/src/shared/constants.js
35582
+ //#region ../../node_modules/.pnpm/@publint+pack@0.1.7/node_modules/@publint/pack/src/shared/constants.js
35578
35583
  var supportedPackageManagers;
35579
35584
  var init_constants$2 = __esmMin((() => {
35580
35585
  supportedPackageManagers = [
@@ -35585,7 +35590,7 @@ var init_constants$2 = __esmMin((() => {
35585
35590
  ];
35586
35591
  }));
35587
35592
  //#endregion
35588
- //#region ../../node_modules/.pnpm/@publint+pack@0.1.6/node_modules/@publint/pack/src/index-node.js
35593
+ //#region ../../node_modules/.pnpm/@publint+pack@0.1.7/node_modules/@publint/pack/src/index-node.js
35589
35594
  var init_index_node$1 = __esmMin((() => {
35590
35595
  init_pack();
35591
35596
  init_pack_as_list();
@@ -35595,7 +35600,7 @@ var init_index_node$1 = __esmMin((() => {
35595
35600
  init_constants$2();
35596
35601
  }));
35597
35602
  //#endregion
35598
- //#region ../../node_modules/.pnpm/publint@0.3.23/node_modules/publint/src/node/vfs-node.js
35603
+ //#region ../../node_modules/.pnpm/publint@0.3.24/node_modules/publint/src/node/vfs-node.js
35599
35604
  /**
35600
35605
  * Creates a node-compatible Vfs object
35601
35606
  * @returns {import('../shared/core.js').Vfs}
@@ -35634,7 +35639,7 @@ function createNodeVfs() {
35634
35639
  }
35635
35640
  var init_vfs_node = __esmMin((() => {}));
35636
35641
  //#endregion
35637
- //#region ../../node_modules/.pnpm/publint@0.3.23/node_modules/publint/src/shared/constants.js
35642
+ //#region ../../node_modules/.pnpm/publint@0.3.24/node_modules/publint/src/shared/constants.js
35638
35643
  var lintableFileExtensions, invalidJsxExtensions, knownBrowserishConditions, commonInternalPaths, commonInternalTestFileRegex, licenseFiles;
35639
35644
  var init_constants$1 = __esmMin((() => {
35640
35645
  lintableFileExtensions = [
@@ -35695,7 +35700,7 @@ var init_constants$1 = __esmMin((() => {
35695
35700
  ];
35696
35701
  }));
35697
35702
  //#endregion
35698
- //#region ../../node_modules/.pnpm/publint@0.3.23/node_modules/publint/src/shared/utils.js
35703
+ //#region ../../node_modules/.pnpm/publint@0.3.24/node_modules/publint/src/shared/utils.js
35699
35704
  /**
35700
35705
  * @param {string} code
35701
35706
  */
@@ -36111,7 +36116,7 @@ var init_utils$1 = __esmMin((() => {
36111
36116
  DTS_RE = /\.d\.[mc]?ts$/;
36112
36117
  }));
36113
36118
  //#endregion
36114
- //#region ../../node_modules/.pnpm/publint@0.3.23/node_modules/publint/src/shared/core.js
36119
+ //#region ../../node_modules/.pnpm/publint@0.3.24/node_modules/publint/src/shared/core.js
36115
36120
  /**
36116
36121
  * @typedef Vfs
36117
36122
  * @property {(path: string) => Promise<string>} readFile
@@ -36469,7 +36474,7 @@ async function core({ pkgDir, vfs, level, strict, _packedFiles }) {
36469
36474
  path: ["repository"],
36470
36475
  type: "warning"
36471
36476
  });
36472
- } else if (typeof repository === "object" && repository.url && repository.type === "git") {
36477
+ } else if (typeof repository === "object" && repository.url && (repository.type === "git" || repository.type == null)) {
36473
36478
  if (!isGitUrl(repository.url)) messages.push({
36474
36479
  code: "INVALID_REPOSITORY_VALUE",
36475
36480
  args: { type: "invalid-git-url" },
@@ -36987,7 +36992,7 @@ var init_core = __esmMin((() => {
36987
36992
  init_utils$1();
36988
36993
  }));
36989
36994
  //#endregion
36990
- //#region ../../node_modules/.pnpm/publint@0.3.23/node_modules/publint/src/shared/vfs-tarball.js
36995
+ //#region ../../node_modules/.pnpm/publint@0.3.24/node_modules/publint/src/shared/vfs-tarball.js
36991
36996
  /**
36992
36997
  * @param {import("../index.d.ts").PackFile[]} files
36993
36998
  * @return {import("./core.js").Vfs}
@@ -37211,7 +37216,7 @@ var init_detect = __esmMin((() => {
37211
37216
  init_constants();
37212
37217
  }));
37213
37218
  //#endregion
37214
- //#region ../../node_modules/.pnpm/publint@0.3.23/node_modules/publint/src/index-node.js
37219
+ //#region ../../node_modules/.pnpm/publint@0.3.24/node_modules/publint/src/index-node.js
37215
37220
  var index_node_exports = /* @__PURE__ */ __exportAll({ publint: () => publint$1 });
37216
37221
  /**
37217
37222
  * @typedef {T extends string ? T : never} ExtractStringLiteral
@@ -37363,7 +37368,7 @@ var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
37363
37368
  module.exports.createColors = createColors;
37364
37369
  }));
37365
37370
  //#endregion
37366
- //#region ../../node_modules/.pnpm/publint@0.3.23/node_modules/publint/src/shared/message.js
37371
+ //#region ../../node_modules/.pnpm/publint@0.3.24/node_modules/publint/src/shared/message.js
37367
37372
  /** @type {import('../utils.d.ts').formatMessage} */
37368
37373
  function formatMessage(m, pkg, opts = {}) {
37369
37374
  const h = getHighlighter(opts.color);
@@ -37532,7 +37537,7 @@ var init_message = __esmMin((() => {
37532
37537
  EMPTY_MSG = "<empty>";
37533
37538
  }));
37534
37539
  //#endregion
37535
- //#region ../../node_modules/.pnpm/publint@0.3.23/node_modules/publint/src/utils.js
37540
+ //#region ../../node_modules/.pnpm/publint@0.3.24/node_modules/publint/src/utils.js
37536
37541
  var utils_exports = /* @__PURE__ */ __exportAll({
37537
37542
  formatMessage: () => formatMessage,
37538
37543
  formatMessagePath: () => formatMessagePath,
@@ -41440,6 +41445,81 @@ function gitignore() {
41440
41445
  }
41441
41446
  }
41442
41447
  //#endregion
41448
+ //#region src/actions/gitlintIgnore.ts
41449
+ /** The canonical entry that denies the toolchain cache at every depth. */
41450
+ const TOOLCHAIN_CACHE_IGNORE_ENTRY = "**/.xy/cache/";
41451
+ const TOOLCHAIN_CACHE_IGNORE_COMMENT = "# XY toolchain cache (never .xy/work, which is tracked)";
41452
+ /**
41453
+ * Entries that deny `.xy/cache` in every package rather than only at the root.
41454
+ *
41455
+ * `.xy/cache` is deliberately absent. A Git ignore pattern containing an
41456
+ * interior slash is anchored to the directory of the ignore file, so that entry
41457
+ * denies the root cache and misses every per-package one — which is the exact
41458
+ * gap this rule exists to close. `.xy` on its own has no interior slash, so it
41459
+ * matches at any depth and does cover the cache, at the cost of also hiding the
41460
+ * tracked `.xy/work` store.
41461
+ */
41462
+ const NestedCacheCoveringEntries = /* @__PURE__ */ new Set([
41463
+ ".xy",
41464
+ "**/.xy",
41465
+ "**/.xy/cache"
41466
+ ]);
41467
+ /** Root-anchored entries this rule replaces rather than duplicates. */
41468
+ const SupersededCacheEntries = /* @__PURE__ */ new Set([".xy/cache", "/.xy/cache"]);
41469
+ function significantEntry(line) {
41470
+ const trimmed = line.trim();
41471
+ if (trimmed.length === 0 || trimmed.startsWith("#")) return void 0;
41472
+ return trimmed.endsWith("/") ? trimmed.slice(0, -1) : trimmed;
41473
+ }
41474
+ /**
41475
+ * Whether the ignore file denies the toolchain cache in every package.
41476
+ *
41477
+ * The toolchain writes `<packageRoot>/.xy/cache` for each package it compiles,
41478
+ * so a root-only rule leaves every package's cache committable.
41479
+ */
41480
+ function coversNestedToolchainCache(content) {
41481
+ return content.split("\n").some((line) => {
41482
+ const entry = significantEntry(line);
41483
+ return entry !== void 0 && NestedCacheCoveringEntries.has(entry);
41484
+ });
41485
+ }
41486
+ /**
41487
+ * Add the canonical entry, replacing a superseded root-anchored one in place
41488
+ * so the file gains coverage without gaining a redundant line.
41489
+ */
41490
+ function applyToolchainCacheEntry(content) {
41491
+ if (coversNestedToolchainCache(content)) return content;
41492
+ const lines = content.split("\n");
41493
+ const supersededIndex = lines.findIndex((line) => {
41494
+ const entry = significantEntry(line);
41495
+ return entry !== void 0 && SupersededCacheEntries.has(entry);
41496
+ });
41497
+ if (supersededIndex !== -1) {
41498
+ lines[supersededIndex] = TOOLCHAIN_CACHE_IGNORE_ENTRY;
41499
+ return lines.join("\n");
41500
+ }
41501
+ const body = content.length === 0 || content.endsWith("\n") ? content : `${content}\n`;
41502
+ return `${body}${body.length === 0 || body.endsWith("\n\n") ? "" : "\n"}${TOOLCHAIN_CACHE_IGNORE_COMMENT}\n${TOOLCHAIN_CACHE_IGNORE_ENTRY}\n`;
41503
+ }
41504
+ function ignorePath(rootDir) {
41505
+ return PATH.join(rootDir, ".gitignore");
41506
+ }
41507
+ function readIgnoreFile(rootDir) {
41508
+ const path = ignorePath(rootDir);
41509
+ return existsSync(path) ? readFileSync(path, "utf8") : "";
41510
+ }
41511
+ function hasNestedToolchainCacheEntry(rootDir) {
41512
+ return coversNestedToolchainCache(readIgnoreFile(rootDir));
41513
+ }
41514
+ /** Returns true when the file was changed. */
41515
+ function writeToolchainCacheEntry(rootDir) {
41516
+ const content = readIgnoreFile(rootDir);
41517
+ const updated = applyToolchainCacheEntry(content);
41518
+ if (updated === content) return false;
41519
+ writeFileSync(ignorePath(rootDir), updated, "utf8");
41520
+ return true;
41521
+ }
41522
+ //#endregion
41443
41523
  //#region src/actions/ruleRunner.ts
41444
41524
  const RULE_LEVELS = /* @__PURE__ */ new Set([
41445
41525
  "error",
@@ -41615,6 +41695,20 @@ const GITLINT_RULES = [
41615
41695
  description: "core.eol must be lf",
41616
41696
  fixable: true,
41617
41697
  id: "git.eol"
41698
+ },
41699
+ {
41700
+ check: (_context, { fix }) => {
41701
+ if (hasNestedToolchainCacheEntry(INIT_CWD())) return {};
41702
+ if (fix) {
41703
+ writeToolchainCacheEntry(INIT_CWD());
41704
+ return { fixedCount: 1 };
41705
+ }
41706
+ return { diagnostics: [{ message: `.gitignore does not deny the toolchain cache in every package; add "${TOOLCHAIN_CACHE_IGNORE_ENTRY}" [run xy git lint --fix]` }] };
41707
+ },
41708
+ defaultLevel: "warn",
41709
+ description: "The .xy/cache toolchain cache is ignored in every package, not only at the repository root",
41710
+ fixable: true,
41711
+ id: "git.ignore-toolchain-cache"
41618
41712
  }
41619
41713
  ];
41620
41714
  function logGitlintDiagnostic(diagnostic) {