@antelopejs/tooling-configs 0.3.2 → 0.3.3
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
CHANGED
|
@@ -193,19 +193,20 @@ pnpm exec antelopejs-sync
|
|
|
193
193
|
pnpm install
|
|
194
194
|
```
|
|
195
195
|
|
|
196
|
-
| File | What `sync` does
|
|
197
|
-
| ------------------------------------------------------- |
|
|
198
|
-
| `oxlint.config.ts`, `oxfmt.config.ts`, `knip.config.ts` | Writes a config that extends the preset, unless the file already imports it
|
|
199
|
-
| `lefthook.yml` | Pre-commit on staged files: oxfmt, oxlint, size, suppressions. Pre-push: typecheck
|
|
200
|
-
| `package.json` | `prepare` installs lefthook. Sets `checks`, `size`, `ratchet`, `ratchet:update`, `suppressions`, `suppressions:update`, `sync`, `sync:check`; adds missing `typecheck`, `lint`, `format`, `format:check`, `knip`; adds `lefthook` and `knip`
|
|
201
|
-
|
|
|
202
|
-
| `.
|
|
203
|
-
| `
|
|
204
|
-
| `
|
|
205
|
-
| `
|
|
206
|
-
| `
|
|
207
|
-
| `guardrails.
|
|
208
|
-
|
|
|
196
|
+
| File | What `sync` does |
|
|
197
|
+
| ------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
198
|
+
| `oxlint.config.ts`, `oxfmt.config.ts`, `knip.config.ts` | Writes a config that extends the preset, unless the file already imports it |
|
|
199
|
+
| `lefthook.yml` | Pre-commit on staged files: oxfmt, oxlint, size, suppressions. Pre-push: typecheck |
|
|
200
|
+
| `package.json` | `prepare` installs lefthook. Sets `checks`, `size`, `ratchet`, `ratchet:update`, `suppressions`, `suppressions:update`, `sync`, `sync:check`; adds missing `typecheck`, `lint`, `format`, `format:check`, `knip`; adds `lefthook` and `knip` |
|
|
201
|
+
| `renovate.json` | Writes one extending `github>AntelopeJS/.github:renovate.json5` when the repository has no Renovate config at any path Renovate reads (including a `renovate` key in `package.json`). An existing config stays as it is; sync and `--check` fail one that does not extend the preset. Under `--profile template`, only in the template source, so a scaffold may keep, change or delete the copy it gets |
|
|
202
|
+
| `.nvmrc` | `24` |
|
|
203
|
+
| `.agents/setup` | Orb setup: switches to the `.nvmrc` Node, activates `packageManager` through corepack, installs with the frozen lockfile |
|
|
204
|
+
| `AGENTS.md` | Writes the managed block between `<!-- antelopejs-guardrails:start -->` and `:end -->`; text outside the markers stays |
|
|
205
|
+
| `README.md` of each `@antelopejs` package | Writes the generated compatibility block (see [Generated compatibility block](./docs/documentation-checks.md#generated-compatibility-block)); prose outside its markers stays |
|
|
206
|
+
| `CLAUDE.md` | `@AGENTS.md` |
|
|
207
|
+
| `guardrails.ratchet.json` | Records non-empty debt on first adoption, before `sync:check` exists |
|
|
208
|
+
| `guardrails.suppressions.json` | Records the current suppression counts when the file is missing; restores the committed file instead when HEAD has one; otherwise only adds `config` and `agentFiles` at today's counts when the file predates them |
|
|
209
|
+
| `<layer>/build/backend-boundary.ts` | Where a DMS frontend layer tracks one, restores the pack's backend boundary plugin for the package that holds the layer. A formatter's rewrite is not drift; any other edit is |
|
|
209
210
|
|
|
210
211
|
`--profile template` writes only the three preset configs, a user-facing `AGENTS.md` block and the `suppressions` package scripts (plus `ratchet` once `guardrails.ratchet.json` exists) that `antelopejs-checks` requires, for template repositories. The agent layer, `verify-template` and the writing skills under `.agents/skills/` with their `.claude/skills` links, is synced and checked only in the template source, marked by its `.agents/skills/verify-template/` folder; a project scaffolded from the template ships without it, so the template's `AGENTS.md` block links no skill under `.agents/` or `.claude/skills/`. `antelopejs-sync --check` writes nothing and exits 1 on any drift; `pnpm run checks` runs it.
|
|
211
212
|
|
package/dist/bin/garden.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { c as object, d as optTime, f as parseJson, h as time, i as isObject, l as optNum, m as strings, n as children, o as list, p as str, r as flag, s as num, t as child, u as optStr } from "../json-CG2L7YFl.mjs";
|
|
3
3
|
import { n as runCliAsync } from "../cli-4Tv71vYk.mjs";
|
|
4
|
-
import { c as ciRenovateSyncCallers, i as CI_RENOVATE_SYNC_REF, n as CI_NODE_REF, r as CI_PATH, s as ciNodeCallers, t as CI_CONTEXT } from "../ci-workflow-
|
|
4
|
+
import { c as ciRenovateSyncCallers, d as RENOVATE_PRESET, i as CI_RENOVATE_SYNC_REF, n as CI_NODE_REF, r as CI_PATH, s as ciNodeCallers, t as CI_CONTEXT, u as RENOVATE_CONFIGS } from "../ci-workflow-CXcAZj6g.mjs";
|
|
5
5
|
import { i as ghToken, n as createApi, t as ApiError } from "../api-CCOiLN3w.mjs";
|
|
6
6
|
import { parseArgs } from "node:util";
|
|
7
7
|
import { inflateRawSync } from "node:zlib";
|
|
@@ -709,15 +709,6 @@ async function tooling(context) {
|
|
|
709
709
|
//#region src/garden/checks/conformance.ts
|
|
710
710
|
const CHECK$1 = "conformance";
|
|
711
711
|
const DAY$2 = 864e5;
|
|
712
|
-
const RENOVATE_CONFIGS = [
|
|
713
|
-
"renovate.json",
|
|
714
|
-
"renovate.json5",
|
|
715
|
-
".github/renovate.json",
|
|
716
|
-
".github/renovate.json5",
|
|
717
|
-
".renovaterc",
|
|
718
|
-
".renovaterc.json"
|
|
719
|
-
];
|
|
720
|
-
const RENOVATE_PRESET = /github>AntelopeJS\/\.github(?::|\/)/;
|
|
721
712
|
const MEND_EXEMPT = /* @__PURE__ */ new Set(["k8s-gitops-infra"]);
|
|
722
713
|
function problem(repo, subject, evidence, doneMeans) {
|
|
723
714
|
return finding({
|
package/dist/bin/sync.mjs
CHANGED
|
@@ -6,8 +6,8 @@ import { a as VERIFY_KINDS, c as isVerifyKind, i as SYNCED_SKILL_FILES, l as ski
|
|
|
6
6
|
import { t as runCli } from "../cli-4Tv71vYk.mjs";
|
|
7
7
|
import { c as repositoryRoot } from "../files-DJ0TeaTU.mjs";
|
|
8
8
|
import { i as recordedRelease, t as measureBaseline } from "../ratchet-BAcLRYuM.mjs";
|
|
9
|
+
import { a as ciWorkflow, c as ciRenovateSyncCallers, f as renovateArtifacts, l as hasChecksWorkflow, o as MISSING_CHECKS_WORKFLOW, r as CI_PATH, s as ciNodeCallers } from "../ci-workflow-CXcAZj6g.mjs";
|
|
9
10
|
import { n as SUPPRESSIONS_FILE, r as adoptedBudget } from "../suppression-budget-C0SkPO5R.mjs";
|
|
10
|
-
import { a as ciWorkflow, c as ciRenovateSyncCallers, l as hasChecksWorkflow, o as MISSING_CHECKS_WORKFLOW, r as CI_PATH, s as ciNodeCallers } from "../ci-workflow-mc0vywUV.mjs";
|
|
11
11
|
import { chmodSync, existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, readlinkSync, rmdirSync, statSync, symlinkSync, unlinkSync, writeFileSync } from "node:fs";
|
|
12
12
|
import { dirname, join, resolve } from "node:path";
|
|
13
13
|
import { execFileSync } from "node:child_process";
|
|
@@ -1321,8 +1321,8 @@ function syncRepository(root, options = {}) {
|
|
|
1321
1321
|
const writing = planWritingSkills(root, profile, verify.kind);
|
|
1322
1322
|
const actions = [...verify.actions, ...writing.actions];
|
|
1323
1323
|
const context = repositoryContext(root, current, profile, verify.verificationSkill);
|
|
1324
|
-
const
|
|
1325
|
-
let plan = [...planSync(current, modes, context), ...
|
|
1324
|
+
const standalone = [...backendBoundaryArtifacts(root), ...renovateArtifacts(root, manifest, profile === "full" || verify.kind === "template")];
|
|
1325
|
+
let plan = [...planSync(current, modes, context), ...standalone];
|
|
1326
1326
|
const errors = plan.filter((artifact) => artifact.kind === "error").map(({ message }) => message);
|
|
1327
1327
|
const entryOnly = checkEntryOnlyConfiguration(root);
|
|
1328
1328
|
errors.push(...entryOnly.errors, ...verify.errors, ...writing.errors);
|
|
@@ -1337,7 +1337,7 @@ function syncRepository(root, options = {}) {
|
|
|
1337
1337
|
...baseline,
|
|
1338
1338
|
pack: recordedRelease(void 0)
|
|
1339
1339
|
});
|
|
1340
|
-
plan = [...planSync(current, modes, context), ...
|
|
1340
|
+
plan = [...planSync(current, modes, context), ...standalone];
|
|
1341
1341
|
}
|
|
1342
1342
|
const writes = plan.filter((artifact) => artifact.kind === "write" || artifact.kind === "migrated");
|
|
1343
1343
|
if (!options.check && !errors.length) {
|
|
@@ -1,6 +1,60 @@
|
|
|
1
1
|
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import { Scalar, isMap, isPair, isScalar, isSeq, parseDocument, visit } from "yaml";
|
|
4
|
+
//#region src/guardrails/renovate.ts
|
|
5
|
+
/** The Renovate config file sync writes when a repository has none. */
|
|
6
|
+
const RENOVATE_PATH = "renovate.json";
|
|
7
|
+
/** The config files Renovate's `detectConfigFile` reads, in its lookup order (`getConfigFileNames()` in its `lib/config/app-strings.ts`, called without a platform), before the `renovate` key of `package.json`. */
|
|
8
|
+
const RENOVATE_CONFIGS = [
|
|
9
|
+
RENOVATE_PATH,
|
|
10
|
+
"renovate.jsonc",
|
|
11
|
+
"renovate.json5",
|
|
12
|
+
".github/renovate.json",
|
|
13
|
+
".github/renovate.jsonc",
|
|
14
|
+
".github/renovate.json5",
|
|
15
|
+
".gitlab/renovate.json",
|
|
16
|
+
".gitlab/renovate.jsonc",
|
|
17
|
+
".gitlab/renovate.json5",
|
|
18
|
+
".renovaterc",
|
|
19
|
+
".renovaterc.json",
|
|
20
|
+
".renovaterc.jsonc",
|
|
21
|
+
".renovaterc.json5"
|
|
22
|
+
];
|
|
23
|
+
const PRESET = "github>AntelopeJS/.github:renovate.json5";
|
|
24
|
+
/** Matches a config that extends the AntelopeJS shared Renovate preset. */
|
|
25
|
+
const RENOVATE_PRESET = /github>AntelopeJS\/\.github(?::|\/)/;
|
|
26
|
+
const RENOVATE_JSON = `{
|
|
27
|
+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
|
28
|
+
"extends": ["${PRESET}"]
|
|
29
|
+
}
|
|
30
|
+
`;
|
|
31
|
+
/**
|
|
32
|
+
* Writes `renovate.json` when the repository has no Renovate config, keeps an existing one byte for byte,
|
|
33
|
+
* and fails one that does not extend the AntelopeJS preset, since rewriting it would drop the repository's settings.
|
|
34
|
+
* `managed` is false for a project scaffolded from a template, whose Renovate setup is its own.
|
|
35
|
+
*/
|
|
36
|
+
function renovateArtifacts(root, manifest, managed) {
|
|
37
|
+
if (!managed) return [];
|
|
38
|
+
const file = RENOVATE_CONFIGS.find((path) => existsSync(join(root, path)));
|
|
39
|
+
const path = file ?? "package.json";
|
|
40
|
+
const text = file === void 0 ? manifest.renovate ? JSON.stringify(manifest.renovate) : void 0 : readFileSync(join(root, file), "utf8");
|
|
41
|
+
if (text === void 0) return [{
|
|
42
|
+
kind: "write",
|
|
43
|
+
path: RENOVATE_PATH,
|
|
44
|
+
content: RENOVATE_JSON,
|
|
45
|
+
mode: void 0
|
|
46
|
+
}];
|
|
47
|
+
if (RENOVATE_PRESET.test(text)) return [{
|
|
48
|
+
kind: "unchanged",
|
|
49
|
+
path
|
|
50
|
+
}];
|
|
51
|
+
return [{
|
|
52
|
+
kind: "error",
|
|
53
|
+
path,
|
|
54
|
+
message: `${file ?? "package.json \"renovate\""}: extend "${PRESET}" in its extends, then rerun antelopejs-sync.`
|
|
55
|
+
}];
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
4
58
|
//#region src/guardrails/workflow.ts
|
|
5
59
|
const CI_NODE_PATTERN = /^AntelopeJS\/\.github\/\.github\/workflows\/ci-node\.yml@\S+$/;
|
|
6
60
|
const CI_RENOVATE_SYNC_PATTERN = /^AntelopeJS\/\.github\/\.github\/workflows\/ci-renovate-sync\.yml@\S+$/;
|
|
@@ -344,4 +398,4 @@ function ciWorkflow(current, callers, syncCallers, docsFiles) {
|
|
|
344
398
|
});
|
|
345
399
|
}
|
|
346
400
|
//#endregion
|
|
347
|
-
export { ciWorkflow as a, ciRenovateSyncCallers as c, CI_RENOVATE_SYNC_REF as i, hasChecksWorkflow as l, CI_NODE_REF as n, MISSING_CHECKS_WORKFLOW as o, CI_PATH as r, ciNodeCallers as s, CI_CONTEXT as t };
|
|
401
|
+
export { ciWorkflow as a, ciRenovateSyncCallers as c, RENOVATE_PRESET as d, renovateArtifacts as f, CI_RENOVATE_SYNC_REF as i, hasChecksWorkflow as l, CI_NODE_REF as n, MISSING_CHECKS_WORKFLOW as o, CI_PATH as r, ciNodeCallers as s, CI_CONTEXT as t, RENOVATE_CONFIGS as u };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antelopejs/tooling-configs",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
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",
|