@antelopejs/tooling-configs 0.2.17 → 0.2.19

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 (42) hide show
  1. package/README.md +35 -21
  2. package/dist/bin/api-diff.mjs +25 -14
  3. package/dist/bin/body-check.mjs +3 -3
  4. package/dist/bin/capture.d.mts +1 -0
  5. package/dist/bin/capture.mjs +559 -0
  6. package/dist/bin/check-size.mjs +3 -3
  7. package/dist/bin/checks.mjs +24 -6
  8. package/dist/bin/comment-proof.mjs +3 -3
  9. package/dist/bin/garden.mjs +229 -28
  10. package/dist/bin/lease.d.mts +1 -0
  11. package/dist/bin/lease.mjs +1053 -0
  12. package/dist/bin/ratchet.mjs +146 -100
  13. package/dist/bin/suppressions.mjs +5 -5
  14. package/dist/bin/sync.mjs +150 -176
  15. package/dist/bin/verify.mjs +238 -125
  16. package/dist/capture/index.d.mts +50 -0
  17. package/dist/capture/index.mjs +2 -0
  18. package/dist/{ci-workflow-ChW4He0r.mjs → ci-workflow-DVkpwauQ.mjs} +12 -0
  19. package/dist/{files-Bc036sJW.mjs → files-DJ0TeaTU.mjs} +10 -4
  20. package/dist/formal/index.d.mts +40 -0
  21. package/dist/formal/index.mjs +205 -0
  22. package/dist/oxc/anti-slop/index.mjs +717 -16
  23. package/dist/oxc/fmt.mjs +1 -1
  24. package/dist/oxc/guardrails/index.d.mts +1 -1
  25. package/dist/oxc/guardrails/index.mjs +93 -5
  26. package/dist/oxc/lint.d.mts +9 -0
  27. package/dist/oxc/lint.mjs +14 -3
  28. package/dist/{oxlint-Bltmk8-6.mjs → oxlint-DIV-lLSS.mjs} +7 -3
  29. package/dist/{package-DTxLPNDu.mjs → package-BRTjkzt5.mjs} +26 -1
  30. package/dist/{proof-stamp-w-3j47A-.mjs → proof-stamp-DDDC0J6l.mjs} +3 -3
  31. package/dist/{ratchet-DwRj9h4L.mjs → ratchet-BAcLRYuM.mjs} +194 -21
  32. package/dist/scenes-DZVXkcxS.mjs +104 -0
  33. package/dist/shared-igPpEDpS.mjs +622 -0
  34. package/dist/{size-DNtWruCO.mjs → size-DBatLT-F.mjs} +2 -2
  35. package/dist/{suppression-base-DAfCXwjL.mjs → suppression-base-9L8dlMQK.mjs} +36 -11
  36. package/dist/{suppression-budget-Bd2GqMYb.mjs → suppression-budget-C0SkPO5R.mjs} +56 -19
  37. package/dist/{suppressions-BD_f8f7L.mjs → suppressions-DM60NkvL.mjs} +1 -1
  38. package/dist/templates-CypDm-j9.mjs +121 -0
  39. package/dist/{typescript-BmS5BmrS.mjs → typescript-CM0LrVP7.mjs} +2 -2
  40. package/dist/verify/index.d.mts +6 -1
  41. package/package.json +29 -4
  42. package/dist/shared-CoUt4GUm.mjs +0 -73
@@ -1,5 +1,6 @@
1
- import { s as resolveRevision } from "./files-Bc036sJW.mjs";
2
- import { a as parseBudget, n as SUPPRESSIONS_FILE, o as safetyCeiling, p as coveredLimits } from "./suppression-budget-Bd2GqMYb.mjs";
1
+ import { l as resolveRevision, o as isAgentFile } from "./files-DJ0TeaTU.mjs";
2
+ import { a as parseBudget, n as SUPPRESSIONS_FILE, o as safetyCeiling, p as coveredLimits } from "./suppression-budget-C0SkPO5R.mjs";
3
+ import { o as revisionSuppressions, r as countSuppressions } from "./suppressions-DM60NkvL.mjs";
3
4
  import { readFileSync } from "node:fs";
4
5
  import { join } from "node:path";
5
6
  import { spawnSync } from "node:child_process";
@@ -60,13 +61,35 @@ function suppressionBase(root, base) {
60
61
  }
61
62
  return verified(root, "refs/remotes/origin/HEAD");
62
63
  }
64
+ function agentFilesDropped(base, current) {
65
+ return base.agentFiles && !current.agentFiles ? [`${SUPPRESSIONS_FILE}: drops agentFiles, which the base has. Keep it; the repository's own files under the agent directories stay counted.`] : [];
66
+ }
67
+ /** What the agent directories hold, when `current` begins recording them and `base` does not; nothing otherwise. */
68
+ function adoptableAgentCounts(root, revision, base, current) {
69
+ const none = {
70
+ rules: {},
71
+ config: {},
72
+ tsExpectError: 0,
73
+ tsIgnore: 0,
74
+ safety: 0
75
+ };
76
+ if (base.agentFiles || !current.agentFiles) return none;
77
+ const counts = countSuppressions(revisionSuppressions(root, revision).filter(({ file }) => isAgentFile(file)));
78
+ return {
79
+ ...counts,
80
+ config: counts.config ?? {}
81
+ };
82
+ }
63
83
  /**
64
84
  * Fails each ceiling of the working-tree budget that is higher than on
65
85
  * `revision`, and each rule that `revision` lists but the working tree
66
86
  * dropped, config rule-offs included once the base has their ceilings; a
67
87
  * config ceiling may rise by what a containing scope of its rule falls. The
68
88
  * safety ceiling may rise by what the SAFETY rule's own ceiling falls. A
69
- * base without a budget, a first adoption, passes.
89
+ * base that does not record the agent directories' files lets the working
90
+ * tree record them, each ceiling rising by no more than its count there; a
91
+ * base that does must keep recording them. A base without a budget, a first
92
+ * adoption, passes.
70
93
  */
71
94
  function raisedCeilings(root, revision) {
72
95
  const committed = spawnSync("git", ["show", `${revision}:${SUPPRESSIONS_FILE}`], {
@@ -77,18 +100,20 @@ function raisedCeilings(root, revision) {
77
100
  const label = `${revision.slice(0, 12)}:${SUPPRESSIONS_FILE}`;
78
101
  const base = parseBudget(committed.stdout, label);
79
102
  const current = parseBudget(readFileSync(join(root, SUPPRESSIONS_FILE), "utf8"), SUPPRESSIONS_FILE);
80
- const failures = [];
81
- const compare = (key, before, after) => {
103
+ const failures = agentFilesDropped(base, current);
104
+ const room = adoptableAgentCounts(root, revision, base, current);
105
+ const compare = (key, ceiling, after, adoptable = 0) => {
106
+ const before = ceiling + adoptable;
82
107
  if (after === void 0) failures.push(`${SUPPRESSIONS_FILE}: removes ${key}, which has ceiling ${before} on the base. Keep the key; lower it with suppressions:update.`);
83
- else if (after > before) failures.push(`${SUPPRESSIONS_FILE}: raises ${key} from ${before} on the base to ${after}.`);
108
+ else if (after > before) failures.push(`${SUPPRESSIONS_FILE}: raises ${key} from ${ceiling} on the base to ${after}${adoptable ? `, above the ${before} that recording the agent files allows` : ""}.`);
84
109
  };
85
- for (const rule of /* @__PURE__ */ new Set([...Object.keys(base.rules), ...Object.keys(current.rules)])) compare(`lint rule \`${rule}\``, base.rules[rule] ?? 0, Object.hasOwn(base.rules, rule) ? current.rules[rule] : current.rules[rule] ?? 0);
110
+ for (const rule of /* @__PURE__ */ new Set([...Object.keys(base.rules), ...Object.keys(current.rules)])) compare(`lint rule \`${rule}\``, base.rules[rule] ?? 0, Object.hasOwn(base.rules, rule) ? current.rules[rule] : current.rules[rule] ?? 0, room.rules[rule]);
86
111
  const baseConfig = base.config ?? {};
87
112
  const covered = coveredLimits(baseConfig, current.config ?? {});
88
- for (const rule of /* @__PURE__ */ new Set([...Object.keys(baseConfig), ...Object.keys(current.config ?? {})])) if (base.config !== void 0) compare(`lint config rule-off \`${rule}\``, covered[rule] ?? 0, current.config === void 0 || Object.hasOwn(baseConfig, rule) && !Object.hasOwn(current.config, rule) ? void 0 : current.config[rule] ?? 0);
89
- compare("`@ts-expect-error`", base.tsExpectError, current.tsExpectError);
90
- compare("`@ts-ignore`", base.tsIgnore, current.tsIgnore);
91
- compare("`SAFETY:` comments", safetyCeiling(base, current.rules["anti-slop/require-safety-comment-for-type-assertion"] ?? 0), current.safety);
113
+ for (const rule of /* @__PURE__ */ new Set([...Object.keys(baseConfig), ...Object.keys(current.config ?? {})])) if (base.config !== void 0) compare(`lint config rule-off \`${rule}\``, covered[rule] ?? 0, current.config === void 0 || Object.hasOwn(baseConfig, rule) && !Object.hasOwn(current.config, rule) ? void 0 : current.config[rule] ?? 0, room.config[rule]);
114
+ compare("`@ts-expect-error`", base.tsExpectError, current.tsExpectError, room.tsExpectError);
115
+ compare("`@ts-ignore`", base.tsIgnore, current.tsIgnore, room.tsIgnore);
116
+ compare("`SAFETY:` comments", safetyCeiling(base, current.rules["anti-slop/require-safety-comment-for-type-assertion"] ?? 0), current.safety, room.safety);
92
117
  return failures.length ? [...failures, "Ceilings only go down. Fix the code, or remove another suppression of the same kind; raising a ceiling needs the operator's approval through the ruleset bypass."] : [];
93
118
  }
94
119
  //#endregion
@@ -1,6 +1,6 @@
1
1
  import { n as renamedPaths } from "./renames-L2owF5GD.mjs";
2
- import { n as changedFiles } from "./files-Bc036sJW.mjs";
3
- import { a as openDisablesIn, i as inWorktree, l as worktreeSuppressions, n as configKey, o as revisionSuppressions, r as countSuppressions, s as sortedKeys, t as atRevision } from "./suppressions-BD_f8f7L.mjs";
2
+ import { o as isAgentFile, r as changedFiles } from "./files-DJ0TeaTU.mjs";
3
+ import { a as openDisablesIn, i as inWorktree, l as worktreeSuppressions, n as configKey, o as revisionSuppressions, r as countSuppressions, s as sortedKeys, t as atRevision } from "./suppressions-DM60NkvL.mjs";
4
4
  import { existsSync, readFileSync, writeFileSync } from "node:fs";
5
5
  import { join, matchesGlob } from "node:path";
6
6
  import { execFileSync, spawnSync } from "node:child_process";
@@ -318,6 +318,10 @@ function parseBudget(text, source) {
318
318
  safety: count(parsed.safety, `${source}: safety`)
319
319
  };
320
320
  if (parsed.config !== void 0) budget.config = counted(parsed.config, `${source}: config`);
321
+ if (parsed.agentFiles !== void 0) {
322
+ if (parsed.agentFiles !== true) throw new Error(`${source}: agentFiles must be true`);
323
+ budget.agentFiles = true;
324
+ }
321
325
  return budget;
322
326
  }
323
327
  /** Serializes a budget with sorted rules and config rule-offs, zero ceilings kept, so rewriting an unchanged budget is a no-op. */
@@ -329,35 +333,67 @@ function formatBudget(budget) {
329
333
  if (budget.config !== void 0) sorted.config = sortedKeys(budget.config);
330
334
  return `${JSON.stringify(sorted, null, 2)}\n`;
331
335
  }
332
- /** A budget with config rule-off ceilings: `text` itself when it has them or does not parse, else `text` plus today's config rule-offs. */
333
- function withConfigCeilings(root, text) {
336
+ /** `suppressions` without those in the agent directories, unless `budget` records them. */
337
+ function budgeted(budget, suppressions) {
338
+ return budget.agentFiles ? suppressions : suppressions.filter(({ file }) => !isAgentFile(file));
339
+ }
340
+ /** The totals of the working tree's suppressions in the agent directories. */
341
+ function agentCounts(root) {
342
+ return countSuppressions(worktreeSuppressions(root).filter(({ file }) => isAgentFile(file)));
343
+ }
344
+ function summed(base, extra) {
345
+ const count = (map, key) => Object.hasOwn(map, key) ? map[key] : 0;
346
+ return Object.fromEntries([.../* @__PURE__ */ new Set([...Object.keys(base), ...Object.keys(extra)])].map((key) => [key, count(base, key) + count(extra, key)]));
347
+ }
348
+ /** `budget` with each ceiling raised by the count of its key in the agent directories, and the repository marked as recording them. */
349
+ function withAgentCeilings(budget, agent) {
350
+ return {
351
+ rules: summed(budget.rules, agent.rules),
352
+ tsExpectError: budget.tsExpectError + agent.tsExpectError,
353
+ tsIgnore: budget.tsIgnore + agent.tsIgnore,
354
+ safety: budget.safety + agent.safety,
355
+ config: summed(budget.config ?? {}, agent.config ?? {}),
356
+ agentFiles: true
357
+ };
358
+ }
359
+ /**
360
+ * A budget with config rule-off ceilings and the agent directories' ceilings:
361
+ * `text` itself when it has both or does not parse, else `text` plus today's
362
+ * config rule-offs outside the agent directories, and the agent directories'
363
+ * counts added on top of the ceilings.
364
+ */
365
+ function withAdoptedCeilings(root, text) {
334
366
  let budget;
335
367
  try {
336
368
  budget = parseBudget(text, SUPPRESSIONS_FILE);
337
369
  } catch {
338
370
  return text;
339
371
  }
340
- if (budget.config !== void 0) return text;
341
- const { config } = countSuppressions(worktreeSuppressions(root));
342
- return formatBudget({
372
+ if (budget.config !== void 0 && budget.agentFiles) return text;
373
+ const counted = countSuppressions(budgeted(budget, worktreeSuppressions(root)));
374
+ const adopted = {
343
375
  ...budget,
344
- config
345
- });
376
+ config: budget.config ?? counted.config
377
+ };
378
+ return formatBudget(budget.agentFiles ? adopted : withAgentCeilings(adopted, agentCounts(root)));
346
379
  }
347
380
  /**
348
- * The budget sync writes: `current` with today's config rule-offs adopted
349
- * when it predates them; when the file is missing, the committed one when it
350
- * was only deleted, so recreating it never raises a ceiling, else the
351
- * current counts.
381
+ * The budget sync writes: `current` with today's config rule-offs and the
382
+ * agent directories' suppressions adopted when it predates them; when the file
383
+ * is missing, the committed one when it was only deleted, so recreating it
384
+ * never raises a ceiling, else the current counts.
352
385
  */
353
386
  function adoptedBudget(root, current) {
354
- if (current !== void 0) return withConfigCeilings(root, current);
387
+ if (current !== void 0) return withAdoptedCeilings(root, current);
355
388
  const committed = spawnSync("git", ["show", `HEAD:${SUPPRESSIONS_FILE}`], {
356
389
  cwd: root,
357
390
  encoding: "utf8"
358
391
  });
359
- if (committed.status === 0) return withConfigCeilings(root, committed.stdout);
360
- return formatBudget(countSuppressions(worktreeSuppressions(root)));
392
+ if (committed.status === 0) return withAdoptedCeilings(root, committed.stdout);
393
+ return formatBudget({
394
+ ...countSuppressions(worktreeSuppressions(root)),
395
+ agentFiles: true
396
+ });
361
397
  }
362
398
  /** Each `file:line` once, indented, in the order found. */
363
399
  function locations(found) {
@@ -383,6 +419,7 @@ function lowered(budget, current) {
383
419
  safety: Math.min(safetyCeiling(budget, current.rules["anti-slop/require-safety-comment-for-type-assertion"] ?? 0), current.safety)
384
420
  };
385
421
  if (budget.config !== void 0) result.config = lowerEach(budget.config, current.config);
422
+ if (budget.agentFiles) result.agentFiles = true;
386
423
  return result;
387
424
  }
388
425
  /**
@@ -399,7 +436,7 @@ function checkSuppressions(root, update = false) {
399
436
  const path = join(root, SUPPRESSIONS_FILE);
400
437
  if (!existsSync(path)) throw new Error(`${SUPPRESSIONS_FILE} is missing. Run antelopejs-sync.`);
401
438
  const committed = parseBudget(readFileSync(path, "utf8"), SUPPRESSIONS_FILE);
402
- const suppressions = worktreeSuppressions(root);
439
+ const suppressions = budgeted(committed, worktreeSuppressions(root));
403
440
  const counts = countSuppressions(suppressions);
404
441
  const budget = withCoveredScopes(committed, counts);
405
442
  const changed = changedFiles(root);
@@ -472,8 +509,8 @@ function stagedBudget(root, staged, previous) {
472
509
  const head = budgetAt(root, "HEAD");
473
510
  if (head === void 0) return [];
474
511
  const index = budgetAt(root, "") ?? head;
475
- const headSuppressions = revisionSuppressions(root, "HEAD", previous);
476
- const stagedSuppressions = revisionSuppressions(root, "", staged);
512
+ const headSuppressions = budgeted(index, revisionSuppressions(root, "HEAD", previous));
513
+ const stagedSuppressions = budgeted(index, revisionSuppressions(root, "", staged));
477
514
  const before = groupByKey(headSuppressions);
478
515
  const after = groupByKey(stagedSuppressions);
479
516
  const scopes = stagedScopes(head, index, countSuppressions(headSuppressions).config ?? {}, countSuppressions(stagedSuppressions).config ?? {});
@@ -1,5 +1,5 @@
1
1
  import { n as markerPattern, t as DEFAULT_SAFETY_MARKERS } from "./require-safety-comment-for-type-assertion-BBQ669kj.mjs";
2
- import { i as gitFiles, r as generatedOutput } from "./files-Bc036sJW.mjs";
2
+ import { a as gitFiles, i as generatedOutput } from "./files-DJ0TeaTU.mjs";
3
3
  import { createRequire } from "node:module";
4
4
  import { existsSync, lstatSync, readFileSync } from "node:fs";
5
5
  import { join } from "node:path";
@@ -0,0 +1,121 @@
1
+ import { t as execCommand } from "./package-BRTjkzt5.mjs";
2
+ import { isMap, parseDocument } from "yaml";
3
+ //#region src/guardrails/templates.ts
4
+ const PRESET_CONFIGS = [
5
+ {
6
+ path: "oxlint.config.ts",
7
+ legacy: [".oxlintrc.json"],
8
+ specifier: "@antelopejs/tooling-configs/oxc/lint",
9
+ content: "import { defineConfig } from \"oxlint\";\nimport {\n ANTELOPE_IGNORE_PATTERNS,\n antelopePreset,\n} from \"@antelopejs/tooling-configs/oxc/lint\";\n\nexport default defineConfig({\n extends: [antelopePreset()],\n ignorePatterns: ANTELOPE_IGNORE_PATTERNS,\n options: { typeAware: true },\n});\n",
10
+ previous: ["import { defineConfig } from \"oxlint\";\nimport { antelopePreset } from \"@antelopejs/tooling-configs/oxc/lint\";\n\nexport default defineConfig({\n extends: [antelopePreset()],\n options: { typeAware: true },\n});\n"]
11
+ },
12
+ {
13
+ path: "oxfmt.config.ts",
14
+ legacy: [".oxfmtrc.json"],
15
+ specifier: "@antelopejs/tooling-configs/oxc/fmt",
16
+ content: "import { antelopeFmtPreset } from \"@antelopejs/tooling-configs/oxc/fmt\";\n\nexport default antelopeFmtPreset();\n"
17
+ },
18
+ {
19
+ path: "knip.config.ts",
20
+ legacy: [
21
+ "knip.json",
22
+ "knip.jsonc",
23
+ ".knip.json"
24
+ ],
25
+ specifier: "@antelopejs/tooling-configs/knip",
26
+ content: "import { antelopeKnipConfig } from \"@antelopejs/tooling-configs/knip\";\n\nexport default antelopeKnipConfig();\n"
27
+ }
28
+ ];
29
+ function presetConfig(current, preset, tools) {
30
+ const target = tools.presets[preset.path];
31
+ const specifier = target.replaceAll("/", "\\/").replaceAll(".", "\\.");
32
+ const imported = new RegExp(`(?:\\bfrom\\s*|\\bimport\\s*\\(?\\s*)["']${specifier}["']`);
33
+ const fresh = preset.content.replace(preset.specifier, target);
34
+ if (current === void 0 || preset.previous?.some((previous) => previous.replace(preset.specifier, target) === current)) return fresh;
35
+ if (imported.test(current)) return current;
36
+ const importLine = preset.content.split("\n").filter((line) => line.includes(preset.specifier)).join("\n").replace(preset.specifier, target);
37
+ throw new Error(`${preset.path} does not import its preset. Add \`${importLine}\` and extend that preset, then rerun antelopejs-sync. The file was not replaced.`);
38
+ }
39
+ function lefthook(current, manager, tools, ratchet = true) {
40
+ const exec = execCommand(manager);
41
+ const document = parseDocument(current ?? "{}\n");
42
+ if (document.errors.length) throw new Error(`lefthook.yml: ${document.errors.map(({ message }) => message).join("; ")}`);
43
+ if (!isMap(document.contents)) throw new Error("lefthook.yml must contain a YAML mapping. Merge the guardrail hooks manually and rerun antelopejs-sync.");
44
+ if (current === void 0) document.contents.flow = false;
45
+ const glob = "*.{js,mjs,cjs,jsx,ts,mts,cts,tsx,vue}";
46
+ const hooks = {
47
+ "pre-commit": {
48
+ "antelopejs-format": {
49
+ run: `${exec} oxfmt --no-error-on-unmatched-pattern {staged_files}`,
50
+ stage_fixed: true
51
+ },
52
+ "antelopejs-lint": {
53
+ glob,
54
+ run: `${exec} oxlint --no-error-on-unmatched-pattern {staged_files}`
55
+ },
56
+ "antelopejs-size": { run: `${tools.hookPrefix}${tools.commands.size} --staged {staged_files}` },
57
+ "antelopejs-ratchet": {
58
+ glob,
59
+ run: `${tools.hookPrefix}${tools.commands.ratchet} --staged {staged_files}`
60
+ },
61
+ "antelopejs-suppressions": {
62
+ glob,
63
+ run: `${tools.hookPrefix}${tools.commands.suppressions} --staged`
64
+ }
65
+ },
66
+ "pre-push": { "antelopejs-typecheck": { run: `${manager} run typecheck` } }
67
+ };
68
+ for (const [hook, commands] of Object.entries(hooks)) {
69
+ for (const path of [[hook], [hook, "commands"]]) {
70
+ if (!document.hasIn(path)) document.setIn(path, document.createNode({}));
71
+ if (!isMap(document.getIn(path))) throw new Error(`lefthook.yml: ${path.join(".")} must be a mapping. Preserve the existing hook and merge its commands before rerunning antelopejs-sync.`);
72
+ }
73
+ for (const [key, command] of Object.entries(commands)) document.setIn([
74
+ hook,
75
+ "commands",
76
+ key
77
+ ], document.createNode(command));
78
+ }
79
+ if (!ratchet) document.deleteIn([
80
+ "pre-commit",
81
+ "commands",
82
+ "antelopejs-ratchet"
83
+ ]);
84
+ return document.toString({ lineWidth: 0 });
85
+ }
86
+ const SETUP_SCRIPT = `#!/usr/bin/env bash
87
+ set -euo pipefail
88
+ cd "$(dirname "$BASH_SOURCE")/.."
89
+ export CI=1 COREPACK_ENABLE_DOWNLOAD_PROMPT=0
90
+ major="$(tr -d 'v[:space:]' < .nvmrc)"
91
+ if [[ "$(node -p 'process.versions.node.split(".")[0]')" != "$major" ]]; then
92
+ if command -v fnm >/dev/null 2>&1; then
93
+ eval "$(fnm env --shell bash)"
94
+ fnm install "$major"
95
+ fnm use "$major"
96
+ else
97
+ export NVM_DIR="\${NVM_DIR:-$HOME/.nvm}"
98
+ if [[ ! -s "$NVM_DIR/nvm.sh" ]]; then
99
+ git clone --quiet --depth 1 --branch v0.40.3 https://github.com/nvm-sh/nvm.git "$NVM_DIR"
100
+ fi
101
+ source "$NVM_DIR/nvm.sh" --no-use
102
+ nvm install "$major"
103
+ nvm use "$major"
104
+ fi
105
+ fi
106
+ pin="$(node -p 'JSON.parse(require("node:fs").readFileSync("package.json", "utf8")).packageManager || "pnpm"')"
107
+ manager="\${pin%%@*}"
108
+ corepack enable
109
+ if [[ "$pin" == *@* ]]; then
110
+ corepack prepare "$pin" --activate
111
+ fi
112
+ case "$manager" in
113
+ pnpm) pnpm install --frozen-lockfile ;;
114
+ yarn) YARN_ENABLE_IMMUTABLE_INSTALLS=true yarn install --frozen-lockfile ;;
115
+ npm) npm ci ;;
116
+ bun) bun install --frozen-lockfile ;;
117
+ *) printf 'Unsupported package manager %s\\n' "$manager" >&2; exit 1 ;;
118
+ esac
119
+ `;
120
+ //#endregion
121
+ export { presetConfig as i, SETUP_SCRIPT as n, lefthook as r, PRESET_CONFIGS as t };
@@ -1,5 +1,5 @@
1
- import { c as trackedManifests } from "./files-Bc036sJW.mjs";
2
- import { i as parseManifest } from "./package-DTxLPNDu.mjs";
1
+ import { i as parseManifest } from "./package-BRTjkzt5.mjs";
2
+ import { u as trackedManifests } from "./files-DJ0TeaTU.mjs";
3
3
  import { createRequire } from "node:module";
4
4
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
5
5
  import { dirname, join, matchesGlob, relative, resolve, sep } from "node:path";
@@ -166,7 +166,12 @@ interface JourneyContext {
166
166
  expect(folder: string, checks: Check[], options?: {
167
167
  critical?: boolean;
168
168
  }): boolean;
169
- /** Ends the journey as not verified, for example when provider sandbox keys are missing. */
169
+ /**
170
+ * Ends the journey as not verified, for example when provider sandbox keys
171
+ * are missing or something the journey depends on outside the harness's
172
+ * services and apps stopped answering. An environment failure is never a
173
+ * failing check: `seeded` counts only failing checks as catches.
174
+ */
170
175
  notVerified(reason: string): never;
171
176
  service(name: string): ServiceEndpoint;
172
177
  /** Runs a command inside a service's container: the read-back through the native client. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antelopejs/tooling-configs",
3
- "version": "0.2.17",
3
+ "version": "0.2.19",
4
4
  "description": "Shared tooling presets for AntelopeJS repositories: oxlint (with the vendored anti-slop rules), oxfmt, ESLint for Nuxt layers, Knip, and an interface range check",
5
5
  "keywords": [
6
6
  "antelopejs",
@@ -23,11 +23,13 @@
23
23
  "bin": {
24
24
  "antelopejs-api-diff": "./dist/bin/api-diff.mjs",
25
25
  "antelopejs-body-check": "./dist/bin/body-check.mjs",
26
+ "antelopejs-capture": "./dist/bin/capture.mjs",
26
27
  "antelopejs-check-interface-ranges": "./dist/bin/check-interface-ranges.mjs",
27
28
  "antelopejs-check-size": "./dist/bin/check-size.mjs",
28
29
  "antelopejs-checks": "./dist/bin/checks.mjs",
29
30
  "antelopejs-comment-proof": "./dist/bin/comment-proof.mjs",
30
31
  "antelopejs-garden": "./dist/bin/garden.mjs",
32
+ "antelopejs-lease": "./dist/bin/lease.mjs",
31
33
  "antelopejs-ratchet": "./dist/bin/ratchet.mjs",
32
34
  "antelopejs-suppressions": "./dist/bin/suppressions.mjs",
33
35
  "antelopejs-sync": "./dist/bin/sync.mjs",
@@ -44,7 +46,9 @@
44
46
  "./oxc/guardrails": "./dist/oxc/guardrails/index.mjs",
45
47
  "./knip": "./dist/knip.mjs",
46
48
  "./eslint": "./dist/eslint.mjs",
47
- "./verify": "./dist/verify/index.mjs"
49
+ "./verify": "./dist/verify/index.mjs",
50
+ "./formal": "./dist/formal/index.mjs",
51
+ "./capture": "./dist/capture/index.mjs"
48
52
  },
49
53
  "publishConfig": {
50
54
  "access": "public",
@@ -67,7 +71,8 @@
67
71
  "sync:check": "node src/bin/sync.ts --check",
68
72
  "knip": "knip",
69
73
  "suppressions": "node src/bin/suppressions.ts",
70
- "suppressions:update": "node src/bin/suppressions.ts --update"
74
+ "suppressions:update": "node src/bin/suppressions.ts --update",
75
+ "docs:generate": "node src/docs/generate.ts"
71
76
  },
72
77
  "dependencies": {
73
78
  "@oxlint/plugins": "1.81.0",
@@ -81,11 +86,15 @@
81
86
  "eslint-plugin-perfectionist": "^5.11.0",
82
87
  "knip": "^6.34.0",
83
88
  "lefthook": "^2.2.2",
89
+ "mongodb-memory-server": "^11.3.0",
84
90
  "oxfmt": "^0.66.0",
85
91
  "oxlint": "1.81.0",
86
92
  "oxlint-tsgolint": "^7.0.2001",
93
+ "pixelmatch": "^8.0.0",
94
+ "playwright-core": "^1.56.1",
87
95
  "release-it": "^19.2.4",
88
96
  "release-it-changelogen": "^0.1.0",
97
+ "sharp": "^0.35.5",
89
98
  "tsdown": "^0.22.14",
90
99
  "vite": "^8.3.4"
91
100
  },
@@ -93,8 +102,12 @@
93
102
  "@nuxt/eslint-config": ">=1.2.0",
94
103
  "eslint-plugin-perfectionist": ">=5.0.0",
95
104
  "knip": ">=6.0.0",
105
+ "mongodb-memory-server": ">=10.0.0",
96
106
  "oxfmt": "^0.66.0",
97
- "oxlint": "1.81.0"
107
+ "oxlint": "1.81.0",
108
+ "pixelmatch": ">=7.0.0",
109
+ "playwright-core": ">=1.56.0",
110
+ "sharp": ">=0.34.0"
98
111
  },
99
112
  "peerDependenciesMeta": {
100
113
  "knip": {
@@ -111,6 +124,18 @@
111
124
  },
112
125
  "eslint-plugin-perfectionist": {
113
126
  "optional": true
127
+ },
128
+ "mongodb-memory-server": {
129
+ "optional": true
130
+ },
131
+ "pixelmatch": {
132
+ "optional": true
133
+ },
134
+ "playwright-core": {
135
+ "optional": true
136
+ },
137
+ "sharp": {
138
+ "optional": true
114
139
  }
115
140
  },
116
141
  "engines": {
@@ -1,73 +0,0 @@
1
- //#region src/verify/kinds.ts
2
- /** The repository kinds whose verification skill is synced from this pack. */
3
- const VERIFY_KINDS = [
4
- "interface",
5
- "module",
6
- "template"
7
- ];
8
- /** Whether `value` names a shared verification kind. */
9
- function isVerifyKind(value) {
10
- return VERIFY_KINDS.some((kind) => kind === value);
11
- }
12
- /** The skill folder of a kind, relative to the repository root. */
13
- function skillFolder(kind) {
14
- return `.agents/skills/verify-${kind}`;
15
- }
16
- /** The `.claude/skills` link that exposes a kind's skill folder to Claude Code. */
17
- function claudeLink(kind) {
18
- return `.claude/skills/verify-${kind}`;
19
- }
20
- /** Where the link points, relative to the link's own folder. */
21
- function claudeLinkTarget(kind) {
22
- return `../../${skillFolder(kind)}`;
23
- }
24
- /** The files `antelopejs-sync` writes into a shared skill folder; everything else there is the repository's own. */
25
- const SYNCED_SKILL_FILES = [
26
- "SKILL.md",
27
- "package.json",
28
- "tsconfig.json"
29
- ];
30
- /**
31
- * Every path under the agent directories that `antelopejs-sync` writes for the shared skills:
32
- * each kind's synced files and its `.claude/skills` link, which shows the whole folder, repository files included, a second time.
33
- */
34
- function syncedAgentPaths() {
35
- return VERIFY_KINDS.flatMap((kind) => [...SYNCED_SKILL_FILES.map((file) => `${skillFolder(kind)}/${file}`), claudeLink(kind)]);
36
- }
37
- //#endregion
38
- //#region src/oxc/shared.ts
39
- /**
40
- * Paths every AntelopeJS project generates or vendors, and that no linter should read.
41
- * `.github/ISSUE_TEMPLATE/**` holds GitHub's legacy issue templates: Markdown with
42
- * YAML frontmatter saved under a .yml extension, which a YAML formatter cannot parse.
43
- * `build/**` and `output/**` match only at the repository root: a directory with
44
- * either name under `src/` or another authored root is source, not build output.
45
- */
46
- const IGNORE_PATTERNS = [
47
- "**/node_modules/**",
48
- "**/dist/**",
49
- "**/coverage/**",
50
- "**/.antelope/**",
51
- "**/.nuxt/**",
52
- "**/.output/**",
53
- "build/**",
54
- "output/**",
55
- "**/i18n-registry.generated.ts",
56
- ".github/ISSUE_TEMPLATE/**"
57
- ];
58
- /** Agent tooling directories: assets we install, not source we own. */
59
- const AGENT_IGNORE_PATTERNS = [
60
- ".agent/**",
61
- ".agents/**",
62
- ".amp/**",
63
- ".claude/**",
64
- ".codex/**",
65
- ".cursor/**",
66
- ".gemini/**",
67
- ".opencode/**",
68
- ".windsurf/**"
69
- ];
70
- /** What `antelopejs-sync` writes under the agent directories, from the list it syncs; the repository's own files there stay linted. */
71
- const SYNCED_AGENT_PATTERNS = syncedAgentPaths().flatMap((path) => [path, `${path}/**`]);
72
- //#endregion
73
- export { VERIFY_KINDS as a, isVerifyKind as c, SYNCED_SKILL_FILES as i, skillFolder as l, IGNORE_PATTERNS as n, claudeLink as o, SYNCED_AGENT_PATTERNS as r, claudeLinkTarget as s, AGENT_IGNORE_PATTERNS as t };