@theholocron/astromech 5.0.0-alpha.147 → 5.0.0-alpha.149
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/dist/config/index.d.mts +32 -4
- package/dist/config/index.mjs +14 -2
- package/dist/index.d.mts +140 -201
- package/dist/index.mjs +295 -239
- package/dist/load-ToVjaKPr.mjs +55 -0
- package/dist/{schema-BDld3xq1.d.mts → schema.type-BUiSrwS5.d.mts} +2 -12
- package/package.json +6 -4
- package/dist/load-ytspboBj.mjs +0 -50
package/dist/config/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as TaskEntry, r as TasksConfig, t as TaskConfigItem } from "../schema.type-BUiSrwS5.mjs";
|
|
2
|
+
import { Loaded } from "@theholocron/datapad";
|
|
2
3
|
//#region src/config/define.d.ts
|
|
3
4
|
/**
|
|
4
5
|
* Typed identity helper for `astromech.config.ts`:
|
|
@@ -13,7 +14,7 @@ import { i as normalizeTaskEntry, n as TaskEntry, r as TasksConfig, t as TaskCon
|
|
|
13
14
|
*/
|
|
14
15
|
declare const defineConfig: <C extends TasksConfig>(config: C) => C;
|
|
15
16
|
//#endregion
|
|
16
|
-
//#region src/config/load.d.ts
|
|
17
|
+
//#region src/config/load.type.d.ts
|
|
17
18
|
/**
|
|
18
19
|
* The `tasks` value in each source. A dedicated `astromech.config.*`
|
|
19
20
|
* default-exports the full {@link TasksConfig} object; the `tasks` key of
|
|
@@ -21,6 +22,16 @@ declare const defineConfig: <C extends TasksConfig>(config: C) => C;
|
|
|
21
22
|
* `workflows` key). Either form is accepted from either source.
|
|
22
23
|
*/
|
|
23
24
|
type TasksInput = TasksConfig | TaskConfigItem[];
|
|
25
|
+
interface LoadTasksConfigOptions {
|
|
26
|
+
/**
|
|
27
|
+
* The `holocron.config.*` the caller has already loaded (`null`: it looked and
|
|
28
|
+
* there is none), so it isn't found and loaded a second time. Leave it unset
|
|
29
|
+
* to have `loadTasksConfig` find it itself.
|
|
30
|
+
*/
|
|
31
|
+
holocron?: Loaded<object> | null;
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/config/load.d.ts
|
|
24
35
|
/**
|
|
25
36
|
* Resolve the task manifest for a repo: the `tasks` key of
|
|
26
37
|
* `holocron.config.*`, then a dedicated `astromech.config.*` merged on
|
|
@@ -30,10 +41,15 @@ type TasksInput = TasksConfig | TaskConfigItem[];
|
|
|
30
41
|
* `walkUp: true` — `holocron run`/`ci` are usable from any subdirectory of
|
|
31
42
|
* a repo, not only its exact root (datapad walks up to the nearest `.git`
|
|
32
43
|
* boundary; see `@theholocron/datapad`'s own doc comment).
|
|
44
|
+
*
|
|
45
|
+
* A caller that has already loaded `holocron.config.*` passes it as
|
|
46
|
+
* `options.holocron` so it is not found and loaded again.
|
|
33
47
|
*/
|
|
34
|
-
declare function loadTasksConfig(cwd: string): Promise<TasksConfig>;
|
|
48
|
+
declare function loadTasksConfig(cwd: string, options?: LoadTasksConfigOptions): Promise<TasksConfig>;
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/config/merge-tasks-layers.d.ts
|
|
35
51
|
/**
|
|
36
|
-
* The
|
|
52
|
+
* The same layering as {@link loadTasksConfig}, for callers that load the two
|
|
37
53
|
* sources some other way (Sentinel reads them from the GitHub API, not
|
|
38
54
|
* from disk, holocron#916): `holocron.config.*`'s `tasks` value first,
|
|
39
55
|
* then a dedicated `astromech.config.*`'s default export merged on top.
|
|
@@ -41,4 +57,16 @@ declare function loadTasksConfig(cwd: string): Promise<TasksConfig>;
|
|
|
41
57
|
*/
|
|
42
58
|
declare function mergeTasksLayers(parentTasks: TasksInput | undefined, dedicated: TasksInput | undefined): TasksConfig;
|
|
43
59
|
//#endregion
|
|
60
|
+
//#region src/config/schema.d.ts
|
|
61
|
+
/**
|
|
62
|
+
* The `tasks` config shape — the single manifest of what a repo runs.
|
|
63
|
+
* Read from a dedicated `astromech.config.*` file or the `tasks` key of
|
|
64
|
+
* `holocron.config.*` (see {@link loadTasksConfig}).
|
|
65
|
+
*
|
|
66
|
+
* Runtime validation is the loader's job, not this type's — the type only
|
|
67
|
+
* describes what an author writes.
|
|
68
|
+
*/
|
|
69
|
+
/** Normalise a `TaskConfigItem` to a full {@link TaskEntry} with defaults applied. */
|
|
70
|
+
declare function normalizeTaskEntry(item: TaskConfigItem): Required<Pick<TaskEntry, "name" | "ci" | "local">> & TaskEntry;
|
|
71
|
+
//#endregion
|
|
44
72
|
export { type TaskConfigItem, type TaskEntry, type TasksConfig, defineConfig, loadTasksConfig, mergeTasksLayers, normalizeTaskEntry };
|
package/dist/config/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
import { createDefineConfig } from "@theholocron/datapad";
|
|
1
|
+
import { n as coerceTasks, r as normalizeTaskEntry, t as loadTasksConfig } from "../load-ToVjaKPr.mjs";
|
|
2
|
+
import { createDefineConfig, mergeLayers } from "@theholocron/datapad";
|
|
3
3
|
//#region src/config/define.ts
|
|
4
4
|
/**
|
|
5
5
|
* Typed identity helper for `astromech.config.ts`:
|
|
@@ -14,4 +14,16 @@ import { createDefineConfig } from "@theholocron/datapad";
|
|
|
14
14
|
*/
|
|
15
15
|
const defineConfig = createDefineConfig();
|
|
16
16
|
//#endregion
|
|
17
|
+
//#region src/config/merge-tasks-layers.ts
|
|
18
|
+
/**
|
|
19
|
+
* The same layering as {@link loadTasksConfig}, for callers that load the two
|
|
20
|
+
* sources some other way (Sentinel reads them from the GitHub API, not
|
|
21
|
+
* from disk, holocron#916): `holocron.config.*`'s `tasks` value first,
|
|
22
|
+
* then a dedicated `astromech.config.*`'s default export merged on top.
|
|
23
|
+
* Either may be `undefined` (source absent); returns `{}` when both are.
|
|
24
|
+
*/
|
|
25
|
+
function mergeTasksLayers(parentTasks, dedicated) {
|
|
26
|
+
return mergeLayers([coerceTasks(parentTasks), coerceTasks(dedicated)]) ?? {};
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
17
29
|
export { defineConfig, loadTasksConfig, mergeTasksLayers, normalizeTaskEntry };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,55 +1,5 @@
|
|
|
1
|
-
import { r as TasksConfig } from "./schema-
|
|
2
|
-
//#region src/generators/github-action-thin-callers.d.ts
|
|
3
|
-
/**
|
|
4
|
-
* Workflow templates + thin-caller generation.
|
|
5
|
-
*
|
|
6
|
-
* `WORKFLOW_TEMPLATES` holds each reusable `.github/workflows/<name>.yml`
|
|
7
|
-
* (synced to `theholocron/.github`); `generateThinCallerContent` wraps one
|
|
8
|
-
* into the thin caller `holocron repo setup` / `holocron repo sync` write locally.
|
|
9
|
-
*/
|
|
10
|
-
declare const WORKFLOW_TEMPLATES: Record<string, string>;
|
|
11
|
-
declare const KNOWN_WORKFLOWS: Set<string>;
|
|
12
|
-
/**
|
|
13
|
-
* The GitHub status-check context a `required` task contributes to branch
|
|
14
|
-
* protection. Format: `"{workflow name} / {job name}"`.
|
|
15
|
-
*
|
|
16
|
-
* Most of these are single-job workflows now (D3's decomposition split what
|
|
17
|
-
* used to be multi-job `lint`/`audit` into one task per concern) — the
|
|
18
|
-
* context names that job directly, no `Conclusion` aggregator needed; a
|
|
19
|
-
* single job's own conclusion already *is* the workflow's conclusion.
|
|
20
|
-
* `Conclusion` fan-in jobs are kept only where a task genuinely has several
|
|
21
|
-
* conditionally-run jobs feeding one required check:
|
|
22
|
-
* `verification.unitTests` (unit / Storybook / Chromatic / interaction /
|
|
23
|
-
* user-flow, each gated by its own `run-*` input) and
|
|
24
|
-
* `platform.repoValidation` (its three script jobs all must pass). Only
|
|
25
|
-
* merge-gating workflows are listed. `astromech.requiredChecks()` reads this
|
|
26
|
-
* for every `required` task.
|
|
27
|
-
*/
|
|
28
|
-
declare const WORKFLOW_CHECK_CONTEXTS: Partial<Record<string, string>>;
|
|
29
|
-
/**
|
|
30
|
-
* Generate the thin caller content for a workflow, optionally injecting or
|
|
31
|
-
* merging `with:` overrides into the jobs block.
|
|
32
|
-
*
|
|
33
|
-
* Two strategies are used depending on the template:
|
|
34
|
-
* - Templates that already have a `with:` block (e.g. lint):
|
|
35
|
-
* the override entries are merged in, replacing existing keys and appending
|
|
36
|
-
* new ones.
|
|
37
|
-
* - Templates that end with ` secrets: inherit`: a new `with:` block is
|
|
38
|
-
* injected immediately before `secrets: inherit`.
|
|
39
|
-
* If neither pattern matches the template, a warning is emitted and the
|
|
40
|
-
* base template is returned unchanged.
|
|
41
|
-
*/
|
|
42
|
-
declare function generateThinCallerContent(name: string, withOverrides?: Record<string, unknown>, additionalPaths?: string[],
|
|
43
|
-
/** Optional sink for the "could not inject `with:`" warning. */
|
|
44
|
-
logger?: {
|
|
45
|
-
warn(obj: Record<string, unknown>, msg: string): void;
|
|
46
|
-
},
|
|
47
|
-
/**
|
|
48
|
-
* `with:` key → a `# comment` line rendered immediately above that entry.
|
|
49
|
-
* Only honored when injecting a fresh `with:` block (no template today
|
|
50
|
-
* ships one), which is the path `lint` takes.
|
|
51
|
-
*/
|
|
52
|
-
comments?: Record<string, string>): string;
|
|
1
|
+
import { r as TasksConfig } from "./schema.type-BUiSrwS5.mjs";
|
|
2
|
+
//#region src/generators/github-action-thin-callers.type.d.ts
|
|
53
3
|
interface PreviewConfig {
|
|
54
4
|
/** Cloudflare Pages project name shared across all repos for previews. */
|
|
55
5
|
project: string;
|
|
@@ -72,46 +22,8 @@ interface OrgContext {
|
|
|
72
22
|
/** Project name — injected as the `name` input to the deploy reusable when `docs: true`. */
|
|
73
23
|
repoName?: string;
|
|
74
24
|
}
|
|
75
|
-
/**
|
|
76
|
-
* Extract the Cloudflare Pages preview config from a deploy workflow's `with:` object.
|
|
77
|
-
*
|
|
78
|
-
* Accepts three forms:
|
|
79
|
-
* - `preview: true` — derive both project and domain from org context
|
|
80
|
-
* - `preview: { project: "..." }` — explicit project; domain derived from context if omitted
|
|
81
|
-
* - `preview: { project: "...", domain: "..." }` — fully explicit
|
|
82
|
-
*
|
|
83
|
-
* Returns null when `preview:` is absent, false, or can't be resolved.
|
|
84
|
-
*/
|
|
85
|
-
declare function extractPreviewConfig(raw: Record<string, unknown>, ctx?: OrgContext): PreviewConfig | null;
|
|
86
|
-
/**
|
|
87
|
-
* Generate the full thin-caller YAML for a `deploy.yml` that handles both
|
|
88
|
-
* production (push to main → GitHub Pages) and preview (pull_request →
|
|
89
|
-
* Cloudflare Pages) in a single file.
|
|
90
|
-
*
|
|
91
|
-
* Both jobs receive the same docs/storybook `with:` inputs. If the per-repo
|
|
92
|
-
* config supplies `cloudflare-project` it is forwarded; otherwise the reusable
|
|
93
|
-
* falls back to the `CLOUDFLARE_PAGES_PROJECT` org variable — set that once and
|
|
94
|
-
* all repos with a `deploy` workflow get previews without per-repo config.
|
|
95
|
-
*/
|
|
96
|
-
declare function generateCombinedDeployContent(deployWith: Record<string, unknown>, paths: string[], preview: Pick<PreviewConfig, "project">): string;
|
|
97
|
-
/**
|
|
98
|
-
* Expand structured with-values to flat GitHub Actions inputs before
|
|
99
|
-
* generating the thin caller. Handles:
|
|
100
|
-
* - deploy shorthand: docs/storybook → type + storybook-projects
|
|
101
|
-
* - preview: stripped (handled separately via extractPreviewConfig)
|
|
102
|
-
* - run-chromatic object → run-chromatic: true + chromatic-projects
|
|
103
|
-
* - plain arrays → JSON-stringified for YAML scalar quoting
|
|
104
|
-
*
|
|
105
|
-
* Used by both `holocron repo setup` and `sync-workflow-templates`.
|
|
106
|
-
*/
|
|
107
|
-
declare function normalizeWorkflowWith(raw: Record<string, unknown>): Record<string, unknown>;
|
|
108
|
-
/**
|
|
109
|
-
* Derive on.push.paths entries from the deploy with: shorthand.
|
|
110
|
-
* Used by both `holocron repo setup` and `sync-workflow-templates`.
|
|
111
|
-
*/
|
|
112
|
-
declare function deriveDeployPaths(raw: Record<string, unknown>): string[];
|
|
113
25
|
//#endregion
|
|
114
|
-
//#region src/generators/turbo.d.ts
|
|
26
|
+
//#region src/generators/turbo.type.d.ts
|
|
115
27
|
interface EnsureRootWorkspaceMemberResult {
|
|
116
28
|
content: string;
|
|
117
29
|
changed: boolean;
|
|
@@ -121,36 +33,7 @@ interface EnsureTurboDependencyResult {
|
|
|
121
33
|
changed: boolean;
|
|
122
34
|
}
|
|
123
35
|
//#endregion
|
|
124
|
-
//#region src/tasks/run/run.d.ts
|
|
125
|
-
/**
|
|
126
|
-
* `holocron run <task> [job] [-- <passthrough>]` — run a registry task (or one
|
|
127
|
-
* of its sub-jobs) locally.
|
|
128
|
-
*
|
|
129
|
-
* A `job` argument only applies to tasks that declare `jobs`; for any other
|
|
130
|
-
* task it is folded back into the passthrough (`holocron run delivery.build
|
|
131
|
-
* src/`).
|
|
132
|
-
*
|
|
133
|
-
* Resolution:
|
|
134
|
-
*
|
|
135
|
-
* J. job given → TASKS[task].jobs[job].local (unknown job → exit 1)
|
|
136
|
-
* 1. turbo.json defines the task → `turbo run <task>`
|
|
137
|
-
* 2. package.json has a `<task>` script → `<pm> run <task>`
|
|
138
|
-
* (unless it's the `holocron run …` thin caller — that recurses)
|
|
139
|
-
* 3. TASKS[task].local resolves → `<tool> <args> <org-flags> <passthrough>`
|
|
140
|
-
* 3b. TASKS[task].linterGroup → run each resolved linter natively (see below)
|
|
141
|
-
* 4. TASKS[task].jobs has entries → run each job in declared order
|
|
142
|
-
* 5. TASKS[task].local === null → "enforced in CI" (skip, even with --required)
|
|
143
|
-
* 5b. known task, nothing resolved → "no <task> task" (exit 0, or 1 with --required)
|
|
144
|
-
* 6. unknown task → "unknown task" (exit 1)
|
|
145
|
-
*
|
|
146
|
-
* A `linterGroup` task (`sourceQuality.staticAnalysis`, etc.) runs its fixed
|
|
147
|
-
* set of `linters.ts` entries, each still gated by that linter's own
|
|
148
|
-
* `detect`/`always` rule — every entry runs its `localBin` natively when
|
|
149
|
-
* found on PATH. Missing tools are flagged; the exit code is the worst of
|
|
150
|
-
* the lot. Unlike the old single `lint` task, this check runs *after*
|
|
151
|
-
* turbo/`package.json` resolution (step 3b, not step 0) — a `linterGroup`
|
|
152
|
-
* task is a normal turbo-delegatable task like any other.
|
|
153
|
-
*/
|
|
36
|
+
//#region src/tasks/run/run.type.d.ts
|
|
154
37
|
/** Minimal structural logger — `@theholocron/observability`'s `Logger` satisfies it. */
|
|
155
38
|
interface RunLogger {
|
|
156
39
|
debug(obj: Record<string, unknown>, msg?: string): void;
|
|
@@ -202,9 +85,8 @@ interface RunTaskReport {
|
|
|
202
85
|
command?: string;
|
|
203
86
|
message?: string;
|
|
204
87
|
}
|
|
205
|
-
declare function runTask(input: RunTaskInput): RunTaskReport;
|
|
206
88
|
//#endregion
|
|
207
|
-
//#region src/tasks/ci.d.ts
|
|
89
|
+
//#region src/tasks/ci.type.d.ts
|
|
208
90
|
interface CiOptions {
|
|
209
91
|
/** Print the plan without running anything. */
|
|
210
92
|
dryRun?: boolean;
|
|
@@ -229,9 +111,8 @@ interface CiInput extends RunDeps, CiOptions {
|
|
|
229
111
|
cwd: string;
|
|
230
112
|
config: TasksConfig;
|
|
231
113
|
}
|
|
232
|
-
declare function runCi(input: CiInput): CiReport;
|
|
233
114
|
//#endregion
|
|
234
|
-
//#region src/tasks/group.d.ts
|
|
115
|
+
//#region src/tasks/group.type.d.ts
|
|
235
116
|
interface GroupOptions {
|
|
236
117
|
/** Print the resolved commands without running anything. */
|
|
237
118
|
dryRun?: boolean;
|
|
@@ -255,11 +136,8 @@ interface GroupInput extends RunDeps, GroupOptions {
|
|
|
255
136
|
/** The bare namespace, e.g. `"sourceQuality"` — matched against `"sourceQuality."`-prefixed task names. */
|
|
256
137
|
namespace: string;
|
|
257
138
|
}
|
|
258
|
-
/** Every configured task whose name starts with `"<namespace>."`, in manifest declaration order. */
|
|
259
|
-
declare function matchNamespace(config: TasksConfig, namespace: string): string[];
|
|
260
|
-
declare function runGroup(input: GroupInput): GroupReport;
|
|
261
139
|
//#endregion
|
|
262
|
-
//#region src/astromech.d.ts
|
|
140
|
+
//#region src/astromech.type.d.ts
|
|
263
141
|
interface AstromechOptions {
|
|
264
142
|
/** Repo root. */
|
|
265
143
|
cwd: string;
|
|
@@ -395,23 +273,19 @@ interface Astromech {
|
|
|
395
273
|
*/
|
|
396
274
|
ensureTurboDependency(packageJson: string, workspaceYaml: string): EnsureTurboDependencyResult;
|
|
397
275
|
}
|
|
276
|
+
//#endregion
|
|
277
|
+
//#region src/astromech.d.ts
|
|
398
278
|
declare function createAstromech(options: AstromechOptions): Astromech;
|
|
399
279
|
//#endregion
|
|
400
|
-
//#region src/generators/codecov.d.ts
|
|
401
|
-
/**
|
|
402
|
-
* `codecov.yml` generation — a manifest-derived artifact (component `paths`
|
|
403
|
-
* come from workspace packages; the status targets track the `test` task's
|
|
404
|
-
* coverage setup), the same category as the reusable `test.yml` this package
|
|
405
|
-
* also generates. Moved out of `@theholocron/cli` (theholocron/holocron#650)
|
|
406
|
-
* — `holocron repo setup`'s codecov step now calls {@link codecovConfig} instead
|
|
407
|
-
* of importing this logic directly.
|
|
408
|
-
*/
|
|
280
|
+
//#region src/generators/codecov.type.d.ts
|
|
409
281
|
interface WorkspacePackage {
|
|
410
282
|
slug: string;
|
|
411
283
|
name: string;
|
|
412
284
|
/** Which workspace root the package was discovered under. Defaults to `"packages"`. */
|
|
413
285
|
dir?: "packages" | "apps" | "plugins";
|
|
414
286
|
}
|
|
287
|
+
//#endregion
|
|
288
|
+
//#region src/generators/codecov.d.ts
|
|
415
289
|
declare function codecovComponentBlock(packages: WorkspacePackage[]): string;
|
|
416
290
|
/**
|
|
417
291
|
* Ensure every codecov status default carries `if_not_found: success`, so an
|
|
@@ -470,52 +344,94 @@ declare const WORKFLOW_TEMPLATE_PROPERTIES: Record<string, string>;
|
|
|
470
344
|
*/
|
|
471
345
|
declare function reusableTemplates(): Map<string, string>;
|
|
472
346
|
//#endregion
|
|
473
|
-
//#region src/generators/
|
|
474
|
-
|
|
475
|
-
declare
|
|
476
|
-
//#endregion
|
|
477
|
-
//#region src/generators/tsconfig.d.ts
|
|
347
|
+
//#region src/generators/github-action-thin-callers.d.ts
|
|
348
|
+
declare const WORKFLOW_TEMPLATES: Record<string, string>;
|
|
349
|
+
declare const KNOWN_WORKFLOWS: Set<string>;
|
|
478
350
|
/**
|
|
479
|
-
*
|
|
480
|
-
*
|
|
481
|
-
* directly from disk, no `--config` override mechanism to hand it a path
|
|
482
|
-
* instead), but its content is fully derivable, so it's generated rather
|
|
483
|
-
* than hand-authored — the same category as `.editorconfig`
|
|
484
|
-
* ({@link "./templates/configs/editorconfig/create-config.js" createConfig})
|
|
485
|
-
* and {@link codecovConfig}.
|
|
351
|
+
* The GitHub status-check context a `required` task contributes to branch
|
|
352
|
+
* protection. Format: `"{workflow name} / {job name}"`.
|
|
486
353
|
*
|
|
487
|
-
*
|
|
488
|
-
*
|
|
489
|
-
*
|
|
490
|
-
*
|
|
491
|
-
*
|
|
492
|
-
*
|
|
493
|
-
*
|
|
354
|
+
* Most of these are single-job workflows now (D3's decomposition split what
|
|
355
|
+
* used to be multi-job `lint`/`audit` into one task per concern) — the
|
|
356
|
+
* context names that job directly, no `Conclusion` aggregator needed; a
|
|
357
|
+
* single job's own conclusion already *is* the workflow's conclusion.
|
|
358
|
+
* `Conclusion` fan-in jobs are kept only where a task genuinely has several
|
|
359
|
+
* conditionally-run jobs feeding one required check:
|
|
360
|
+
* `verification.unitTests` (unit / Storybook / Chromatic / interaction /
|
|
361
|
+
* user-flow, each gated by its own `run-*` input) and
|
|
362
|
+
* `platform.repoValidation` (its three script jobs all must pass). Only
|
|
363
|
+
* merge-gating workflows are listed. `astromech.requiredChecks()` reads this
|
|
364
|
+
* for every `required` task.
|
|
365
|
+
*/
|
|
366
|
+
declare const WORKFLOW_CHECK_CONTEXTS: Partial<Record<string, string>>;
|
|
367
|
+
/**
|
|
368
|
+
* Generate the thin caller content for a workflow, optionally injecting or
|
|
369
|
+
* merging `with:` overrides into the jobs block.
|
|
370
|
+
*
|
|
371
|
+
* Two strategies are used depending on the template:
|
|
372
|
+
* - Templates that already have a `with:` block (e.g. lint):
|
|
373
|
+
* the override entries are merged in, replacing existing keys and appending
|
|
374
|
+
* new ones.
|
|
375
|
+
* - Templates that end with ` secrets: inherit`: a new `with:` block is
|
|
376
|
+
* injected immediately before `secrets: inherit`.
|
|
377
|
+
* If neither pattern matches the template, a warning is emitted and the
|
|
378
|
+
* base template is returned unchanged.
|
|
379
|
+
*/
|
|
380
|
+
declare function generateThinCallerContent(name: string, withOverrides?: Record<string, unknown>, additionalPaths?: string[],
|
|
381
|
+
/** Optional sink for the "could not inject `with:`" warning. */
|
|
382
|
+
logger?: {
|
|
383
|
+
warn(obj: Record<string, unknown>, msg: string): void;
|
|
384
|
+
},
|
|
385
|
+
/**
|
|
386
|
+
* `with:` key → a `# comment` line rendered immediately above that entry.
|
|
387
|
+
* Only honored when injecting a fresh `with:` block (no template today
|
|
388
|
+
* ships one), which is the path `lint` takes.
|
|
389
|
+
*/
|
|
390
|
+
comments?: Record<string, string>): string;
|
|
391
|
+
/**
|
|
392
|
+
* Extract the Cloudflare Pages preview config from a deploy workflow's `with:` object.
|
|
393
|
+
*
|
|
394
|
+
* Accepts three forms:
|
|
395
|
+
* - `preview: true` — derive both project and domain from org context
|
|
396
|
+
* - `preview: { project: "..." }` — explicit project; domain derived from context if omitted
|
|
397
|
+
* - `preview: { project: "...", domain: "..." }` — fully explicit
|
|
494
398
|
*
|
|
495
|
-
*
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
*
|
|
500
|
-
*
|
|
501
|
-
*
|
|
502
|
-
* `compilerOptions.rootDir` (present in exactly two packages, always the
|
|
503
|
-
* same value `./src` that `include` already implies — an unnecessary
|
|
504
|
-
* override wherever it appears, not a pattern worth generalizing).
|
|
399
|
+
* Returns null when `preview:` is absent, false, or can't be resolved.
|
|
400
|
+
*/
|
|
401
|
+
declare function extractPreviewConfig(raw: Record<string, unknown>, ctx?: OrgContext): PreviewConfig | null;
|
|
402
|
+
/**
|
|
403
|
+
* Generate the full thin-caller YAML for a `deploy.yml` that handles both
|
|
404
|
+
* production (push to main → GitHub Pages) and preview (pull_request →
|
|
405
|
+
* Cloudflare Pages) in a single file.
|
|
505
406
|
*
|
|
506
|
-
*
|
|
507
|
-
*
|
|
508
|
-
*
|
|
509
|
-
*
|
|
407
|
+
* Both jobs receive the same docs/storybook `with:` inputs. If the per-repo
|
|
408
|
+
* config supplies `cloudflare-project` it is forwarded; otherwise the reusable
|
|
409
|
+
* falls back to the `CLOUDFLARE_PAGES_PROJECT` org variable — set that once and
|
|
410
|
+
* all repos with a `deploy` workflow get previews without per-repo config.
|
|
411
|
+
*/
|
|
412
|
+
declare function generateCombinedDeployContent(deployWith: Record<string, unknown>, paths: string[], preview: Pick<PreviewConfig, "project">): string;
|
|
413
|
+
/**
|
|
414
|
+
* Expand structured with-values to flat GitHub Actions inputs before
|
|
415
|
+
* generating the thin caller. Handles:
|
|
416
|
+
* - deploy shorthand: docs/storybook → type + storybook-projects
|
|
417
|
+
* - preview: stripped (handled separately via extractPreviewConfig)
|
|
418
|
+
* - run-chromatic object → run-chromatic: true + chromatic-projects
|
|
419
|
+
* - plain arrays → JSON-stringified for YAML scalar quoting
|
|
510
420
|
*
|
|
511
|
-
*
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
*
|
|
516
|
-
*
|
|
517
|
-
* the generator itself, ready for it to call.
|
|
421
|
+
* Used by both `holocron repo setup` and `sync-workflow-templates`.
|
|
422
|
+
*/
|
|
423
|
+
declare function normalizeWorkflowWith(raw: Record<string, unknown>): Record<string, unknown>;
|
|
424
|
+
/**
|
|
425
|
+
* Derive on.push.paths entries from the deploy with: shorthand.
|
|
426
|
+
* Used by both `holocron repo setup` and `sync-workflow-templates`.
|
|
518
427
|
*/
|
|
428
|
+
declare function deriveDeployPaths(raw: Record<string, unknown>): string[];
|
|
429
|
+
//#endregion
|
|
430
|
+
//#region src/generators/required-checks.d.ts
|
|
431
|
+
/** Ordered (task contexts in {@link CI_ORDER}, then extras), de-duplicated. */
|
|
432
|
+
declare function requiredChecks(config: TasksConfig): string[];
|
|
433
|
+
//#endregion
|
|
434
|
+
//#region src/generators/tsconfig.type.d.ts
|
|
519
435
|
interface TsconfigOptions {
|
|
520
436
|
/** Human-readable name for the `display` field — the package's own name is the usual choice. */
|
|
521
437
|
display: string;
|
|
@@ -532,6 +448,8 @@ interface TsconfigOptions {
|
|
|
532
448
|
*/
|
|
533
449
|
paths?: boolean;
|
|
534
450
|
}
|
|
451
|
+
//#endregion
|
|
452
|
+
//#region src/generators/tsconfig.d.ts
|
|
535
453
|
/**
|
|
536
454
|
* A package-level `tsconfig.json` — the uniform shape confirmed across
|
|
537
455
|
* every package checked, parameterized only by the two fields that
|
|
@@ -543,28 +461,7 @@ interface TsconfigOptions {
|
|
|
543
461
|
*/
|
|
544
462
|
declare function createTsconfig(options: TsconfigOptions): string;
|
|
545
463
|
//#endregion
|
|
546
|
-
//#region src/registry.d.ts
|
|
547
|
-
/**
|
|
548
|
-
* The task registry — how each task runs *locally*, without GitHub
|
|
549
|
-
* Actions. `holocron run <task>` and `holocron run ci` resolve against this;
|
|
550
|
-
* adding a task here gives every repo that task.
|
|
551
|
-
*
|
|
552
|
-
* Keyed identically to the workflow templates — a task IS a workflow. This
|
|
553
|
-
* is the canonical vocabulary table (epic #672, D11): every other artifact
|
|
554
|
-
* (`KNOWN_TASKS`, `thin-callers.ts`'s `KNOWN_WORKFLOWS`/`WORKFLOW_CHECK_CONTEXTS`,
|
|
555
|
-
* `CI_ORDER`) derives from these keys rather than hand-duplicating them —
|
|
556
|
-
* including the future GitHub App (#679), which imports this same table for
|
|
557
|
-
* config-schema validation instead of reimplementing its own copy.
|
|
558
|
-
*
|
|
559
|
-
* Task names are an intent-facing vocabulary (`verification.*`,
|
|
560
|
-
* `sourceQuality.*`, `security.*`, `delivery.*`, `platform.*`,
|
|
561
|
-
* `knowledge.*`), not tool names — `eslint`/`vitest`/`tsdown`/… stay
|
|
562
|
-
* internal to this file and `theholocron/configs`. See
|
|
563
|
-
* `docs/wiki/specifications/tech-vocabulary-rename.spec.md` (#675) for the full mapping and
|
|
564
|
-
* the reasoning behind each namespace and decomposition.
|
|
565
|
-
*
|
|
566
|
-
* Spec: `docs/wiki/specifications/tech-astromech-task-runner.spec.md` (epic #581).
|
|
567
|
-
*/
|
|
464
|
+
//#region src/registry.type.d.ts
|
|
568
465
|
/** How to run one task (or job) locally. */
|
|
569
466
|
interface LocalRunner {
|
|
570
467
|
/** Binary to invoke — resolved from `node_modules/.bin` then PATH. */
|
|
@@ -640,6 +537,29 @@ interface TaskDef {
|
|
|
640
537
|
/** Turborepo fan-out config for this task — see {@link TurboTaskConfig}. Omitted for whole-repo, non-fan-out tasks. */
|
|
641
538
|
turbo?: TurboTaskConfig;
|
|
642
539
|
}
|
|
540
|
+
//#endregion
|
|
541
|
+
//#region src/registry.d.ts
|
|
542
|
+
/**
|
|
543
|
+
* The task registry — how each task runs *locally*, without GitHub
|
|
544
|
+
* Actions. `holocron run <task>` and `holocron run ci` resolve against this;
|
|
545
|
+
* adding a task here gives every repo that task.
|
|
546
|
+
*
|
|
547
|
+
* Keyed identically to the workflow templates — a task IS a workflow. This
|
|
548
|
+
* is the canonical vocabulary table (epic #672, D11): every other artifact
|
|
549
|
+
* (`KNOWN_TASKS`, `thin-callers.ts`'s `KNOWN_WORKFLOWS`/`WORKFLOW_CHECK_CONTEXTS`,
|
|
550
|
+
* `CI_ORDER`) derives from these keys rather than hand-duplicating them —
|
|
551
|
+
* including the future GitHub App (#679), which imports this same table for
|
|
552
|
+
* config-schema validation instead of reimplementing its own copy.
|
|
553
|
+
*
|
|
554
|
+
* Task names are an intent-facing vocabulary (`verification.*`,
|
|
555
|
+
* `sourceQuality.*`, `security.*`, `delivery.*`, `platform.*`,
|
|
556
|
+
* `knowledge.*`), not tool names — `eslint`/`vitest`/`tsdown`/… stay
|
|
557
|
+
* internal to this file and `theholocron/configs`. See
|
|
558
|
+
* `docs/wiki/specifications/tech-vocabulary-rename.spec.md` (#675) for the full mapping and
|
|
559
|
+
* the reasoning behind each namespace and decomposition.
|
|
560
|
+
*
|
|
561
|
+
* Spec: `docs/wiki/specifications/tech-astromech-task-runner.spec.md` (epic #581).
|
|
562
|
+
*/
|
|
643
563
|
declare const TASKS: Record<string, TaskDef>;
|
|
644
564
|
/** Every task name the registry knows. */
|
|
645
565
|
declare const KNOWN_TASKS: Set<string>;
|
|
@@ -651,17 +571,24 @@ declare const KNOWN_TASKS: Set<string>;
|
|
|
651
571
|
*/
|
|
652
572
|
declare const CI_ORDER: string[];
|
|
653
573
|
//#endregion
|
|
654
|
-
//#region src/tasks/
|
|
574
|
+
//#region src/tasks/ci.d.ts
|
|
575
|
+
declare function runCi(input: CiInput): CiReport;
|
|
576
|
+
//#endregion
|
|
577
|
+
//#region src/utils/default-run.type.d.ts
|
|
655
578
|
interface SpawnResult {
|
|
656
579
|
status: number | null;
|
|
657
580
|
stdout: string;
|
|
658
581
|
stderr: string;
|
|
659
582
|
}
|
|
660
583
|
type Run = (command: string, args: string[], options: Record<string, unknown>) => SpawnResult;
|
|
584
|
+
//#endregion
|
|
585
|
+
//#region src/tasks/deploy-on-release/workspace-packages.type.d.ts
|
|
661
586
|
interface Tree {
|
|
662
587
|
readJson: (path: string) => unknown;
|
|
663
588
|
listDirs: (path: string) => string[];
|
|
664
589
|
}
|
|
590
|
+
//#endregion
|
|
591
|
+
//#region src/tasks/deploy-on-release/deploy-on-release.type.d.ts
|
|
665
592
|
interface DeployOnReleaseOptions {
|
|
666
593
|
cwd: string;
|
|
667
594
|
/** The release's channel: its prerelease identifier (`alpha`); empty or `main` for a stable release. */
|
|
@@ -691,6 +618,8 @@ interface DeployOnReleaseReport {
|
|
|
691
618
|
status: "ok" | "fail" | "skip";
|
|
692
619
|
results: DeployOnReleaseResult[];
|
|
693
620
|
}
|
|
621
|
+
//#endregion
|
|
622
|
+
//#region src/tasks/deploy-on-release/deploy-on-release.d.ts
|
|
694
623
|
/**
|
|
695
624
|
* Deploys every package whose manifest declares a release-time deploy that
|
|
696
625
|
* applies to this release. Never throws for a deploy problem: each package's
|
|
@@ -698,4 +627,14 @@ interface DeployOnReleaseReport {
|
|
|
698
627
|
*/
|
|
699
628
|
declare function deployOnRelease(options: DeployOnReleaseOptions, { run, readJson, listDirs, sleep, now, loadTasks }?: DeployOnReleaseDeps): Promise<DeployOnReleaseReport>;
|
|
700
629
|
//#endregion
|
|
630
|
+
//#region src/tasks/group.d.ts
|
|
631
|
+
declare function runGroup(input: GroupInput): GroupReport;
|
|
632
|
+
//#endregion
|
|
633
|
+
//#region src/tasks/match-namespace.d.ts
|
|
634
|
+
/** Every configured task whose name starts with `"<namespace>."`, in manifest declaration order. */
|
|
635
|
+
declare function matchNamespace(config: TasksConfig, namespace: string): string[];
|
|
636
|
+
//#endregion
|
|
637
|
+
//#region src/tasks/run/run.d.ts
|
|
638
|
+
declare function runTask(input: RunTaskInput): RunTaskReport;
|
|
639
|
+
//#endregion
|
|
701
640
|
export { type Astromech, type AstromechOptions, CI_ORDER, type CiJobReport, type CiOptions, type CiReport, type DeployOnReleaseOptions, type DeployOnReleaseReport, type DeployOnReleaseResult, type ExecFn, type GroupJobReport, type GroupOptions, type GroupReport, 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 WorkspacePackage, codecovComponentBlock, codecovConfig, createAstromech, createCodecovConfig, createTsconfig, deployOnRelease, deriveDeployPaths, ensureIfNotFound, extractPreviewConfig, generateCombinedDeployContent, generateThinCallerContent, matchNamespace, mergeCodecovComponents, normalizeWorkflowWith, readWorkspacePackages, requiredChecks, reusableTemplates, runCi, runGroup, runTask };
|