@antelopejs/tooling-configs 0.7.2 → 0.7.4

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.
Files changed (32) hide show
  1. package/README.md +68 -26
  2. package/dist/bin/api-diff.mjs +16 -16
  3. package/dist/bin/body-check.mjs +1 -1
  4. package/dist/bin/check-size.mjs +1 -1
  5. package/dist/bin/checks.mjs +1 -1
  6. package/dist/bin/comment-proof.mjs +2 -2
  7. package/dist/bin/ratchet.mjs +3 -3
  8. package/dist/bin/readme-strip.mjs +1 -1
  9. package/dist/bin/suppressions.mjs +3 -3
  10. package/dist/bin/sync.mjs +41 -28
  11. package/dist/bin/tsc.d.mts +1 -0
  12. package/dist/bin/tsc.mjs +24 -0
  13. package/dist/bin/verify.mjs +89 -89
  14. package/dist/{checks-DvND3Ngb.mjs → checks-BTFf0Evy.mjs} +246 -65
  15. package/dist/{docs-compat-BAZiPLZt.mjs → docs-compat-BmczGA1d.mjs} +1 -1
  16. package/dist/eslint.mjs +1 -1
  17. package/dist/{guardrails-PoMIcyGb.mjs → guardrails-CNmSFSxO.mjs} +128 -120
  18. package/dist/{installed-typescript-6MtIWlE4.mjs → installed-typescript-CF_FR9DV.mjs} +17 -17
  19. package/dist/oxc/guardrails/index.mjs +1 -1
  20. package/dist/oxc/lint.mjs +1 -1
  21. package/dist/{package-DDG3YH7W.mjs → package-1pH5I0TF.mjs} +3 -7
  22. package/dist/{proof-stamp-BFV7JTZT.mjs → proof-stamp-Bg4ULLvr.mjs} +2 -2
  23. package/dist/{ratchet-DLCfeaPY.mjs → ratchet-CPpvIU6Y.mjs} +2 -2
  24. package/dist/{suppression-base-CYaLZAq7.mjs → suppression-base-CDiFJse2.mjs} +2 -2
  25. package/dist/{suppression-budget-CPDSFg4X.mjs → suppression-budget-BeJIgSTO.mjs} +1 -1
  26. package/dist/{suppressions-CxPnh4sC.mjs → suppressions-BvWGA463.mjs} +5 -1
  27. package/dist/{templates-HG0fel2S.mjs → templates-Df6SlGLA.mjs} +1 -1
  28. package/dist/{typescript-QfxkJYzd.mjs → typescript-B0df00nl.mjs} +13 -13
  29. package/dist/typescript-version-CptQKjGz.mjs +18 -0
  30. package/dist/typescript6-BWqCcXGY.mjs +2 -0
  31. package/dist/typescript6-HdyOMBv3.mjs +8 -0
  32. package/package.json +27 -5
@@ -1,8 +1,9 @@
1
1
  import { t as CEILINGS_FILE } from "./ceilings-B7KayYIG.mjs";
2
- import { l as serializeManifest, o as packageManager, s as parseManifest } from "./package-DDG3YH7W.mjs";
2
+ import { l as serializeManifest, o as packageManager, s as parseManifest } from "./package-1pH5I0TF.mjs";
3
+ import { t as typescript6_default } from "./typescript6-HdyOMBv3.mjs";
3
4
  import { a as isString, f as parseJson, i as isObject, u as optStr } from "./json-CG2L7YFl.mjs";
4
5
  import { a as gitFiles, u as trackedManifests } from "./files-C-JJhExM.mjs";
5
- import { i as DMS_PACKAGES, n as workspaceDirectories } from "./docs-compat-BAZiPLZt.mjs";
6
+ import { i as DMS_PACKAGES, n as workspaceDirectories } from "./docs-compat-BmczGA1d.mjs";
6
7
  import { n as shimInvocation, t as runCommand } from "./run-command-BlFRPORx.mjs";
7
8
  import { n as tagVersion } from "./npm-CIIqL5SG.mjs";
8
9
  import { n as packTarball } from "./pack-tarball-Cn4zGKn7.mjs";
@@ -11,7 +12,6 @@ import { existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, realpath
11
12
  import { basename, dirname, join, posix, relative, resolve, sep } from "node:path";
12
13
  import { spawnSync } from "node:child_process";
13
14
  import { isMap, isScalar, isSeq, parseAllDocuments, parseDocument, stringify } from "yaml";
14
- import ts from "@typescript/typescript6";
15
15
  import { createHash } from "node:crypto";
16
16
  import { tmpdir } from "node:os";
17
17
  import { Range, gtr, minVersion, prerelease, satisfies, valid, validRange } from "semver";
@@ -521,17 +521,17 @@ const CONSUMER_OPTIONS = {
521
521
  const CONSUMER_FILES = {
522
522
  import: {
523
523
  file: "consumer.mts",
524
- mode: ts.ModuleKind.ESNext
524
+ mode: typescript6_default.ModuleKind.ESNext
525
525
  },
526
526
  require: {
527
527
  file: "consumer.cts",
528
- mode: ts.ModuleKind.CommonJS
528
+ mode: typescript6_default.ModuleKind.CommonJS
529
529
  }
530
530
  };
531
531
  const DECLARATION_EXTENSIONS = /* @__PURE__ */ new Set([
532
- ts.Extension.Dts,
533
- ts.Extension.Dmts,
534
- ts.Extension.Dcts
532
+ typescript6_default.Extension.Dts,
533
+ typescript6_default.Extension.Dmts,
534
+ typescript6_default.Extension.Dcts
535
535
  ]);
536
536
  const DECLARATION_FILE$1 = /\.d\.[cm]?ts$/;
537
537
  /** An `exports` value that names declarations: a `types` condition or a `.d.ts`, `.d.mts` or `.d.cts` target. */
@@ -585,10 +585,10 @@ function entrySpecifiers(name, exports, files, consumer) {
585
585
  import: [name],
586
586
  require: []
587
587
  };
588
- const { options } = ts.convertCompilerOptionsFromJson(CONSUMER_OPTIONS, consumer);
588
+ const { options } = typescript6_default.convertCompilerOptionsFromJson(CONSUMER_OPTIONS, consumer);
589
589
  const found = [...candidates(name, exports, files)];
590
590
  const kept = (mode) => found.flatMap(([specifier, namesDeclarations]) => {
591
- const { resolvedModule } = ts.resolveModuleName(specifier, join(consumer, CONSUMER_FILES[mode].file), options, ts.sys, void 0, void 0, CONSUMER_FILES[mode].mode);
591
+ const { resolvedModule } = typescript6_default.resolveModuleName(specifier, join(consumer, CONSUMER_FILES[mode].file), options, typescript6_default.sys, void 0, void 0, CONSUMER_FILES[mode].mode);
592
592
  if (!resolvedModule) return [];
593
593
  return DECLARATION_EXTENSIONS.has(resolvedModule.extension) || namesDeclarations ? [specifier] : [];
594
594
  });
@@ -598,7 +598,130 @@ function entrySpecifiers(name, exports, files, consumer) {
598
598
  };
599
599
  }
600
600
  //#endregion
601
+ //#region src/guardrails/known-failures.ts
602
+ /** The file at the repository root that declares the errors `published:types` reports in a dependency's own declarations. */
603
+ const KNOWN_FAILURES_FILE = "guardrails.published-types.json";
604
+ const ENTRY_KEYS = /* @__PURE__ */ new Set([
605
+ "dependency",
606
+ "file",
607
+ "code"
608
+ ]);
609
+ const CODE = /^TS\d+$/;
610
+ const INSIDE_PACKAGE = /^(?!\.\/|\/)[^\\]+$/;
611
+ const PACKAGE_NAME = /^(?:@[^/\s]+\/)?[^/@\s][^/\s]*$/;
612
+ /** What is wrong with `entry`, or the {@link KnownFailure} it declares. */
613
+ function parseEntry(entry) {
614
+ if (!isObject(entry)) return { problem: "is not an object" };
615
+ const extra = Object.keys(entry).filter((key) => !ENTRY_KEYS.has(key));
616
+ if (extra.length) return { problem: `has unknown key ${extra.join(", ")}` };
617
+ const dependency = optStr(entry, "dependency") ?? "";
618
+ const file = optStr(entry, "file") ?? "";
619
+ const code = optStr(entry, "code") ?? "";
620
+ if (!PACKAGE_NAME.test(dependency)) return { problem: "needs dependency as a package name" };
621
+ if (!INSIDE_PACKAGE.test(file) || file.split("/").includes("..")) return { problem: "needs file as a path inside the package" };
622
+ if (!CODE.test(code)) return { problem: "needs code such as TS2416" };
623
+ return {
624
+ problem: "",
625
+ failure: {
626
+ dependency,
627
+ file,
628
+ code
629
+ }
630
+ };
631
+ }
632
+ const EXPECTED = `expected { "knownFailures": [{ "dependency", "file", "code" }] }`;
633
+ /** The entries `KNOWN_FAILURES_FILE` declares at `root`, none when the file is missing, or what is wrong with it. An entry may not name a package of `ownPackages`, the repository's own, whose declarations the repository fixes instead. */
634
+ function readKnownFailures(root, ownPackages) {
635
+ const path = join(root, KNOWN_FAILURES_FILE);
636
+ if (!existsSync(path)) return {
637
+ failure: "",
638
+ entries: []
639
+ };
640
+ let parsed;
641
+ try {
642
+ parsed = parseJson(readFileSync(path, "utf8"));
643
+ } catch (error) {
644
+ return { failure: `${KNOWN_FAILURES_FILE}: ${String(error)}\n` };
645
+ }
646
+ const list = isObject(parsed) && Object.keys(parsed).length === 1 && Object.hasOwn(parsed, "knownFailures") ? parsed.knownFailures : void 0;
647
+ if (!Array.isArray(list)) return { failure: `${KNOWN_FAILURES_FILE}: ${EXPECTED}.\n` };
648
+ const entries = [];
649
+ let problems = "";
650
+ for (const [index, value] of list.entries()) {
651
+ const parsedEntry = parseEntry(value);
652
+ if ("failure" in parsedEntry && entries.some((entry) => describeEntry(entry) === describeEntry(parsedEntry.failure))) problems += `${KNOWN_FAILURES_FILE}: knownFailures[${index}] repeats an earlier entry.\n`;
653
+ else if ("failure" in parsedEntry && ownPackages.has(parsedEntry.failure.dependency)) problems += `${KNOWN_FAILURES_FILE}: knownFailures[${index}] names ${parsedEntry.failure.dependency}, a package of this repository. Fix its declarations instead.\n`;
654
+ else if ("failure" in parsedEntry) entries.push(parsedEntry.failure);
655
+ else problems += `${KNOWN_FAILURES_FILE}: knownFailures[${index}] ${parsedEntry.problem}.\n`;
656
+ }
657
+ return problems ? { failure: problems } : {
658
+ failure: "",
659
+ entries
660
+ };
661
+ }
662
+ /** The diagnostics of tsc's `--pretty false` output, each its first line and the indented lines that continue it. */
663
+ function diagnosticBlocks(output) {
664
+ const blocks = [];
665
+ for (const line of output.split(/\r?\n/)) {
666
+ if (!line) continue;
667
+ if (/^\s/.test(line) && blocks.length) blocks[blocks.length - 1] += `\n${line}`;
668
+ else blocks.push(line);
669
+ }
670
+ return blocks;
671
+ }
672
+ const LOCATED = /^(.*?)\(\d+,\d+\): error (TS\d+): /;
673
+ const INSTALLED = /^((?:@[^/]+\/)?[^/]+)\/(.+)$/;
674
+ const NODE_MODULES = "node_modules/";
675
+ /** Where `block` is reported, undefined when it names no file under `node_modules`. */
676
+ function installedDiagnostic(block) {
677
+ const [, path = "", code = ""] = LOCATED.exec(block) ?? [];
678
+ const marker = path.lastIndexOf(NODE_MODULES);
679
+ if (marker < 0) return void 0;
680
+ const installed = path.slice(marker + 13);
681
+ const [, dependency = "", file = ""] = INSTALLED.exec(installed) ?? [];
682
+ if (!dependency) return void 0;
683
+ return {
684
+ dependency,
685
+ file,
686
+ code,
687
+ text: `${installed}${block.slice(path.length)}`
688
+ };
689
+ }
690
+ /** `entry` written as tsc names its file, `<dependency>/<file> <code>`. */
691
+ function describeEntry(entry) {
692
+ return `${entry.dependency}/${entry.file} ${entry.code}`;
693
+ }
694
+ /**
695
+ * Splits tsc's `--pretty false` `output` into the diagnostics an entry of `entries` declares and the rest. A diagnostic
696
+ * is declared when it lies in a package's installed declarations and an entry names that package, the file inside it
697
+ * and the code. Each entry that declares one is added to `matched`. A diagnostic in a
698
+ * file under `node_modules` names it as `<package>/<file>`.
699
+ */
700
+ function splitDiagnostics(output, entries, matched) {
701
+ const known = [];
702
+ const unknown = [];
703
+ for (const block of diagnosticBlocks(output)) {
704
+ const diagnostic = installedDiagnostic(block);
705
+ const entry = diagnostic ? entries.find(({ dependency, file, code }) => dependency === diagnostic.dependency && file === diagnostic.file && code === diagnostic.code) : void 0;
706
+ if (entry && diagnostic) {
707
+ matched.add(entry);
708
+ known.push(diagnostic.text);
709
+ } else unknown.push(diagnostic?.text ?? block);
710
+ }
711
+ return {
712
+ known,
713
+ unknown
714
+ };
715
+ }
716
+ //#endregion
601
717
  //#region src/guardrails/published-types.ts
718
+ function unchecked(failure) {
719
+ return {
720
+ failure,
721
+ known: [],
722
+ compiled: false
723
+ };
724
+ }
602
725
  const DECLARATION_FILE = /\.d\.[cm]?ts$/;
603
726
  /** An `exports` map that names declarations: a `types` condition or a `.d.ts`, `.d.mts` or `.d.cts` target. */
604
727
  const TYPED_EXPORTS = /"types"\s*:|\.d\.[cm]?ts"/;
@@ -767,13 +890,23 @@ async function typecheck(run, consumer, typed, manifest) {
767
890
  signal: run.signal,
768
891
  shell: false
769
892
  });
770
- return tsc.status === 0 ? "" : readable(tsc.output, consumer, typed.name);
893
+ if (tsc.status === 0) return {
894
+ failure: "",
895
+ known: [],
896
+ compiled: true
897
+ };
898
+ const { known, unknown } = splitDiagnostics(tsc.output, run.declared, run.matched);
899
+ return {
900
+ failure: unknown.length || !known.length ? readable(unknown.length ? `${unknown.join("\n")}\n` : `tsc exited with status ${String(tsc.status)}.\n`, consumer, typed.name) : "",
901
+ known,
902
+ compiled: true
903
+ };
771
904
  }
772
905
  async function consumerErrors(run, typed, slot) {
773
906
  const packed = await pack(run, typed.name);
774
- if (!("tarball" in packed)) return packed.failure;
907
+ if (!("tarball" in packed)) return unchecked(packed.failure);
775
908
  const siblings = await siblingTarballs(run, typed.name, packed.manifest);
776
- if (siblings.failure) return siblings.failure;
909
+ if (siblings.failure) return unchecked(siblings.failure);
777
910
  const consumer = join(run.scratch, `consumer-${slot}`);
778
911
  mkdirSync(consumer);
779
912
  const overrides = {
@@ -790,38 +923,59 @@ async function consumerErrors(run, typed, slot) {
790
923
  cwd: consumer,
791
924
  signal: run.signal
792
925
  });
793
- if (install.status !== 0) return `Installing the tarball failed:\n${install.output}`;
926
+ if (install.status !== 0) return unchecked(`Installing the tarball failed:\n${install.output}`);
794
927
  return typecheck(run, consumer, typed, packed.manifest);
795
928
  }
796
929
  function packsWithPnpmOrNpm(manager) {
797
930
  return manager === "pnpm" || manager === "npm";
798
931
  }
932
+ /** The line that fails each entry of `run` no error matched, once tsc ran over every package. */
933
+ function staleEntries(run) {
934
+ return run.declared.filter((entry) => !run.matched.has(entry)).map((entry) => `${KNOWN_FAILURES_FILE}: ${describeEntry(entry)} no longer occurs. Remove the entry.\n`).join("");
935
+ }
799
936
  /**
800
937
  * Packs each package `typedPackages` finds, running its `prepack`, and installs the tarball alone in a scratch
801
938
  * directory with its peers, optional ones included, `typescript` and `@types/node` at the latest version unless it
802
939
  * names them as peers, and the tarball of each package of the repository it depends on in place of the registry's.
803
940
  * Then runs `tsc` with `skipLibCheck` off over a consumer file importing each entry its `exports` names, or, without
804
- * `exports`, the package itself and every declaration file it ships. Returns what failed, each package's errors under
805
- * its `package.json`, empty when every package passed.
941
+ * `exports`, the package itself and every declaration file it ships. An error in a dependency's declarations that
942
+ * `guardrails.published-types.json` declares is reported under `notes` instead of failing; an entry no error matched
943
+ * fails once tsc ran over every package. Each package's errors are listed under its `package.json`.
806
944
  */
807
945
  async function checkPublishedTypes(root, signal) {
808
946
  const manager = packageManager(parseManifest(readFileSync(join(root, "package.json"), "utf8")));
809
- if (!packsWithPnpmOrNpm(manager)) return `This check packs with pnpm or npm, not ${manager}.\n`;
947
+ if (!packsWithPnpmOrNpm(manager)) return {
948
+ failure: `This check packs with pnpm or npm, not ${manager}.\n`,
949
+ notes: ""
950
+ };
951
+ const members = new Map(publicPackages(root).map(({ name, directory }) => [name, directory]));
952
+ const declared = readKnownFailures(root, new Set(members.keys()));
953
+ if (!("entries" in declared)) return {
954
+ failure: declared.failure,
955
+ notes: ""
956
+ };
810
957
  const scratch = realpathSync.native(mkdtempSync(join(tmpdir(), "published-types-")));
811
958
  const run = {
812
959
  root,
813
960
  manager,
814
961
  scratch,
815
962
  signal,
816
- members: new Map(publicPackages(root).map(({ name, directory }) => [name, directory])),
817
- packs: /* @__PURE__ */ new Map()
963
+ members,
964
+ packs: /* @__PURE__ */ new Map(),
965
+ declared: declared.entries,
966
+ matched: /* @__PURE__ */ new Set()
818
967
  };
819
- let failures = "";
968
+ let failure = "";
969
+ let notes = "";
970
+ let complete = true;
820
971
  try {
821
972
  for (const [slot, typed] of typedPackages(root).entries()) {
822
973
  if (signal?.aborted) break;
823
- const failure = await consumerErrors(run, typed, slot);
824
- if (failure) failures += `${join(typed.directory, "package.json")}: ${typed.name} as a consumer installs it, checked by tsc with skipLibCheck off:\n${failure}`;
974
+ const checked = await consumerErrors(run, typed, slot);
975
+ complete &&= checked.compiled;
976
+ const header = `${join(typed.directory, "package.json")}: ${typed.name} as a consumer installs it, checked by tsc with skipLibCheck off`;
977
+ if (checked.failure) failure += `${header}:\n${checked.failure}`;
978
+ if (checked.known.length) notes += `${header}, errors ${KNOWN_FAILURES_FILE} declares as known:\n${checked.known.join("\n")}\n`;
825
979
  }
826
980
  } finally {
827
981
  rmSync(scratch, {
@@ -829,7 +983,11 @@ async function checkPublishedTypes(root, signal) {
829
983
  force: true
830
984
  });
831
985
  }
832
- return failures;
986
+ if (complete && !signal?.aborted) failure += staleEntries(run);
987
+ return {
988
+ failure,
989
+ notes
990
+ };
833
991
  }
834
992
  //#endregion
835
993
  //#region src/guardrails/readme-version.ts
@@ -1061,8 +1219,6 @@ function isLayerCode(layer, file) {
1061
1219
  const segments = relative(layer, file).split(sep);
1062
1220
  return segments[0] !== LAYER_PLAYGROUND && !segments.some((segment) => NOT_LAYER_CODE.has(segment));
1063
1221
  }
1064
- /** The packages whose `tsc` a repository runs, in order: `typescript`, else `@typescript/native` when `typescript` is the TypeScript 6 API (`@typescript/typescript6`, whose only bin is `tsc6`) installed beside TypeScript 7 for tools that need that API. */
1065
- const COMPILER_PACKAGES = ["typescript", "@typescript/native"];
1066
1222
  /**
1067
1223
  * The `package.json` of the package `name` in the nearest `node_modules` from `root` up, where a workspace may hoist it.
1068
1224
  * Node's resolution is not used: it falls back to `NODE_PATH`, where a package manager's bin shim lists the pack's own
@@ -1075,9 +1231,9 @@ function manifestOf(root, name) {
1075
1231
  if (dirname(folder) === folder) return void 0;
1076
1232
  }
1077
1233
  }
1078
- /** The `bin.tsc` entry of the package `name` that `root` installs, read from its `package.json`, a file every TypeScript version ships, because TypeScript 7 declares an `exports` map that leaves `typescript/bin/tsc` out. */
1079
- function binTsc(root, name) {
1080
- const manifestPath = manifestOf(root, name);
1234
+ /** The repository's own `tsc`, the `bin.tsc` entry of the `typescript` it installs, run with Node so no shell parses its path. It is read from `package.json`, a file every TypeScript version ships, because TypeScript 7 declares an `exports` map that leaves `typescript/bin/tsc` out. */
1235
+ function compilerOf(root) {
1236
+ const manifestPath = manifestOf(root, "typescript");
1081
1237
  if (manifestPath === void 0) return void 0;
1082
1238
  try {
1083
1239
  const tsc = parseManifest(readFileSync(manifestPath, "utf8")).bin?.tsc;
@@ -1086,17 +1242,10 @@ function binTsc(root, name) {
1086
1242
  return;
1087
1243
  }
1088
1244
  }
1089
- /** The repository's own `tsc` entry, run with Node so no shell parses its path. */
1090
- function compilerOf(root) {
1091
- for (const name of COMPILER_PACKAGES) {
1092
- const tsc = binTsc(root, name);
1093
- if (tsc !== void 0) return tsc;
1094
- }
1095
- }
1096
1245
  async function typecheckLayer(root, compiler, layer, signal) {
1097
1246
  const configPath = join(root, layer, TSCONFIG);
1098
1247
  if (!existsSync(configPath)) return `${layer}: has a verify.config.ts and no tsconfig.json. Add a tsconfig.json that includes its TypeScript files; antelopejs-sync writes one for the shared kinds.\n`;
1099
- const ts = (await import("@typescript/typescript6")).default;
1248
+ const ts = (await import("./typescript6-BWqCcXGY.mjs")).default;
1100
1249
  const parsed = ts.getParsedCommandLineOfConfigFile(configPath, void 0, {
1101
1250
  ...ts.sys,
1102
1251
  onUnRecoverableConfigFileDiagnostic: () => void 0
@@ -1478,7 +1627,8 @@ function checkSingletonPackages(root) {
1478
1627
  //#region src/guardrails/script-steps.ts
1479
1628
  const SEPARATORS = /&&|\|\||[;|\n]|(?<![>&])&(?!&)/u;
1480
1629
  const ENV_ASSIGNMENT = /^[A-Za-z_]\w*=/u;
1481
- const TSC_COMMAND = /(?:^|[\\/])tsc(?:\.js)?$/u;
1630
+ /** The compilers a script runs by name: TypeScript's `tsc` and the pack's `antelopejs-tsc`, which takes the same arguments. */
1631
+ const TSC_COMMANDS = ["tsc", "antelopejs-tsc"];
1482
1632
  const MANAGERS = /* @__PURE__ */ new Set([
1483
1633
  "pnpm",
1484
1634
  "npm",
@@ -1588,15 +1738,19 @@ function skipOptions(args, from, valued) {
1588
1738
  targets
1589
1739
  };
1590
1740
  }
1591
- function isTsc(word) {
1592
- return TSC_COMMAND.test(word);
1741
+ /** The compiler `word` runs: its name or a path to it, with or without `.js`. */
1742
+ function tscCommand(word) {
1743
+ const name = word.split(/[\\/]/u).at(-1)?.replace(/\.js$/u, "");
1744
+ return TSC_COMMANDS.find((command) => command === name);
1593
1745
  }
1594
- /** `tsc`, a path to it, or `node` running one. */
1746
+ /** `tsc` or the pack's `antelopejs-tsc`, a path to either, or `node` running one. */
1595
1747
  function programSteps(line) {
1596
1748
  const [head, ...rest] = line;
1597
1749
  if (head === void 0) return [];
1598
- if (isTsc(head)) return [{
1750
+ const command = tscCommand(head);
1751
+ if (command) return [{
1599
1752
  kind: "tsc",
1753
+ command,
1600
1754
  args: rest,
1601
1755
  targets: []
1602
1756
  }];
@@ -1607,8 +1761,10 @@ function programSteps(line) {
1607
1761
  targets: []
1608
1762
  }];
1609
1763
  const at = rest.findIndex((word) => !word.startsWith("-"));
1610
- return at !== -1 && isTsc(rest[at]) ? [{
1764
+ const run = at === -1 ? void 0 : tscCommand(rest[at]);
1765
+ return run ? [{
1611
1766
  kind: "tsc",
1767
+ command: run,
1612
1768
  args: rest.slice(at + 1),
1613
1769
  targets: []
1614
1770
  }] : [];
@@ -1641,7 +1797,7 @@ function managerSteps(manager, args) {
1641
1797
  const verb = args[first.index];
1642
1798
  if (verb === void 0) return [];
1643
1799
  if (EXEC_VERBS.has(verb)) return pointedAt(execSteps(args.slice(first.index + 1)), first.targets);
1644
- if (isTsc(verb)) return pointedAt(programSteps(args.slice(first.index)), first.targets);
1800
+ if (tscCommand(verb)) return pointedAt(programSteps(args.slice(first.index)), first.targets);
1645
1801
  const run = verb === "run" || verb === "run-script";
1646
1802
  const second = run ? skipOptions(args, first.index + 1, valued) : {
1647
1803
  index: first.index,
@@ -1761,12 +1917,12 @@ function configFile(directory, project) {
1761
1917
  /** Whether a `tsc` command line writes output: `-b`, or a run whose command line or tsconfig chain leaves `noEmit` unset. */
1762
1918
  function tscWrites(directory, args) {
1763
1919
  if (/^--?b(?:uild)?$/iu.test(args[0] ?? "")) return true;
1764
- const { options } = ts.parseCommandLine([...args]);
1920
+ const { options } = typescript6_default.parseCommandLine([...args]);
1765
1921
  if (options.noEmit !== void 0) return !options.noEmit;
1766
1922
  const file = configFile(directory, options.project ?? ".");
1767
1923
  if (!existsSync(file)) return true;
1768
- return ts.getParsedCommandLineOfConfigFile(file, {}, {
1769
- ...ts.sys,
1924
+ return typescript6_default.getParsedCommandLineOfConfigFile(file, {}, {
1925
+ ...typescript6_default.sys,
1770
1926
  onUnRecoverableConfigFileDiagnostic: () => void 0
1771
1927
  })?.options.noEmit !== true;
1772
1928
  }
@@ -1828,14 +1984,20 @@ const CHECK_STEPS = [
1828
1984
  "readme:version",
1829
1985
  "published:types"
1830
1986
  ];
1831
- /** Steps `antelopejs-checks` runs itself, no package.json script behind them: each returns what failed, empty when it passed. */
1987
+ function failureOnly(check) {
1988
+ return async (root, signal) => ({
1989
+ failure: await check(root, signal),
1990
+ notes: ""
1991
+ });
1992
+ }
1993
+ /** Steps `antelopejs-checks` runs itself, no package.json script behind them. */
1832
1994
  const OWN_STEPS = /* @__PURE__ */ new Map([
1833
- ["verify:types", typecheckLayers],
1834
- ["verify:lockfiles", (root) => Promise.resolve(checkLockfiles(root))],
1835
- ["lockfile:singletons", (root) => Promise.resolve(checkSingletonPackages(root))],
1836
- ["dependency:ranges", checkRepositoryRanges],
1837
- ["git:identity", checkGitIdentity],
1838
- ["readme:version", checkReadmeVersion],
1995
+ ["verify:types", failureOnly(typecheckLayers)],
1996
+ ["verify:lockfiles", failureOnly((root) => Promise.resolve(checkLockfiles(root)))],
1997
+ ["lockfile:singletons", failureOnly((root) => Promise.resolve(checkSingletonPackages(root)))],
1998
+ ["dependency:ranges", failureOnly(checkRepositoryRanges)],
1999
+ ["git:identity", failureOnly(checkGitIdentity)],
2000
+ ["readme:version", failureOnly(checkReadmeVersion)],
1839
2001
  ["published:types", checkPublishedTypes]
1840
2002
  ]);
1841
2003
  function hasWork(root, step) {
@@ -1901,13 +2063,22 @@ function skippedNames(setting) {
1901
2063
  async function runSteps(root, manifest, steps, signal) {
1902
2064
  const manager = packageManager(manifest);
1903
2065
  const runStep = async (step) => {
1904
- if (signal?.aborted) return [];
2066
+ if (signal?.aborted) return {
2067
+ failure: "",
2068
+ notes: ""
2069
+ };
1905
2070
  const own = OWN_STEPS.get(step);
1906
2071
  if (own) {
1907
- const failure = await own(root, signal);
1908
- return failure ? [`[${step}]\n${failure}`] : [];
2072
+ const { failure, notes } = await own(root, signal);
2073
+ return {
2074
+ failure: failure && `[${step}]\n${failure}`,
2075
+ notes: notes && `[${step}]\n${notes}`
2076
+ };
1909
2077
  }
1910
- if (!manifest.scripts?.[step]) return [`[${step}] Missing package.json script "${step}". Run antelopejs-sync.\n`];
2078
+ if (!manifest.scripts?.[step]) return {
2079
+ failure: `[${step}] Missing package.json script "${step}". Run antelopejs-sync.\n`,
2080
+ notes: ""
2081
+ };
1911
2082
  const result = await runCommand(manager, ["run", step], {
1912
2083
  cwd: root,
1913
2084
  env: {
@@ -1916,11 +2087,18 @@ async function runSteps(root, manifest, steps, signal) {
1916
2087
  },
1917
2088
  signal
1918
2089
  });
1919
- return result.status === 0 ? [] : [`[${step}]\n${result.output}`];
2090
+ return {
2091
+ failure: result.status === 0 ? "" : `[${step}]\n${result.output}`,
2092
+ notes: ""
2093
+ };
2094
+ };
2095
+ const reports = /* @__PURE__ */ new Map();
2096
+ for (const phase of phases(root, steps)) await Promise.all(phase.map(async (step) => reports.set(step, await runStep(step))));
2097
+ const listed = (field) => steps.flatMap((step) => reports.get(step)?.[field] || []);
2098
+ return {
2099
+ failures: listed("failure"),
2100
+ notes: listed("notes")
1920
2101
  };
1921
- const failures = /* @__PURE__ */ new Map();
1922
- for (const phase of phases(root, steps)) await Promise.all(phase.map(async (step) => failures.set(step, await runStep(step))));
1923
- return steps.flatMap((step) => failures.get(step) ?? []);
1924
2102
  }
1925
2103
  /** The optional package script run once before the steps, to build what several steps read, such as a workspace package's `dist`. */
1926
2104
  const PREPARE = "checks:prepare";
@@ -1947,8 +2125,8 @@ async function prepare(root, manifest, signal) {
1947
2125
  output: `${failure}Checks: 0 passed, 1 failed.\n`
1948
2126
  };
1949
2127
  }
1950
- function summary(failures, passed, skipped) {
1951
- return `${failures.join("\n")}Checks: ${passed} passed, ${failures.length} failed${skipped ? `, ${skipped} skipped` : ""}.\n`;
2128
+ function summary(reported, failed, passed, skipped) {
2129
+ return `${reported}Checks: ${passed} passed, ${failed} failed${skipped ? `, ${skipped} skipped` : ""}.\n`;
1952
2130
  }
1953
2131
  /**
1954
2132
  * Runs the `checks:prepare` package script first when it exists and a step will run, and stops there if it fails.
@@ -1986,19 +2164,22 @@ async function runChecks(root, options = {}) {
1986
2164
  owned: false
1987
2165
  };
1988
2166
  let failures = [];
2167
+ let notes = [];
1989
2168
  let stopped = "";
1990
2169
  try {
1991
- failures = started.failure ? [`[services]\n${started.failure}`] : await runSteps(root, manifest, steps, signal);
2170
+ if (started.failure) failures = [`[services]\n${started.failure}`];
2171
+ else ({failures, notes} = await runSteps(root, manifest, steps, signal));
1992
2172
  } finally {
1993
2173
  if (started.owned) stopped = await stopServices(root);
1994
2174
  }
1995
2175
  const passed = started.failure ? 0 : steps.length - failures.length;
1996
2176
  if (stopped) failures.push(`[services]\n${stopped}`);
1997
2177
  const interrupted = signal?.aborted ?? false;
2178
+ const reported = [...notes, ...failures].join("\n");
1998
2179
  return {
1999
2180
  failed: failures.length,
2000
2181
  interrupted,
2001
- output: interrupted ? `${failures.join("\n")}Checks interrupted by ${String(signal?.reason)}.\n` : summary(failures, passed, skipped)
2182
+ output: interrupted ? `${reported}Checks interrupted by ${String(signal?.reason)}.\n` : summary(reported, failures.length, passed, skipped)
2002
2183
  };
2003
2184
  }
2004
2185
  //#endregion
@@ -1,4 +1,4 @@
1
- import { s as parseManifest } from "./package-DDG3YH7W.mjs";
1
+ import { s as parseManifest } from "./package-1pH5I0TF.mjs";
2
2
  import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
3
3
  import { join } from "node:path";
4
4
  import { isMap, isScalar, isSeq, parseDocument } from "yaml";
package/dist/eslint.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { n as typeAwareRuleSetting, t as TYPE_AWARE_RULES } from "./type-aware-rules-BxhHbizU.mjs";
2
- import { t as guardrailsPlugin } from "./guardrails-PoMIcyGb.mjs";
2
+ import { t as guardrailsPlugin } from "./guardrails-CNmSFSxO.mjs";
3
3
  import { createConfigForNuxt } from "@nuxt/eslint-config/flat";
4
4
  //#region src/eslint.ts
5
5
  /** Whether every rule of `plugin` has the `create` function ESLint calls, which `eslintCompatPlugin` gives each oxlint rule. */