@theholocron/astromech 5.0.0-alpha.20 → 5.0.0-alpha.201
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 +76 -32
- package/dist/config/index.d.mts +52 -5
- package/dist/config/index.mjs +12 -22
- package/dist/editorconfig-checker-DPejtR5z.mjs +41 -0
- package/dist/index.d.mts +518 -403
- package/dist/index.mjs +2287 -1277
- package/dist/lint/index.d.mts +99 -0
- package/dist/lint/index.mjs +143 -0
- package/dist/load-DdHEVFlG.mjs +55 -0
- package/dist/{schema-D01VYg43.d.mts → schema.type-BJmfOafW.d.mts} +16 -17
- package/package.json +22 -9
- package/dist/schema-Cf5dfaDO.mjs +0 -11
package/dist/index.d.mts
CHANGED
|
@@ -1,34 +1,223 @@
|
|
|
1
|
-
import { r as TasksConfig } from "./schema-
|
|
2
|
-
//#region src/
|
|
1
|
+
import { r as TasksConfig } from "./schema.type-BJmfOafW.mjs";
|
|
2
|
+
//#region src/generators/codecov/codecov.type.d.ts
|
|
3
|
+
interface WorkspacePackage$1 {
|
|
4
|
+
slug: string;
|
|
5
|
+
name: string;
|
|
6
|
+
/** Which workspace root the package was discovered under. Defaults to `"packages"`. */
|
|
7
|
+
dir?: "packages" | "apps" | "plugins";
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region src/generators/codecov/codecov.d.ts
|
|
11
|
+
declare function codecovComponentBlock(packages: WorkspacePackage$1[]): string;
|
|
12
|
+
/**
|
|
13
|
+
* Ensure every codecov status default carries `if_not_found: success`, so an
|
|
14
|
+
* infra-only PR (dep bump, config, lockfile — no coverable change) passes
|
|
15
|
+
* instead of hanging forever on a required check codecov never posts.
|
|
16
|
+
*
|
|
17
|
+
* Injects the key on the line after each `target:` that sits inside a status
|
|
18
|
+
* block (`coverage.status.*.default` or a `statuses:` list item — indent ≥ 8,
|
|
19
|
+
* or ≥ 8 for a `- type:` list entry), when the immediate sibling lines do not
|
|
20
|
+
* already declare it.
|
|
21
|
+
*/
|
|
22
|
+
declare function ensureIfNotFound(yaml: string): string;
|
|
23
|
+
declare function mergeCodecovComponents(existing: string, packages: WorkspacePackage$1[]): string;
|
|
24
|
+
/**
|
|
25
|
+
* Every public `packages/*`, `apps/*`, and `plugins/*` workspace, sorted by
|
|
26
|
+
* slug. `[]` when none of the three directories exist. Monorepo templates
|
|
27
|
+
* (Next.js, React, …) ship user-facing code under `apps/` alongside library
|
|
28
|
+
* code under `packages/`; `holocron` itself splits vendor plugin packages
|
|
29
|
+
* into their own `plugins/*` root — every recognized root needs a codecov
|
|
30
|
+
* component so `codecov/patch/<slug>` actually posts for each.
|
|
31
|
+
*/
|
|
32
|
+
declare function readWorkspacePackages(repoRoot: string): WorkspacePackage$1[];
|
|
33
|
+
/** A brand-new `codecov.yml` — the scaffold header + the base template + this repo's component list. */
|
|
34
|
+
declare function createCodecovConfig(packages: WorkspacePackage$1[]): string;
|
|
3
35
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
36
|
+
* The full pipeline `holocron repo setup` needs: read this repo's public
|
|
37
|
+
* `packages/*`, then either merge them into an `existing` `codecov.yml` or
|
|
38
|
+
* scaffold a new one.
|
|
39
|
+
*/
|
|
40
|
+
declare function codecovConfig(repoRoot: string, existing: string | null): string;
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/generators/github-action-reusable-workflows/github-action-reusable-workflows.d.ts
|
|
43
|
+
/**
|
|
44
|
+
* The **reusable** GitHub Actions surface pushed to `theholocron/.github` by
|
|
45
|
+
* `holocron sync github` — the `workflow_call` implementations and composite
|
|
46
|
+
* actions that every repo's thin callers delegate to.
|
|
6
47
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* src/`
|
|
48
|
+
* `theholocron/.github` is a **pure sync target**: `.github/workflows/*`,
|
|
49
|
+
* `.github/actions/*` and `workflow-templates/*` there are generated from the
|
|
50
|
+
* `.yml` files in `src/templates/reusable/` and pushed verbatim (with a
|
|
51
|
+
* "do not edit" header). Never hand-edit them in `.github`.
|
|
10
52
|
*
|
|
11
|
-
*
|
|
53
|
+
* Not to be confused with `WORKFLOW_TEMPLATES` in `github-action-thin-callers.ts` — those are
|
|
54
|
+
* the *thin-caller bases* written into each consumer repo's `.github/workflows/`.
|
|
55
|
+
*/
|
|
56
|
+
/** `workflow_call` implementations → `.github/workflows/<name>.yml`. */
|
|
57
|
+
declare const REUSABLE_WORKFLOWS: Record<string, string>;
|
|
58
|
+
/** Composite actions → `.github/actions/<name>/action.yml` (key includes `/action`). */
|
|
59
|
+
declare const REUSABLE_ACTIONS: Record<string, string>;
|
|
60
|
+
/** GitHub starter-workflow metadata → `workflow-templates/<name>.properties.json`. */
|
|
61
|
+
declare const WORKFLOW_TEMPLATE_PROPERTIES: Record<string, string>;
|
|
62
|
+
/**
|
|
63
|
+
* The complete file batch `holocron sync github` pushes to `theholocron/.github`:
|
|
64
|
+
* path → content. YAML gets the "do not edit" header; the starter-workflow
|
|
65
|
+
* `.properties.json` files are left bare (native JSON, not a commented file).
|
|
66
|
+
*/
|
|
67
|
+
declare function reusableTemplates(): Map<string, string>;
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/generators/github-action-thin-callers/github-action-thin-callers.type.d.ts
|
|
70
|
+
interface PreviewConfig {
|
|
71
|
+
/** Cloudflare Pages project name shared across all repos for previews. */
|
|
72
|
+
project: string;
|
|
73
|
+
/**
|
|
74
|
+
* Base domain for preview URLs (e.g. `"preview.theholocron.dev"`).
|
|
75
|
+
* When set, `holocron repo setup` automatically provisions:
|
|
76
|
+
* - Cloudflare Pages custom domain `*.<domain>` on the project
|
|
77
|
+
* - DNS wildcard CNAME `*.<domain>` → `<project>.pages.dev`
|
|
78
|
+
*
|
|
79
|
+
* Preview URLs resolve as `<repo>-pr-<n>.<domain>`.
|
|
80
|
+
*/
|
|
81
|
+
domain?: string;
|
|
82
|
+
}
|
|
83
|
+
/** Org-level context used to derive preview defaults from `preview: true`. */
|
|
84
|
+
interface OrgContext {
|
|
85
|
+
/** GitHub org name — becomes the prefix of the default project: `<org>-preview`. */
|
|
86
|
+
org?: string;
|
|
87
|
+
/** Org canonical domain — becomes `preview.<domain>` for the default preview domain. */
|
|
88
|
+
domain?: string;
|
|
89
|
+
/** Project name — injected as the `name` input to the deploy reusable when `docs: true`. */
|
|
90
|
+
repoName?: string;
|
|
91
|
+
}
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region src/generators/github-action-thin-callers/github-action-thin-callers.d.ts
|
|
94
|
+
declare const WORKFLOW_TEMPLATES: Record<string, string>;
|
|
95
|
+
declare const KNOWN_WORKFLOWS: Set<string>;
|
|
96
|
+
/**
|
|
97
|
+
* The GitHub status-check context a `required` task contributes to branch
|
|
98
|
+
* protection. Format: `"{workflow name} / {job name}"`.
|
|
99
|
+
*
|
|
100
|
+
* Most of these are single-job workflows now (D3's decomposition split what
|
|
101
|
+
* used to be multi-job `lint`/`audit` into one task per concern) — the
|
|
102
|
+
* context names that job directly, no `Conclusion` aggregator needed; a
|
|
103
|
+
* single job's own conclusion already *is* the workflow's conclusion.
|
|
104
|
+
* `Conclusion` fan-in jobs are kept only where a task genuinely has several
|
|
105
|
+
* conditionally-run jobs feeding one required check:
|
|
106
|
+
* `verification.unitTests` (unit / Storybook / Chromatic / interaction /
|
|
107
|
+
* user-flow, each gated by its own `run-*` input) and
|
|
108
|
+
* `platform.repoValidation` (its three script jobs all must pass). Only
|
|
109
|
+
* merge-gating workflows are listed. `astromech.requiredChecks()` reads this
|
|
110
|
+
* for every `required` task.
|
|
111
|
+
*/
|
|
112
|
+
declare const WORKFLOW_CHECK_CONTEXTS: Partial<Record<string, string>>;
|
|
113
|
+
/**
|
|
114
|
+
* Generate the thin caller content for a workflow, optionally injecting or
|
|
115
|
+
* merging `with:` overrides into the jobs block.
|
|
116
|
+
*
|
|
117
|
+
* Two strategies are used depending on the template:
|
|
118
|
+
* - Templates that already have a `with:` block (e.g. lint):
|
|
119
|
+
* the override entries are merged in, replacing existing keys and appending
|
|
120
|
+
* new ones.
|
|
121
|
+
* - Templates that end with ` secrets: inherit`: a new `with:` block is
|
|
122
|
+
* injected immediately before `secrets: inherit`.
|
|
123
|
+
* If neither pattern matches the template, a warning is emitted and the
|
|
124
|
+
* base template is returned unchanged.
|
|
125
|
+
*/
|
|
126
|
+
declare function generateThinCallerContent(name: string, withOverrides?: Record<string, unknown>, additionalPaths?: string[],
|
|
127
|
+
/** Optional sink for the "could not inject `with:`" warning. */
|
|
128
|
+
logger?: {
|
|
129
|
+
warn(obj: Record<string, unknown>, msg: string): void;
|
|
130
|
+
},
|
|
131
|
+
/**
|
|
132
|
+
* `with:` key → a `# comment` line rendered immediately above that entry.
|
|
133
|
+
* Only honored when injecting a fresh `with:` block (no template today
|
|
134
|
+
* ships one), which is the path `lint` takes.
|
|
135
|
+
*/
|
|
136
|
+
comments?: Record<string, string>): string;
|
|
137
|
+
/**
|
|
138
|
+
* Extract the Cloudflare Pages preview config from a deploy workflow's `with:` object.
|
|
139
|
+
*
|
|
140
|
+
* Accepts three forms:
|
|
141
|
+
* - `preview: true` — derive both project and domain from org context
|
|
142
|
+
* - `preview: { project: "..." }` — explicit project; domain derived from context if omitted
|
|
143
|
+
* - `preview: { project: "...", domain: "..." }` — fully explicit
|
|
144
|
+
*
|
|
145
|
+
* Returns null when `preview:` is absent, false, or can't be resolved.
|
|
146
|
+
*/
|
|
147
|
+
declare function extractPreviewConfig(raw: Record<string, unknown>, ctx?: OrgContext): PreviewConfig | null;
|
|
148
|
+
/**
|
|
149
|
+
* Generate the full thin-caller YAML for a `deploy.yml` that handles both
|
|
150
|
+
* production (push to main → GitHub Pages) and preview (pull_request →
|
|
151
|
+
* Cloudflare Pages) in a single file.
|
|
12
152
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
153
|
+
* Both jobs receive the same docs/storybook `with:` inputs. If the per-repo
|
|
154
|
+
* config supplies `cloudflare-project` it is forwarded; otherwise the reusable
|
|
155
|
+
* falls back to the `CLOUDFLARE_PAGES_PROJECT` org variable — set that once and
|
|
156
|
+
* all repos with a `deploy` workflow get previews without per-repo config.
|
|
157
|
+
*/
|
|
158
|
+
declare function generateCombinedDeployContent(deployWith: Record<string, unknown>, paths: string[], preview: Pick<PreviewConfig, "project">): string;
|
|
159
|
+
/**
|
|
160
|
+
* Expand structured with-values to flat GitHub Actions inputs before
|
|
161
|
+
* generating the thin caller. Handles:
|
|
162
|
+
* - deploy shorthand: docs/storybook → type + storybook-projects
|
|
163
|
+
* - preview: stripped (handled separately via extractPreviewConfig)
|
|
164
|
+
* - chromatic-projects entries' untraced array → newline-joined string
|
|
165
|
+
* - plain arrays → JSON-stringified for YAML scalar quoting
|
|
23
166
|
*
|
|
24
|
-
*
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
|
|
167
|
+
* Used by both `holocron repo setup` and `sync-workflow-templates`.
|
|
168
|
+
*/
|
|
169
|
+
declare function normalizeWorkflowWith(raw: Record<string, unknown>): Record<string, unknown>;
|
|
170
|
+
/**
|
|
171
|
+
* Derive on.push.paths entries from the deploy with: shorthand.
|
|
172
|
+
* Used by both `holocron repo setup` and `sync-workflow-templates`.
|
|
173
|
+
*/
|
|
174
|
+
declare function deriveDeployPaths(raw: Record<string, unknown>): string[];
|
|
175
|
+
//#endregion
|
|
176
|
+
//#region src/generators/required-checks/required-checks.d.ts
|
|
177
|
+
/** Ordered (task contexts in {@link CI_ORDER}, then extras), de-duplicated. */
|
|
178
|
+
declare function requiredChecks(config: TasksConfig): string[];
|
|
179
|
+
//#endregion
|
|
180
|
+
//#region src/generators/tsconfig/tsconfig.type.d.ts
|
|
181
|
+
interface TsconfigOptions {
|
|
182
|
+
/** Human-readable name for the `display` field — the package's own name is the usual choice. */
|
|
183
|
+
display: string;
|
|
184
|
+
/**
|
|
185
|
+
* `@theholocron/tsconfig` variant. Defaults to `"node-lts"` — every
|
|
186
|
+
* checked package uses it; the other three (`astro`, `nextjs`, `react`)
|
|
187
|
+
* exist for a template repo's app-shaped packages, not the plain
|
|
188
|
+
* Node.js library packages this org's currently-migrated repos ship.
|
|
189
|
+
*/
|
|
190
|
+
variant?: "astro" | "nextjs" | "node-lts" | "react";
|
|
191
|
+
/**
|
|
192
|
+
* Add a `@/*` → `./src/*` path alias. A real per-package choice, not a
|
|
193
|
+
* default — roughly 40% of packages checked use one, the rest don't.
|
|
194
|
+
*/
|
|
195
|
+
paths?: boolean;
|
|
196
|
+
}
|
|
197
|
+
//#endregion
|
|
198
|
+
//#region src/generators/tsconfig/tsconfig.d.ts
|
|
199
|
+
/**
|
|
200
|
+
* A package-level `tsconfig.json` — the uniform shape confirmed across
|
|
201
|
+
* every package checked, parameterized only by the two fields that
|
|
202
|
+
* genuinely vary (`display`, `paths`). No scaffold/workflow header (matches
|
|
203
|
+
* `.alexrc.json`'s existing precedent for a strict-JSON Bucket B file —
|
|
204
|
+
* JSON has no comment syntax to carry one, and TypeScript's own tolerance
|
|
205
|
+
* for JSONC comments in `tsconfig.json` isn't worth relying on for a file
|
|
206
|
+
* this thin).
|
|
31
207
|
*/
|
|
208
|
+
declare function createTsconfig(options: TsconfigOptions): string;
|
|
209
|
+
//#endregion
|
|
210
|
+
//#region src/generators/turbo/turbo.type.d.ts
|
|
211
|
+
interface EnsureRootWorkspaceMemberResult {
|
|
212
|
+
content: string;
|
|
213
|
+
changed: boolean;
|
|
214
|
+
}
|
|
215
|
+
interface EnsureTurboDependencyResult {
|
|
216
|
+
content: string;
|
|
217
|
+
changed: boolean;
|
|
218
|
+
}
|
|
219
|
+
//#endregion
|
|
220
|
+
//#region src/tasks/run/run.type.d.ts
|
|
32
221
|
/** Minimal structural logger — `@theholocron/observability`'s `Logger` satisfies it. */
|
|
33
222
|
interface RunLogger {
|
|
34
223
|
debug(obj: Record<string, unknown>, msg?: string): void;
|
|
@@ -80,9 +269,11 @@ interface RunTaskReport {
|
|
|
80
269
|
command?: string;
|
|
81
270
|
message?: string;
|
|
82
271
|
}
|
|
272
|
+
//#endregion
|
|
273
|
+
//#region src/tasks/run/run.d.ts
|
|
83
274
|
declare function runTask(input: RunTaskInput): RunTaskReport;
|
|
84
275
|
//#endregion
|
|
85
|
-
//#region src/ci.d.ts
|
|
276
|
+
//#region src/tasks/ci/ci.type.d.ts
|
|
86
277
|
interface CiOptions {
|
|
87
278
|
/** Print the plan without running anything. */
|
|
88
279
|
dryRun?: boolean;
|
|
@@ -107,127 +298,187 @@ interface CiInput extends RunDeps, CiOptions {
|
|
|
107
298
|
cwd: string;
|
|
108
299
|
config: TasksConfig;
|
|
109
300
|
}
|
|
301
|
+
//#endregion
|
|
302
|
+
//#region src/tasks/ci/ci.d.ts
|
|
110
303
|
declare function runCi(input: CiInput): CiReport;
|
|
111
304
|
//#endregion
|
|
112
|
-
//#region src/
|
|
113
|
-
/**
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
* protection. Format: `"{workflow name} / {job name}"`.
|
|
125
|
-
*
|
|
126
|
-
* Most of these are single-job workflows now (D3's decomposition split what
|
|
127
|
-
* used to be multi-job `lint`/`audit` into one task per concern) — the
|
|
128
|
-
* context names that job directly, no `Conclusion` aggregator needed; a
|
|
129
|
-
* single job's own conclusion already *is* the workflow's conclusion.
|
|
130
|
-
* `Conclusion` fan-in jobs are kept only where a task genuinely has several
|
|
131
|
-
* conditionally-run jobs feeding one required check:
|
|
132
|
-
* `verification.unitTests` (unit / Storybook / Chromatic / interaction /
|
|
133
|
-
* user-flow, each gated by its own `run-*` input) and
|
|
134
|
-
* `platform.repoValidation` (its three script jobs all must pass). Only
|
|
135
|
-
* merge-gating workflows are listed. `astromech.requiredChecks()` reads this
|
|
136
|
-
* for every `required` task.
|
|
137
|
-
*/
|
|
138
|
-
declare const WORKFLOW_CHECK_CONTEXTS: Partial<Record<string, string>>;
|
|
139
|
-
/**
|
|
140
|
-
* Generate the thin caller content for a workflow, optionally injecting or
|
|
141
|
-
* merging `with:` overrides into the jobs block.
|
|
142
|
-
*
|
|
143
|
-
* Two strategies are used depending on the template:
|
|
144
|
-
* - Templates that already have a `with:` block (e.g. lint):
|
|
145
|
-
* the override entries are merged in, replacing existing keys and appending
|
|
146
|
-
* new ones.
|
|
147
|
-
* - Templates that end with ` secrets: inherit`: a new `with:` block is
|
|
148
|
-
* injected immediately before `secrets: inherit`.
|
|
149
|
-
* If neither pattern matches the template, a warning is emitted and the
|
|
150
|
-
* base template is returned unchanged.
|
|
151
|
-
*/
|
|
152
|
-
declare function generateThinCallerContent(name: string, withOverrides?: Record<string, unknown>, additionalPaths?: string[],
|
|
153
|
-
/** Optional sink for the "could not inject `with:`" warning. */
|
|
154
|
-
logger?: {
|
|
155
|
-
warn(obj: Record<string, unknown>, msg: string): void;
|
|
156
|
-
},
|
|
157
|
-
/**
|
|
158
|
-
* `with:` key → a `# comment` line rendered immediately above that entry.
|
|
159
|
-
* Only honored when injecting a fresh `with:` block (no template today
|
|
160
|
-
* ships one), which is the path `lint` takes.
|
|
161
|
-
*/
|
|
162
|
-
comments?: Record<string, string>): string;
|
|
163
|
-
interface PreviewConfig {
|
|
164
|
-
/** Cloudflare Pages project name shared across all repos for previews. */
|
|
165
|
-
project: string;
|
|
305
|
+
//#region src/utils/create-header/create-header.type.d.ts
|
|
306
|
+
/** Comment style produced by workflowHeader. */
|
|
307
|
+
type WorkflowHeaderFormat = "yaml" | "cjs" | "shebang";
|
|
308
|
+
interface CreateHeaderOptions {
|
|
309
|
+
/** Path within theholocron/holocron that owns the file being generated. */
|
|
310
|
+
source: string;
|
|
311
|
+
/** CLI command that produces the file. Defaults to "holocron repo setup". */
|
|
312
|
+
tool?: string;
|
|
313
|
+
/** Set true only when writing to theholocron/.github itself. */
|
|
314
|
+
forPrimary?: boolean;
|
|
315
|
+
}
|
|
316
|
+
interface HeaderFunctions {
|
|
166
317
|
/**
|
|
167
|
-
*
|
|
168
|
-
* When set, `holocron setup` automatically provisions:
|
|
169
|
-
* - Cloudflare Pages custom domain `*.<domain>` on the project
|
|
170
|
-
* - DNS wildcard CNAME `*.<domain>` → `<project>.pages.dev`
|
|
318
|
+
* "AUTO-GENERATED — do not edit" header for files managed on every run.
|
|
171
319
|
*
|
|
172
|
-
*
|
|
320
|
+
* format:
|
|
321
|
+
* "yaml" — `# …` comment lines (YAML, text, ignore files)
|
|
322
|
+
* "cjs" — `/* … *\/` block comment (CommonJS modules)
|
|
323
|
+
* "shebang" — `#!/bin/sh` on line 1, then yaml header (shell scripts)
|
|
173
324
|
*/
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
/** Org canonical domain — becomes `preview.<domain>` for the default preview domain. */
|
|
181
|
-
domain?: string;
|
|
182
|
-
/** Project name — injected as the `name` input to the deploy reusable when `docs: true`. */
|
|
183
|
-
repoName?: string;
|
|
325
|
+
workflowHeader(format?: WorkflowHeaderFormat): string;
|
|
326
|
+
/**
|
|
327
|
+
* "Scaffolded — edit this file freely" header for one-time generated files
|
|
328
|
+
* that the user is expected to take over (e.g. codecov.yml).
|
|
329
|
+
*/
|
|
330
|
+
scaffoldHeader(): string;
|
|
184
331
|
}
|
|
332
|
+
//#endregion
|
|
333
|
+
//#region src/utils/create-header/create-header.d.ts
|
|
185
334
|
/**
|
|
186
|
-
*
|
|
335
|
+
* Factory that binds `source` and `tool` once and returns all header
|
|
336
|
+
* constructors for auto-generated files. Prefer this over passing source
|
|
337
|
+
* as a positional argument at every call site.
|
|
187
338
|
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
339
|
+
* @example
|
|
340
|
+
* const { workflowHeader, scaffoldHeader } = createHeader({
|
|
341
|
+
* source: "packages/astromech/src/templates/configs/editorconfig/create-config.ts",
|
|
342
|
+
* });
|
|
192
343
|
*
|
|
193
|
-
*
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* Generate the full thin-caller YAML for a `deploy.yml` that handles both
|
|
198
|
-
* production (push to main → GitHub Pages) and preview (pull_request →
|
|
199
|
-
* Cloudflare Pages) in a single file.
|
|
344
|
+
* export function createConfig(): string {
|
|
345
|
+
* return `${workflowHeader()}${body}`;
|
|
346
|
+
* }
|
|
200
347
|
*
|
|
201
|
-
*
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
348
|
+
* ## Which header to use
|
|
349
|
+
*
|
|
350
|
+
* | Function | When to use | User can edit? |
|
|
351
|
+
* |-------------------|----------------------------------------------------|----------------|
|
|
352
|
+
* | `workflowHeader` | Files overwritten on every setup / sync-github run | No — "AUTO-GENERATED — do not edit" |
|
|
353
|
+
* | `scaffoldHeader` | Files written once; user takes ownership after | Yes — "Scaffolded — edit this file freely" |
|
|
354
|
+
*
|
|
355
|
+
* ## `workflowHeader` formats
|
|
356
|
+
*
|
|
357
|
+
* | Format | Comment style | Used for |
|
|
358
|
+
* |---------------------|------------------------|-------------------------------------------------------|
|
|
359
|
+
* | `"yaml"` (default) | `# …` lines | YAML workflows, ignore files, `.editorconfig`, labeler|
|
|
360
|
+
* | `"cjs"` | `/* … *\/` block | CommonJS config files (`.cjs`) |
|
|
361
|
+
* | `"shebang"` | `#!/bin/sh` + `# …` | Shell scripts (`prepare-commit-msg`, hooks) |
|
|
205
362
|
*/
|
|
206
|
-
declare function
|
|
363
|
+
declare function createHeader(options: CreateHeaderOptions): HeaderFunctions;
|
|
364
|
+
//#endregion
|
|
365
|
+
//#region src/utils/default-list-dirs/default-list-dirs.d.ts
|
|
366
|
+
declare const defaultListDirs: (path: string) => string[];
|
|
367
|
+
//#endregion
|
|
368
|
+
//#region src/utils/default-read-json/default-read-json.d.ts
|
|
369
|
+
declare const defaultReadJson: (path: string) => unknown;
|
|
370
|
+
//#endregion
|
|
371
|
+
//#region src/utils/default-run/default-run.type.d.ts
|
|
372
|
+
interface SpawnResult {
|
|
373
|
+
status: number | null;
|
|
374
|
+
stdout: string;
|
|
375
|
+
stderr: string;
|
|
376
|
+
}
|
|
377
|
+
type Run = (command: string, args: string[], options: Record<string, unknown>) => SpawnResult;
|
|
378
|
+
//#endregion
|
|
379
|
+
//#region src/tasks/deploy-on-release/workspace-packages/workspace-packages.type.d.ts
|
|
380
|
+
/** A workspace package: absolute folder, and what its `package.json` says. */
|
|
381
|
+
interface WorkspacePackage {
|
|
382
|
+
name: string;
|
|
383
|
+
dir: string;
|
|
384
|
+
version: string | undefined;
|
|
385
|
+
dependencies: Record<string, string>;
|
|
386
|
+
/**
|
|
387
|
+
* A workspace:* devDependency can optionally count too (holocron#1071,
|
|
388
|
+
* workspaceDependencies' includeDevDependencies option). Optional so a
|
|
389
|
+
* caller holding the previous, dev-dependency-less shape (a plain
|
|
390
|
+
* object literal, or a value from outside this package's own version)
|
|
391
|
+
* keeps compiling and working -- a missing value is treated the same
|
|
392
|
+
* as `{}`.
|
|
393
|
+
*/
|
|
394
|
+
devDependencies?: Record<string, string>;
|
|
395
|
+
}
|
|
396
|
+
interface Tree {
|
|
397
|
+
readJson: (path: string) => unknown;
|
|
398
|
+
listDirs: (path: string) => string[];
|
|
399
|
+
}
|
|
400
|
+
//#endregion
|
|
401
|
+
//#region src/tasks/deploy-on-release/workspace-packages/workspace-packages.d.ts
|
|
207
402
|
/**
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
* - run-chromatic object → run-chromatic: true + chromatic-projects
|
|
213
|
-
* - plain arrays → JSON-stringified for YAML scalar quoting
|
|
214
|
-
*
|
|
215
|
-
* Used by both `holocron setup` and `sync-workflow-templates`.
|
|
403
|
+
* Every package under `<repoRoot>/packages/*`, `<repoRoot>/apps/*` and
|
|
404
|
+
* `<repoRoot>/plugins/*` with a readable, named `package.json` — `holocron`'s
|
|
405
|
+
* own layout splits vendor plugin packages into `plugins/*` and deployable
|
|
406
|
+
* apps into `apps/*`, siblings to `packages/*`.
|
|
216
407
|
*/
|
|
217
|
-
declare function
|
|
408
|
+
declare function workspacePackages(repoRoot: string, { readJson, listDirs }: Tree): WorkspacePackage[];
|
|
409
|
+
//#endregion
|
|
410
|
+
//#region src/tasks/deploy-on-release/deploy-on-release.type.d.ts
|
|
411
|
+
interface DeployOnReleaseOptions {
|
|
412
|
+
cwd: string;
|
|
413
|
+
/** The release's channel: its prerelease identifier (`alpha`); empty or `main` for a stable release. */
|
|
414
|
+
channel: string;
|
|
415
|
+
/** The previous release's commit; omitted when there is none, so every deploying channel match deploys. */
|
|
416
|
+
from?: string;
|
|
417
|
+
/** The release commit. Default `HEAD`. */
|
|
418
|
+
to?: string;
|
|
419
|
+
/** Where progress lines go (stdout in the CLI). */
|
|
420
|
+
print: (line: string) => void;
|
|
421
|
+
dryRun?: boolean;
|
|
422
|
+
}
|
|
423
|
+
interface DeployOnReleaseDeps extends Partial<Tree> {
|
|
424
|
+
run?: Run;
|
|
425
|
+
sleep?: (ms: number) => Promise<void>;
|
|
426
|
+
now?: () => number;
|
|
427
|
+
/** Reads a package folder's task manifest; `loadTasksConfig` by default. */
|
|
428
|
+
loadTasks?: (dir: string) => Promise<TasksConfig>;
|
|
429
|
+
}
|
|
430
|
+
interface DeployOnReleaseResult {
|
|
431
|
+
pkg: string;
|
|
432
|
+
status: "ok" | "fail" | "skip" | "dry-run";
|
|
433
|
+
message: string;
|
|
434
|
+
}
|
|
435
|
+
interface DeployOnReleaseReport {
|
|
436
|
+
/** `fail` if any package's deploy failed; `skip` if none applied to this release; else `ok`. */
|
|
437
|
+
status: "ok" | "fail" | "skip";
|
|
438
|
+
results: DeployOnReleaseResult[];
|
|
439
|
+
}
|
|
440
|
+
//#endregion
|
|
441
|
+
//#region src/tasks/deploy-on-release/deploy-on-release.d.ts
|
|
218
442
|
/**
|
|
219
|
-
*
|
|
220
|
-
*
|
|
443
|
+
* Deploys every package whose manifest declares a release-time deploy that
|
|
444
|
+
* applies to this release. Never throws for a deploy problem: each package's
|
|
445
|
+
* outcome is in the report, and `status: "fail"` is the caller's exit code.
|
|
221
446
|
*/
|
|
222
|
-
declare function
|
|
447
|
+
declare function deployOnRelease(options: DeployOnReleaseOptions, { run, readJson, listDirs, sleep, now, loadTasks }?: DeployOnReleaseDeps): Promise<DeployOnReleaseReport>;
|
|
223
448
|
//#endregion
|
|
224
|
-
//#region src/
|
|
225
|
-
interface
|
|
226
|
-
|
|
227
|
-
|
|
449
|
+
//#region src/tasks/group/group.type.d.ts
|
|
450
|
+
interface GroupOptions {
|
|
451
|
+
/** Print the resolved commands without running anything. */
|
|
452
|
+
dryRun?: boolean;
|
|
453
|
+
/** `turbo --filter=<pkg>` passthrough (monorepo). */
|
|
454
|
+
filter?: string;
|
|
455
|
+
}
|
|
456
|
+
interface GroupJobReport {
|
|
457
|
+
task: string;
|
|
458
|
+
status: "ok" | "fail" | "skip" | "dry-run";
|
|
459
|
+
command?: string;
|
|
460
|
+
message?: string;
|
|
461
|
+
}
|
|
462
|
+
interface GroupReport {
|
|
463
|
+
/** `"unknown"` when the namespace matches zero configured tasks. */
|
|
464
|
+
status: "ok" | "fail" | "dry-run" | "unknown";
|
|
465
|
+
jobs: GroupJobReport[];
|
|
466
|
+
}
|
|
467
|
+
interface GroupInput extends RunDeps, GroupOptions {
|
|
468
|
+
cwd: string;
|
|
469
|
+
config: TasksConfig;
|
|
470
|
+
/** The bare namespace, e.g. `"sourceQuality"` — matched against `"sourceQuality."`-prefixed task names. */
|
|
471
|
+
namespace: string;
|
|
228
472
|
}
|
|
229
473
|
//#endregion
|
|
230
|
-
//#region src/
|
|
474
|
+
//#region src/tasks/group/group.d.ts
|
|
475
|
+
declare function runGroup(input: GroupInput): GroupReport;
|
|
476
|
+
//#endregion
|
|
477
|
+
//#region src/tasks/match-namespace/match-namespace.d.ts
|
|
478
|
+
/** Every configured task whose name starts with `"<namespace>."`, in manifest declaration order. */
|
|
479
|
+
declare function matchNamespace(config: TasksConfig, namespace: string): string[];
|
|
480
|
+
//#endregion
|
|
481
|
+
//#region src/astromech.type.d.ts
|
|
231
482
|
interface AstromechOptions {
|
|
232
483
|
/** Repo root. */
|
|
233
484
|
cwd: string;
|
|
@@ -272,8 +523,15 @@ interface RunOptions {
|
|
|
272
523
|
filter?: string;
|
|
273
524
|
}
|
|
274
525
|
interface Astromech {
|
|
275
|
-
/**
|
|
276
|
-
|
|
526
|
+
/**
|
|
527
|
+
* Run one task — or one of its sub-jobs (`opts.job`) — locally. When
|
|
528
|
+
* `task` isn't an exact registry task but matches the prefix of one or
|
|
529
|
+
* more configured tasks (`"sourceQuality"` against `sourceQuality.*`),
|
|
530
|
+
* runs every matching task in sequence instead ({@link GroupReport}) —
|
|
531
|
+
* `opts.job` is ignored for a namespace match, since a job belongs to
|
|
532
|
+
* one task, not a namespace.
|
|
533
|
+
*/
|
|
534
|
+
run(task: string, opts?: RunOptions): RunTaskReport | GroupReport;
|
|
277
535
|
/**
|
|
278
536
|
* Run the merge-gating checks locally, in CI order — "will CI pass?".
|
|
279
537
|
* Default scope: `required: true` tasks (falls back to every `ci: true`
|
|
@@ -288,7 +546,7 @@ interface Astromech {
|
|
|
288
546
|
*/
|
|
289
547
|
thinCallers(): Map<string, string>;
|
|
290
548
|
/**
|
|
291
|
-
* The complete reusable-workflow batch `holocron sync
|
|
549
|
+
* The complete reusable-workflow batch `holocron sync github` pushes to
|
|
292
550
|
* `theholocron/.github` — repo-relative path → content, "do not edit" header
|
|
293
551
|
* already applied to the YAML. Config-independent (the same for every repo).
|
|
294
552
|
*/
|
|
@@ -301,10 +559,19 @@ interface Astromech {
|
|
|
301
559
|
* when there is no config or `syncScripts: false`.
|
|
302
560
|
*/
|
|
303
561
|
packageScripts(): Record<string, string>;
|
|
562
|
+
/**
|
|
563
|
+
* Task names this repo's manifest can actually run locally — the same
|
|
564
|
+
* filter {@link packageScripts} applies (skips `local: false` and tasks
|
|
565
|
+
* with no local runner at all), but independent of `syncScripts`: a repo
|
|
566
|
+
* that opts out of generated `package.json` scripts still has real
|
|
567
|
+
* runnable tasks. Empty when there is no config. Backs `holocron`'s own
|
|
568
|
+
* interactive task picker (`run` with no task given).
|
|
569
|
+
*/
|
|
570
|
+
runnableTasks(): string[];
|
|
304
571
|
/**
|
|
305
572
|
* The branch-protection required-status-check contexts for this repo —
|
|
306
573
|
* every `required: true` task's check context plus `extraRequiredChecks`,
|
|
307
|
-
* ordered and de-duplicated. `holocron setup` prepends `"DCO"` and applies
|
|
574
|
+
* ordered and de-duplicated. `holocron repo setup` prepends `"DCO"` and applies
|
|
308
575
|
* the list; this method is policy-free (manifest only).
|
|
309
576
|
*/
|
|
310
577
|
requiredChecks(): string[];
|
|
@@ -312,7 +579,7 @@ interface Astromech {
|
|
|
312
579
|
* This repo's `codecov.yml` — component `paths` derived from `packages/*`.
|
|
313
580
|
* Pass the current file's content (`null` if none exists yet) to either
|
|
314
581
|
* merge the component list in or scaffold a fresh file. Policy-free same
|
|
315
|
-
* as {@link requiredChecks} — `holocron setup` owns writing the result.
|
|
582
|
+
* as {@link requiredChecks} — `holocron repo setup` owns writing the result.
|
|
316
583
|
*/
|
|
317
584
|
codecovConfig(existing: string | null): string;
|
|
318
585
|
/**
|
|
@@ -328,151 +595,30 @@ interface Astromech {
|
|
|
328
595
|
* (not just an orchestrator) silently vanishes from `turbo run <task>`.
|
|
329
596
|
* Pass `pnpm-workspace.yaml`'s current content (or `""` if none exists —
|
|
330
597
|
* a no-op either way, since no `packages:` key means single-package mode
|
|
331
|
-
* already) and root `package.json`'s own `scripts`
|
|
332
|
-
*
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
//#endregion
|
|
338
|
-
//#region src/codecov.d.ts
|
|
339
|
-
/**
|
|
340
|
-
* `codecov.yml` generation — a manifest-derived artifact (component `paths`
|
|
341
|
-
* come from workspace packages; the status targets track the `test` task's
|
|
342
|
-
* coverage setup), the same category as the reusable `test.yml` this package
|
|
343
|
-
* also generates. Moved out of `@theholocron/cli` (theholocron/holocron#650)
|
|
344
|
-
* — `holocron setup`'s codecov step now calls {@link codecovConfig} instead
|
|
345
|
-
* of importing this logic directly.
|
|
346
|
-
*/
|
|
347
|
-
interface WorkspacePackage {
|
|
348
|
-
slug: string;
|
|
349
|
-
name: string;
|
|
350
|
-
/** Which workspace root the package was discovered under. Defaults to `"packages"`. */
|
|
351
|
-
dir?: "packages" | "apps";
|
|
352
|
-
}
|
|
353
|
-
declare function codecovComponentBlock(packages: WorkspacePackage[]): string;
|
|
354
|
-
/**
|
|
355
|
-
* Ensure every codecov status default carries `if_not_found: success`, so an
|
|
356
|
-
* infra-only PR (dep bump, config, lockfile — no coverable change) passes
|
|
357
|
-
* instead of hanging forever on a required check codecov never posts.
|
|
358
|
-
*
|
|
359
|
-
* Injects the key on the line after each `target:` that sits inside a status
|
|
360
|
-
* block (`coverage.status.*.default` or a `statuses:` list item — indent ≥ 8,
|
|
361
|
-
* or ≥ 8 for a `- type:` list entry), when the immediate sibling lines do not
|
|
362
|
-
* already declare it.
|
|
363
|
-
*/
|
|
364
|
-
declare function ensureIfNotFound(yaml: string): string;
|
|
365
|
-
declare function mergeCodecovComponents(existing: string, packages: WorkspacePackage[]): string;
|
|
366
|
-
/**
|
|
367
|
-
* Every public `packages/*` and `apps/*` workspace, sorted by slug. `[]`
|
|
368
|
-
* when neither directory exists. Monorepo templates (Next.js, React, …)
|
|
369
|
-
* ship user-facing code under `apps/` alongside library code under
|
|
370
|
-
* `packages/` — both need a codecov component so `codecov/patch/<slug>`
|
|
371
|
-
* actually posts for each.
|
|
372
|
-
*/
|
|
373
|
-
declare function readWorkspacePackages(repoRoot: string): WorkspacePackage[];
|
|
374
|
-
/** A brand-new `codecov.yml` — the scaffold header + the base template + this repo's component list. */
|
|
375
|
-
declare function createCodecovConfig(packages: WorkspacePackage[]): string;
|
|
376
|
-
/**
|
|
377
|
-
* The full pipeline `holocron setup` needs: read this repo's public
|
|
378
|
-
* `packages/*`, then either merge them into an `existing` `codecov.yml` or
|
|
379
|
-
* scaffold a new one.
|
|
380
|
-
*/
|
|
381
|
-
declare function codecovConfig(repoRoot: string, existing: string | null): string;
|
|
382
|
-
//#endregion
|
|
383
|
-
//#region src/linters.d.ts
|
|
384
|
-
/**
|
|
385
|
-
* The linter registry — one list of linter names (from `config.tasks`'
|
|
386
|
-
* `{ name: "lint", linters: [...] }`, or auto-detected) maps to both the
|
|
387
|
-
* CI super-linter `VALIDATE_*` env and the native local run. This table is
|
|
388
|
-
* the single source of truth for that mapping; {@link superLinterConfig}
|
|
389
|
-
* (CI) and the `holocron run lint` aggregate (local) both read it.
|
|
390
|
-
*
|
|
391
|
-
* Spec: `docs/wiki/specifications/tech-astromech-task-runner.spec.md` "Lint parity".
|
|
392
|
-
*/
|
|
393
|
-
interface LinterDef {
|
|
394
|
-
/**
|
|
395
|
-
* super-linter `VALIDATE_*` keys this linter turns on. Setting any
|
|
396
|
-
* `VALIDATE_*` puts super-linter in allow-list mode, so emitting only the
|
|
397
|
-
* enabled keys makes it run exactly this set.
|
|
398
|
-
*/
|
|
399
|
-
validate: string[];
|
|
400
|
-
/** super-linter `FIX_*` keys (auto-commit / `--write` parity). */
|
|
401
|
-
fix?: string[];
|
|
402
|
-
/**
|
|
403
|
-
* Local binary, resolved from `node_modules/.bin` then `PATH`. Absent →
|
|
404
|
-
* the linter has no meaningful local run (`holocron run lint` prints
|
|
405
|
-
* "CI only"); CI still enforces it.
|
|
406
|
-
*/
|
|
407
|
-
localBin?: string;
|
|
408
|
-
/** Args for `localBin` in CHECK mode — never `--write` / `--fix`. */
|
|
409
|
-
localArgs?: string[];
|
|
410
|
-
/**
|
|
411
|
-
* Shown by `holocron run lint` when `localBin` is set but not found on
|
|
412
|
-
* PATH — the "you're missing a tool the repo needs" nudge.
|
|
598
|
+
* already) and root `package.json`'s own `scripts` object — values and
|
|
599
|
+
* all, not just keys, so a task-name-matching script that's already the
|
|
600
|
+
* generated `holocron run <task> --` wrapper (predating this call, not
|
|
601
|
+
* written by it) is correctly excluded rather than treated as proof root
|
|
602
|
+
* is directly buildable (#846). `changed: false` means don't write
|
|
603
|
+
* anything — the file is already correct.
|
|
413
604
|
*/
|
|
414
|
-
|
|
605
|
+
ensureRootWorkspaceMember(workspaceYaml: string, rootScripts: Readonly<Record<string, string>>): EnsureRootWorkspaceMemberResult;
|
|
415
606
|
/**
|
|
416
|
-
*
|
|
417
|
-
*
|
|
607
|
+
* `turboConfig()` writes a `turbo.json` but never touches `package.json`
|
|
608
|
+
* — a repo with no local `turbo` devDependency falls back to whatever
|
|
609
|
+
* (if anything) is globally on `PATH`, per `run.ts`'s `resolveBin()`.
|
|
610
|
+
* Pass root `package.json`'s raw content and `pnpm-workspace.yaml`'s
|
|
611
|
+
* current content (checked for an existing `turbo` catalog entry, which
|
|
612
|
+
* takes precedence over the hardcoded fallback version). `changed: false`
|
|
613
|
+
* means don't write anything — `devDependencies.turbo` already exists.
|
|
418
614
|
*/
|
|
419
|
-
|
|
420
|
-
/** Enabled regardless of detection (the org baseline). */
|
|
421
|
-
always?: boolean;
|
|
422
|
-
/** Reusable-workflow config-file input this linter honors, if any. */
|
|
423
|
-
configInput?: "eslint-config" | "prettier-config" | "yaml-config";
|
|
615
|
+
ensureTurboDependency(packageJson: string, workspaceYaml: string): EnsureTurboDependencyResult;
|
|
424
616
|
}
|
|
425
|
-
/**
|
|
426
|
-
* Known linters, in execution order. `always` entries are the current
|
|
427
|
-
* hard-coded super-linter baseline; `prettier` is always-on because the org
|
|
428
|
-
* applies it universally (super-linter only lints files that exist).
|
|
429
|
-
*/
|
|
430
|
-
declare const LINTERS: Record<string, LinterDef>;
|
|
431
|
-
/** Every linter name the registry knows. */
|
|
432
|
-
declare const LINTER_NAMES: ReadonlySet<string>;
|
|
433
|
-
/**
|
|
434
|
-
* Resolve the linter set for a repo. An `explicit` list (from `config.tasks`)
|
|
435
|
-
* picks the candidate set; otherwise the candidates are every `always` linter
|
|
436
|
-
* plus every `detect`-gated linter whose filenames are present at the repo
|
|
437
|
-
* root. Either way, a `detect`-gated linter (eslint, markdownlint) only makes
|
|
438
|
-
* the final set when its config file is actually present — a repo can't run
|
|
439
|
-
* eslint without an `eslint.config.*`, and super-linter FATALs if you ask it
|
|
440
|
-
* to (theholocron/holocron#654). `always` linters are unconditional. Result
|
|
441
|
-
* is ordered by {@link LINTERS} declaration order.
|
|
442
|
-
*
|
|
443
|
-
* @throws when an `explicit` name is not in the registry — a typo is a
|
|
444
|
-
* config bug, not a linter to silently skip.
|
|
445
|
-
*/
|
|
446
|
-
declare function resolveLinters(opts: {
|
|
447
|
-
explicit?: string[];
|
|
448
|
-
rootFiles: string[];
|
|
449
|
-
}): Array<{
|
|
450
|
-
name: string;
|
|
451
|
-
def: LinterDef;
|
|
452
|
-
}>;
|
|
453
617
|
//#endregion
|
|
454
|
-
//#region src/
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
* adding a task here gives every repo that task.
|
|
459
|
-
*
|
|
460
|
-
* Keyed identically to the workflow templates — a task IS a workflow. This
|
|
461
|
-
* is the canonical vocabulary table (epic #672, D11): every other artifact
|
|
462
|
-
* (`KNOWN_TASKS`, `thin-callers.ts`'s `KNOWN_WORKFLOWS`/`WORKFLOW_CHECK_CONTEXTS`,
|
|
463
|
-
* `CI_ORDER`) derives from these keys rather than hand-duplicating them —
|
|
464
|
-
* including the future GitHub App (#679), which imports this same table for
|
|
465
|
-
* config-schema validation instead of reimplementing its own copy.
|
|
466
|
-
*
|
|
467
|
-
* Task names are an intent-facing vocabulary (`verification.*`,
|
|
468
|
-
* `sourceQuality.*`, `security.*`, `delivery.*`, `platform.*`,
|
|
469
|
-
* `knowledge.*`), not tool names — `eslint`/`vitest`/`tsdown`/… stay
|
|
470
|
-
* internal to this file and `theholocron/configs`. See
|
|
471
|
-
* `.notes/tech-vocabulary-rename.spec.md` (#675) for the full mapping and
|
|
472
|
-
* the reasoning behind each namespace and decomposition.
|
|
473
|
-
*
|
|
474
|
-
* Spec: `docs/wiki/specifications/tech-astromech-task-runner.spec.md` (epic #581).
|
|
475
|
-
*/
|
|
618
|
+
//#region src/astromech.d.ts
|
|
619
|
+
declare function createAstromech(options: AstromechOptions): Astromech;
|
|
620
|
+
//#endregion
|
|
621
|
+
//#region src/registry/registry.type.d.ts
|
|
476
622
|
/** How to run one task (or job) locally. */
|
|
477
623
|
interface LocalRunner {
|
|
478
624
|
/** Binary to invoke — resolved from `node_modules/.bin` then PATH. */
|
|
@@ -511,7 +657,7 @@ interface JobDef {
|
|
|
511
657
|
/**
|
|
512
658
|
* The CI status-check context this job reports as (e.g.
|
|
513
659
|
* `platform.repoValidation / Validate registry consistency`) — every sub-job is a CI job.
|
|
514
|
-
* `holocron run <task>` and `holocron ci` label each job line with it;
|
|
660
|
+
* `holocron run <task>` and `holocron run ci` label each job line with it;
|
|
515
661
|
* the task-level `… / Conclusion` context (only for tasks with several
|
|
516
662
|
* jobs) lives in `WORKFLOW_CHECK_CONTEXTS`.
|
|
517
663
|
*/
|
|
@@ -522,7 +668,7 @@ interface TaskDef {
|
|
|
522
668
|
* `null` — the registry has no built-in runner (CodeQL, deploys, the
|
|
523
669
|
* bundle-size job). An explicit turbo task or `package.json` script still
|
|
524
670
|
* runs (resolution steps 1–2); with neither, `holocron run` does nothing
|
|
525
|
-
* and `holocron ci` skips it — never a failure, even when the task is
|
|
671
|
+
* and `holocron run ci` skips it — never a failure, even when the task is
|
|
526
672
|
* `required` (a CI-only check isn't a local one).
|
|
527
673
|
*/
|
|
528
674
|
local: LocalRunner | null;
|
|
@@ -548,155 +694,124 @@ interface TaskDef {
|
|
|
548
694
|
/** Turborepo fan-out config for this task — see {@link TurboTaskConfig}. Omitted for whole-repo, non-fan-out tasks. */
|
|
549
695
|
turbo?: TurboTaskConfig;
|
|
550
696
|
}
|
|
697
|
+
//#endregion
|
|
698
|
+
//#region src/registry/registry.d.ts
|
|
699
|
+
/**
|
|
700
|
+
* The task registry — how each task runs *locally*, without GitHub
|
|
701
|
+
* Actions. `holocron run <task>` and `holocron run ci` resolve against this;
|
|
702
|
+
* adding a task here gives every repo that task.
|
|
703
|
+
*
|
|
704
|
+
* Keyed identically to the workflow templates — a task IS a workflow. This
|
|
705
|
+
* is the canonical vocabulary table (epic #672, D11): every other artifact
|
|
706
|
+
* (`KNOWN_TASKS`, `thin-callers.ts`'s `KNOWN_WORKFLOWS`/`WORKFLOW_CHECK_CONTEXTS`,
|
|
707
|
+
* `CI_ORDER`) derives from these keys rather than hand-duplicating them —
|
|
708
|
+
* including the future GitHub App (#679), which imports this same table for
|
|
709
|
+
* config-schema validation instead of reimplementing its own copy.
|
|
710
|
+
*
|
|
711
|
+
* Task names are an intent-facing vocabulary (`verification.*`,
|
|
712
|
+
* `sourceQuality.*`, `security.*`, `delivery.*`, `platform.*`,
|
|
713
|
+
* `knowledge.*`), not tool names — `eslint`/`vitest`/`tsdown`/… stay
|
|
714
|
+
* internal to this file and `theholocron/configs`. See
|
|
715
|
+
* `docs/wiki/specifications/tech-vocabulary-rename.spec.md` (#675) for the full mapping and
|
|
716
|
+
* the reasoning behind each namespace and decomposition.
|
|
717
|
+
*
|
|
718
|
+
* Spec: `docs/wiki/specifications/tech-astromech-task-runner.spec.md` (epic #581).
|
|
719
|
+
*/
|
|
551
720
|
declare const TASKS: Record<string, TaskDef>;
|
|
552
721
|
/** Every task name the registry knows. */
|
|
553
722
|
declare const KNOWN_TASKS: Set<string>;
|
|
554
723
|
/**
|
|
555
|
-
* The order `holocron ci` runs tasks in — cheapest / fastest signal first, so
|
|
724
|
+
* The order `holocron run ci` runs tasks in — cheapest / fastest signal first, so
|
|
556
725
|
* an agent or a `pre-push` hook fails early. Tasks not listed here run last, in
|
|
557
726
|
* manifest order. (The generated thin callers carry no `needs:` — cross-workflow
|
|
558
|
-
* ordering lives in `theholocron/.github` — so `holocron ci` declares its own.)
|
|
727
|
+
* ordering lives in `theholocron/.github` — so `holocron run ci` declares its own.)
|
|
559
728
|
*/
|
|
560
729
|
declare const CI_ORDER: string[];
|
|
561
730
|
//#endregion
|
|
562
|
-
//#region src/
|
|
563
|
-
/** Ordered (task contexts in {@link CI_ORDER}, then extras), de-duplicated. */
|
|
564
|
-
declare function requiredChecks(config: TasksConfig): string[];
|
|
565
|
-
//#endregion
|
|
566
|
-
//#region src/resolver.d.ts
|
|
731
|
+
//#region src/tasks/deploy-on-release/default-paths/default-paths.d.ts
|
|
567
732
|
/**
|
|
568
|
-
*
|
|
569
|
-
*
|
|
570
|
-
*
|
|
571
|
-
*
|
|
572
|
-
* entry, right after the tool's own args.
|
|
573
|
-
*
|
|
574
|
-
* Every mapped package's resolved entry point already carries a ready-to-use
|
|
575
|
-
* default export (a plain re-export for `prettier`/`commitlint`; an invoked,
|
|
576
|
-
* zero-arg preset for `eslint`/`vitest`/`tsdown` — verified end-to-end against
|
|
577
|
-
* each tool's real `--config`/`--extends` loader, not just the file's shape).
|
|
578
|
-
* A repo doesn't need this package installed at all — every lookup degrades to
|
|
579
|
-
* `[]` (no flag added, the tool falls back to its own auto-discovery of a
|
|
580
|
-
* local file, unchanged from today) rather than throwing, so this is additive
|
|
581
|
-
* and safe to run unconditionally.
|
|
733
|
+
* The paths a release must touch to redeploy `pkg` when its manifest doesn't
|
|
734
|
+
* list them: its own folder plus the folder of every
|
|
735
|
+
* {@link workspaceDependencies} entry. Derived rather than listed so a new or
|
|
736
|
+
* dropped workspace dependency needs no second edit.
|
|
582
737
|
*
|
|
583
|
-
*
|
|
584
|
-
* deliberately absent — `semantic-release-config`'s `defineConfig()` needs
|
|
585
|
-
* real per-repo data (branches, npm options) a static `--extends <path>` can't
|
|
586
|
-
* carry; `devmoji` runs through a git hook template, not `holocron run
|
|
587
|
-
* <task>`; `editorconfig-checker` has no shared-config package yet; `knip` is
|
|
588
|
-
* repo-specific by nature, never a shared-config candidate. See
|
|
589
|
-
* `.notes/tech-config-resolution.spec.md` (#676).
|
|
738
|
+
* @returns Repo-relative prefixes, each ending in `/`.
|
|
590
739
|
*/
|
|
591
|
-
|
|
592
|
-
readFile: (path: string) => string;
|
|
593
|
-
fileExists: (path: string) => boolean;
|
|
594
|
-
}
|
|
595
|
-
/** Every tool name the resolver knows how to point at a shared config. */
|
|
596
|
-
declare const RESOLVABLE_TOOLS: ReadonlySet<string>;
|
|
597
|
-
/**
|
|
598
|
-
* `<flag> <absolute path>` for `tool`, resolved against `cwd`'s
|
|
599
|
-
* `node_modules` — or `[]` when the tool isn't mapped, the package isn't
|
|
600
|
-
* installed, its `package.json` doesn't declare the export subpath this
|
|
601
|
-
* needs, or the resolved file doesn't actually exist on disk (a stale
|
|
602
|
-
* install, or a package version that predates the export existing).
|
|
603
|
-
*/
|
|
604
|
-
declare function resolveToolConfig(tool: string, cwd: string, deps: ResolverDeps): string[];
|
|
740
|
+
declare function defaultPaths(repoRoot: string, pkg: WorkspacePackage, all: WorkspacePackage[]): string[];
|
|
605
741
|
//#endregion
|
|
606
|
-
//#region src/
|
|
742
|
+
//#region src/templates/configs/alexjs/create-config.d.ts
|
|
743
|
+
declare function createRcConfig(): string;
|
|
744
|
+
declare function createIgnoreConfig(): string;
|
|
745
|
+
//#endregion
|
|
746
|
+
//#region src/templates/configs/commit-msg/create-config.d.ts
|
|
607
747
|
/**
|
|
608
|
-
*
|
|
609
|
-
*
|
|
610
|
-
*
|
|
748
|
+
* `.husky/commit-msg` — lints the commit message via `holocron run lint
|
|
749
|
+
* commit-msg` (holocron#789), the real programmatic replacement for
|
|
750
|
+
* shelling out to `commitlint --edit`. Installed by `holocron repo setup` when
|
|
751
|
+
* hooks are enabled. Same `__HOLOCRON_SCRIPT__` substitution as `pre-push`.
|
|
611
752
|
*
|
|
612
|
-
*
|
|
613
|
-
*
|
|
614
|
-
* `.yml` files in `src/templates/reusable/` and pushed verbatim (with a
|
|
615
|
-
* "do not edit" header). Never hand-edit them in `.github`.
|
|
616
|
-
*
|
|
617
|
-
* Not to be confused with `WORKFLOW_TEMPLATES` in `thin-callers.ts` — those are
|
|
618
|
-
* the *thin-caller bases* written into each consumer repo's `.github/workflows/`.
|
|
753
|
+
* @param holocronScript - the command that invokes the CLI. Defaults to
|
|
754
|
+
* `pnpm exec holocron`; the source repo passes `node packages/cli/dist/cli.mjs`.
|
|
619
755
|
*/
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
declare
|
|
624
|
-
|
|
625
|
-
|
|
756
|
+
declare function createConfig(holocronScript?: string): string;
|
|
757
|
+
//#endregion
|
|
758
|
+
//#region src/templates/configs/dependabot/create-config.d.ts
|
|
759
|
+
declare function createConfig$1(): string;
|
|
760
|
+
//#endregion
|
|
761
|
+
//#region src/templates/configs/devmoji/create-config.d.ts
|
|
762
|
+
declare function createConfig$2(): string;
|
|
763
|
+
//#endregion
|
|
764
|
+
//#region src/templates/configs/editorconfig/create-config.d.ts
|
|
765
|
+
declare function createConfig$3(): string;
|
|
766
|
+
//#endregion
|
|
767
|
+
//#region src/templates/configs/editorconfig-checker/create-config.d.ts
|
|
626
768
|
/**
|
|
627
|
-
* The
|
|
628
|
-
*
|
|
629
|
-
*
|
|
769
|
+
* The generated `.editorconfig-checker.json`.
|
|
770
|
+
*
|
|
771
|
+
* Deliberately carries no `"Version"` key: editorconfig-checker treats it as a
|
|
772
|
+
* hard gate and exits non-zero the moment the running binary's version differs
|
|
773
|
+
* — which it does the instant a contributor's local install (Homebrew tracks
|
|
774
|
+
* latest) drifts from the version super-linter bundles in CI, breaking
|
|
775
|
+
* `holocron run lint` / the pre-push hook for everyone (#618). The config
|
|
776
|
+
* options here (`Exclude`, `Disable`) are stable across releases, so pinning
|
|
777
|
+
* buys nothing.
|
|
630
778
|
*/
|
|
631
|
-
declare function
|
|
779
|
+
declare function createConfig$4(): string;
|
|
632
780
|
//#endregion
|
|
633
|
-
//#region src/
|
|
781
|
+
//#region src/templates/configs/labeler/create-config.d.ts
|
|
782
|
+
declare function createConfig$5(): string;
|
|
783
|
+
//#endregion
|
|
784
|
+
//#region src/templates/configs/pre-commit/create-config.d.ts
|
|
634
785
|
/**
|
|
635
|
-
* `
|
|
636
|
-
*
|
|
637
|
-
*
|
|
638
|
-
*
|
|
639
|
-
* than hand-authored — the same category as `.editorconfig`
|
|
640
|
-
* ({@link "./templates/configs/editorconfig/create-config.js" createConfig})
|
|
641
|
-
* and {@link codecovConfig}.
|
|
642
|
-
*
|
|
643
|
-
* Surveyed every package-level `tsconfig.json` across the org (`holocron`,
|
|
644
|
-
* `clients`, `utils` — 20+ packages). `extends: "@theholocron/tsconfig/
|
|
645
|
-
* node-lts"`, `compilerOptions.baseUrl: "./"`, `compilerOptions.outDir:
|
|
646
|
-
* "./dist"`, `include: ["src/**\/*.ts"]`, and `exclude: ["node_modules",
|
|
647
|
-
* "dist"]` are uniform in every one — safe defaults here. `paths` (a `@/*`
|
|
648
|
-
* → `./src/*` import alias) is a real per-package choice, present in
|
|
649
|
-
* roughly 40% of packages checked — an opt-in parameter, not a default.
|
|
650
|
-
*
|
|
651
|
-
* Two fields checked and deliberately *not* absorbed as defaults, unlike
|
|
652
|
-
* `eslint-config`'s `tsconfigRootDir`/`settings.node` (which turned out
|
|
653
|
-
* redundant with the shared package's own behavior, `configs`#461):
|
|
654
|
-
* `compilerOptions.module`/`moduleResolution` (only `@theholocron/cli`
|
|
655
|
-
* overrides these, to `esnext`/`bundler` — a genuine deviation from the
|
|
656
|
-
* shared `node-lts` preset's `nodenext`/`nodenext`, needed for its bundler
|
|
657
|
-
* tooling, not something every package should inherit) and
|
|
658
|
-
* `compilerOptions.rootDir` (present in exactly two packages, always the
|
|
659
|
-
* same value `./src` that `include` already implies — an unnecessary
|
|
660
|
-
* override wherever it appears, not a pattern worth generalizing).
|
|
786
|
+
* `.husky/pre-commit` — runs GitLeaks (scoped to staged changes) and
|
|
787
|
+
* lint-staged before every commit. Installed by `holocron repo setup` when hooks
|
|
788
|
+
* are enabled (default for `protection: "strict"`). `git commit --no-verify`
|
|
789
|
+
* bypasses it.
|
|
661
790
|
*
|
|
662
|
-
*
|
|
663
|
-
*
|
|
664
|
-
*
|
|
665
|
-
*
|
|
666
|
-
*
|
|
667
|
-
* Not yet wired into `holocron setup`'s per-package write loop (every
|
|
668
|
-
* other Bucket B file there is a single repo-root file, safely
|
|
669
|
-
* overwritten every run — `tsconfig.json` is per-package, and most
|
|
670
|
-
* packages' files still carry real hand-authored content today, not yet
|
|
671
|
-
* migrated to a fully-generated state). That per-package iteration +
|
|
672
|
-
* safe-migration design is `#680`'s job, not duplicated here — this is
|
|
673
|
-
* the generator itself, ready for it to call.
|
|
791
|
+
* `gitleaks protect --staged` (not `gitleaks git`) is deliberate: the latter
|
|
792
|
+
* scans the entire commit history on every invocation, so once any false
|
|
793
|
+
* positive lands in a past commit — a fake test token, an example key in a
|
|
794
|
+
* doc — every future commit is permanently blocked, regardless of what's
|
|
795
|
+
* actually staged.
|
|
674
796
|
*/
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
/**
|
|
679
|
-
* `@theholocron/tsconfig` variant. Defaults to `"node-lts"` — every
|
|
680
|
-
* checked package uses it; the other three (`astro`, `nextjs`, `react`)
|
|
681
|
-
* exist for a template repo's app-shaped packages, not the plain
|
|
682
|
-
* Node.js library packages this org's currently-migrated repos ship.
|
|
683
|
-
*/
|
|
684
|
-
variant?: "astro" | "nextjs" | "node-lts" | "react";
|
|
685
|
-
/**
|
|
686
|
-
* Add a `@/*` → `./src/*` path alias. A real per-package choice, not a
|
|
687
|
-
* default — roughly 40% of packages checked use one, the rest don't.
|
|
688
|
-
*/
|
|
689
|
-
paths?: boolean;
|
|
690
|
-
}
|
|
797
|
+
declare function createConfig$6(): string;
|
|
798
|
+
//#endregion
|
|
799
|
+
//#region src/templates/configs/pre-push/create-config.d.ts
|
|
691
800
|
/**
|
|
692
|
-
*
|
|
693
|
-
* every
|
|
694
|
-
*
|
|
695
|
-
*
|
|
696
|
-
*
|
|
697
|
-
*
|
|
698
|
-
* this thin).
|
|
801
|
+
* `.husky/pre-push` — runs `holocron run ci` (the merge-gating checks, in CI order)
|
|
802
|
+
* before every push. Installed by `holocron repo setup` when hooks are enabled
|
|
803
|
+
* (default for `protection: "strict"`). `git push --no-verify` bypasses it.
|
|
804
|
+
*
|
|
805
|
+
* @param holocronScript - the command that invokes the CLI. Defaults to
|
|
806
|
+
* `pnpm exec holocron`; the source repo passes `node packages/cli/dist/cli.mjs`.
|
|
699
807
|
*/
|
|
700
|
-
declare function
|
|
808
|
+
declare function createConfig$7(holocronScript?: string): string;
|
|
809
|
+
//#endregion
|
|
810
|
+
//#region src/templates/configs/prepare-commit-msg/create-config.d.ts
|
|
811
|
+
declare function createConfig$8(): string;
|
|
812
|
+
//#endregion
|
|
813
|
+
//#region src/templates/configs/yamllint/create-config.d.ts
|
|
814
|
+
declare function createConfig$9(): string;
|
|
815
|
+
declare function createIgnoreConfig$1(): string;
|
|
701
816
|
//#endregion
|
|
702
|
-
export { type Astromech, type AstromechOptions, CI_ORDER, type CiJobReport, type CiOptions, type CiReport, type
|
|
817
|
+
export { type Astromech, type AstromechOptions, CI_ORDER, type CiJobReport, type CiOptions, type CiReport, type CreateHeaderOptions, type DeployOnReleaseOptions, type DeployOnReleaseReport, type DeployOnReleaseResult, type WorkspacePackage as DeployWorkspacePackage, type ExecFn, type GroupJobReport, type GroupOptions, type GroupReport, type HeaderFunctions, type JobDef, KNOWN_TASKS, KNOWN_WORKFLOWS, type LocalRunner, type OrgContext, type PreviewConfig, REUSABLE_ACTIONS, REUSABLE_WORKFLOWS, type RunLogger, type RunOptions, type RunTaskInput, type RunTaskReport, TASKS, type TaskDef, type TsconfigOptions, WORKFLOW_CHECK_CONTEXTS, WORKFLOW_TEMPLATES, WORKFLOW_TEMPLATE_PROPERTIES, type WorkflowHeaderFormat, type WorkspacePackage$1 as WorkspacePackage, codecovComponentBlock, codecovConfig, createIgnoreConfig as createAlexignore, createRcConfig as createAlexrc, createAstromech, createCodecovConfig, createConfig as createCommitMsg, createConfig$1 as createDependabot, createConfig$2 as createDevmoji, createConfig$3 as createEditorconfig, createConfig$4 as createEditorconfigChecker, createHeader, createConfig$5 as createLabeler, createConfig$6 as createPreCommit, createConfig$7 as createPrePush, createConfig$8 as createPrepareCommitMsg, createTsconfig, createIgnoreConfig$1 as createYamlignore, createConfig$9 as createYamllint, defaultListDirs, defaultPaths, defaultReadJson, deployOnRelease, deriveDeployPaths, ensureIfNotFound, extractPreviewConfig, generateCombinedDeployContent, generateThinCallerContent, matchNamespace, mergeCodecovComponents, normalizeWorkflowWith, readWorkspacePackages, requiredChecks, reusableTemplates, runCi, runGroup, runTask, workspacePackages };
|