@theholocron/astromech 5.0.0-alpha.42 → 5.0.0-alpha.421

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,84 @@ 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, or `package.json`'s own `dependencies`/`devDependencies` if that config file isn't there | |
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
+ | `validate:deps` | `holocron probe deps check` | dependency catalogs — a leaf of the `validate` suite, not a linter |
86
+ | `validate:generated` | `holocron probe generated check` | generated files match the config — a leaf of the `validate` suite, not a linter |
87
+ | `measure:docs` | `holocron probe docs coverage` | doc-comment coverage, uploaded to Codecov as the `documentation` flag; the Codecov status gates, not the job |
88
+ | `remind-doctor` | _(none — posts through a webhook secret)_ | a weekly #alerts line that reminds a maintainer to run `doctor notifications --post` |
89
+ | `publish-wiki` | Fern | publishes `docs/wiki/*.md` — not a sync, a publish; carries `preview` |
90
+ | `deploy-docs` | Astro build | the docs site itself; carries `preview` (defaults on) |
91
+ | `deploy-components` | Storybook build | a browsable component catalog — "Storybook" is the tool, not the intent; carries `preview` (defaults on) |
78
92
 
79
93
  **`preview` is a cross-cutting feature, not a namespace.** npm has staging
80
94
  dist-tags, Cloudflare/Vercel do per-PR preview deploys, Fern previews
81
95
  docs — none of these earn their own task or verb; it's one capability any
82
96
  publish/deploy-shaped task can carry, toggled via that task's `with:`.
83
97
 
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
98
+ **`linterGroup` tasks** (`lint:code`) bundle more than one tool under a single
99
+ required check. Each tool is still gated by its own detection rule — e.g.
100
+ `eslint` runs when either a local `eslint.config.*` is present, or the
101
+ package has no local file but `@theholocron/eslint-config` resolves
102
+ (the same shared-config splice the `tool`/`detect` runner path uses) — the
88
103
  `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
104
+ `src/tasks/run/linters/linters.ts`. A repo's choice of which of these run is based on which
90
105
  tasks it includes in `tasks: [...]`, same as any other task.
91
106
 
92
107
  **No super-linter.** Each task above runs its own tool directly, through
@@ -106,9 +121,9 @@ import { defineConfig } from "@theholocron/astromech/config";
106
121
 
107
122
  export default defineConfig({
108
123
  tasks: [
109
- "verification.typeSafety",
110
- { name: "verification.unitTests", required: true, with: { "run-coverage": true } },
111
- { name: "security.codeScanning", ci: true, local: false }, // CI-only
124
+ "typecheck",
125
+ { name: "test:unit", required: true, with: { "run-coverage": true } },
126
+ { name: "scan:code", ci: true, local: false }, // CI-only
112
127
  ],
113
128
  });
114
129
  ```
@@ -116,10 +131,13 @@ export default defineConfig({
116
131
  `loadTasksConfig(cwd)` resolves the manifest: the `tasks` key of
117
132
  `holocron.config.*` (a bare item array), then a dedicated
118
133
  `astromech.config.*` merged on top (dedicated wins; arrays concatenate).
134
+ `mergeTasksLayers(parentTasks, dedicated)` is that merge step on its own,
135
+ for callers that load the two sources some other way (Sentinel reads them
136
+ through the GitHub API).
119
137
 
120
138
  | `TaskEntry` field | Effect |
121
139
  | ------------------------ | ----------------------------------------------------------- |
122
- | `ci` (default `true`) | emit the CI workflow; include in `holocron ci` |
140
+ | `ci` (default `true`) | emit the CI workflow; include in `holocron run ci` |
123
141
  | `local` (default `true`) | write the `package.json` script; `holocron run` resolves it |
124
142
  | `local: false` | `holocron run <name>` → "CI-only task", exit 0 |
125
143
  | `required` | the task's check context is a required status check |
@@ -127,7 +145,7 @@ export default defineConfig({
127
145
 
128
146
  Top-level keys: `syncScripts: false` disables the `package.json` script
129
147
  writes entirely; `holocronScript` sets the command the synced `"holocron"`
130
- script runs (default `"holocron"`).
148
+ script runs (default `"holocron"`) and the one the generated git hooks call.
131
149
 
132
150
  ### Generated surfaces
133
151
 
@@ -135,8 +153,9 @@ script runs (default `"holocron"`).
135
153
  const astromech = createAstromech({ cwd, config, orgContext: { org, domain } });
136
154
 
137
155
  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
156
+ astromech.packageScripts(); // single package: { holocron: "holocron", "test:unit": "holocron run test unit --", … }; workspace: { "test:unit": "turbo run test:unit", … }
157
+ astromech.requiredChecks(true); // ["ci / Required checks", "DCO"] — branch-protection contexts (false: "DCO", then the per-task contexts, then extras)
158
+ astromech.aggregateCaller(); // the thin caller of the `ci` aggregate check, or null when nothing is required
140
159
  astromech.codecovConfig(existing); // codecov.yml content — merges into `existing`, or scaffolds fresh when null
141
160
  astromech.ci({ scope: "required" }); // CiReport — run the gating checks locally, in CI order
142
161
  ```
@@ -145,33 +164,64 @@ astromech.ci({ scope: "required" }); // CiReport — run the gating checks local
145
164
  the same resolution as `run()`, in `CI_ORDER`, and returns `{ status, jobs }`.
146
165
  A `required` task whose local runner can't run is a failure — **except** a
147
166
  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
167
+ member lacks a local binary entirely, like `lint:commits`),
168
+ which is reported skipped even when required. `holocron run ci` sets the
150
169
  process exit code from `status`.
151
170
 
152
171
  `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
172
+ generated-by header — the caller prefixes its own). `deploy` /
173
+ `deploy-docs` / `deploy-components` with `preview:` produce the
155
174
  combined push-to-Pages / PR-to-preview workflow —
156
- `knowledge.docs`/`knowledge.components` default `preview` on, since
175
+ `deploy-docs`/`deploy-components` default `preview` on, since
157
176
  neither has a plain-production-only fallback template.
158
177
  `packageScripts()` emits the `holocron` entry (`holocronScript ?? "holocron"`)
159
- plus one `"<task>": "holocron run <task>"` per runnable task; it skips
178
+ plus the scripts `scriptsFor(config, registry, { monorepo })` computes; it skips
160
179
  `local: false` entries and tasks with no local runner at all, and returns
161
- `{}` when `syncScripts: false` or there is no config.
180
+ `{}` when `syncScripts: false` or there is no config. The same function backs `repo sync`, which merges the result with
181
+ `mergeScripts()`, and `probe generated check`, which fails on a root script that differs and on a script that breaks the
182
+ rules of `checkPackageScripts()`.
183
+
184
+ #### Scripts and `turbo.json`
185
+
186
+ `scriptsFor()` is the one rule for what a root script calls (spec `ci-flat-task-vocabulary`):
187
+
188
+ | Repo | Package-scoped leaf (`build`, `test:unit`) | Repo-scoped leaf (`lint:markdown`, `format`) | Suite (`test`, `lint`) |
189
+ | ---------------------------------------------- | ------------------------------------------ | --------------------------------------------- | ------------------------- |
190
+ | a pnpm workspace with a generated `turbo.json` | `turbo run <key>` | the tool's own command (`prettier --write .`) | `turbo run <suite>` |
191
+ | a single package | `holocron run <words> --` | `holocron run <words> --` | `holocron run <suite> --` |
192
+
193
+ A leaf with no local command (`scan:code`, `lint:commits`, `release`, a holocron subcommand) has no script in a
194
+ workspace. `holocron` may not be built on a fresh clone while turbo is an ordinary devDependency, which is why a
195
+ workspace calls turbo directly. In a workspace `turboConfig()` also writes each suite as a task with no script that
196
+ `dependsOn` its leaves, and a `//#<id>` root task (`cache: false`, since it reads every package's files) for each
197
+ 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
198
+ real tool command and never calls turbo or `holocron run`, and no package carries a script named like a suite.
199
+
200
+ The key a package-scoped leaf has in `turbo.json`, and so the name of its script in every package, **follows how the
201
+ manifest spells the task**: `{ name: "test:unit" }` gives `test:unit`, `{ name: "test:unit" }` keeps
202
+ `test:unit`. A repo's packages hold scripts in the vocabulary its `tasks:` list speaks, so rewriting the list
203
+ to flat ids is what moves its keys, and the package scripts with them (`taskKey()`).
162
204
 
163
205
  ### Required checks
164
206
 
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
207
+ `requiredChecks(aggregate)` is the branch-protection required-status-check list. With the `ci` aggregate (the repo
208
+ contains it, see below) it is `["ci / Required checks", "DCO"]`. Without it, it is `"DCO"`, then every `{ required: true }` task's check
209
+ context, ordered by `CI_ORDER`, then `config.extraRequiredChecks` (codecov gates, …), de-duplicated. Most tasks are
210
+ single always-run jobs now, so their context
211
+ names that job directly (`"typecheck / Run tsc --noEmit"`) — the `… /
212
+ Conclusion` fan-in job inside a workflow is only used where a task genuinely has
171
213
  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.
214
+ (`test:unit`). `holocron repo setup`
215
+ applies the list for `protection: "strict"` repos. Policy-free — manifest only.
216
+
217
+ ### The `ci` aggregate
218
+
219
+ `aggregateChecks(config)` derives what the reusable `ci.yml` (in `ci/workflows/`) waits on, from the same list: the
220
+ `expected` ids are the part before `/` of each required task's context and of each `extraRequiredChecks` entry that
221
+ is not a `codecov/` status (the hand-written `Generated files / Check` becomes `Generated files`), and `statuses` are
222
+ the `codecov/` entries. `aggregateCaller()` renders the `pull_request` caller, whose job `ci` calls the reusable's `Required checks` job.
223
+ `holocron repo sync` writes it only in the repo that contains the reusables. The ids are today's check names; the later
224
+ rename changes them here and costs no ruleset edit.
175
225
 
176
226
  ### `codecov.yml`
177
227
 
@@ -183,18 +233,39 @@ came from), same manifest-derived category as `thinCallers()`. Pass the
183
233
  current file's content (or `null`) and it either merges the
184
234
  `individual_components` list in (preserving everything else in the file —
185
235
  thresholds, flags, custom rules) or scaffolds a fresh file from the base
186
- template. `holocron setup` writes the result via the `source` capability;
236
+ template. `holocron repo setup` writes the result via the `source` capability;
187
237
  this method never touches the filesystem beyond reading `packages/*` and
188
238
  `apps/*` under `cwd`.
189
239
 
240
+ ## Release-time deploys — `deployOnRelease`
241
+
242
+ Deploys the workspace packages whose manifest declares it (holocron#930):
243
+
244
+ ```ts
245
+ // packages/<app>/holocron.config.ts
246
+ tasks: [{ name: "deploy", with: { on: "release", channel: "alpha" } }];
247
+ ```
248
+
249
+ `holocron deploy on-release --channel=<alpha|main> --from=<previous release commit> --to=<release commit>`
250
+ (or `deployOnRelease()` from `@theholocron/astromech`) deploys each such package
251
+ when the release is on its `channel` (default `main`, the stable release;
252
+ set `alpha` for prereleases) and changes the package or one of its `workspace:*` dependencies
253
+ (`with.paths` overrides that), once npm serves the release's new dependency
254
+ versions, by running `pnpm --filter <package> deploy`. A package
255
+ that doesn't apply to the release is skipped; a deploy that fails exits
256
+ non-zero. The shared `release` workflow runs it as a separate `deploy`
257
+ job after the release job (opt in with `deploy-on-release: true`), so a deploy
258
+ is its own re-runnable check. A `deploy` task with `on: "release"`
259
+ generates no workflow.
260
+
190
261
  ## Development
191
262
 
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 |
263
+ | Script | Description |
264
+ | -------------------- | ------------------------------------------- |
265
+ | `pnpm run build` | Bundle with tsdown |
266
+ | `pnpm run test:unit` | Run the vitest suite (always with coverage) |
267
+ | `pnpm run typecheck` | `tsc --noEmit` |
268
+ | `pnpm run lint:code` | ESLint |
198
269
 
199
270
  ## Releases
200
271
 
@@ -202,4 +273,51 @@ Automated via semantic-release. See [CHANGELOG.md](../../CHANGELOG.md).
202
273
 
203
274
  ## Documentation
204
275
 
205
- <https://theholocron.github.io/holocron/>
276
+ <https://docs.theholocron.dev/holocron/>
277
+
278
+ ## Lint — `@theholocron/astromech/lint`
279
+
280
+ The lint tools' own data and checks, in a subpath so the runner and the
281
+ config surface don't pull `@commitlint/*` in:
282
+
283
+ - `lintCommitMsgFile(file, cwd)` / `lintCommitMessage(message, config)` —
284
+ what `holocron run lint commit-msg <file>` (the `commit-msg` hook) runs.
285
+ - `ALEX_CONFIG`, `ALEX_IGNORE_PATTERNS`, `PRETTIER_IGNORE_PATTERNS`,
286
+ `EDITORCONFIG_CHECKER_EXCLUDE` and `isEditorConfigExcluded(path)` — read
287
+ from the same templates `holocron repo setup` writes, so Sentinel's central
288
+ checks skip exactly what each repo's own CI skips.
289
+
290
+ The root entry also exports the config-file generators `holocron repo setup`
291
+ writes (`createEditorconfig`, `createAlexrc`, `createPrePush`, …) and
292
+ `createHeader`.
293
+
294
+ ## Repo validation — `@theholocron/astromech/repo-validation`
295
+
296
+ The rules of the `validate:specs` and `validate:docs` checks, once, as pure functions over plain data (changed files, commit
297
+ subjects, the PR description, a manifest) that return findings. They do no git, no filesystem and no network, so the two
298
+ interfaces that run them only supply the data: the CLI (`holocron probe docs presence` and `holocron probe specs check`, the two leaves of
299
+ the `validate` suite) from git and the filesystem, and [Sentinel](https://docs.theholocron.dev/holocron/sentinel/) from the
300
+ webhook and the GitHub API (#929).
301
+
302
+ - Docs presence: `isFeat(subjects)`, `packageOf(file, readPackage)`, `pageNames(dir)`, `hasDocsSignal(dir, changedFiles, addedCommentLines)`,
303
+ `isAddedDocComment(line)`, `parseSkipDocs(text)` (the `[skip docs] <reason>` marker) and
304
+ `evaluateDocsPresence({ packages, changedFiles, addedCommentLines, skip })`, which sorts a feature's packages into
305
+ those to warn about and those a marker excused.
306
+ - ADRs and specs: `checkSpecs(files)` takes `{ path, text }` pairs and returns `{ fileCount, findings }`, skipping a path that
307
+ is neither an ADR nor a spec; underneath it are `classifySpecPath(path)`, `parseFrontmatter(text)`,
308
+ `validateAdr(path, text)`, `validateSpec(path, text)` and `isValidIsoDate(value)`, and the folders and status sets
309
+ (`ADR_DIR`, `SPEC_DIRS`, `ADR_STATUSES`, `SPEC_STATUSES`). A `SpecFinding` is an `error` (fails the check) or a
310
+ `warning` (never does), with the file, the field's line and the rule.
311
+
312
+ ## Upgrade — `@theholocron/astromech/upgrade`
313
+
314
+ The repo-agnostic machinery behind `holocron repo upgrade`, in a subpath so the CLI and any other tool can use it.
315
+
316
+ - `runUpgradeNode({ to, from?, cwd?, dryRun?, extra?, logger? })` walks the repo and rewrites every Node.js major pin:
317
+ `engines.node`, an exact `@types/node`, `.nvmrc`, `.node-version`, workflow `node-version:`, Dockerfile
318
+ `FROM node:` and `.tool-versions`. `from` is read from `.nvmrc` or `engines.node` when omitted. It never throws:
319
+ a failure is `{ status: "fail", message }`. Underneath are `patchPackageJson`, `patchYaml`, `patchPinFile`,
320
+ `patchDockerfile`, `patchToolVersions` and `detectNodeMajor`.
321
+ - `fetchLatestFromNpm(pkg)` resolves a package's `latest` dist-tag from the npm registry, or `null` on any failure.
322
+
323
+ 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-BWX_CDp6.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,40 @@
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
+ "host-hostess",
12
+ "husky",
13
+ "period"
14
+ ] };
15
+ // src/templates/configs/editorconfig-checker/editorconfig-checker.json
16
+ var editorconfig_checker_default = {
17
+ Verbose: false,
18
+ Format: "",
19
+ Debug: false,
20
+ IgnoreDefaults: false,
21
+ SpacesAfterTabs: false,
22
+ NoColor: false,
23
+ Exclude: [
24
+ "(^|.+/)LICENSE$",
25
+ "^public/.*",
26
+ "\\.md$",
27
+ "\\.mdx$"
28
+ ],
29
+ AllowedContentTypes: [],
30
+ PassedFiles: [],
31
+ Disable: {
32
+ "EndOfLine": false,
33
+ "Indentation": false,
34
+ "InsertFinalNewline": false,
35
+ "TrimTrailingWhitespace": false,
36
+ "IndentSize": false,
37
+ "MaxLineLength": false
38
+ }
39
+ };
40
+ export { alexrc_default as n, editorconfig_checker_default as t };