@antelopejs/tooling-configs 0.5.7 → 0.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/api-diff.mjs +9 -7
- package/dist/bin/body-check.mjs +3 -3
- package/dist/bin/capture.mjs +12 -4
- package/dist/bin/check-size.mjs +6 -4
- package/dist/bin/checks.mjs +2 -2
- package/dist/bin/comment-proof.mjs +3 -3
- package/dist/bin/garden.mjs +151 -15
- package/dist/bin/lease.mjs +142 -20
- package/dist/bin/ratchet.mjs +5 -5
- package/dist/bin/readme-strip.mjs +1 -1
- package/dist/bin/suppressions.mjs +9 -10
- package/dist/bin/sync.mjs +66 -22
- package/dist/bin/verify.mjs +61 -36
- package/dist/{checks-CD2oFGrt.mjs → checks-BC-F8bsv.mjs} +2 -66
- package/dist/{files-DJ0TeaTU.mjs → files-C-JJhExM.mjs} +1 -1
- package/dist/launch-D5cylwvb.mjs +76 -0
- package/dist/{map-DRyYz_Fw.mjs → map-BYkmnvNw.mjs} +42 -10
- package/dist/oxc/fmt.mjs +1 -1
- package/dist/oxc/guardrails/index.mjs +1 -1
- package/dist/oxc/lint.mjs +1 -1
- package/dist/{oxlint-BbpTFFmf.mjs → oxlint-CCOJqj3d.mjs} +6 -2
- package/dist/{proof-stamp-Kg-tkM6G.mjs → proof-stamp-lyD84zmj.mjs} +4 -4
- package/dist/{ratchet-1O8k4Dxu.mjs → ratchet-SQ7vTR0i.mjs} +4 -4
- package/dist/run-command-BlFRPORx.mjs +95 -0
- package/dist/{shared-igPpEDpS.mjs → shared-BCFFyp3l.mjs} +9 -2
- package/dist/{size-DBatLT-F.mjs → size-CCGLY4Ke.mjs} +1 -1
- package/dist/slash-BEgSnfYw.mjs +12 -0
- package/dist/{suppression-base-DZgUDXiI.mjs → suppression-base-whhvw-IJ.mjs} +3 -3
- package/dist/{suppression-budget-DgYdu6JK.mjs → suppression-budget-CtIYSoDO.mjs} +2 -2
- package/dist/{suppressions-CQTcKCi1.mjs → suppressions-C79kRvYI.mjs} +1 -1
- package/dist/{typescript-CqcOaci8.mjs → typescript--_8og8AM.mjs} +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { s as parseManifest } from "./package-DnxZ2CXZ.mjs";
|
|
2
|
-
import { l as resolveRevision, u as trackedManifests } from "./files-
|
|
3
|
-
import { o as revisionSuppressions, r as countSuppressions } from "./suppressions-
|
|
2
|
+
import { l as resolveRevision, u as trackedManifests } from "./files-C-JJhExM.mjs";
|
|
3
|
+
import { o as revisionSuppressions, r as countSuppressions } from "./suppressions-C79kRvYI.mjs";
|
|
4
4
|
import { copyFileSync, existsSync, lstatSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, realpathSync, rmSync, statSync, symlinkSync } from "node:fs";
|
|
5
5
|
import { dirname, isAbsolute, join, matchesGlob, relative, sep } from "node:path";
|
|
6
6
|
import { execFileSync, spawnSync } from "node:child_process";
|
|
@@ -135,7 +135,7 @@ function mirrorInstalled(installed, path) {
|
|
|
135
135
|
mirrorInstalled(installed, join(path, entry));
|
|
136
136
|
continue;
|
|
137
137
|
}
|
|
138
|
-
const real = realpathSync(source);
|
|
138
|
+
const real = realpathSync.native(source);
|
|
139
139
|
const own = ownCopy(relative(realRoot, real), packages);
|
|
140
140
|
const type = directory ? DIRECTORY_LINK : "file";
|
|
141
141
|
if (own !== void 0) symlinkSync(join(worktree, own), target, type);
|
|
@@ -149,7 +149,7 @@ function linkDependencies(root, worktree, ownWorkspace) {
|
|
|
149
149
|
const directories = /* @__PURE__ */ new Set([".", ...trackedManifests(root).map(dirname)]);
|
|
150
150
|
const installed = {
|
|
151
151
|
root,
|
|
152
|
-
realRoot: realpathSync(root),
|
|
152
|
+
realRoot: realpathSync.native(root),
|
|
153
153
|
worktree,
|
|
154
154
|
packages: ownWorkspace ? ownPackages(root, worktree) : /* @__PURE__ */ new Map()
|
|
155
155
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { a as formatCeilings, c as parseCeilings, n as MAX_FILE_BYTES, o as isPackRelease, s as isRetired, t as CEILINGS_FILE } from "./ceilings-B7KayYIG.mjs";
|
|
2
2
|
import { n as renamedPaths, t as readCarriedCeilings } from "./renames-L2owF5GD.mjs";
|
|
3
3
|
import { f as toolingVersions } from "./package-DnxZ2CXZ.mjs";
|
|
4
|
-
import { n as authoredSizes, o as isAgentFile, r as changedFiles, t as LINT_CONFIG } from "./files-
|
|
5
|
-
import { t as lintDiagnostics } from "./oxlint-
|
|
6
|
-
import "./suppression-budget-
|
|
7
|
-
import { n as sizeFailure } from "./size-
|
|
4
|
+
import { n as authoredSizes, o as isAgentFile, r as changedFiles, t as LINT_CONFIG } from "./files-C-JJhExM.mjs";
|
|
5
|
+
import { t as lintDiagnostics } from "./oxlint-CCOJqj3d.mjs";
|
|
6
|
+
import "./suppression-budget-CtIYSoDO.mjs";
|
|
7
|
+
import { n as sizeFailure } from "./size-CCGLY4Ke.mjs";
|
|
8
8
|
import { copyFileSync, existsSync, mkdirSync, mkdtempSync, rmSync, symlinkSync, unlinkSync, writeFileSync } from "node:fs";
|
|
9
9
|
import { dirname, join } from "node:path";
|
|
10
10
|
import { execFileSync, spawnSync } from "node:child_process";
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
//#region src/guardrails/run-command.ts
|
|
3
|
+
const KILL_GRACE_MS = 5e3;
|
|
4
|
+
function stopGroup(child, signal) {
|
|
5
|
+
if (child.pid === void 0 || child.exitCode !== null) return;
|
|
6
|
+
try {
|
|
7
|
+
if (process.platform === "win32") child.kill(signal);
|
|
8
|
+
else process.kill(-child.pid, signal);
|
|
9
|
+
} catch {
|
|
10
|
+
child.kill(signal);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
const PLAIN_ARGUMENT = /^[\w./:\\@=+~,-]+$/u;
|
|
14
|
+
/** `argument` as cmd.exe passes it on whole: as it is when plain, else in double quotes, with a trailing backslash doubled so it does not escape the closing quote. Throws for a `"`, `%`, CR or LF, which cmd.exe would expand or split however it is quoted. */
|
|
15
|
+
function windowsArgument(argument) {
|
|
16
|
+
if (PLAIN_ARGUMENT.test(argument)) return argument;
|
|
17
|
+
if (/["%\r\n]/u.test(argument)) throw new Error(`Cannot pass ${JSON.stringify(argument)} through cmd.exe, which would expand or split it.`);
|
|
18
|
+
return `"${argument.replace(/\\+$/u, "$&$&")}"`;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* How to spawn `command`, a name on `PATH` such as `pnpm`, with `args`. On Windows that is cmd.exe running one
|
|
22
|
+
* quoted line, so the `.cmd` shim resolves and each argument stays whole without Node's deprecated `shell` option
|
|
23
|
+
* with an argument array; elsewhere the command itself.
|
|
24
|
+
*/
|
|
25
|
+
function shimInvocation(command, args) {
|
|
26
|
+
if (process.platform !== "win32") return {
|
|
27
|
+
command,
|
|
28
|
+
args: [...args],
|
|
29
|
+
shell: false
|
|
30
|
+
};
|
|
31
|
+
return {
|
|
32
|
+
command: [command, ...args].map(windowsArgument).join(" "),
|
|
33
|
+
args: [],
|
|
34
|
+
shell: true
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Runs `command` in its own process group and collects stdout and stderr together. When `signal` aborts, the group
|
|
39
|
+
* gets SIGTERM, then SIGKILL after a grace period, so a step's own children stop with it. On Windows the command runs
|
|
40
|
+
* through cmd.exe per {@link shimInvocation}, so `npm` and `pnpm` resolve to their `.cmd` shims, unless `shell` is
|
|
41
|
+
* `false`: pass that for an executable path.
|
|
42
|
+
*/
|
|
43
|
+
function runCommand(command, args, options) {
|
|
44
|
+
const { cwd, env = process.env, signal, shell = true } = options;
|
|
45
|
+
const invocation = shell ? shimInvocation(command, args) : {
|
|
46
|
+
command,
|
|
47
|
+
args,
|
|
48
|
+
shell
|
|
49
|
+
};
|
|
50
|
+
return new Promise((resolve) => {
|
|
51
|
+
const child = spawn(invocation.command, invocation.args, {
|
|
52
|
+
cwd,
|
|
53
|
+
env,
|
|
54
|
+
shell: invocation.shell,
|
|
55
|
+
detached: process.platform !== "win32",
|
|
56
|
+
stdio: [
|
|
57
|
+
"ignore",
|
|
58
|
+
"pipe",
|
|
59
|
+
"pipe"
|
|
60
|
+
]
|
|
61
|
+
});
|
|
62
|
+
const chunks = [];
|
|
63
|
+
const stdout = [];
|
|
64
|
+
child.stdout.on("data", (chunk) => {
|
|
65
|
+
chunks.push(chunk);
|
|
66
|
+
stdout.push(chunk);
|
|
67
|
+
});
|
|
68
|
+
child.stderr.on("data", (chunk) => chunks.push(chunk));
|
|
69
|
+
const interrupt = () => {
|
|
70
|
+
stopGroup(child, "SIGTERM");
|
|
71
|
+
setTimeout(() => stopGroup(child, "SIGKILL"), KILL_GRACE_MS).unref();
|
|
72
|
+
};
|
|
73
|
+
if (signal?.aborted) interrupt();
|
|
74
|
+
else signal?.addEventListener("abort", interrupt, { once: true });
|
|
75
|
+
child.once("error", (error) => {
|
|
76
|
+
signal?.removeEventListener("abort", interrupt);
|
|
77
|
+
resolve({
|
|
78
|
+
status: null,
|
|
79
|
+
stdout: "",
|
|
80
|
+
output: `${error.message}\n`
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
child.once("close", (code, killed) => {
|
|
84
|
+
signal?.removeEventListener("abort", interrupt);
|
|
85
|
+
const text = Buffer.concat(chunks).toString("utf8");
|
|
86
|
+
resolve({
|
|
87
|
+
status: code,
|
|
88
|
+
stdout: Buffer.concat(stdout).toString("utf8"),
|
|
89
|
+
output: `${text}${killed ? `Terminated by ${killed}\n` : ""}`
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
//#endregion
|
|
95
|
+
export { shimInvocation as n, windowsArgument as r, runCommand as t };
|
|
@@ -492,6 +492,13 @@ const UNSLOP_SKILL = [
|
|
|
492
492
|
"Edit text to remove AI patterns. Scan for the patterns below, then rewrite. Preserve meaning and match the intended tone."
|
|
493
493
|
].join("\n") + "\n\n" + renderRuleSection(UNSLOP_RULES);
|
|
494
494
|
//#endregion
|
|
495
|
+
//#region src/guardrails/links.ts
|
|
496
|
+
/** Whether the symlink at `link` under `root` holds exactly `target`, a relative path with `/`; on Windows, which stores a `/` target with `\` separators, the stored text is read back with `/`. */
|
|
497
|
+
function linkPointsAt(root, link, target) {
|
|
498
|
+
const text = readlinkSync(join(root, link));
|
|
499
|
+
return (process.platform === "win32" ? text.replaceAll("\\", "/") : text) === target;
|
|
500
|
+
}
|
|
501
|
+
//#endregion
|
|
495
502
|
//#region src/guardrails/docs-skills.ts
|
|
496
503
|
/** The writing skills `antelopejs-sync` installs in every managed repository, by folder name. */
|
|
497
504
|
const DOCS_SKILLS = [{
|
|
@@ -535,7 +542,7 @@ function planDocsSkills(root) {
|
|
|
535
542
|
target
|
|
536
543
|
});
|
|
537
544
|
else if (!stat.isSymbolicLink()) errors.push(`${link} is not a symlink. Move it away, then rerun antelopejs-sync.`);
|
|
538
|
-
else if (
|
|
545
|
+
else if (!linkPointsAt(root, link, target)) actions.push({
|
|
539
546
|
kind: "link",
|
|
540
547
|
path: link,
|
|
541
548
|
target
|
|
@@ -619,4 +626,4 @@ const AGENT_IGNORE_PATTERNS = [
|
|
|
619
626
|
/** What `antelopejs-sync` writes under the agent directories, from the list it syncs; the repository's own files there stay linted. */
|
|
620
627
|
const SYNCED_AGENT_PATTERNS = syncedAgentPaths().flatMap((path) => [path, `${path}/**`]);
|
|
621
628
|
//#endregion
|
|
622
|
-
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, planDocsSkills as u };
|
|
629
|
+
export { VERIFY_KINDS as a, isVerifyKind as c, linkPointsAt as d, 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, planDocsSkills as u };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./ceilings-B7KayYIG.mjs";
|
|
2
2
|
import { t as readCarriedCeilings } from "./renames-L2owF5GD.mjs";
|
|
3
|
-
import { n as authoredSizes, o as isAgentFile } from "./files-
|
|
3
|
+
import { n as authoredSizes, o as isAgentFile } from "./files-C-JJhExM.mjs";
|
|
4
4
|
//#region src/guardrails/size.ts
|
|
5
5
|
function sizeFailure(file, size, limit) {
|
|
6
6
|
return `${file}: ${size} bytes, ${size - limit} bytes over the ${limit}-byte ceiling. Split by responsibility into sibling modules, one cohesive group of exports each; keep the original path re-exporting only if it is a public entry point. Split a test file by behaviour under test, one file per describe. Do not minify, strip whitespace, or move code under an excluded path to pass.${isAgentFile(file) ? " A repository that began counting its agent files with this release records the ones it already has once, with `antelopejs-ratchet --update`." : ""}`;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { relative, sep } from "node:path";
|
|
2
|
+
//#region src/verify/slash.ts
|
|
3
|
+
/** `path` with `/` between its segments on every platform, as git and the messages this pack prints spell it. */
|
|
4
|
+
function slashed(path) {
|
|
5
|
+
return path.split(sep).join("/");
|
|
6
|
+
}
|
|
7
|
+
/** The path from `from` to `to`, spelled with `/` on every platform. */
|
|
8
|
+
function relativeSlashed(from, to) {
|
|
9
|
+
return slashed(relative(from, to));
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { relativeSlashed as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { l as resolveRevision, o as isAgentFile } from "./files-
|
|
2
|
-
import { a as parseBudget, n as SUPPRESSIONS_FILE, o as safetyCeiling, p as coveredLimits } from "./suppression-budget-
|
|
3
|
-
import { o as revisionSuppressions, r as countSuppressions } from "./suppressions-
|
|
1
|
+
import { l as resolveRevision, o as isAgentFile } from "./files-C-JJhExM.mjs";
|
|
2
|
+
import { a as parseBudget, n as SUPPRESSIONS_FILE, o as safetyCeiling, p as coveredLimits } from "./suppression-budget-CtIYSoDO.mjs";
|
|
3
|
+
import { o as revisionSuppressions, r as countSuppressions } from "./suppressions-C79kRvYI.mjs";
|
|
4
4
|
import { readFileSync } from "node:fs";
|
|
5
5
|
import { join } from "node:path";
|
|
6
6
|
import { spawnSync } from "node:child_process";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as renamedPaths } from "./renames-L2owF5GD.mjs";
|
|
2
|
-
import { o as isAgentFile, r as changedFiles } from "./files-
|
|
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-
|
|
2
|
+
import { o as isAgentFile, r as changedFiles } from "./files-C-JJhExM.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-C79kRvYI.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";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as markerPattern, t as DEFAULT_SAFETY_MARKERS } from "./require-safety-comment-for-type-assertion-mnb0CIxa.mjs";
|
|
2
|
-
import { a as gitFiles, i as generatedOutput } from "./files-
|
|
2
|
+
import { a as gitFiles, i as generatedOutput } from "./files-C-JJhExM.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { existsSync, lstatSync, readFileSync } from "node:fs";
|
|
5
5
|
import { join } from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { s as parseManifest } from "./package-DnxZ2CXZ.mjs";
|
|
2
|
-
import { u as trackedManifests } from "./files-
|
|
2
|
+
import { u as trackedManifests } from "./files-C-JJhExM.mjs";
|
|
3
3
|
import { n as workspaceDirectories, r as workspacePatterns } from "./docs-compat-Ft1r2sf0.mjs";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antelopejs/tooling-configs",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.8",
|
|
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",
|