@antelopejs/tooling-configs 0.5.3 → 0.5.5
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/README.md +24 -23
- package/assets/readme/OFL.txt +93 -0
- package/assets/readme/geist-extrabold.woff2 +0 -0
- package/assets/readme/geist-mono.woff2 +0 -0
- package/dist/bin/api-diff.mjs +3 -3
- package/dist/bin/body-check.mjs +1 -1
- package/dist/bin/checks.mjs +1 -1
- package/dist/bin/comment-proof.mjs +2 -2
- package/dist/bin/ratchet.mjs +1 -1
- package/dist/bin/readme-strip.d.mts +1 -0
- package/dist/bin/readme-strip.mjs +134 -0
- package/dist/bin/sync.mjs +197 -51
- package/dist/{checks-BFGuy1KI.mjs → checks-DqTjyKCC.mjs} +994 -880
- package/dist/oxc/lint.mjs +1 -1
- package/dist/{package-DiaBP7bI.mjs → package-DnxZ2CXZ.mjs} +37 -30
- package/dist/{proof-stamp-BPIdT5ik.mjs → proof-stamp-Kg-tkM6G.mjs} +1 -1
- package/dist/{ratchet-BZvlFCWL.mjs → ratchet-1O8k4Dxu.mjs} +1 -1
- package/dist/{templates-C6cfOd2H.mjs → templates-Dg188oRC.mjs} +1 -1
- package/dist/{typescript-DJzdex32.mjs → typescript-DhavwHb7.mjs} +1 -1
- package/package.json +3 -1
package/dist/oxc/lint.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as findGitRoot } from "../ceilings-B7KayYIG.mjs";
|
|
2
2
|
import { t as readCarriedCeilings } from "../renames-L2owF5GD.mjs";
|
|
3
|
-
import { t as PRESET_CONFIGS } from "../templates-
|
|
3
|
+
import { t as PRESET_CONFIGS } from "../templates-Dg188oRC.mjs";
|
|
4
4
|
import { t as TYPE_AWARE_RULES } from "../type-aware-rules-DMuN6sHb.mjs";
|
|
5
5
|
import { n as TEST_FILE_GLOBS, t as ASSERTION_FUNCTION_NAMES } from "../shared-WC0z3y9F.mjs";
|
|
6
6
|
import { n as IGNORE_PATTERNS, r as SYNCED_AGENT_PATTERNS } from "../shared-igPpEDpS.mjs";
|
|
@@ -2,6 +2,9 @@ import { t as admits } from "./semver-BDxeEcP_.mjs";
|
|
|
2
2
|
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
3
3
|
import { dirname, join } from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
+
//#region package.json
|
|
6
|
+
var packageManager$1 = "pnpm@10.2.0";
|
|
7
|
+
//#endregion
|
|
5
8
|
//#region src/guardrails/package.ts
|
|
6
9
|
/** The capture tool's optional peers, which a repository with `docs/captures.ts` declares as devDependencies at the ranges the pack tests against. */
|
|
7
10
|
const CAPTURE_PEERS = [
|
|
@@ -29,44 +32,48 @@ function packageManager(manifest) {
|
|
|
29
32
|
function usesNuxt(root, manifest) {
|
|
30
33
|
return Boolean(manifest.dependencies?.nuxt || manifest.devDependencies?.nuxt || readdirSync(root).some((name) => name.startsWith("nuxt.config.")));
|
|
31
34
|
}
|
|
35
|
+
/** Whether the repository at `root` has `docs/captures.ts`, so it declares the capture tool's peers. */
|
|
36
|
+
function usesCaptures(root) {
|
|
37
|
+
return existsSync(join(root, "docs/captures.ts"));
|
|
38
|
+
}
|
|
32
39
|
function execCommand(manager) {
|
|
33
40
|
if (manager === "npm") return "npm exec --";
|
|
34
41
|
if (manager === "bun") return "bun x --no-install";
|
|
35
42
|
return `${manager} exec`;
|
|
36
43
|
}
|
|
37
|
-
|
|
44
|
+
/** The directory of the installed `@antelopejs/tooling-configs` package, from source or from `dist`. */
|
|
45
|
+
function toolingRoot() {
|
|
38
46
|
let directory = dirname(fileURLToPath(import.meta.url));
|
|
39
47
|
while (true) {
|
|
40
48
|
const path = join(directory, "package.json");
|
|
41
|
-
if (existsSync(path))
|
|
42
|
-
const manifest = parseManifest(readFileSync(path, "utf8"));
|
|
43
|
-
if (manifest.name === "@antelopejs/tooling-configs") {
|
|
44
|
-
const declared = (field, name) => {
|
|
45
|
-
const range = manifest[field]?.[name];
|
|
46
|
-
if (!range) throw new Error(`tooling-configs must declare ${name} in ${field}.`);
|
|
47
|
-
return range;
|
|
48
|
-
};
|
|
49
|
-
const dev = (name) => declared("devDependencies", name);
|
|
50
|
-
if (!manifest.version || !manifest.packageManager) throw new Error("tooling-configs must declare its version and packageManager.");
|
|
51
|
-
return {
|
|
52
|
-
lefthook: dev("lefthook"),
|
|
53
|
-
knip: dev("knip"),
|
|
54
|
-
tsgolint: dev("oxlint-tsgolint"),
|
|
55
|
-
oxlint: dev("oxlint"),
|
|
56
|
-
oxfmt: dev("oxfmt"),
|
|
57
|
-
typescript: declared("dependencies", "typescript"),
|
|
58
|
-
nodeTypes: dev("@types/node"),
|
|
59
|
-
capture: CAPTURE_PEERS.map((name) => [name, dev(name)]),
|
|
60
|
-
packageManager: manifest.packageManager,
|
|
61
|
-
pack: manifest.version
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
}
|
|
49
|
+
if (existsSync(path) && parseManifest(readFileSync(path, "utf8")).name === "@antelopejs/tooling-configs") return directory;
|
|
65
50
|
const parent = dirname(directory);
|
|
66
51
|
if (parent === directory) throw new Error("Cannot find tooling-configs package.json.");
|
|
67
52
|
directory = parent;
|
|
68
53
|
}
|
|
69
54
|
}
|
|
55
|
+
function toolingVersions() {
|
|
56
|
+
const manifest = parseManifest(readFileSync(join(toolingRoot(), "package.json"), "utf8"));
|
|
57
|
+
const declared = (field, name) => {
|
|
58
|
+
const range = manifest[field]?.[name];
|
|
59
|
+
if (!range) throw new Error(`tooling-configs must declare ${name} in ${field}.`);
|
|
60
|
+
return range;
|
|
61
|
+
};
|
|
62
|
+
const dev = (name) => declared("devDependencies", name);
|
|
63
|
+
if (!manifest.version) throw new Error("tooling-configs must declare its version.");
|
|
64
|
+
return {
|
|
65
|
+
lefthook: dev("lefthook"),
|
|
66
|
+
knip: dev("knip"),
|
|
67
|
+
tsgolint: dev("oxlint-tsgolint"),
|
|
68
|
+
oxlint: dev("oxlint"),
|
|
69
|
+
oxfmt: dev("oxfmt"),
|
|
70
|
+
typescript: declared("dependencies", "typescript"),
|
|
71
|
+
nodeTypes: dev("@types/node"),
|
|
72
|
+
capture: CAPTURE_PEERS.map((name) => [name, dev(name)]),
|
|
73
|
+
packageManager: packageManager$1,
|
|
74
|
+
pack: manifest.version
|
|
75
|
+
};
|
|
76
|
+
}
|
|
70
77
|
function repositoryTools(manifest) {
|
|
71
78
|
return {
|
|
72
79
|
installed: {
|
|
@@ -186,9 +193,9 @@ function bootstrapDependencies(manifest, versions, nodeProject) {
|
|
|
186
193
|
/** The `test` script `npm init` writes, which fails every run. */
|
|
187
194
|
const NPM_INIT_TEST = "echo \"Error: no test specified\" && exit 1";
|
|
188
195
|
/**
|
|
189
|
-
* `current` with `added` in its sorted devDependencies, `packageManager` set to `pin`
|
|
190
|
-
* script running Node's test runner when it has none or only npm's
|
|
191
|
-
* and runs the ones the repository adds. An explicit `"type": "commonjs"`, which `npm init` writes, is dropped: under
|
|
196
|
+
* `current` with `added` in its sorted devDependencies, `packageManager` set to `pin` unless it names pnpm, the only
|
|
197
|
+
* manager the pack's CI installs with, and a `test` script running Node's test runner when it has none or only npm's
|
|
198
|
+
* failing default, which passes with no test file and runs the ones the repository adds. An explicit `"type": "commonjs"`, which `npm init` writes, is dropped: under
|
|
192
199
|
* it Node refuses to load the pack's ESM `*.config.ts` files, while without it `.js` files stay CommonJS unless they
|
|
193
200
|
* use ESM syntax, which `commonjs` rejected anyway. Formatted as the rest of the sync writers do.
|
|
194
201
|
*/
|
|
@@ -198,7 +205,7 @@ function bootstrappedManifest(current, added, pin) {
|
|
|
198
205
|
...manifest.devDependencies,
|
|
199
206
|
...Object.fromEntries(added)
|
|
200
207
|
});
|
|
201
|
-
manifest.packageManager
|
|
208
|
+
if (manifest.packageManager === void 0 || packageManager(manifest) !== "pnpm") manifest.packageManager = pin;
|
|
202
209
|
if (manifest.type === "commonjs") delete manifest.type;
|
|
203
210
|
const scripts = manifest.scripts ??= {};
|
|
204
211
|
if (scripts.test === void 0 || scripts.test === NPM_INIT_TEST) scripts.test = "node --test";
|
|
@@ -274,4 +281,4 @@ function serializeManifest(manifest, current) {
|
|
|
274
281
|
return `${JSON.stringify(manifest, null, indent).replaceAll("\n", newline)}${newline}`;
|
|
275
282
|
}
|
|
276
283
|
//#endregion
|
|
277
|
-
export { managedPackage as a, repositoryTools as c,
|
|
284
|
+
export { managedPackage as a, repositoryTools as c, toolingRoot as d, toolingVersions as f, execCommand as i, serializeManifest as l, usesNuxt as m, bootstrapDependencies as n, packageManager as o, usesCaptures as p, bootstrappedManifest as r, parseManifest as s, addedDevDependencies as t, templatePackage as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as parseManifest } from "./package-
|
|
1
|
+
import { s as parseManifest } from "./package-DnxZ2CXZ.mjs";
|
|
2
2
|
import { l as resolveRevision, u as trackedManifests } from "./files-DJ0TeaTU.mjs";
|
|
3
3
|
import { o as revisionSuppressions, r as countSuppressions } from "./suppressions-CQTcKCi1.mjs";
|
|
4
4
|
import { copyFileSync, existsSync, lstatSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, realpathSync, rmSync, statSync, symlinkSync } from "node:fs";
|
|
@@ -1,6 +1,6 @@
|
|
|
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
|
-
import {
|
|
3
|
+
import { f as toolingVersions } from "./package-DnxZ2CXZ.mjs";
|
|
4
4
|
import { n as authoredSizes, o as isAgentFile, r as changedFiles, t as LINT_CONFIG } from "./files-DJ0TeaTU.mjs";
|
|
5
5
|
import { t as lintDiagnostics } from "./oxlint-BbpTFFmf.mjs";
|
|
6
6
|
import "./suppression-budget-DgYdu6JK.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as parseManifest } from "./package-
|
|
1
|
+
import { s as parseManifest } from "./package-DnxZ2CXZ.mjs";
|
|
2
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";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antelopejs/tooling-configs",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.5",
|
|
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",
|
|
@@ -31,12 +31,14 @@
|
|
|
31
31
|
"antelopejs-garden": "./dist/bin/garden.mjs",
|
|
32
32
|
"antelopejs-lease": "./dist/bin/lease.mjs",
|
|
33
33
|
"antelopejs-ratchet": "./dist/bin/ratchet.mjs",
|
|
34
|
+
"antelopejs-readme-strip": "./dist/bin/readme-strip.mjs",
|
|
34
35
|
"antelopejs-suppressions": "./dist/bin/suppressions.mjs",
|
|
35
36
|
"antelopejs-sync": "./dist/bin/sync.mjs",
|
|
36
37
|
"antelopejs-triage": "./dist/bin/triage.mjs",
|
|
37
38
|
"antelopejs-verify": "./dist/bin/verify.mjs"
|
|
38
39
|
},
|
|
39
40
|
"files": [
|
|
41
|
+
"assets",
|
|
40
42
|
"dist"
|
|
41
43
|
],
|
|
42
44
|
"type": "module",
|