@theholocron/astromech 5.0.0-alpha.36 → 5.0.0-alpha.361

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
@@ -1,7 +1,7 @@
1
1
  # `@theholocron/astromech`
2
2
 
3
3
  The Holocron task runner. One **task manifest** per repo, and every
4
- derived surface comes from it: `holocron run` (local), `holocron ci` (the
4
+ derived surface comes from it: `holocron run` (local), `holocron run ci` (the
5
5
  CI suite run locally), the generated GitHub Actions workflows, the
6
6
  `package.json` scripts, and the branch-protection required-checks list.
7
7
 
@@ -24,69 +24,80 @@ import { createAstromech } from "@theholocron/astromech";
24
24
 
25
25
  const astromech = createAstromech({ cwd });
26
26
 
27
- const report = astromech.run("verification.unitTests", { passthrough: ["--watch"] });
27
+ const report = astromech.run("test:unit", { passthrough: ["--watch"] });
28
28
  // → { status: "ok" | "fail" | "skip" | "dry-run" | "unknown", command?, message? }
29
29
  ```
30
30
 
31
31
  ### `holocron run <task>` resolution
32
32
 
33
- `holocron run verification.unitTests` runs your tests — you don't tell it
34
- turbo vs pnpm vs npm, or which runner:
33
+ `holocron run test:unit` runs your unit tests, `holocron run test` the whole `test` suite — you don't tell it
34
+ turbo vs pnpm vs npm, or which runner. The words are joined with `:` and the longest match against the registry wins
35
+ (`test unit` is `test:unit`, `deploy preview` is `deploy-preview`); what is left is the `[job]` argument. A suite
36
+ (`test`, `lint`, `scan`) is declared by the `suite` field of its leaves in the registry and runs the leaves the repo's
37
+ `tasks:` lists, in registry order; `format` is its own verb (prettier only; writes, `--check` reads). The old dotted
38
+ names (`LEGACY_NAMES`) are accepted in `tasks:` and by `run`, with a deprecation notice on stderr:
35
39
 
36
- ```
40
+ ```text
37
41
  1. turbo.json defines the task → turbo run <task>
38
42
  2. package.json has a <task> script → <detected pm> run <task>
39
- (a "holocron run …" thin caller is skipped — no recursion)
40
- 3. the registry has a local runner → <tool> <args> <org-flags> (e.g. --coverage)
43
+ (a "holocron run …" thin caller is skipped — no recursion; so is the root script generated from the
44
+ registry's own command, which step 3 runs itself)
45
+ 3. the registry has a local runner → <tool> <args> (`test:unit` is `vitest run --coverage`)
41
46
  3b. the task is a linterGroup → each resolved linter, run natively
42
- 4. the task is a container of jobs → each job, in declared order
43
- 5. known task, nothing to run → "no <task> task", exit 0 (exit 1 with --required)
44
- 6. unknown task → error, exit 1
47
+ 4. known task, nothing to run → "no <task> task", exit 0 (exit 1 with --required)
48
+ 5. unknown task → error, exit 1
45
49
  ```
46
50
 
47
51
  ## Intent → technology
48
52
 
49
53
  Tasks are named by **intent**, not by tool — a repo declares
50
- `verification.unitTests`, not `vitest`. The table below is the full
51
- registry (`TASKS` in `src/registry.ts`): every task name astromech knows,
54
+ `test:unit`, not `vitest`. (The dotted names such as `verification.unitTests` are the old spelling; they still <!-- holocron-allow-old-name -->
55
+ work as aliases, see `LEGACY_NAMES`, but nothing generated uses them for a repo on flat ids.)
56
+ The table below is the full
57
+ registry (`TASKS` in `src/registry/registry.ts`): every task name astromech knows,
52
58
  what it actually runs, and why. Tool names never appear in
53
59
  `holocron.config.ts` — they're an implementation detail this table
54
60
  documents, not a naming convention repos need to follow.
55
61
 
56
- | Task | Runs | Notes |
57
- | ---------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
58
- | `verification.unitTests` | vitest | carries the `--coverage` org default |
59
- | `verification.typeSafety` | tsc | `tsc --noEmit` |
60
- | `verification.performance` | Lighthouse CI | only runs with a `lighthouse.config.*` present |
61
- | `sourceQuality.staticAnalysis` | eslint, actionlint, git-merge-conflict-markers | a `linterGroup` — see below |
62
- | `sourceQuality.formatting` | prettier, editorconfig-checker, markdownlint-cli2 | a `linterGroup` |
63
- | `sourceQuality.structuredDataValidation` | yamllint | |
64
- | `sourceQuality.deadCodeAnalysis` | knip | |
65
- | `security.secretDetection` | gitleaks | |
66
- | `security.codeScanning` | CodeQL | no local equivalent — CI only |
67
- | `security.dependencyReview` | GitHub's native Dependabot alerts/graph | a capability-model method (`Source.enableVulnerabilityAlerts()`), not a task |
68
- | `delivery.build` | tsdown / vite / rollup / tsc, detected from the repo's own config file | |
69
- | `delivery.publish` | semantic-release | no local equivalent — CI only; carries `preview` (npm dist-tags) |
70
- | `delivery.deploy` | Cloudflare Pages / Vercel | no local equivalent — CI only; carries `preview` |
71
- | `delivery.bundleSize` | bundle-size upload to Codecov | no local equivalent — CI only |
72
- | `platform.repoSync` | `holocron sync` | keeps generated files current |
73
- | `platform.commitStandards` | commitlint | no local equivalent — enforced by the `commit-msg` hook locally, over the PR's commit range in CI |
74
- | `platform.repoValidation` | `scripts/validate-adrs.mjs`, `scripts/validate-registry.mjs`, `scripts/validate-docs-presence.mjs` | a job-bearing task — spec/ADR frontmatter, registry-doc completeness, and docs-presence, not linters |
75
- | `knowledge.wiki` | Fern | publishes `docs/wiki/*.md` — not a sync, a publish; carries `preview` |
76
- | `knowledge.docs` | Astro build | the docs site itself; carries `preview` (defaults on) |
77
- | `knowledge.components` | Storybook build | a browsable component catalog — "Storybook" is the tool, not the intent; carries `preview` (defaults on) |
62
+ | Task | Runs | Notes |
63
+ | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
64
+ | `test:unit` | vitest | always runs with coverage: `vitest run --coverage`, there is no flag |
65
+ | `typecheck` | tsc | `tsc --noEmit` |
66
+ | `test:perf` | Lighthouse CI | only runs with a `lighthouse.config.*` present |
67
+ | `lint:code` | eslint, actionlint, git-merge-conflict-markers | a `linterGroup` — see below |
68
+ | `lint:editorconfig`, `lint:markdown` | editorconfig-checker, markdownlint-cli2 | each is a `linterGroup` of one tool |
69
+ | `format` | prettier | writes by default, `--check` is read-only; no workflow of its own |
70
+ | `lint:data` | yamllint | |
71
+ | `lint:unused` | knip | |
72
+ | `scan:secrets` | gitleaks | |
73
+ | `scan:code` | CodeQL | no local equivalent — CI only |
74
+ | `check-tokens` | `holocron doctor tokens` | scheduled daily in CI; fails on a rejected token or one with 7 days or fewer left; never part of `run ci` |
75
+ | `build` | tsdown / vite / rollup / tsc, detected from the repo's own config file, or `package.json`'s own `dependencies`/`devDependencies` if that config file isn't there | |
76
+ | `release` | semantic-release | no local equivalent — CI only; carries `preview` (npm dist-tags) |
77
+ | `deploy` | Cloudflare Pages / Vercel | no local equivalent — CI only; carries `preview` |
78
+ | `measure-bundle` | bundle-size upload to Codecov | no local equivalent — CI only |
79
+ | `check-preview` | `holocron monitoring check <url>` against the PR's own Vercel preview URL | no local equivalent — CI only; triggered by `deployment_status`, not `push`/`pull_request` |
80
+ | `check-notify` | _(none — manual workflow)_ | posts a labelled test message to every notification channel; fails per channel that does not work |
81
+ | `sync-repo` | `holocron repo sync` | keeps generated files current |
82
+ | `lint:commits` | commitlint | no local equivalent — enforced by the `commit-msg` hook locally, over the PR's commit range in CI |
83
+ | `validate:specs` | `holocron probe specs check` | spec/ADR frontmatter — a leaf of the `validate` suite, not a linter |
84
+ | `validate:docs` | `holocron probe docs validate` | docs presence (warns) and token docs (fails) — a leaf of the `validate` suite, not a linter |
85
+ | `publish-wiki` | Fern | publishes `docs/wiki/*.md` — not a sync, a publish; carries `preview` |
86
+ | `deploy-docs` | Astro build | the docs site itself; carries `preview` (defaults on) |
87
+ | `deploy-components` | Storybook build | a browsable component catalog — "Storybook" is the tool, not the intent; carries `preview` (defaults on) |
78
88
 
79
89
  **`preview` is a cross-cutting feature, not a namespace.** npm has staging
80
90
  dist-tags, Cloudflare/Vercel do per-PR preview deploys, Fern previews
81
91
  docs — none of these earn their own task or verb; it's one capability any
82
92
  publish/deploy-shaped task can carry, toggled via that task's `with:`.
83
93
 
84
- **`linterGroup` tasks** (`sourceQuality.staticAnalysis`,
85
- `sourceQuality.formatting`) bundle more than one tool under a single
86
- required check. Each tool is still gated by its own detection rule (e.g.
87
- `eslint` only runs if `eslint.config.*` is present) — the
94
+ **`linterGroup` tasks** (`lint:code`) bundle more than one tool under a single
95
+ required check. Each tool is still gated by its own detection rule — e.g.
96
+ `eslint` runs when either a local `eslint.config.*` is present, or the
97
+ package has no local file but `@theholocron/eslint-config` resolves
98
+ (the same shared-config splice the `tool`/`detect` runner path uses) — the
88
99
  `tool name → detection rule → local binary` mapping lives in one place,
89
- `src/linters.ts`. A repo's choice of which of these run is just which
100
+ `src/tasks/run/linters/linters.ts`. A repo's choice of which of these run is based on which
90
101
  tasks it includes in `tasks: [...]`, same as any other task.
91
102
 
92
103
  **No super-linter.** Each task above runs its own tool directly, through
@@ -106,9 +117,9 @@ import { defineConfig } from "@theholocron/astromech/config";
106
117
 
107
118
  export default defineConfig({
108
119
  tasks: [
109
- "verification.typeSafety",
110
- { name: "verification.unitTests", required: true, with: { "run-coverage": true } },
111
- { name: "security.codeScanning", ci: true, local: false }, // CI-only
120
+ "typecheck",
121
+ { name: "test:unit", required: true, with: { "run-coverage": true } },
122
+ { name: "scan:code", ci: true, local: false }, // CI-only
112
123
  ],
113
124
  });
114
125
  ```
@@ -116,10 +127,13 @@ export default defineConfig({
116
127
  `loadTasksConfig(cwd)` resolves the manifest: the `tasks` key of
117
128
  `holocron.config.*` (a bare item array), then a dedicated
118
129
  `astromech.config.*` merged on top (dedicated wins; arrays concatenate).
130
+ `mergeTasksLayers(parentTasks, dedicated)` is that merge step on its own,
131
+ for callers that load the two sources some other way (Sentinel reads them
132
+ through the GitHub API).
119
133
 
120
134
  | `TaskEntry` field | Effect |
121
135
  | ------------------------ | ----------------------------------------------------------- |
122
- | `ci` (default `true`) | emit the CI workflow; include in `holocron ci` |
136
+ | `ci` (default `true`) | emit the CI workflow; include in `holocron run ci` |
123
137
  | `local` (default `true`) | write the `package.json` script; `holocron run` resolves it |
124
138
  | `local: false` | `holocron run <name>` → "CI-only task", exit 0 |
125
139
  | `required` | the task's check context is a required status check |
@@ -127,7 +141,7 @@ export default defineConfig({
127
141
 
128
142
  Top-level keys: `syncScripts: false` disables the `package.json` script
129
143
  writes entirely; `holocronScript` sets the command the synced `"holocron"`
130
- script runs (default `"holocron"`).
144
+ script runs (default `"holocron"`) and the one the generated git hooks call.
131
145
 
132
146
  ### Generated surfaces
133
147
 
@@ -135,8 +149,9 @@ script runs (default `"holocron"`).
135
149
  const astromech = createAstromech({ cwd, config, orgContext: { org, domain } });
136
150
 
137
151
  astromech.thinCallers(); // Map<"<name>.yml", yaml> — one per templated, ci-enabled task
138
- astromech.packageScripts(); // { holocron: "holocron", "verification.unitTests": "holocron run verification.unitTests", … }
139
- astromech.requiredChecks(); // ["Typecheck / tsc --noEmit", "codecov/patch", …] — branch-protection contexts
152
+ astromech.packageScripts(); // single package: { holocron: "holocron", "test:unit": "holocron run test unit --", … }; workspace: { "test:unit": "turbo run test:unit", … }
153
+ astromech.requiredChecks(true); // ["ci / Required checks", "DCO"] — branch-protection contexts (false: "DCO", then the per-task contexts, then extras)
154
+ astromech.aggregateCaller(); // the thin caller of the `ci` aggregate check, or null when nothing is required
140
155
  astromech.codecovConfig(existing); // codecov.yml content — merges into `existing`, or scaffolds fresh when null
141
156
  astromech.ci({ scope: "required" }); // CiReport — run the gating checks locally, in CI order
142
157
  ```
@@ -145,33 +160,64 @@ astromech.ci({ scope: "required" }); // CiReport — run the gating checks local
145
160
  the same resolution as `run()`, in `CI_ORDER`, and returns `{ status, jobs }`.
146
161
  A `required` task whose local runner can't run is a failure — **except** a
147
162
  task that's genuinely CI-only (`local: null`, or a `linterGroup` whose every
148
- member lacks a local binary entirely, like `platform.commitStandards`),
149
- which is reported skipped even when required. `holocron ci` sets the
163
+ member lacks a local binary entirely, like `lint:commits`),
164
+ which is reported skipped even when required. `holocron run ci` sets the
150
165
  process exit code from `status`.
151
166
 
152
167
  `thinCallers()` returns the raw `.github/workflows/*.yml` content (no
153
- generated-by header — the caller prefixes its own). `delivery.deploy` /
154
- `knowledge.docs` / `knowledge.components` with `preview:` produce the
168
+ generated-by header — the caller prefixes its own). `deploy` /
169
+ `deploy-docs` / `deploy-components` with `preview:` produce the
155
170
  combined push-to-Pages / PR-to-preview workflow —
156
- `knowledge.docs`/`knowledge.components` default `preview` on, since
171
+ `deploy-docs`/`deploy-components` default `preview` on, since
157
172
  neither has a plain-production-only fallback template.
158
173
  `packageScripts()` emits the `holocron` entry (`holocronScript ?? "holocron"`)
159
- plus one `"<task>": "holocron run <task>"` per runnable task; it skips
174
+ plus the scripts `scriptsFor(config, registry, { monorepo })` computes; it skips
160
175
  `local: false` entries and tasks with no local runner at all, and returns
161
- `{}` when `syncScripts: false` or there is no config.
176
+ `{}` when `syncScripts: false` or there is no config. The same function backs `repo sync`, which merges the result with
177
+ `mergeScripts()`, and `probe generated check`, which fails on a root script that differs and on a script that breaks the
178
+ rules of `checkPackageScripts()`.
179
+
180
+ #### Scripts and `turbo.json`
181
+
182
+ `scriptsFor()` is the one rule for what a root script calls (spec `ci-flat-task-vocabulary`):
183
+
184
+ | Repo | Package-scoped leaf (`build`, `test:unit`) | Repo-scoped leaf (`lint:markdown`, `format`) | Suite (`test`, `lint`) |
185
+ | ---------------------------------------------- | ------------------------------------------ | --------------------------------------------- | ------------------------- |
186
+ | a pnpm workspace with a generated `turbo.json` | `turbo run <key>` | the tool's own command (`prettier --write .`) | `turbo run <suite>` |
187
+ | a single package | `holocron run <words> --` | `holocron run <words> --` | `holocron run <suite> --` |
188
+
189
+ A leaf with no local command (`scan:code`, `lint:commits`, `release`, a holocron subcommand) has no script in a
190
+ workspace. `holocron` may not be built on a fresh clone while turbo is an ordinary devDependency, which is why a
191
+ workspace calls turbo directly. In a workspace `turboConfig()` also writes each suite as a task with no script that
192
+ `dependsOn` its leaves, and a `//#<id>` root task (`cache: false`, since it reads every package's files) for each
193
+ repo-scoped leaf that belongs to a suite, which is how a suite reaches the root tool. A package's own leaf script holds the
194
+ real tool command and never calls turbo or `holocron run`, and no package carries a script named like a suite.
195
+
196
+ The key a package-scoped leaf has in `turbo.json`, and so the name of its script in every package, **follows how the
197
+ manifest spells the task**: `{ name: "test:unit" }` gives `test:unit`, `{ name: "test:unit" }` keeps
198
+ `test:unit`. A repo's packages hold scripts in the vocabulary its `tasks:` list speaks, so rewriting the list
199
+ to flat ids is what moves its keys, and the package scripts with them (`taskKey()`).
162
200
 
163
201
  ### Required checks
164
202
 
165
- `requiredChecks()` derives the branch-protection required-status-check list
166
- from the manifest: every `{ required: true }` task's check context, ordered
167
- by `CI_ORDER`, then `config.extraRequiredChecks` (codecov gates, …),
168
- de-duplicated. Most tasks are single always-run jobs now, so their context
169
- names that job directly (`"Typecheck / tsc --noEmit"`) — the `… /
170
- Conclusion` fan-in aggregate is only used where a task genuinely has
203
+ `requiredChecks(aggregate)` is the branch-protection required-status-check list. With the `ci` aggregate (the repo
204
+ contains it, see below) it is `["ci / Required checks", "DCO"]`. Without it, it is `"DCO"`, then every `{ required: true }` task's check
205
+ context, ordered by `CI_ORDER`, then `config.extraRequiredChecks` (codecov gates, …), de-duplicated. Most tasks are
206
+ single always-run jobs now, so their context
207
+ names that job directly (`"typecheck / Run tsc --noEmit"`) — the `… /
208
+ Conclusion` fan-in job inside a workflow is only used where a task genuinely has
171
209
  several conditionally-run jobs feeding one check
172
- (`verification.unitTests`, `platform.repoValidation`). `holocron setup`
173
- prepends `"DCO"` and applies the list for `protection: "strict"` repos.
174
- Policy-free — manifest only.
210
+ (`test:unit`). `holocron repo setup`
211
+ applies the list for `protection: "strict"` repos. Policy-free — manifest only.
212
+
213
+ ### The `ci` aggregate
214
+
215
+ `aggregateChecks(config)` derives what the reusable `ci.yml` (in `ci/workflows/`) waits on, from the same list: the
216
+ `expected` ids are the part before `/` of each required task's context and of each `extraRequiredChecks` entry that
217
+ is not a `codecov/` status (the hand-written `Generated files / Check` becomes `Generated files`), and `statuses` are
218
+ the `codecov/` entries. `aggregateCaller()` renders the `pull_request` caller, whose job `ci` calls the reusable's `Required checks` job.
219
+ `holocron repo sync` writes it only in the repo that contains the reusables. The ids are today's check names; the later
220
+ rename changes them here and costs no ruleset edit.
175
221
 
176
222
  ### `codecov.yml`
177
223
 
@@ -183,18 +229,39 @@ came from), same manifest-derived category as `thinCallers()`. Pass the
183
229
  current file's content (or `null`) and it either merges the
184
230
  `individual_components` list in (preserving everything else in the file —
185
231
  thresholds, flags, custom rules) or scaffolds a fresh file from the base
186
- template. `holocron setup` writes the result via the `source` capability;
232
+ template. `holocron repo setup` writes the result via the `source` capability;
187
233
  this method never touches the filesystem beyond reading `packages/*` and
188
234
  `apps/*` under `cwd`.
189
235
 
236
+ ## Release-time deploys — `deployOnRelease`
237
+
238
+ Deploys the workspace packages whose manifest declares it (holocron#930):
239
+
240
+ ```ts
241
+ // packages/<app>/holocron.config.ts
242
+ tasks: [{ name: "deploy", with: { on: "release", channel: "alpha" } }];
243
+ ```
244
+
245
+ `holocron deploy on-release --channel=<alpha|main> --from=<previous release commit> --to=<release commit>`
246
+ (or `deployOnRelease()` from `@theholocron/astromech`) deploys each such package
247
+ when the release is on its `channel` (default `main`, the stable release;
248
+ set `alpha` for prereleases) and changes the package or one of its `workspace:*` dependencies
249
+ (`with.paths` overrides that), once npm serves the release's new dependency
250
+ versions, by running `pnpm --filter <package> deploy`. A package
251
+ that doesn't apply to the release is skipped; a deploy that fails exits
252
+ non-zero. The shared `release` workflow runs it as a separate `deploy`
253
+ job after the release job (opt in with `deploy-on-release: true`), so a deploy
254
+ is its own re-runnable check. A `deploy` task with `on: "release"`
255
+ generates no workflow.
256
+
190
257
  ## Development
191
258
 
192
- | Script | Description |
193
- | --------------------------------------- | ------------------------------------------- |
194
- | `pnpm run delivery.build` | Bundle with tsdown |
195
- | `pnpm run verification.unitTests` | Run the vitest suite (always with coverage) |
196
- | `pnpm run verification.typeSafety` | `tsc --noEmit` |
197
- | `pnpm run sourceQuality.staticAnalysis` | ESLint |
259
+ | Script | Description |
260
+ | -------------------- | ------------------------------------------- |
261
+ | `pnpm run build` | Bundle with tsdown |
262
+ | `pnpm run test:unit` | Run the vitest suite (always with coverage) |
263
+ | `pnpm run typecheck` | `tsc --noEmit` |
264
+ | `pnpm run lint:code` | ESLint |
198
265
 
199
266
  ## Releases
200
267
 
@@ -202,4 +269,51 @@ Automated via semantic-release. See [CHANGELOG.md](../../CHANGELOG.md).
202
269
 
203
270
  ## Documentation
204
271
 
205
- <https://theholocron.github.io/holocron/>
272
+ <https://docs.theholocron.dev/holocron/>
273
+
274
+ ## Lint — `@theholocron/astromech/lint`
275
+
276
+ The lint tools' own data and checks, in a subpath so the runner and the
277
+ config surface don't pull `@commitlint/*` in:
278
+
279
+ - `lintCommitMsgFile(file, cwd)` / `lintCommitMessage(message, config)` —
280
+ what `holocron run lint commit-msg <file>` (the `commit-msg` hook) runs.
281
+ - `ALEX_CONFIG`, `ALEX_IGNORE_PATTERNS`, `PRETTIER_IGNORE_PATTERNS`,
282
+ `EDITORCONFIG_CHECKER_EXCLUDE` and `isEditorConfigExcluded(path)` — read
283
+ from the same templates `holocron repo setup` writes, so Sentinel's central
284
+ checks skip exactly what each repo's own CI skips.
285
+
286
+ The root entry also exports the config-file generators `holocron repo setup`
287
+ writes (`createEditorconfig`, `createAlexrc`, `createPrePush`, …) and
288
+ `createHeader`.
289
+
290
+ ## Repo validation — `@theholocron/astromech/repo-validation`
291
+
292
+ The rules of the `validate:specs` and `validate:docs` checks, once, as pure functions over plain data (changed files, commit
293
+ subjects, the PR description, a manifest) that return findings. They do no git, no filesystem and no network, so the two
294
+ interfaces that run them only supply the data: the CLI (`holocron probe docs presence` and `holocron probe specs check`, the two leaves of
295
+ the `validate` suite) from git and the filesystem, and [Sentinel](https://docs.theholocron.dev/holocron/sentinel/) from the
296
+ webhook and the GitHub API (#929).
297
+
298
+ - Docs presence: `isFeat(subjects)`, `packageOf(file, readPackage)`, `pageNames(dir)`, `hasDocsSignal(dir, changedFiles, addedCommentLines)`,
299
+ `isAddedDocComment(line)`, `parseSkipDocs(text)` (the `[skip docs] <reason>` marker) and
300
+ `evaluateDocsPresence({ packages, changedFiles, addedCommentLines, skip })`, which sorts a feature's packages into
301
+ those to warn about and those a marker excused.
302
+ - ADRs and specs: `checkSpecs(files)` takes `{ path, text }` pairs and returns `{ fileCount, findings }`, skipping a path that
303
+ is neither an ADR nor a spec; underneath it are `classifySpecPath(path)`, `parseFrontmatter(text)`,
304
+ `validateAdr(path, text)`, `validateSpec(path, text)` and `isValidIsoDate(value)`, and the folders and status sets
305
+ (`ADR_DIR`, `SPEC_DIRS`, `ADR_STATUSES`, `SPEC_STATUSES`). A `SpecFinding` is an `error` (fails the check) or a
306
+ `warning` (never does), with the file, the field's line and the rule.
307
+
308
+ ## Upgrade — `@theholocron/astromech/upgrade`
309
+
310
+ The repo-agnostic machinery behind `holocron repo upgrade`, in a subpath so the CLI and any other tool can use it.
311
+
312
+ - `runUpgradeNode({ to, from?, cwd?, dryRun?, extra?, logger? })` walks the repo and rewrites every Node.js major pin:
313
+ `engines.node`, an exact `@types/node`, `.nvmrc`, `.node-version`, workflow `node-version:`, Dockerfile
314
+ `FROM node:` and `.tool-versions`. `from` is read from `.nvmrc` or `engines.node` when omitted. It never throws:
315
+ a failure is `{ status: "fail", message }`. Underneath are `patchPackageJson`, `patchYaml`, `patchPinFile`,
316
+ `patchDockerfile`, `patchToolVersions` and `detectNodeMajor`.
317
+ - `fetchLatestFromNpm(pkg)` resolves a package's `latest` dist-tag from the npm registry, or `null` on any failure.
318
+
319
+ What counts as a Holocron pin (`@theholocron/*`) and the `holocron.config.ts` migration stay in `@theholocron/cli`.
@@ -1,5 +1,15 @@
1
- import { i as normalizeTaskEntry, n as TaskEntry, r as TasksConfig, t as TaskConfigItem } from "../schema-D01VYg43.mjs";
2
- //#region src/config/define.d.ts
1
+ import { n as TaskEntry, r as TasksConfig, t as TaskConfigItem } from "../schema.type-BfeI4AnM.mjs";
2
+ import { Loaded } from "@theholocron/datapad";
3
+ /**
4
+ * The `tasks` config shape — the single manifest of what a repo runs.
5
+ * Read from a dedicated `astromech.config.*` file or the `tasks` key of
6
+ * `holocron.config.*` (see {@link loadTasksConfig}).
7
+ *
8
+ * Runtime validation is the loader's job, not this type's — the type only
9
+ * describes what an author writes.
10
+ */
11
+ /** Normalise a `TaskConfigItem` to a full {@link TaskEntry} with defaults applied. */
12
+ export declare function normalizeTaskEntry(item: TaskConfigItem): Required<Pick<TaskEntry, "name" | "ci" | "local">> & TaskEntry;
3
13
  /**
4
14
  * Typed identity helper for `astromech.config.ts`:
5
15
  *
@@ -11,15 +21,49 @@ import { i as normalizeTaskEntry, n as TaskEntry, r as TasksConfig, t as TaskCon
11
21
  * });
12
22
  * ```
13
23
  */
14
- declare const defineConfig: <C extends TasksConfig>(config: C) => C;
15
- //#endregion
16
- //#region src/config/load.d.ts
24
+ export declare const defineConfig: <C extends TasksConfig>(config: C) => C;
25
+ /**
26
+ * The `tasks` value in each source. A dedicated `astromech.config.*`
27
+ * default-exports the full {@link TasksConfig} object; the `tasks` key of
28
+ * `holocron.config.*` is the bare item array (it mirrors the old
29
+ * `workflows` key). Either form is accepted from either source.
30
+ */
31
+ type TasksInput = TasksConfig | TaskConfigItem[];
32
+ interface LoadTasksConfigOptions {
33
+ /**
34
+ * The `holocron.config.*` the caller has already loaded (`null`: it looked and
35
+ * there is none), so it isn't found and loaded a second time. Leave it unset
36
+ * to have `loadTasksConfig` find it itself.
37
+ */
38
+ holocron?: Loaded<object> | null;
39
+ }
17
40
  /**
18
41
  * Resolve the task manifest for a repo: the `tasks` key of
19
42
  * `holocron.config.*`, then a dedicated `astromech.config.*` merged on
20
43
  * top (dedicated wins; item arrays concatenate). Returns `{}` when
21
44
  * neither source is present.
45
+ *
46
+ * `walkUp: true` — `holocron run`/`ci` are usable from any subdirectory of
47
+ * a repo, not only its exact root (datapad walks up to the nearest `.git`
48
+ * boundary; see `@theholocron/datapad`'s own doc comment).
49
+ *
50
+ * A caller that has already loaded `holocron.config.*` passes it as
51
+ * `options.holocron` so it is not found and loaded again.
52
+ */
53
+ export declare function loadTasksConfig(cwd: string, options?: LoadTasksConfigOptions): Promise<TasksConfig>;
54
+ /**
55
+ * The same layering as {@link loadTasksConfig}, for callers that load the two
56
+ * sources some other way (Sentinel reads them from the GitHub API, not
57
+ * from disk, holocron#916): `holocron.config.*`'s `tasks` value first,
58
+ * then a dedicated `astromech.config.*`'s default export merged on top.
59
+ * Either may be `undefined` (source absent); returns `{}` when both are.
60
+ */
61
+ export declare function mergeTasksLayers(parentTasks: TasksInput | undefined, dedicated: TasksInput | undefined): TasksConfig;
62
+ /**
63
+ * The version groups a repo releases on their own: the folder names listed under `groups`
64
+ * in its `delivery.publish` task. This is what the generated publish workflow reads, so a
65
+ * release config that asks here stays in step with it instead of keeping a second list.
66
+ * `[]` for a repo that releases as one.
22
67
  */
23
- declare function loadTasksConfig(cwd: string): Promise<TasksConfig>;
24
- //#endregion
25
- export { type TaskConfigItem, type TaskEntry, type TasksConfig, defineConfig, loadTasksConfig, normalizeTaskEntry };
68
+ export declare function releaseGroups(config: Pick<TasksConfig, "tasks">): string[];
69
+ export type { TaskConfigItem, TaskEntry, TasksConfig };
@@ -1,6 +1,6 @@
1
- import { t as normalizeTaskEntry } from "../schema-Cf5dfaDO.mjs";
2
- import { createDefineConfig, loadConfigFile, mergeConfig } from "@theholocron/datapad";
3
- //#region src/config/define.ts
1
+ import { n as coerceTasks, r as isTask, t as loadTasksConfig, u as normalizeTaskEntry } from "../load-_eGVkyoe.mjs";
2
+ import { createDefineConfig, mergeLayers } from "@theholocron/datapad";
3
+ // src/config/define/define.ts
4
4
  /**
5
5
  * Typed identity helper for `astromech.config.ts`:
6
6
  *
@@ -13,27 +13,30 @@ import { createDefineConfig, loadConfigFile, mergeConfig } from "@theholocron/da
13
13
  * ```
14
14
  */
15
15
  const defineConfig = createDefineConfig();
16
- //#endregion
17
- //#region src/config/load.ts
16
+ // src/config/merge-tasks-layers/merge-tasks-layers.ts
18
17
  /**
19
- * Resolve the task manifest for a repo: the `tasks` key of
20
- * `holocron.config.*`, then a dedicated `astromech.config.*` merged on
21
- * top (dedicated wins; item arrays concatenate). Returns `{}` when
22
- * neither source is present.
18
+ * The same layering as {@link loadTasksConfig}, for callers that load the two
19
+ * sources some other way (Sentinel reads them from the GitHub API, not
20
+ * from disk, holocron#916): `holocron.config.*`'s `tasks` value first,
21
+ * then a dedicated `astromech.config.*`'s default export merged on top.
22
+ * Either may be `undefined` (source absent); returns `{}` when both are.
23
23
  */
24
- async function loadTasksConfig(cwd) {
25
- const dedicated = await loadConfigFile({
26
- cwd,
27
- name: "astromech"
28
- });
29
- return [coerce((await loadConfigFile({
30
- cwd,
31
- name: "holocron"
32
- }))?.config.tasks), coerce(dedicated?.config)].filter((layer) => layer !== void 0).reduce((acc, layer) => mergeConfig(acc, layer), {});
24
+ function mergeTasksLayers(parentTasks, dedicated) {
25
+ return mergeLayers([coerceTasks(parentTasks), coerceTasks(dedicated)]) ?? {};
33
26
  }
34
- function coerce(value) {
35
- if (value == null) return void 0;
36
- return Array.isArray(value) ? { tasks: value } : value;
27
+ // src/config/release-groups/release-groups.ts
28
+ /**
29
+ * The version groups a repo releases on their own: the folder names listed under `groups`
30
+ * in its `delivery.publish` task. This is what the generated publish workflow reads, so a
31
+ * release config that asks here stays in step with it instead of keeping a second list.
32
+ * `[]` for a repo that releases as one.
33
+ */
34
+ function releaseGroups(config) {
35
+ const groups = (config.tasks ?? []).map(normalizeTaskEntry).find((entry) => isTask(entry.name, "release"))?.with?.["groups"];
36
+ if (!Array.isArray(groups)) return [];
37
+ return groups.flatMap((group) => {
38
+ const name = typeof group === "string" ? group : group?.name;
39
+ return typeof name === "string" ? [name] : [];
40
+ });
37
41
  }
38
- //#endregion
39
- export { defineConfig, loadTasksConfig, normalizeTaskEntry };
42
+ export { defineConfig, loadTasksConfig, mergeTasksLayers, normalizeTaskEntry, releaseGroups };
@@ -0,0 +1,39 @@
1
+ // src/templates/configs/alexjs/alexrc.json
2
+ var alexrc_default = { allow: [
3
+ "dead",
4
+ "execute",
5
+ "execution",
6
+ "executes",
7
+ "failure",
8
+ "failures",
9
+ "hook",
10
+ "hooks",
11
+ "husky",
12
+ "period"
13
+ ] };
14
+ // src/templates/configs/editorconfig-checker/editorconfig-checker.json
15
+ var editorconfig_checker_default = {
16
+ Verbose: false,
17
+ Format: "",
18
+ Debug: false,
19
+ IgnoreDefaults: false,
20
+ SpacesAfterTabs: false,
21
+ NoColor: false,
22
+ Exclude: [
23
+ "(^|.+/)LICENSE$",
24
+ "^public/.*",
25
+ "\\.md$",
26
+ "\\.mdx$"
27
+ ],
28
+ AllowedContentTypes: [],
29
+ PassedFiles: [],
30
+ Disable: {
31
+ "EndOfLine": false,
32
+ "Indentation": false,
33
+ "InsertFinalNewline": false,
34
+ "TrimTrailingWhitespace": false,
35
+ "IndentSize": false,
36
+ "MaxLineLength": false
37
+ }
38
+ };
39
+ export { alexrc_default as n, editorconfig_checker_default as t };