@theholocron/cli 5.0.0-alpha.25 → 5.0.0-alpha.250
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 +320 -56
- package/dist/cli.mjs +14014 -8103
- package/dist/cli.mjs.map +1 -1
- package/dist/compose-DFW8ftHT.mjs +209 -0
- package/dist/index-BD9zG_5Z.d.mts +1632 -0
- package/dist/index-BK5cc9WI.d.mts +626 -0
- package/dist/index.d.mts +102 -576
- package/dist/index.mjs +174 -252
- package/dist/plugin/capabilities.d.mts +2 -794
- package/dist/plugin/capabilities.mjs +15 -3
- package/dist/presets.d.mts +211 -0
- package/dist/presets.mjs +401 -0
- package/package.json +25 -19
|
@@ -0,0 +1,626 @@
|
|
|
1
|
+
import { Ht as TeamEntry, Tt as PagesConfig, h as CapabilityKey } from "./index-BD9zG_5Z.mjs";
|
|
2
|
+
import { LogLevel } from "@theholocron/observability/core";
|
|
3
|
+
/** Structured-logging config. The Axiom **token** never lives here — only in
|
|
4
|
+
* env vars or the OS keyring — but the non-secret dataset name may. */
|
|
5
|
+
interface LogConfig {
|
|
6
|
+
/**
|
|
7
|
+
* Default log level. The lowest-priority level source: `--verbose` /
|
|
8
|
+
* `--quiet` and `HOLOCRON_LOG_LEVEL` both outrank it.
|
|
9
|
+
*/
|
|
10
|
+
level?: LogLevel;
|
|
11
|
+
/**
|
|
12
|
+
* Axiom log-shipping. Set `axiom.dataset` to opt local runs into Axiom
|
|
13
|
+
* without exporting `HOLOCRON_AXIOM_DATASET` — the CLI then pairs it with
|
|
14
|
+
* the token from `HOLOCRON_AXIOM_TOKEN` / `AXIOM_TOKEN` or the OS keyring
|
|
15
|
+
* (`holocron auth set axiom[.<org>] <TOKEN>`). Env vars still win. In CI,
|
|
16
|
+
* prefer the `HOLOCRON_AXIOM_DATASET` variable.
|
|
17
|
+
*/
|
|
18
|
+
axiom?: {
|
|
19
|
+
/** Target Axiom dataset, e.g. `"holocron-local"`. */
|
|
20
|
+
dataset?: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* CLI self-telemetry config — the committed, reviewable override layer over the
|
|
25
|
+
* env-var + shipped-fallback activation (ADR-0007 / ADR-0008). No secret lives
|
|
26
|
+
* here; the Sentry DSN and PostHog key come from env vars or ship as fallbacks.
|
|
27
|
+
*
|
|
28
|
+
* Precedence: `HOLOCRON_TELEMETRY=false` (env) → `telemetry.enabled` (this) →
|
|
29
|
+
* default on. `enabled` never *re-enables* what the env var turned off.
|
|
30
|
+
*/
|
|
31
|
+
interface TelemetryConfig {
|
|
32
|
+
/**
|
|
33
|
+
* Repo-level opt-out — the committed peer of `HOLOCRON_TELEMETRY=false`.
|
|
34
|
+
* `false` installs the no-op sinks for the whole run. Default on.
|
|
35
|
+
*/
|
|
36
|
+
enabled?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Usage-analytics provider. `"none"` disables PostHog usage analytics while
|
|
39
|
+
* leaving error reporting (Sentry) untouched. Default `"posthog"`.
|
|
40
|
+
*/
|
|
41
|
+
analytics?: "posthog" | "none";
|
|
42
|
+
}
|
|
43
|
+
type ProviderOptions = Record<string, unknown>;
|
|
44
|
+
/**
|
|
45
|
+
* The shape a capability config package's default export must satisfy.
|
|
46
|
+
* Config packages let teams share a pre-bundled provider + options across
|
|
47
|
+
* repos (Level 1 of the shareable-configs story, issue #75).
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* // @acme/holocron-vault/index.ts
|
|
51
|
+
* import type { CapabilityConfigPackage } from '@theholocron/cli'
|
|
52
|
+
* export default {
|
|
53
|
+
* provider: '1password',
|
|
54
|
+
* options: { vault: 'acme-app' },
|
|
55
|
+
* } satisfies CapabilityConfigPackage
|
|
56
|
+
*/
|
|
57
|
+
interface CapabilityConfigPackage {
|
|
58
|
+
provider: string;
|
|
59
|
+
options?: ProviderOptions;
|
|
60
|
+
}
|
|
61
|
+
type SingleEntry = string | [provider: string, options: ProviderOptions];
|
|
62
|
+
type MultiEntry = Array<string | [provider: string, options: ProviderOptions]>;
|
|
63
|
+
type RawProviderEntry = SingleEntry | MultiEntry;
|
|
64
|
+
type RawProvidersConfig = Partial<Record<CapabilityKey, RawProviderEntry>>;
|
|
65
|
+
type RepoProtection = "balanced" | "strict" | "none";
|
|
66
|
+
/**
|
|
67
|
+
* Raw `docs` config as written by the user. `build` is optional so the
|
|
68
|
+
* field can be declared without committing to a build type yet; setup
|
|
69
|
+
* will error if `docs` is present but `build` is absent.
|
|
70
|
+
*/
|
|
71
|
+
interface DocsConfig {
|
|
72
|
+
/**
|
|
73
|
+
* GitHub Pages build source.
|
|
74
|
+
* "workflow" → GitHub Actions (PUT { build_type: "workflow" })
|
|
75
|
+
* "branch" → classic gh-pages branch (PUT { build_type: "legacy", source: { branch: "gh-pages", path: "/" } })
|
|
76
|
+
* When absent, Pages is not managed by `holocron repo setup`.
|
|
77
|
+
*/
|
|
78
|
+
build?: "workflow" | "branch";
|
|
79
|
+
/**
|
|
80
|
+
* Custom domain / CNAME (e.g. "docs.theholocron.dev").
|
|
81
|
+
* When set and `homepage` is not explicitly provided, setup derives
|
|
82
|
+
* `homepage` as `https://{domain}/` for package.json and the repo website field.
|
|
83
|
+
*/
|
|
84
|
+
domain?: string;
|
|
85
|
+
/** Enforce HTTPS. Only effective once the custom domain is DNS-verified. */
|
|
86
|
+
https?: boolean;
|
|
87
|
+
}
|
|
88
|
+
interface RepoProperties {
|
|
89
|
+
lifecycle?: "active" | "experimental" | "deprecated";
|
|
90
|
+
open_source?: boolean;
|
|
91
|
+
runtime_environment?: "node" | "browser" | "universal" | "none";
|
|
92
|
+
uses_external_packages?: boolean;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* GitHub Actions variables, declared so a workflow that reads `vars.NAME` finds it. Values are plain text, so
|
|
96
|
+
* never put a secret here; secrets go through the `secrets` capability.
|
|
97
|
+
*/
|
|
98
|
+
interface RepoVariables {
|
|
99
|
+
/** Repository-level variables. */
|
|
100
|
+
repo?: Record<string, string>;
|
|
101
|
+
/**
|
|
102
|
+
* Organization-level variables. A bare string is visible to every repository; `visibility: "private"` limits it
|
|
103
|
+
* to private ones. Declare these in one repo only (the one that owns the org's configuration).
|
|
104
|
+
*/
|
|
105
|
+
org?: Record<string, string | {
|
|
106
|
+
value: string;
|
|
107
|
+
visibility?: "all" | "private";
|
|
108
|
+
}>;
|
|
109
|
+
/** Delete variables that exist but are not declared here. Off by default: they are left alone. */
|
|
110
|
+
prune?: boolean;
|
|
111
|
+
}
|
|
112
|
+
interface RepoConfig {
|
|
113
|
+
/** "owner/name" — the GitHub repository coordinate. Derived from the git remote when absent. */
|
|
114
|
+
name?: string;
|
|
115
|
+
/**
|
|
116
|
+
* GitHub's repo-level default branch (`HEAD`) — what a fresh clone checks
|
|
117
|
+
* out, what `gh pr create`/the compare UI target by default, and what
|
|
118
|
+
* Sentinel's `validateConfig()` reads (D6: the App only ever reads config
|
|
119
|
+
* from the repo's default branch, never a PR ref, as a security boundary
|
|
120
|
+
* — never widen that to read PR branches instead of fixing this field).
|
|
121
|
+
* Synced by `holocron repo setup`. Omit to leave GitHub's current setting
|
|
122
|
+
* untouched — most repos never need this. Exists for a repo using a
|
|
123
|
+
* `main`/`alpha` prerelease-channel split (CLAUDE.md's Releases section)
|
|
124
|
+
* where active development happens on a non-`main` branch: set this to
|
|
125
|
+
* that branch so Sentinel validates against what's actually being
|
|
126
|
+
* developed, then change it back once that branch merges to `main` for a
|
|
127
|
+
* stable cut and stops being the active branch.
|
|
128
|
+
*/
|
|
129
|
+
defaultBranch?: string;
|
|
130
|
+
/**
|
|
131
|
+
* Branch protection preset applied by `holocron repo setup`. When omitted,
|
|
132
|
+
* no protection is applied and no `branch_protection_level` property is set.
|
|
133
|
+
* Required-status-check contexts for `"strict"` are derived from the task
|
|
134
|
+
* manifest — `{ required: true }` tasks + top-level `extraRequiredChecks`
|
|
135
|
+
* (see `astromech.requiredChecks()`).
|
|
136
|
+
*/
|
|
137
|
+
protection?: RepoProtection;
|
|
138
|
+
/**
|
|
139
|
+
* GitHub teams granted repository access. Synced by `holocron repo setup`, which
|
|
140
|
+
* also writes `.github/CODEOWNERS` for teams with write-or-higher permission.
|
|
141
|
+
* String shorthand defaults to `push` (Write).
|
|
142
|
+
*/
|
|
143
|
+
teams?: TeamEntry[];
|
|
144
|
+
/** GitHub topics set on the repository. */
|
|
145
|
+
topics?: string[];
|
|
146
|
+
/** GitHub custom properties synced to the org dashboard. */
|
|
147
|
+
properties?: RepoProperties;
|
|
148
|
+
/** GitHub Actions variables reconciled by `holocron repo setup`. */
|
|
149
|
+
variables?: RepoVariables;
|
|
150
|
+
}
|
|
151
|
+
interface AppConfig {
|
|
152
|
+
name: string;
|
|
153
|
+
path: string;
|
|
154
|
+
kind?: string;
|
|
155
|
+
}
|
|
156
|
+
interface DoctorConfig {
|
|
157
|
+
checks?: string[];
|
|
158
|
+
}
|
|
159
|
+
interface EnvConfig {
|
|
160
|
+
/**
|
|
161
|
+
* Namespace prefixes used by this project's env vars.
|
|
162
|
+
* Listed from least- to most-specific (cascade model — last wins).
|
|
163
|
+
* Tooling reads this to generate `.env.example`, validate required
|
|
164
|
+
* vars, and produce documentation.
|
|
165
|
+
*
|
|
166
|
+
* @example
|
|
167
|
+
* // Project-only prefix
|
|
168
|
+
* namespaces: ["CLI_TEMPLATE"]
|
|
169
|
+
*
|
|
170
|
+
* // Org-wide defaults + project-specific overrides
|
|
171
|
+
* namespaces: ["HOLOCRON", "MY_CLI"]
|
|
172
|
+
*/
|
|
173
|
+
namespaces?: string[];
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* A single Chromatic project entry in a `verification.visualRegression`
|
|
177
|
+
* task's `chromatic-projects` config.
|
|
178
|
+
* Each entry produces one matrix job in CI, publishing to a separate Chromatic project.
|
|
179
|
+
*
|
|
180
|
+
* The `tokenName` maps to a repository secret named `CHROMATIC_PROJECT_TOKEN_<TOKENNAME>`.
|
|
181
|
+
* Additional fields correspond to chromaui/action inputs and are passed through directly.
|
|
182
|
+
*
|
|
183
|
+
* @see https://www.chromatic.com/docs/monorepos/
|
|
184
|
+
*/
|
|
185
|
+
interface ChromaticProjectConfig {
|
|
186
|
+
/**
|
|
187
|
+
* Secret suffix. The CI job reads `CHROMATIC_PROJECT_TOKEN_<tokenName>`.
|
|
188
|
+
* Must be uppercase (e.g. `"WEB"`, `"UI"`).
|
|
189
|
+
*/
|
|
190
|
+
tokenName: string;
|
|
191
|
+
/**
|
|
192
|
+
* Path to run the Chromatic build from, relative to the repo root.
|
|
193
|
+
* Typically the package directory (e.g. `"apps/web"`, `"packages/ui"`).
|
|
194
|
+
*/
|
|
195
|
+
workingDir: string;
|
|
196
|
+
/**
|
|
197
|
+
* Script name to build Storybook. Defaults to `"build:storybook"`.
|
|
198
|
+
* Must accept `--output-dir` pass-through (use `turbo run … --` at root).
|
|
199
|
+
*/
|
|
200
|
+
buildScript?: string;
|
|
201
|
+
/**
|
|
202
|
+
* Path to the Storybook folder relative to `workingDir`, for TurboSnap.
|
|
203
|
+
* Tells Chromatic where to find `.storybook/` when the Storybook config
|
|
204
|
+
* is in a subdirectory. Corresponds to `--storybook-base-dir`.
|
|
205
|
+
*/
|
|
206
|
+
storybookBaseDir?: string;
|
|
207
|
+
/**
|
|
208
|
+
* Glob patterns of files/dirs that should NOT trigger a TurboSnap bailout
|
|
209
|
+
* when changed. Useful for ignoring non-UI changes in a monorepo
|
|
210
|
+
* (e.g. `"./packages/!(ui)/**"` to focus TurboSnap on the UI package).
|
|
211
|
+
* Corresponds to `--untraced`. Accepts a single glob string or array.
|
|
212
|
+
*/
|
|
213
|
+
untraced?: string | string[];
|
|
214
|
+
/**
|
|
215
|
+
* Glob patterns matching story files to snapshot. When set, only matching
|
|
216
|
+
* stories are captured. Corresponds to `--only-story-files`.
|
|
217
|
+
* Cannot be combined with `onlyStoryNames`.
|
|
218
|
+
*/
|
|
219
|
+
onlyStoryFiles?: string;
|
|
220
|
+
/**
|
|
221
|
+
* Exit with code 0 even when visual changes are detected.
|
|
222
|
+
* Useful during initial setup before baselines are approved.
|
|
223
|
+
* Corresponds to `--exit-zero-on-changes`.
|
|
224
|
+
*/
|
|
225
|
+
exitZeroOnChanges?: boolean;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* A single Storybook app in a deploy workflow config.
|
|
229
|
+
* `name` becomes the sandbox sub-path (`_site/sandbox/<name>/`).
|
|
230
|
+
* `path` is the working directory relative to the repo root; defaults to `"."` (repo root) when omitted.
|
|
231
|
+
*/
|
|
232
|
+
interface StorybookDeployProject {
|
|
233
|
+
name?: string;
|
|
234
|
+
path?: string;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Typed `with:` inputs for reusable workflows.
|
|
238
|
+
*
|
|
239
|
+
* `chromatic-projects` (on the `verification.visualRegression` task) takes a
|
|
240
|
+
* `ChromaticProjectConfig[]` directly; each entry's `untraced` glob list may
|
|
241
|
+
* be authored as an array and is newline-joined for you.
|
|
242
|
+
*
|
|
243
|
+
* `docs` / `storybook` are high-level deploy shorthand that `holocron repo setup`
|
|
244
|
+
* translates to `type` / `storybook-projects` before writing the thin caller.
|
|
245
|
+
* They also drive automatic `paths:` derivation so you never need to write
|
|
246
|
+
* `paths:` manually for deploy entries.
|
|
247
|
+
*/
|
|
248
|
+
type WorkflowWithConfig = Record<string, unknown> & {
|
|
249
|
+
"chromatic-projects"?: ChromaticProjectConfig[];
|
|
250
|
+
/**
|
|
251
|
+
* Docs deployment shorthand. `true` uses the org-standard `docs/` directory;
|
|
252
|
+
* `{ path: "custom" }` uses a custom directory. Both derive a `paths:` entry automatically.
|
|
253
|
+
*/
|
|
254
|
+
docs?: true | {
|
|
255
|
+
path: string;
|
|
256
|
+
};
|
|
257
|
+
/** Storybook apps to deploy alongside docs. Each entry's `path` is appended to `paths:`. */
|
|
258
|
+
storybook?: StorybookDeployProject[];
|
|
259
|
+
};
|
|
260
|
+
/**
|
|
261
|
+
* A `tasks` manifest entry in object form. A bare string entry is shorthand
|
|
262
|
+
* for `{ name, ci: true, local: true }`.
|
|
263
|
+
*/
|
|
264
|
+
interface TaskEntryConfig {
|
|
265
|
+
name: string;
|
|
266
|
+
with?: WorkflowWithConfig;
|
|
267
|
+
paths?: string[];
|
|
268
|
+
linters?: string[];
|
|
269
|
+
/** Emit a `.github/workflows/<name>.yml` thin caller + include in `holocron run ci`. Default `true`. */
|
|
270
|
+
ci?: boolean;
|
|
271
|
+
/** Write a `package.json` script + let `holocron run <name>` resolve the task. Default `true`. */
|
|
272
|
+
local?: boolean;
|
|
273
|
+
/** The task's CI check context is a required status check + part of `holocron run ci`'s default run. */
|
|
274
|
+
required?: boolean;
|
|
275
|
+
/**
|
|
276
|
+
* Per-repo additions to this task's generated `turbo.json` entry —
|
|
277
|
+
* a separate channel from `with:` (that's the reusable *workflow's*
|
|
278
|
+
* inputs; this is local turbo cache config, unrelated). No-op for a
|
|
279
|
+
* task with no turbo fan-out config in the registry. Mirrors
|
|
280
|
+
* astromech's own `TaskEntry["turbo"]` — kept in sync by hand, since
|
|
281
|
+
* this package doesn't depend on astromech directly.
|
|
282
|
+
*/
|
|
283
|
+
turbo?: {
|
|
284
|
+
/** Extra env vars turbo hashes into this task's cache key, appended to the registry default. */
|
|
285
|
+
passThroughEnv?: string[];
|
|
286
|
+
/**
|
|
287
|
+
* Extra input globs appended to the registry default's `inputs`
|
|
288
|
+
* (holocron#845) — for a package whose layout the registry
|
|
289
|
+
* default doesn't cover (e.g. a flat-layout package with no
|
|
290
|
+
* `src/` directory at all).
|
|
291
|
+
*/
|
|
292
|
+
inputs?: string[];
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
interface HolocronConfig {
|
|
296
|
+
/** Project name. Derived from package.json when absent. */
|
|
297
|
+
name?: string;
|
|
298
|
+
description?: string;
|
|
299
|
+
/** Project homepage URL. Synced to package.json#homepage and the GitHub repo's website field by `holocron repo sync`. */
|
|
300
|
+
homepage?: string;
|
|
301
|
+
/**
|
|
302
|
+
* Active org name for namespaced keyring lookup. When set, token resolution
|
|
303
|
+
* tries `<service>.<org>` before the unnamespaced `<service>` fallback, so
|
|
304
|
+
* a single machine can hold credentials for multiple GitHub orgs without
|
|
305
|
+
* collision. Overridden by `--org` CLI flag or `HOLOCRON_ORG` env var.
|
|
306
|
+
*/
|
|
307
|
+
org?: string;
|
|
308
|
+
/**
|
|
309
|
+
* Org canonical domain (e.g. `"theholocron.dev"`). Subdomains are derived
|
|
310
|
+
* from this — `preview: true` on a deploy workflow resolves the preview base
|
|
311
|
+
* domain as `preview.<domain>`, giving URLs like `<repo>-pr-<n>.<domain>`.
|
|
312
|
+
*/
|
|
313
|
+
domain?: string;
|
|
314
|
+
/**
|
|
315
|
+
* Repository identity and metadata. When set, `PluginLoader` injects
|
|
316
|
+
* `repo.name` into every plugin's `RuntimeContext.repo` so plugins that
|
|
317
|
+
* need a repo (github, etc.) don't require `--repo` on every invocation.
|
|
318
|
+
* `--repo` on the command line still overrides.
|
|
319
|
+
*/
|
|
320
|
+
repo?: RepoConfig;
|
|
321
|
+
/**
|
|
322
|
+
* The task manifest — what this repo runs. Each entry is a task name
|
|
323
|
+
* (backed by a reusable workflow in `theholocron/.github`), or the object
|
|
324
|
+
* form to pass `with:` inputs. `@theholocron/astromech` reads this as the
|
|
325
|
+
* single source for `holocron run` / `holocron run ci` / the generated CI
|
|
326
|
+
* workflows / `package.json` scripts.
|
|
327
|
+
*
|
|
328
|
+
* Supported values (intent-facing vocabulary — epic #672, D3):
|
|
329
|
+
* "verification.unitTests" | "verification.visualRegression" | "verification.typeSafety" | "verification.performance" |
|
|
330
|
+
* "sourceQuality.staticAnalysis" | "sourceQuality.formatting" |
|
|
331
|
+
* "sourceQuality.structuredDataValidation" | "sourceQuality.deadCodeAnalysis" |
|
|
332
|
+
* "security.secretDetection" | "security.codeScanning" |
|
|
333
|
+
* "delivery.build" | "delivery.publish" | "delivery.deploy" | "delivery.bundleSize" |
|
|
334
|
+
* "platform.repoSync" | "platform.notifyCheck" | "platform.commitStandards" | "platform.repoValidation" |
|
|
335
|
+
* "knowledge.wiki" | "knowledge.docs" | "knowledge.components" |
|
|
336
|
+
* "review" | "tag" | "stale" | "greetings" | "dependencies" | "bookkeeping"
|
|
337
|
+
*
|
|
338
|
+
* `holocron repo setup` writes `.github/workflows/<name>.yml` for each entry,
|
|
339
|
+
* calling the corresponding reusable workflow in `theholocron/.github`.
|
|
340
|
+
* Files are overwritten on each run — they are generated artifacts.
|
|
341
|
+
*
|
|
342
|
+
* ### delivery.deploy / knowledge.docs / knowledge.components
|
|
343
|
+
* `delivery.deploy` uses `docs` and/or `storybook` in `with:` — setup
|
|
344
|
+
* derives `paths:` automatically. `docs: true` uses the org-standard
|
|
345
|
+
* `docs/` directory; `docs: { path: "custom" }` overrides it.
|
|
346
|
+
* `knowledge.docs` / `knowledge.components` are the same underlying
|
|
347
|
+
* mechanism, each dedicated to exactly one type — they imply the
|
|
348
|
+
* corresponding shorthand, so a repo using them never has to spell out
|
|
349
|
+
* `docs: true` / `storybook: […]` itself.
|
|
350
|
+
*
|
|
351
|
+
* ```ts
|
|
352
|
+
* // Docs only (standard layout)
|
|
353
|
+
* { name: "delivery.deploy", with: { docs: true } }
|
|
354
|
+
* // …or equivalently, the dedicated task:
|
|
355
|
+
* "knowledge.docs"
|
|
356
|
+
*
|
|
357
|
+
* // Docs + monorepo storybooks
|
|
358
|
+
* {
|
|
359
|
+
* name: "delivery.deploy",
|
|
360
|
+
* with: {
|
|
361
|
+
* docs: true,
|
|
362
|
+
* storybook: [
|
|
363
|
+
* { name: "web", path: "apps/web" },
|
|
364
|
+
* { name: "ui", path: "packages/ui" },
|
|
365
|
+
* ],
|
|
366
|
+
* },
|
|
367
|
+
* }
|
|
368
|
+
*
|
|
369
|
+
* // Non-standard docs location
|
|
370
|
+
* { name: "delivery.deploy", with: { docs: { path: "packages/site" } } }
|
|
371
|
+
* ```
|
|
372
|
+
*
|
|
373
|
+
* ### verification.visualRegression
|
|
374
|
+
* Its own task, not a `verification.unitTests` sub-job (holocron#394/#1062)
|
|
375
|
+
* — GitHub evaluates a job's `if:` before expanding its `strategy.matrix`,
|
|
376
|
+
* so no `chromatic-projects` default can make a *disabled* Chromatic job
|
|
377
|
+
* disappear from PR checks; only not generating the job at all does. Omit
|
|
378
|
+
* this task entirely for a repo that doesn't use Chromatic — no workflow,
|
|
379
|
+
* no job, no check, not even a skipped one.
|
|
380
|
+
*
|
|
381
|
+
* For a single-project repo, use a `CHROMATIC_PROJECT_TOKEN` repository
|
|
382
|
+
* secret with `tokenName: "default"`:
|
|
383
|
+
* ```ts
|
|
384
|
+
* {
|
|
385
|
+
* name: "verification.visualRegression",
|
|
386
|
+
* with: { "chromatic-projects": [{ tokenName: "default", workingDir: "." }] },
|
|
387
|
+
* }
|
|
388
|
+
* ```
|
|
389
|
+
*
|
|
390
|
+
* For monorepos with multiple Storybooks, list one entry per project:
|
|
391
|
+
* ```ts
|
|
392
|
+
* {
|
|
393
|
+
* name: "verification.visualRegression",
|
|
394
|
+
* with: {
|
|
395
|
+
* "chromatic-projects": [
|
|
396
|
+
* { tokenName: "WEB", workingDir: "apps/web" },
|
|
397
|
+
* { tokenName: "UI", workingDir: "packages/ui" },
|
|
398
|
+
* ],
|
|
399
|
+
* },
|
|
400
|
+
* }
|
|
401
|
+
* ```
|
|
402
|
+
* Each `tokenName` maps to a repository secret named
|
|
403
|
+
* `CHROMATIC_PROJECT_TOKEN_<TOKENNAME>`.
|
|
404
|
+
*
|
|
405
|
+
* @example
|
|
406
|
+
* ["sourceQuality.staticAnalysis", { "name": "delivery.publish", "with": { "run-build": false } }]
|
|
407
|
+
* { "name": "delivery.deploy", "with": { "docs": true } }
|
|
408
|
+
*/
|
|
409
|
+
tasks?: Array<string | TaskEntryConfig>;
|
|
410
|
+
/**
|
|
411
|
+
* Opt out of `holocron repo sync`'s `package.json` script writes. Default `true`.
|
|
412
|
+
*/
|
|
413
|
+
syncScripts?: boolean;
|
|
414
|
+
/**
|
|
415
|
+
* The command the synced `"holocron"` `package.json` script runs. Default
|
|
416
|
+
* `"holocron"` (the installed bin). This repo overrides it to run its own
|
|
417
|
+
* build (`"node cli/cli/dist/cli.mjs"`).
|
|
418
|
+
*/
|
|
419
|
+
holocronScript?: string;
|
|
420
|
+
/**
|
|
421
|
+
* Required status-check contexts not backed by a `required` task (codecov
|
|
422
|
+
* gates, the bundle-build check, …). `holocron repo setup` appends these to the
|
|
423
|
+
* task-derived list from `astromech.requiredChecks()`.
|
|
424
|
+
*/
|
|
425
|
+
extraRequiredChecks?: string[];
|
|
426
|
+
/**
|
|
427
|
+
* Git hooks `holocron repo setup` installs. `true` / `{ prePush: true }` writes
|
|
428
|
+
* `.husky/pre-push` (runs `holocron run ci` before every push); `false` /
|
|
429
|
+
* `{ prePush: false }` opts out. Omitted → on for `protection: "strict"`,
|
|
430
|
+
* off otherwise. `--hooks` / `--no-hooks` on `holocron repo setup` override.
|
|
431
|
+
*/
|
|
432
|
+
hooks?: boolean | {
|
|
433
|
+
prePush?: boolean;
|
|
434
|
+
};
|
|
435
|
+
providers: RawProvidersConfig;
|
|
436
|
+
apps?: AppConfig[];
|
|
437
|
+
doctor?: DoctorConfig;
|
|
438
|
+
/**
|
|
439
|
+
* Agent runtime that determines where skills are installed by `holocron repo setup`.
|
|
440
|
+
* Skills are installed to `.agents/skills/<name>/` (canonical) with a
|
|
441
|
+
* relative symlink at the agent-specific path:
|
|
442
|
+
* - `"claude"` → `.claude/skills/<name>` → `../../.agents/skills/<name>`
|
|
443
|
+
* - `"codex"` | `"gemini"` → logged as unsupported; skipped gracefully.
|
|
444
|
+
*/
|
|
445
|
+
agent?: "claude" | "codex" | "gemini";
|
|
446
|
+
/**
|
|
447
|
+
* Skill names from `@theholocron/skills` to install during `holocron repo setup`.
|
|
448
|
+
* Installed paths are gitignored and managed by setup — do not commit them.
|
|
449
|
+
*
|
|
450
|
+
* @example
|
|
451
|
+
* ["git-safety", "pr-workflow", "commit-standards"]
|
|
452
|
+
*/
|
|
453
|
+
skills?: string[];
|
|
454
|
+
/**
|
|
455
|
+
* GitHub Pages configuration. When present, `holocron repo setup` calls the
|
|
456
|
+
* Pages API using `HOLOCRON_DEPLOY_TOKEN` (requires `pages:write` + `repo` scope).
|
|
457
|
+
* When absent, Pages is left as-is.
|
|
458
|
+
*
|
|
459
|
+
* @example
|
|
460
|
+
* { build: "workflow", domain: "docs.theholocron.dev", https: true }
|
|
461
|
+
*/
|
|
462
|
+
docs?: DocsConfig;
|
|
463
|
+
/**
|
|
464
|
+
* Environment variable namespace configuration.
|
|
465
|
+
* Declares the prefix(es) this project uses for its env vars so that
|
|
466
|
+
* tooling can generate `.env.example`, validate required vars, and
|
|
467
|
+
* produce accurate documentation without hard-coding prefix strings.
|
|
468
|
+
*
|
|
469
|
+
* @example
|
|
470
|
+
* { namespaces: ["HOLOCRON", "MY_CLI"] }
|
|
471
|
+
*/
|
|
472
|
+
env?: EnvConfig;
|
|
473
|
+
/**
|
|
474
|
+
* Structured-logging config. Only the level belongs here — Axiom
|
|
475
|
+
* credentials come from env vars, never a committed file.
|
|
476
|
+
*
|
|
477
|
+
* @example
|
|
478
|
+
* { level: "debug" }
|
|
479
|
+
*/
|
|
480
|
+
log?: LogConfig;
|
|
481
|
+
/**
|
|
482
|
+
* CLI self-telemetry override layer. Env var (`HOLOCRON_TELEMETRY=false`)
|
|
483
|
+
* still wins; this is the committed way to opt a repo out or drop usage
|
|
484
|
+
* analytics while keeping error reporting.
|
|
485
|
+
*
|
|
486
|
+
* @example
|
|
487
|
+
* { enabled: false }
|
|
488
|
+
* { analytics: "none" }
|
|
489
|
+
*/
|
|
490
|
+
telemetry?: TelemetryConfig;
|
|
491
|
+
/**
|
|
492
|
+
* ESLint bundle option overrides that Sentinel's centralized static-
|
|
493
|
+
* analysis check (holocron#849) can't otherwise see. Bucket 1 checks
|
|
494
|
+
* never read a PR's own committed files for config — this is the
|
|
495
|
+
* declared source of truth Sentinel reads instead, so its check stays
|
|
496
|
+
* in sync with what each package's own `eslint.config.ts` already
|
|
497
|
+
* enforces locally and in CI.
|
|
498
|
+
*/
|
|
499
|
+
eslint?: EslintConfig;
|
|
500
|
+
}
|
|
501
|
+
/**
|
|
502
|
+
* Repo-root-relative directories treated as browser-targeted for eslint's
|
|
503
|
+
* node-builtins compatibility checks — mirrors
|
|
504
|
+
* `@theholocron/eslint-config`'s `library({ browserPackages })` option.
|
|
505
|
+
* Only needed for a package whose own `eslint.config.ts` already declares
|
|
506
|
+
* `browserPackages` (a deliberate outlier, not the norm — see that
|
|
507
|
+
* package's own config file for why).
|
|
508
|
+
*
|
|
509
|
+
* @example
|
|
510
|
+
* { browserPackages: ["packages/github-client/src/app-auth"] }
|
|
511
|
+
*/
|
|
512
|
+
interface EslintConfig {
|
|
513
|
+
browserPackages?: string[];
|
|
514
|
+
}
|
|
515
|
+
interface ResolvedTuple {
|
|
516
|
+
provider: string;
|
|
517
|
+
/** Resolved package name (`@theholocron/holocron-plugin-<provider>` for short refs). */
|
|
518
|
+
packageName: string;
|
|
519
|
+
options: ProviderOptions;
|
|
520
|
+
}
|
|
521
|
+
type ResolvedProviderEntry = {
|
|
522
|
+
cardinality: "single";
|
|
523
|
+
tuple: ResolvedTuple;
|
|
524
|
+
} | {
|
|
525
|
+
cardinality: "many";
|
|
526
|
+
tuples: ResolvedTuple[];
|
|
527
|
+
};
|
|
528
|
+
type ResolvedProvidersConfig = Partial<Record<CapabilityKey, ResolvedProviderEntry>>;
|
|
529
|
+
interface ResolvedHolocronConfig {
|
|
530
|
+
name: string;
|
|
531
|
+
description?: string;
|
|
532
|
+
homepage?: string;
|
|
533
|
+
org?: string;
|
|
534
|
+
domain?: string;
|
|
535
|
+
repo?: RepoConfig;
|
|
536
|
+
tasks?: Array<string | TaskEntryConfig>;
|
|
537
|
+
syncScripts?: boolean;
|
|
538
|
+
holocronScript?: string;
|
|
539
|
+
extraRequiredChecks?: string[];
|
|
540
|
+
hooks?: boolean | {
|
|
541
|
+
prePush?: boolean;
|
|
542
|
+
};
|
|
543
|
+
providers: ResolvedProvidersConfig;
|
|
544
|
+
apps: AppConfig[];
|
|
545
|
+
doctor: DoctorConfig;
|
|
546
|
+
agent?: "claude" | "codex" | "gemini";
|
|
547
|
+
skills?: string[];
|
|
548
|
+
/** Resolved Pages config. `build` is guaranteed present when this field exists. */
|
|
549
|
+
docs?: PagesConfig;
|
|
550
|
+
env?: EnvConfig;
|
|
551
|
+
log?: LogConfig;
|
|
552
|
+
telemetry?: TelemetryConfig;
|
|
553
|
+
eslint?: EslintConfig;
|
|
554
|
+
}
|
|
555
|
+
declare class ConfigError extends Error {
|
|
556
|
+
name: string;
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* Resolve `"github"` → `"@theholocron/holocron-plugin-github"`.
|
|
560
|
+
* Fully-qualified names (scoped or not) are honored verbatim, which
|
|
561
|
+
* is how third-party plugins published outside the org work.
|
|
562
|
+
*/
|
|
563
|
+
declare function resolvePluginPackage(provider: string): string;
|
|
564
|
+
declare function resolveEntry(key: CapabilityKey, raw: RawProviderEntry): ResolvedProviderEntry;
|
|
565
|
+
declare function resolveConfig(raw: HolocronConfig): ResolvedHolocronConfig;
|
|
566
|
+
type TaskEntry = NonNullable<HolocronConfig["tasks"]>[number];
|
|
567
|
+
/** A single composable capability fragment. */
|
|
568
|
+
interface Capability {
|
|
569
|
+
/** Unique identifier — used for deduplication and dependency resolution. */
|
|
570
|
+
id: string;
|
|
571
|
+
/** Other capability IDs that must be present in the same compose() call. */
|
|
572
|
+
requires?: string[];
|
|
573
|
+
/** Task entries contributed by this capability. Merged by name; last writer wins. */
|
|
574
|
+
tasks?: TaskEntry[];
|
|
575
|
+
/** Provider config. Shallow-merged at the top level; later capabilities override per-key. */
|
|
576
|
+
providers?: RawProvidersConfig;
|
|
577
|
+
/**
|
|
578
|
+
* Required status-check contexts **not** backed by a `required` task
|
|
579
|
+
* (codecov gates, `Storybook Publish`, …). Unioned across all capabilities
|
|
580
|
+
* onto the top-level `extraRequiredChecks`. Task-backed checks come from
|
|
581
|
+
* `{ required: true }` task entries via `astromech.requiredChecks()`.
|
|
582
|
+
*/
|
|
583
|
+
extraRequiredChecks?: string[];
|
|
584
|
+
/** Repo config fragment. Scalar fields: last writer wins. properties/topics/teams: merged. */
|
|
585
|
+
repo?: Partial<Omit<RepoConfig, "name">>;
|
|
586
|
+
/** Org name. Last writer wins. */
|
|
587
|
+
org?: string;
|
|
588
|
+
/** Org canonical domain. Last writer wins. */
|
|
589
|
+
domain?: string;
|
|
590
|
+
/** Docs site config. Last writer wins. */
|
|
591
|
+
docs?: DocsConfig;
|
|
592
|
+
}
|
|
593
|
+
/** The merged result of a compose() call. Spreads into defineConfig(). */
|
|
594
|
+
interface ComposedPreset {
|
|
595
|
+
tasks: TaskEntry[];
|
|
596
|
+
providers: RawProvidersConfig;
|
|
597
|
+
repo: Partial<Omit<RepoConfig, "name">>;
|
|
598
|
+
/** Non-task required-check contexts, unioned across capabilities. */
|
|
599
|
+
extraRequiredChecks: string[];
|
|
600
|
+
org?: string;
|
|
601
|
+
domain?: string;
|
|
602
|
+
docs?: DocsConfig;
|
|
603
|
+
}
|
|
604
|
+
/**
|
|
605
|
+
* Merge any number of capability fragments into a single preset object that
|
|
606
|
+
* spreads directly into `defineConfig()`.
|
|
607
|
+
*
|
|
608
|
+
* - Accepts individual capabilities or nested arrays (for bundle presets).
|
|
609
|
+
* - Deduplicates by `id` — when the same ID appears more than once, the last
|
|
610
|
+
* occurrence wins. This lets callers override bundle defaults by listing an
|
|
611
|
+
* explicit capability after the bundle.
|
|
612
|
+
* - Validates all `requires` at call time and throws `ConfigError` if any are
|
|
613
|
+
* unmet, listing every missing dependency in a single message.
|
|
614
|
+
*
|
|
615
|
+
* @example
|
|
616
|
+
* // docs-only site — no typecheck
|
|
617
|
+
* const preset = compose(node(), docs());
|
|
618
|
+
*
|
|
619
|
+
* // library with docs
|
|
620
|
+
* const preset = compose(node(), typecheck(), docs());
|
|
621
|
+
*
|
|
622
|
+
* // nextjs() is a bundle that returns Capability[]
|
|
623
|
+
* const preset = compose(node(), nextjs());
|
|
624
|
+
*/
|
|
625
|
+
declare function compose(...args: (Capability | Capability[])[]): ComposedPreset;
|
|
626
|
+
export { SingleEntry as A, RepoProperties as C, ResolvedProviderEntry as D, ResolvedHolocronConfig as E, TaskEntryConfig as M, TelemetryConfig as N, ResolvedProvidersConfig as O, WorkflowWithConfig as P, RepoConfig as S, RepoVariables as T, LogConfig as _, ConfigError as a, RawProviderEntry as b, resolvePluginPackage as c, ChromaticProjectConfig as d, DocsConfig as f, HolocronConfig as g, EslintConfig as h, TaskEntry as i, StorybookDeployProject as j, ResolvedTuple as k, AppConfig as l, EnvConfig as m, Capability as n, resolveConfig as o, DoctorConfig as p, ComposedPreset as r, resolveEntry as s, compose as t, CapabilityConfigPackage as u, MultiEntry as v, RepoProtection as w, RawProvidersConfig as x, ProviderOptions as y };
|