@theholocron/cli 5.0.0-alpha.37 → 5.0.0-alpha.370
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 +514 -105
- package/dist/cli.mjs +22487 -7976
- package/dist/cli.mjs.map +1 -1
- package/dist/config-system-513IhEuT.d.mts +929 -0
- package/dist/config-system-BVYtgrmR.mjs +578 -0
- package/dist/index-DXC-Eco9.d.mts +2815 -0
- package/dist/index.d.mts +345 -599
- package/dist/index.mjs +353 -365
- package/dist/plugin/capabilities.d.mts +2 -807
- package/dist/plugin/capabilities.mjs +53 -4
- package/dist/presets.d.mts +221 -0
- package/dist/presets.mjs +439 -0
- package/package.json +42 -35
|
@@ -0,0 +1,929 @@
|
|
|
1
|
+
import { D as CapabilityKey, On as TeamEntry, an as PagesConfig } from "./index-DXC-Eco9.mjs";
|
|
2
|
+
import { ConfigError as ConfigError$1, ConfigFileError } from "@theholocron/kyber/config";
|
|
3
|
+
import { DocsCoverageMode } from "@theholocron/astromech";
|
|
4
|
+
import { LogLevel } from "@theholocron/observability/core";
|
|
5
|
+
/** Structured-logging config. The Axiom **token** never lives here — only in
|
|
6
|
+
* env vars or the OS keyring — but the non-secret dataset name may. */
|
|
7
|
+
interface LogConfig {
|
|
8
|
+
/**
|
|
9
|
+
* Default log level. The lowest-priority level source: `--verbose` /
|
|
10
|
+
* `--quiet` and `HOLOCRON_LOG_LEVEL` both outrank it.
|
|
11
|
+
*/
|
|
12
|
+
level?: LogLevel;
|
|
13
|
+
/**
|
|
14
|
+
* Axiom log-shipping. The CLI has one dataset for all its environments, told apart by
|
|
15
|
+
* the `env` field on each line, and that dataset normally comes from the
|
|
16
|
+
* `HOLOCRON_AXIOM_DATASET` variable (`holocron`, synced from 1Password) with no config at all.
|
|
17
|
+
* Set `axiom.dataset` only for a repo that keeps its own dataset: the CLI
|
|
18
|
+
* pairs it with the token from `HOLOCRON_AXIOM_TOKEN` / `AXIOM_TOKEN` or the
|
|
19
|
+
* OS keyring (`holocron auth set axiom[.<org>] <TOKEN>`). Env vars still
|
|
20
|
+
* win, and a `global`-context command ignores it.
|
|
21
|
+
*/
|
|
22
|
+
axiom?: {
|
|
23
|
+
/** Target Axiom dataset for this repo, e.g. `"my-repo"`. */
|
|
24
|
+
dataset?: string;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* CLI self-telemetry config — the committed, reviewable override layer over the
|
|
29
|
+
* env-var + shipped-fallback activation (ADR-0007 / ADR-0008). No secret lives
|
|
30
|
+
* here; the Sentry DSN and PostHog key come from env vars or ship as fallbacks.
|
|
31
|
+
*
|
|
32
|
+
* Precedence: `HOLOCRON_TELEMETRY=false` (env) → `telemetry.enabled` (this) →
|
|
33
|
+
* default on. `enabled` never *re-enables* what the env var turned off.
|
|
34
|
+
*/
|
|
35
|
+
interface TelemetryConfig {
|
|
36
|
+
/**
|
|
37
|
+
* Repo-level opt-out — the committed peer of `HOLOCRON_TELEMETRY=false`.
|
|
38
|
+
* `false` installs the no-op sinks for the whole run. Default on.
|
|
39
|
+
*/
|
|
40
|
+
enabled?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Usage-analytics provider. `"none"` disables PostHog usage analytics while
|
|
43
|
+
* leaving error reporting (Sentry) untouched. Default `"posthog"`.
|
|
44
|
+
*/
|
|
45
|
+
analytics?: "posthog" | "none";
|
|
46
|
+
}
|
|
47
|
+
/** Options a provider plugin receives; their shape is the plugin's own. */
|
|
48
|
+
type ProviderOptions = Record<string, unknown>;
|
|
49
|
+
/**
|
|
50
|
+
* The shape a capability config package's default export must satisfy.
|
|
51
|
+
* Config packages let teams share a pre-bundled provider + options across
|
|
52
|
+
* repos (Level 1 of the shareable-configs story, issue #75).
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* // @acme/holocron-vault/index.ts
|
|
56
|
+
* import type { CapabilityConfigPackage } from '@theholocron/cli'
|
|
57
|
+
* export default {
|
|
58
|
+
* provider: '1password',
|
|
59
|
+
* options: { vault: 'acme-app' },
|
|
60
|
+
* } satisfies CapabilityConfigPackage
|
|
61
|
+
*/
|
|
62
|
+
interface CapabilityConfigPackage {
|
|
63
|
+
/** The provider's short name or package. */
|
|
64
|
+
provider: string;
|
|
65
|
+
/** Options passed to the provider. */
|
|
66
|
+
options?: ProviderOptions;
|
|
67
|
+
}
|
|
68
|
+
/** A single provider: a name, or a `[provider, options]` tuple. */
|
|
69
|
+
type SingleEntry = string | [provider: string, options: ProviderOptions];
|
|
70
|
+
/** Several providers: a list of names or `[provider, options]` tuples. */
|
|
71
|
+
type MultiEntry = Array<string | [provider: string, options: ProviderOptions]>;
|
|
72
|
+
/** A capability's provider entry as written in the config. */
|
|
73
|
+
type RawProviderEntry = SingleEntry | MultiEntry;
|
|
74
|
+
/** The `providers` block as written in the config. */
|
|
75
|
+
type RawProvidersConfig = Partial<Record<CapabilityKey, RawProviderEntry>>;
|
|
76
|
+
/** A branch-protection preset: `balanced`, `strict` or `none`. */
|
|
77
|
+
type RepoProtection = "balanced" | "strict" | "none";
|
|
78
|
+
/**
|
|
79
|
+
* Raw `docs` config as written by the user. `build` is optional so the
|
|
80
|
+
* field can be declared without committing to a build type yet; setup
|
|
81
|
+
* will error if `docs` is present but `build` is absent.
|
|
82
|
+
*/
|
|
83
|
+
interface DocsConfig {
|
|
84
|
+
/**
|
|
85
|
+
* GitHub Pages build source.
|
|
86
|
+
* "workflow" → GitHub Actions (PUT { build_type: "workflow" })
|
|
87
|
+
* "branch" → classic gh-pages branch (PUT { build_type: "legacy", source: { branch: "gh-pages", path: "/" } })
|
|
88
|
+
* When absent, Pages is not managed by `holocron repo setup`.
|
|
89
|
+
*/
|
|
90
|
+
build?: "workflow" | "branch";
|
|
91
|
+
/**
|
|
92
|
+
* Custom domain / CNAME (e.g. "docs.theholocron.dev").
|
|
93
|
+
* When set and `homepage` is not explicitly provided, setup derives
|
|
94
|
+
* `homepage` as `https://{domain}/` for package.json and the repo website field.
|
|
95
|
+
*/
|
|
96
|
+
domain?: string;
|
|
97
|
+
/** Enforce HTTPS. Only effective once the custom domain is DNS-verified. */
|
|
98
|
+
https?: boolean;
|
|
99
|
+
}
|
|
100
|
+
/** GitHub custom properties synced to the org dashboard. */
|
|
101
|
+
interface RepoProperties {
|
|
102
|
+
/** The repo's lifecycle stage. */
|
|
103
|
+
lifecycle?: "active" | "experimental" | "deprecated";
|
|
104
|
+
/** Whether the repo is open source. */
|
|
105
|
+
open_source?: boolean;
|
|
106
|
+
/** Where the code runs. */
|
|
107
|
+
runtime_environment?: "node" | "browser" | "universal" | "none";
|
|
108
|
+
/** Whether the repo depends on external packages. */
|
|
109
|
+
uses_external_packages?: boolean;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* GitHub Actions variables, declared so a workflow that reads `vars.NAME` finds it. Values are plain text, so
|
|
113
|
+
* never put a secret here; secrets go through the `secrets` capability.
|
|
114
|
+
*/
|
|
115
|
+
interface RepoVariables {
|
|
116
|
+
/** Repository-level variables. */
|
|
117
|
+
repo?: Record<string, string>;
|
|
118
|
+
/**
|
|
119
|
+
* Organization-level variables. A bare string is visible to every repository; `visibility: "private"` limits it
|
|
120
|
+
* to private ones. Declare these in one repo only (the one that owns the org's configuration).
|
|
121
|
+
*/
|
|
122
|
+
org?: Record<string, string | {
|
|
123
|
+
value: string;
|
|
124
|
+
visibility?: "all" | "private";
|
|
125
|
+
}>;
|
|
126
|
+
/**
|
|
127
|
+
* The vault environments `holocron secrets sync` fills variables from, so one 1Password Environment is the only
|
|
128
|
+
* place they are edited. Names only. A name here must not also be a literal value in `repo` or `org`, and `prune`
|
|
129
|
+
* cannot be combined with it; either is a config error.
|
|
130
|
+
*/
|
|
131
|
+
sync?: RepoVariablesSync[];
|
|
132
|
+
/** Delete variables that exist but are not declared here. Off by default: they are left alone. */
|
|
133
|
+
prune?: boolean;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* One vault environment that `holocron secrets sync` pushes into GitHub Actions variables. Not secrets: a variable is
|
|
137
|
+
* readable in GitHub afterwards, so keep it in an environment of its own, apart from the one that fills secrets.
|
|
138
|
+
*/
|
|
139
|
+
interface RepoVariablesSync {
|
|
140
|
+
/** The vault environment id, as given to `holocron secrets sync <environmentId>`. */
|
|
141
|
+
environment: string;
|
|
142
|
+
/** The vault keys written as variables, by name. Required: a key the environment gains by mistake is never published. */
|
|
143
|
+
keys: string[];
|
|
144
|
+
/** Where the variables land: `"repo"` (the default) or `"org=<name>"`. */
|
|
145
|
+
scope?: string;
|
|
146
|
+
/** Organization variables only: which repositories can read them. `"all"` by default. */
|
|
147
|
+
visibility?: "all" | "private";
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* The names of the secrets that must exist for this repository's workflows to work, so `holocron doctor secrets`
|
|
151
|
+
* can say which are missing. Only names go here, never values; `holocron secrets set` and `secrets sync` write
|
|
152
|
+
* them. The secrets the config already implies (the notification layout's webhooks and roles, a Chromatic project
|
|
153
|
+
* token) are expected without being listed again. A secret that exists but is not listed is never a problem.
|
|
154
|
+
*/
|
|
155
|
+
interface RepoSecrets {
|
|
156
|
+
/** Repository secrets. */
|
|
157
|
+
repo?: string[];
|
|
158
|
+
/** Organization secrets. Declare these in one repo only (the one that owns the org's configuration). */
|
|
159
|
+
org?: string[];
|
|
160
|
+
/** Environment secrets, by environment name. */
|
|
161
|
+
environments?: Record<string, string[]>;
|
|
162
|
+
/**
|
|
163
|
+
* The vault environments `holocron secrets sync` fills secrets from. `holocron doctor secrets` expects the
|
|
164
|
+
* keys each one holds (or lists) at its scope. Names only; the doctor never reads or prints a value.
|
|
165
|
+
*/
|
|
166
|
+
sync?: RepoSecretsSync[];
|
|
167
|
+
}
|
|
168
|
+
/** One vault environment that `holocron secrets sync` pushes into GitHub secrets, declared so the doctor can check them. */
|
|
169
|
+
interface RepoSecretsSync {
|
|
170
|
+
/** The vault environment id, as given to `holocron secrets sync <environmentId>`. */
|
|
171
|
+
environment: string;
|
|
172
|
+
/**
|
|
173
|
+
* The vault keys pushed to GitHub (the `--github-secret` allowlist). Omit it for every key the vault
|
|
174
|
+
* environment holds, which the doctor then asks the `vault` provider to list.
|
|
175
|
+
*/
|
|
176
|
+
keys?: string[];
|
|
177
|
+
/** Where the secrets land, as `--github-secret-scope` words it: `"repo"` (the default), `"env=<name>"` or `"org=<name>"`. */
|
|
178
|
+
scope?: string;
|
|
179
|
+
}
|
|
180
|
+
/** Per-repo switches for the repo-validation checks (spec `tech-api-docs`, #1368). */
|
|
181
|
+
interface RepoValidationConfig {
|
|
182
|
+
/**
|
|
183
|
+
* How strictly this repo enforces doc-comment coverage of its public API (`holocron probe docs patch` and
|
|
184
|
+
* the `documentation` Codecov flag). `"off"` (the default) does nothing; `"warn"`
|
|
185
|
+
* reports without failing and posts informational Codecov statuses; `"required"` fails the check and posts statuses
|
|
186
|
+
* that are not informational. It never adds a status to the branch-protection required checks: that stays in
|
|
187
|
+
* `extraRequiredChecks`.
|
|
188
|
+
*/
|
|
189
|
+
docsCoverage?: DocsCoverageMode;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* The `.holocron/org.*` area: the organization's non-CI constants that are provider options. The loader fills an
|
|
193
|
+
* option a provider entry leaves out from here; the same option set inline and here is a `ConfigError`. Identifiers
|
|
194
|
+
* only, never a secret, and nothing CI needs (those live in 1Password and sync to a GitHub variable). A key a provider
|
|
195
|
+
* does not use is ignored; a provider or option not listed here is an error.
|
|
196
|
+
*/
|
|
197
|
+
interface OrgConfig {
|
|
198
|
+
/**
|
|
199
|
+
* The organization's DNS zone (`theholocron.dev`). The loader sets `domain` on a config that leaves it out; a
|
|
200
|
+
* config that sets it too is a `ConfigError`. A file that must build a hostname before the loader runs imports
|
|
201
|
+
* this area file instead (`import org from "./org.js"`).
|
|
202
|
+
*/
|
|
203
|
+
domain?: string;
|
|
204
|
+
/** Options filled into every `cloudflare` provider entry. */
|
|
205
|
+
cloudflare?: {
|
|
206
|
+
/** The Cloudflare account id (an identifier, not a credential). */
|
|
207
|
+
accountId?: string;
|
|
208
|
+
};
|
|
209
|
+
/** Options filled into every `vercel` provider entry. */
|
|
210
|
+
vercel?: {
|
|
211
|
+
/** The Vercel team id (an identifier, not a credential). */
|
|
212
|
+
teamId?: string;
|
|
213
|
+
};
|
|
214
|
+
/** Options filled into every `checkly` provider entry. */
|
|
215
|
+
checkly?: {
|
|
216
|
+
/** The Checkly account id (an identifier, not a credential). */
|
|
217
|
+
accountId?: string;
|
|
218
|
+
};
|
|
219
|
+
/** Options filled into every `sentry` provider entry. */
|
|
220
|
+
sentry?: {
|
|
221
|
+
/** The Sentry organization slug (an identifier, not a credential). */
|
|
222
|
+
org?: string;
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
/** The `repo` block: how the GitHub repository is set up and kept in sync by `holocron repo setup`. */
|
|
226
|
+
interface RepoConfig {
|
|
227
|
+
/** "owner/name" — the GitHub repository coordinate. Derived from the git remote when absent. */
|
|
228
|
+
name?: string;
|
|
229
|
+
/**
|
|
230
|
+
* GitHub's repo-level default branch (`HEAD`) — what a fresh clone checks
|
|
231
|
+
* out, what `gh pr create`/the compare UI target by default, and what
|
|
232
|
+
* Sentinel's `validateConfig()` reads (D6: the App only ever reads config
|
|
233
|
+
* from the repo's default branch, never a PR ref, as a security boundary
|
|
234
|
+
* — never widen that to read PR branches instead of fixing this field).
|
|
235
|
+
* Synced by `holocron repo setup`. Omit to leave GitHub's current setting
|
|
236
|
+
* untouched — most repos never need this. Exists for a repo using a
|
|
237
|
+
* `main`/`alpha` prerelease-channel split (CLAUDE.md's Releases section)
|
|
238
|
+
* where active development happens on a non-`main` branch: set this to
|
|
239
|
+
* that branch so Sentinel validates against what's actually being
|
|
240
|
+
* developed, then change it back once that branch merges to `main` for a
|
|
241
|
+
* stable cut and stops being the active branch.
|
|
242
|
+
*/
|
|
243
|
+
defaultBranch?: string;
|
|
244
|
+
/**
|
|
245
|
+
* Branch protection preset applied by `holocron repo setup`. When omitted,
|
|
246
|
+
* no protection is applied and no `branch_protection_level` property is set.
|
|
247
|
+
* Required-status-check contexts for `"strict"` are derived from the task
|
|
248
|
+
* manifest — `{ required: true }` tasks + top-level `extraRequiredChecks`
|
|
249
|
+
* (see `astromech.requiredChecks()`).
|
|
250
|
+
*/
|
|
251
|
+
protection?: RepoProtection;
|
|
252
|
+
/**
|
|
253
|
+
* GitHub teams granted repository access. Synced by `holocron repo setup`, which
|
|
254
|
+
* also writes `.github/CODEOWNERS` for teams with write-or-higher permission.
|
|
255
|
+
* String shorthand defaults to `push` (Write).
|
|
256
|
+
*/
|
|
257
|
+
teams?: TeamEntry[];
|
|
258
|
+
/** GitHub topics set on the repository. */
|
|
259
|
+
topics?: string[];
|
|
260
|
+
/** GitHub custom properties synced to the org dashboard. */
|
|
261
|
+
properties?: RepoProperties;
|
|
262
|
+
/** GitHub Actions variables reconciled by `holocron repo setup`. */
|
|
263
|
+
variables?: RepoVariables;
|
|
264
|
+
/** The secrets that must exist, checked by `holocron doctor secrets`. Names only; nothing writes them. */
|
|
265
|
+
secrets?: RepoSecrets;
|
|
266
|
+
}
|
|
267
|
+
/** An application in the repo. */
|
|
268
|
+
interface AppConfig {
|
|
269
|
+
/** The application's name. */
|
|
270
|
+
name: string;
|
|
271
|
+
/** The application's directory. */
|
|
272
|
+
path: string;
|
|
273
|
+
/** What kind of application it is. */
|
|
274
|
+
kind?: string;
|
|
275
|
+
}
|
|
276
|
+
/** The `doctor` block. */
|
|
277
|
+
interface DoctorConfig {
|
|
278
|
+
/** Names of the checks `doctor` runs. */
|
|
279
|
+
checks?: string[];
|
|
280
|
+
/**
|
|
281
|
+
* The mail provider that serves the apex of `domain`. `holocron doctor dns` then expects that provider's MX and SPF
|
|
282
|
+
* records in the zone, so a change that would break mail is caught. Nothing writes them; they are set up by hand.
|
|
283
|
+
*/
|
|
284
|
+
mail?: "icloud";
|
|
285
|
+
}
|
|
286
|
+
/** The `credentials` block: which environment the `credentials` providers read this machine's tokens from. */
|
|
287
|
+
interface CredentialsConfig {
|
|
288
|
+
/**
|
|
289
|
+
* The name of the environment the `credentials` providers read (a 1Password Environment, for 1Password), for
|
|
290
|
+
* every provider that does not give its own with an `environment` option
|
|
291
|
+
* (`credentials: ["1password", { environment: "Holocron" }]`). It is a name, not a secret, so it is committed. A provider that matches names exactly may be tried with other
|
|
292
|
+
* letter cases of it; see the provider's page.
|
|
293
|
+
*/
|
|
294
|
+
environment: string;
|
|
295
|
+
}
|
|
296
|
+
/** One entry of `githubApps`: a registered GitHub App instance `holocron doctor github-app` compares with its manifest. */
|
|
297
|
+
interface GitHubAppConfig {
|
|
298
|
+
/** The instance's name in the report, e.g. `"Sentinel - dev"`. */
|
|
299
|
+
name: string;
|
|
300
|
+
/**
|
|
301
|
+
* The App manifest file, relative to the directory: `default_permissions` (name to `read`, `write` or
|
|
302
|
+
* `admin`) and `default_events` (names), as in `apps/sentinel/github-app.manifest.json`.
|
|
303
|
+
*/
|
|
304
|
+
manifest: string;
|
|
305
|
+
/**
|
|
306
|
+
* The vault environment (a 1Password Environment) that holds the instance's `GITHUB_APP_ID` and
|
|
307
|
+
* `GITHUB_APP_PRIVATE_KEY`. A name, not a secret, so it is committed.
|
|
308
|
+
*/
|
|
309
|
+
environment: string;
|
|
310
|
+
}
|
|
311
|
+
/** The `dev` block: how `holocron dev` runs this directory's application locally behind a development tunnel. */
|
|
312
|
+
interface DevConfig {
|
|
313
|
+
/**
|
|
314
|
+
* The vault environment whose variables the application runs with, e.g. `"Sentinel - dev"`. A name, not a
|
|
315
|
+
* secret, so it is committed.
|
|
316
|
+
*/
|
|
317
|
+
environment?: string;
|
|
318
|
+
/** The named tunnel to the application: its name, and the public hostname it serves (not a secret). */
|
|
319
|
+
tunnel?: {
|
|
320
|
+
/** The tunnel's name. A second run finds the first one's tunnel by it. */
|
|
321
|
+
name: string;
|
|
322
|
+
/** The public hostname, e.g. `sentinel-dev.theholocron.dev`. One level under a zone the DNS provider manages. */
|
|
323
|
+
hostname: string;
|
|
324
|
+
};
|
|
325
|
+
/** The port the application listens on, and the tunnel sends requests to. Defaults to 3000. */
|
|
326
|
+
port?: number;
|
|
327
|
+
/** The application's command and arguments, e.g. `["pnpm", "run", "serve"]`. */
|
|
328
|
+
command?: string[];
|
|
329
|
+
/**
|
|
330
|
+
* A web-standard handler for `holocron dev` to serve itself, in place of `command`: the application is then
|
|
331
|
+
* `holocron dev serve`, which loads the handler and serves it on `PORT`. `command` and a command after `--` win.
|
|
332
|
+
*/
|
|
333
|
+
serve?: DevServeConfig;
|
|
334
|
+
}
|
|
335
|
+
/** The `dev.serve` block: the handler `holocron dev` serves, and the variables it needs. */
|
|
336
|
+
interface DevServeConfig {
|
|
337
|
+
/** The module that exports the handler, relative to the directory, e.g. `./src/handler/index.ts`. TypeScript is loaded as is. */
|
|
338
|
+
handler: string;
|
|
339
|
+
/** The name of the handler's export. Defaults to `default`. */
|
|
340
|
+
export?: string;
|
|
341
|
+
/** The variables the handler cannot run without. Missing ones are named; nothing starts. */
|
|
342
|
+
required?: string[];
|
|
343
|
+
/** The variables holding the Axiom ingest token and dataset, to say where this run's logs go. */
|
|
344
|
+
logging?: {
|
|
345
|
+
/** The variable holding the Axiom ingest token. Only its presence is reported, never its value. */
|
|
346
|
+
tokenVar: string;
|
|
347
|
+
/** The variable holding the Axiom dataset the app's logs go to. */
|
|
348
|
+
datasetVar: string;
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
/** The `env` block: how the project's environment variables are named and documented. */
|
|
352
|
+
interface EnvConfig {
|
|
353
|
+
/**
|
|
354
|
+
* Namespace prefixes used by this project's env vars.
|
|
355
|
+
* Listed from least- to most-specific (cascade model — last wins).
|
|
356
|
+
* Tooling reads this to generate `.env.example`, validate required
|
|
357
|
+
* vars, and produce documentation.
|
|
358
|
+
*
|
|
359
|
+
* @example
|
|
360
|
+
* // Project-only prefix
|
|
361
|
+
* namespaces: ["CLI_TEMPLATE"]
|
|
362
|
+
*
|
|
363
|
+
* // Org-wide defaults + project-specific overrides
|
|
364
|
+
* namespaces: ["HOLOCRON", "MY_CLI"]
|
|
365
|
+
*/
|
|
366
|
+
namespaces?: string[];
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* A single Chromatic project entry in a `verification.visualRegression`
|
|
370
|
+
* task's `chromatic-projects` config.
|
|
371
|
+
* Each entry produces one matrix job in CI, publishing to a separate Chromatic project.
|
|
372
|
+
*
|
|
373
|
+
* The `tokenName` maps to a repository secret named `CHROMATIC_PROJECT_TOKEN_<TOKENNAME>`.
|
|
374
|
+
* Additional fields correspond to chromaui/action inputs and are passed through directly.
|
|
375
|
+
*
|
|
376
|
+
* @see https://www.chromatic.com/docs/monorepos/
|
|
377
|
+
*/
|
|
378
|
+
interface ChromaticProjectConfig {
|
|
379
|
+
/**
|
|
380
|
+
* Secret suffix. The CI job reads `CHROMATIC_PROJECT_TOKEN_<tokenName>`.
|
|
381
|
+
* Must be uppercase (e.g. `"WEB"`, `"UI"`).
|
|
382
|
+
*/
|
|
383
|
+
tokenName: string;
|
|
384
|
+
/**
|
|
385
|
+
* Path to run the Chromatic build from, relative to the repo root.
|
|
386
|
+
* Typically the package directory (e.g. `"apps/web"`, `"packages/ui"`).
|
|
387
|
+
*/
|
|
388
|
+
workingDir: string;
|
|
389
|
+
/**
|
|
390
|
+
* Script name to build Storybook. Defaults to `"build:storybook"`.
|
|
391
|
+
* Must accept `--output-dir` pass-through (use `turbo run … --` at root).
|
|
392
|
+
*/
|
|
393
|
+
buildScript?: string;
|
|
394
|
+
/**
|
|
395
|
+
* Path to the Storybook folder relative to `workingDir`, for TurboSnap.
|
|
396
|
+
* Tells Chromatic where to find `.storybook/` when the Storybook config
|
|
397
|
+
* is in a subdirectory. Corresponds to `--storybook-base-dir`.
|
|
398
|
+
*/
|
|
399
|
+
storybookBaseDir?: string;
|
|
400
|
+
/**
|
|
401
|
+
* Glob patterns of files/dirs that should NOT trigger a TurboSnap bailout
|
|
402
|
+
* when changed. Useful for ignoring non-UI changes in a monorepo
|
|
403
|
+
* (e.g. `"./packages/!(ui)/**"` to focus TurboSnap on the UI package).
|
|
404
|
+
* Corresponds to `--untraced`. Accepts a single glob string or array.
|
|
405
|
+
*/
|
|
406
|
+
untraced?: string | string[];
|
|
407
|
+
/**
|
|
408
|
+
* Glob patterns matching story files to snapshot. When set, only matching
|
|
409
|
+
* stories are captured. Corresponds to `--only-story-files`.
|
|
410
|
+
* Cannot be combined with `onlyStoryNames`.
|
|
411
|
+
*/
|
|
412
|
+
onlyStoryFiles?: string;
|
|
413
|
+
/**
|
|
414
|
+
* Exit with code 0 even when visual changes are detected.
|
|
415
|
+
* Useful during initial setup before baselines are approved.
|
|
416
|
+
* Corresponds to `--exit-zero-on-changes`.
|
|
417
|
+
*/
|
|
418
|
+
exitZeroOnChanges?: boolean;
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* A single Storybook app in a deploy workflow config.
|
|
422
|
+
* `name` becomes the sandbox sub-path (`_site/sandbox/<name>/`).
|
|
423
|
+
* `path` is the working directory relative to the repo root; defaults to `"."` (repo root) when omitted.
|
|
424
|
+
*/
|
|
425
|
+
interface StorybookDeployProject {
|
|
426
|
+
/** The sub-path under `_site/sandbox/` the Storybook app is published to. */
|
|
427
|
+
name?: string;
|
|
428
|
+
/** The app's working directory relative to the repo root; defaults to `"."`. */
|
|
429
|
+
path?: string;
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Typed `with:` inputs for reusable workflows.
|
|
433
|
+
*
|
|
434
|
+
* `chromatic-projects` (on the `verification.visualRegression` task) takes a
|
|
435
|
+
* `ChromaticProjectConfig[]` directly; each entry's `untraced` glob list may
|
|
436
|
+
* be authored as an array and is newline-joined for you.
|
|
437
|
+
*
|
|
438
|
+
* `docs` / `storybook` are high-level deploy shorthand that `holocron repo setup`
|
|
439
|
+
* translates to `type` / `storybook-projects` before writing the thin caller.
|
|
440
|
+
* They also drive automatic `paths:` derivation so you never need to write
|
|
441
|
+
* `paths:` manually for deploy entries.
|
|
442
|
+
*/
|
|
443
|
+
type WorkflowWithConfig = Record<string, unknown> & {
|
|
444
|
+
"chromatic-projects"?: ChromaticProjectConfig[];
|
|
445
|
+
/**
|
|
446
|
+
* Docs deployment shorthand. `true` uses the org-standard `docs/` directory;
|
|
447
|
+
* `{ path: "custom" }` uses a custom directory. Both derive a `paths:` entry automatically.
|
|
448
|
+
*/
|
|
449
|
+
docs?: true | {
|
|
450
|
+
path: string;
|
|
451
|
+
};
|
|
452
|
+
/** Storybook apps to deploy alongside docs. Each entry's `path` is appended to `paths:`. */
|
|
453
|
+
storybook?: StorybookDeployProject[];
|
|
454
|
+
};
|
|
455
|
+
/**
|
|
456
|
+
* A `tasks` manifest entry in object form. A bare string entry is shorthand
|
|
457
|
+
* for `{ name, ci: true, local: true }`.
|
|
458
|
+
*/
|
|
459
|
+
interface TaskEntryConfig {
|
|
460
|
+
/** The task's name. */
|
|
461
|
+
name: string;
|
|
462
|
+
/** Inputs passed to the task's reusable workflow. */
|
|
463
|
+
with?: WorkflowWithConfig;
|
|
464
|
+
/** Path filters for the generated workflow's triggers. */
|
|
465
|
+
paths?: string[];
|
|
466
|
+
/** Linters this task runs. */
|
|
467
|
+
linters?: string[];
|
|
468
|
+
/** Emit a `.github/workflows/<name>.yml` thin caller + include in `holocron run ci`. Default `true`. */
|
|
469
|
+
ci?: boolean;
|
|
470
|
+
/** Write a `package.json` script + let `holocron run <name>` resolve the task. Default `true`. */
|
|
471
|
+
local?: boolean;
|
|
472
|
+
/** The task's CI check context is a required status check + part of `holocron run ci`'s default run. */
|
|
473
|
+
required?: boolean;
|
|
474
|
+
/**
|
|
475
|
+
* Per-repo additions to this task's generated `turbo.json` entry —
|
|
476
|
+
* a separate channel from `with:` (that's the reusable *workflow's*
|
|
477
|
+
* inputs; this is local turbo cache config, unrelated). No-op for a
|
|
478
|
+
* task with no turbo fan-out config in the registry. Mirrors
|
|
479
|
+
* astromech's own `TaskEntry["turbo"]` — kept in sync by hand, since
|
|
480
|
+
* this package doesn't depend on astromech directly.
|
|
481
|
+
*/
|
|
482
|
+
turbo?: {
|
|
483
|
+
/** Extra env vars turbo hashes into this task's cache key, appended to the registry default. */
|
|
484
|
+
passThroughEnv?: string[];
|
|
485
|
+
/**
|
|
486
|
+
* Extra input globs appended to the registry default's `inputs`
|
|
487
|
+
* (holocron#845) — for a package whose layout the registry
|
|
488
|
+
* default doesn't cover (e.g. a flat-layout package with no
|
|
489
|
+
* `src/` directory at all).
|
|
490
|
+
*/
|
|
491
|
+
inputs?: string[];
|
|
492
|
+
/** Extra tasks this one waits for, appended to the registry default's `dependsOn` (turbo syntax: `"<package>#<task>"`). */
|
|
493
|
+
dependsOn?: string[];
|
|
494
|
+
};
|
|
495
|
+
}
|
|
496
|
+
/** A `holocron.config` as a user writes it; `defineConfig` types it. */
|
|
497
|
+
interface HolocronConfig {
|
|
498
|
+
/** Project name. Derived from package.json when absent. */
|
|
499
|
+
name?: string;
|
|
500
|
+
/** A one-line description of the project. */
|
|
501
|
+
description?: string;
|
|
502
|
+
/** Project homepage URL. Synced to package.json#homepage and the GitHub repo's website field by `holocron repo sync`. */
|
|
503
|
+
homepage?: string;
|
|
504
|
+
/**
|
|
505
|
+
* Active org name for namespaced keyring lookup. When set, token resolution
|
|
506
|
+
* tries `<service>.<org>` before the unnamespaced `<service>` fallback, so
|
|
507
|
+
* a single machine can hold credentials for multiple GitHub orgs without
|
|
508
|
+
* collision. Overridden by `--org` CLI flag or `HOLOCRON_ORG` env var.
|
|
509
|
+
*/
|
|
510
|
+
org?: string;
|
|
511
|
+
/**
|
|
512
|
+
* Org canonical domain (e.g. `"theholocron.dev"`). Subdomains are derived
|
|
513
|
+
* from this — `preview: true` on a deploy workflow resolves the preview base
|
|
514
|
+
* domain as `preview.<domain>`, giving URLs like `<repo>-pr-<n>.<domain>`.
|
|
515
|
+
*/
|
|
516
|
+
domain?: string;
|
|
517
|
+
/**
|
|
518
|
+
* Repository identity and metadata. When set, `PluginLoader` injects
|
|
519
|
+
* `repo.name` into every plugin's `RuntimeContext.repo` so plugins that
|
|
520
|
+
* need a repo (github, etc.) don't require `--repo` on every invocation.
|
|
521
|
+
* `--repo` on the command line still overrides.
|
|
522
|
+
*/
|
|
523
|
+
repo?: RepoConfig;
|
|
524
|
+
/** Per-repo switches for the repo-validation checks. */
|
|
525
|
+
repoValidation?: RepoValidationConfig;
|
|
526
|
+
/**
|
|
527
|
+
* The task manifest — what this repo runs. Each entry is a task name
|
|
528
|
+
* (backed by a reusable workflow in `theholocron/.github`), or the object
|
|
529
|
+
* form to pass `with:` inputs. `@theholocron/astromech` reads this as the
|
|
530
|
+
* single source for `holocron run` / `holocron run ci` / the generated CI
|
|
531
|
+
* workflows / `package.json` scripts.
|
|
532
|
+
*
|
|
533
|
+
* Supported values (intent-facing vocabulary — epic #672, D3):
|
|
534
|
+
* "verification.unitTests" | "verification.visualRegression" | "verification.typeSafety" | "verification.performance" |
|
|
535
|
+
* "sourceQuality.staticAnalysis" | "sourceQuality.formatting" |
|
|
536
|
+
* "sourceQuality.structuredDataValidation" | "sourceQuality.deadCodeAnalysis" |
|
|
537
|
+
* "security.secretDetection" | "security.codeScanning" | "security.tokenExpiry" |
|
|
538
|
+
* "delivery.build" | "delivery.publish" | "delivery.deploy" | "delivery.bundleSize" |
|
|
539
|
+
* "platform.repoSync" | "platform.notifyCheck" | "platform.commitStandards" | "platform.repoValidation" |
|
|
540
|
+
* "knowledge.wiki" | "knowledge.docs" | "knowledge.components" |
|
|
541
|
+
* "review" | "tag" | "stale" | "greetings" | "dependencies" | "bookkeeping"
|
|
542
|
+
*
|
|
543
|
+
* `holocron repo setup` writes `.github/workflows/<name>.yml` for each entry,
|
|
544
|
+
* calling the corresponding reusable workflow in `theholocron/.github`.
|
|
545
|
+
* Files are overwritten on each run — they are generated artifacts.
|
|
546
|
+
*
|
|
547
|
+
* ### delivery.deploy / knowledge.docs / knowledge.components
|
|
548
|
+
* `delivery.deploy` uses `docs` and/or `storybook` in `with:` — setup
|
|
549
|
+
* derives `paths:` automatically. `docs: true` uses the org-standard
|
|
550
|
+
* `docs/` directory; `docs: { path: "custom" }` overrides it.
|
|
551
|
+
* `knowledge.docs` / `knowledge.components` are the same underlying
|
|
552
|
+
* mechanism, each dedicated to exactly one type — they imply the
|
|
553
|
+
* corresponding shorthand, so a repo using them never has to spell out
|
|
554
|
+
* `docs: true` / `storybook: […]` itself.
|
|
555
|
+
*
|
|
556
|
+
* ```ts
|
|
557
|
+
* // Docs only (standard layout)
|
|
558
|
+
* { name: "delivery.deploy", with: { docs: true } }
|
|
559
|
+
* // …or equivalently, the dedicated task:
|
|
560
|
+
* "knowledge.docs"
|
|
561
|
+
*
|
|
562
|
+
* // Docs + monorepo storybooks
|
|
563
|
+
* {
|
|
564
|
+
* name: "delivery.deploy",
|
|
565
|
+
* with: {
|
|
566
|
+
* docs: true,
|
|
567
|
+
* storybook: [
|
|
568
|
+
* { name: "web", path: "apps/web" },
|
|
569
|
+
* { name: "ui", path: "packages/ui" },
|
|
570
|
+
* ],
|
|
571
|
+
* },
|
|
572
|
+
* }
|
|
573
|
+
*
|
|
574
|
+
* // Non-standard docs location
|
|
575
|
+
* { name: "delivery.deploy", with: { docs: { path: "packages/site" } } }
|
|
576
|
+
* ```
|
|
577
|
+
*
|
|
578
|
+
* ### verification.visualRegression
|
|
579
|
+
* Its own task, not a `verification.unitTests` sub-job (holocron#394/#1062)
|
|
580
|
+
* — GitHub evaluates a job's `if:` before expanding its `strategy.matrix`,
|
|
581
|
+
* so no `chromatic-projects` default can make a *disabled* Chromatic job
|
|
582
|
+
* disappear from PR checks; only not generating the job at all does. Omit
|
|
583
|
+
* this task entirely for a repo that doesn't use Chromatic — no workflow,
|
|
584
|
+
* no job, no check, not even a skipped one.
|
|
585
|
+
*
|
|
586
|
+
* For a single-project repo, use a `CHROMATIC_PROJECT_TOKEN` repository
|
|
587
|
+
* secret with `tokenName: "default"`:
|
|
588
|
+
* ```ts
|
|
589
|
+
* {
|
|
590
|
+
* name: "verification.visualRegression",
|
|
591
|
+
* with: { "chromatic-projects": [{ tokenName: "default", workingDir: "." }] },
|
|
592
|
+
* }
|
|
593
|
+
* ```
|
|
594
|
+
*
|
|
595
|
+
* For monorepos with multiple Storybooks, list one entry per project:
|
|
596
|
+
* ```ts
|
|
597
|
+
* {
|
|
598
|
+
* name: "verification.visualRegression",
|
|
599
|
+
* with: {
|
|
600
|
+
* "chromatic-projects": [
|
|
601
|
+
* { tokenName: "WEB", workingDir: "apps/web" },
|
|
602
|
+
* { tokenName: "UI", workingDir: "packages/ui" },
|
|
603
|
+
* ],
|
|
604
|
+
* },
|
|
605
|
+
* }
|
|
606
|
+
* ```
|
|
607
|
+
* Each `tokenName` maps to a repository secret named
|
|
608
|
+
* `CHROMATIC_PROJECT_TOKEN_<TOKENNAME>`.
|
|
609
|
+
*
|
|
610
|
+
* @example
|
|
611
|
+
* ["sourceQuality.staticAnalysis", { "name": "delivery.publish", "with": { "run-build": false } }]
|
|
612
|
+
* { "name": "delivery.deploy", "with": { "docs": true } }
|
|
613
|
+
*/
|
|
614
|
+
tasks?: Array<string | TaskEntryConfig>;
|
|
615
|
+
/**
|
|
616
|
+
* Opt out of `holocron repo sync`'s `package.json` script writes. Default `true`.
|
|
617
|
+
*/
|
|
618
|
+
syncScripts?: boolean;
|
|
619
|
+
/**
|
|
620
|
+
* The command the synced `"holocron"` `package.json` script runs. Default
|
|
621
|
+
* `"holocron"` (the installed bin). This repo overrides it to run its own
|
|
622
|
+
* build (`"node cli/cli/dist/cli.mjs"`).
|
|
623
|
+
*/
|
|
624
|
+
holocronScript?: string;
|
|
625
|
+
/**
|
|
626
|
+
* Required status-check contexts not backed by a `required` task (codecov
|
|
627
|
+
* gates, the bundle-build check, …). `holocron repo setup` appends these to the
|
|
628
|
+
* task-derived list from `astromech.requiredChecks()`.
|
|
629
|
+
*/
|
|
630
|
+
extraRequiredChecks?: string[];
|
|
631
|
+
/**
|
|
632
|
+
* Git hooks `holocron repo setup` installs. `true` / `{ prePush: true }` writes
|
|
633
|
+
* `.husky/pre-push` (runs `holocron run ci` before every push); `false` /
|
|
634
|
+
* `{ prePush: false }` opts out. Omitted → on for `protection: "strict"`,
|
|
635
|
+
* off otherwise. `--hooks` / `--no-hooks` on `holocron repo setup` override.
|
|
636
|
+
*/
|
|
637
|
+
hooks?: boolean | {
|
|
638
|
+
prePush?: boolean;
|
|
639
|
+
};
|
|
640
|
+
/** Which provider backs each capability. */
|
|
641
|
+
providers: RawProvidersConfig;
|
|
642
|
+
/** Applications in the repo. */
|
|
643
|
+
apps?: AppConfig[];
|
|
644
|
+
/** Settings for `holocron doctor`. */
|
|
645
|
+
doctor?: DoctorConfig;
|
|
646
|
+
/**
|
|
647
|
+
* Agent runtime that determines where skills are installed by `holocron repo setup`.
|
|
648
|
+
* Skills are installed to `.agents/skills/<name>/` (canonical) with a
|
|
649
|
+
* relative symlink at the agent-specific path:
|
|
650
|
+
* - `"claude"` → `.claude/skills/<name>` → `../../.agents/skills/<name>`
|
|
651
|
+
* - `"codex"` | `"gemini"` → logged as unsupported; skipped gracefully.
|
|
652
|
+
*/
|
|
653
|
+
agent?: "claude" | "codex" | "gemini";
|
|
654
|
+
/**
|
|
655
|
+
* Skill names from `@theholocron/skills` to install during `holocron repo setup`.
|
|
656
|
+
* Installed paths are gitignored and managed by setup — do not commit them.
|
|
657
|
+
*
|
|
658
|
+
* @example
|
|
659
|
+
* ["git-safety", "pr-workflow", "commit-standards"]
|
|
660
|
+
*/
|
|
661
|
+
skills?: string[];
|
|
662
|
+
/**
|
|
663
|
+
* GitHub Pages configuration. When present, `holocron repo setup` calls the
|
|
664
|
+
* Pages API using `HOLOCRON_DEPLOY_TOKEN` (requires `pages:write` + `repo` scope).
|
|
665
|
+
* When absent, Pages is left as-is.
|
|
666
|
+
*
|
|
667
|
+
* @example
|
|
668
|
+
* { build: "workflow", domain: "docs.theholocron.dev", https: true }
|
|
669
|
+
*/
|
|
670
|
+
docs?: DocsConfig;
|
|
671
|
+
/**
|
|
672
|
+
* Environment variable namespace configuration.
|
|
673
|
+
* Declares the prefix(es) this project uses for its env vars so that
|
|
674
|
+
* tooling can generate `.env.example`, validate required vars, and
|
|
675
|
+
* produce accurate documentation without hard-coding prefix strings.
|
|
676
|
+
*
|
|
677
|
+
* @example
|
|
678
|
+
* { namespaces: ["HOLOCRON", "MY_CLI"] }
|
|
679
|
+
*/
|
|
680
|
+
env?: EnvConfig;
|
|
681
|
+
/**
|
|
682
|
+
* Which environment the `credentials` providers (`providers.credentials`) read this machine's tokens from.
|
|
683
|
+
* The default for every provider; one provider can name its own with an `environment` option in its
|
|
684
|
+
* `providers.credentials` entry, which wins. The plugin never stores the name: the CLI passes it to `read`.
|
|
685
|
+
* Each provider needs one or the other when `providers.credentials` is set.
|
|
686
|
+
*
|
|
687
|
+
* @example
|
|
688
|
+
* { environment: "Holocron" }
|
|
689
|
+
*/
|
|
690
|
+
credentials?: CredentialsConfig;
|
|
691
|
+
/**
|
|
692
|
+
* How `holocron dev` runs this directory's application locally behind a development tunnel: the vault
|
|
693
|
+
* environment its variables come from, the tunnel's name and hostname, the port and the command. Every field is
|
|
694
|
+
* optional here and can be given as a flag instead (a flag wins); `holocron dev` says which one is missing.
|
|
695
|
+
*
|
|
696
|
+
* @example
|
|
697
|
+
* { environment: "Sentinel - dev", tunnel: { name: "sentinel-dev", hostname: "sentinel-dev.theholocron.dev" } }
|
|
698
|
+
*/
|
|
699
|
+
dev?: DevConfig;
|
|
700
|
+
/**
|
|
701
|
+
* The registered GitHub App instances `holocron doctor github-app` checks: GitHub cannot change an existing App's
|
|
702
|
+
* permissions or event subscriptions, so each instance is changed by hand and compared with its manifest here.
|
|
703
|
+
*
|
|
704
|
+
* @example
|
|
705
|
+
* [{ name: "Sentinel", manifest: "apps/sentinel/github-app.manifest.json", environment: "Sentinel" }]
|
|
706
|
+
*/
|
|
707
|
+
githubApps?: GitHubAppConfig[];
|
|
708
|
+
/**
|
|
709
|
+
* Structured-logging config. Only the level belongs here — Axiom
|
|
710
|
+
* credentials come from env vars, never a committed file.
|
|
711
|
+
*
|
|
712
|
+
* @example
|
|
713
|
+
* { level: "debug" }
|
|
714
|
+
*/
|
|
715
|
+
log?: LogConfig;
|
|
716
|
+
/**
|
|
717
|
+
* CLI self-telemetry override layer. Env var (`HOLOCRON_TELEMETRY=false`)
|
|
718
|
+
* still wins; this is the committed way to opt a repo out or drop usage
|
|
719
|
+
* analytics while keeping error reporting.
|
|
720
|
+
*
|
|
721
|
+
* @example
|
|
722
|
+
* { enabled: false }
|
|
723
|
+
* { analytics: "none" }
|
|
724
|
+
*/
|
|
725
|
+
telemetry?: TelemetryConfig;
|
|
726
|
+
/**
|
|
727
|
+
* ESLint bundle option overrides that Sentinel's centralized static-
|
|
728
|
+
* analysis check (holocron#849) can't otherwise see. Bucket 1 checks
|
|
729
|
+
* never read a PR's own committed files for config — this is the
|
|
730
|
+
* declared source of truth Sentinel reads instead, so its check stays
|
|
731
|
+
* in sync with what each package's own `eslint.config.ts` already
|
|
732
|
+
* enforces locally and in CI.
|
|
733
|
+
*/
|
|
734
|
+
eslint?: EslintConfig;
|
|
735
|
+
}
|
|
736
|
+
/**
|
|
737
|
+
* Repo-root-relative directories treated as browser-targeted for eslint's
|
|
738
|
+
* node-builtins compatibility checks — mirrors
|
|
739
|
+
* `@theholocron/eslint-config`'s `library({ browserPackages })` option.
|
|
740
|
+
* Only needed for a package whose own `eslint.config.ts` already declares
|
|
741
|
+
* `browserPackages` (a deliberate outlier, not the norm — see that
|
|
742
|
+
* package's own config file for why).
|
|
743
|
+
*
|
|
744
|
+
* @example
|
|
745
|
+
* { browserPackages: ["packages/github-client/src/app-auth"] }
|
|
746
|
+
*/
|
|
747
|
+
interface EslintConfig {
|
|
748
|
+
/** Repo-root-relative directories treated as browser-targeted. */
|
|
749
|
+
browserPackages?: string[];
|
|
750
|
+
}
|
|
751
|
+
/** A provider with its plugin package resolved. */
|
|
752
|
+
interface ResolvedTuple {
|
|
753
|
+
/** The provider's short name, e.g. `github`. */
|
|
754
|
+
provider: string;
|
|
755
|
+
/** Resolved package name (`@theholocron/holocron-plugin-<provider>` for short refs). */
|
|
756
|
+
packageName: string;
|
|
757
|
+
/** Options passed to the plugin. */
|
|
758
|
+
options: ProviderOptions;
|
|
759
|
+
}
|
|
760
|
+
/** A capability's resolved entry: one provider, or a list of providers. */
|
|
761
|
+
type ResolvedProviderEntry = {
|
|
762
|
+
cardinality: "single";
|
|
763
|
+
tuple: ResolvedTuple;
|
|
764
|
+
} | {
|
|
765
|
+
cardinality: "many";
|
|
766
|
+
tuples: ResolvedTuple[];
|
|
767
|
+
};
|
|
768
|
+
/** Resolved entries by capability. */
|
|
769
|
+
type ResolvedProvidersConfig = Partial<Record<CapabilityKey, ResolvedProviderEntry>>;
|
|
770
|
+
/** A `holocron.config` after `resolveConfig`: defaults applied and provider entries resolved. */
|
|
771
|
+
interface ResolvedHolocronConfig {
|
|
772
|
+
/** Project name. */
|
|
773
|
+
name: string;
|
|
774
|
+
/** A one-line description of the project. */
|
|
775
|
+
description?: string;
|
|
776
|
+
/** Project homepage URL. */
|
|
777
|
+
homepage?: string;
|
|
778
|
+
/** Org name. */
|
|
779
|
+
org?: string;
|
|
780
|
+
/** Org canonical domain. */
|
|
781
|
+
domain?: string;
|
|
782
|
+
/** Repository settings. */
|
|
783
|
+
repo?: RepoConfig;
|
|
784
|
+
/** Which repo-wide checks this repo turns on (`docsCoverage`), validated by `resolveConfig`. */
|
|
785
|
+
repoValidation?: RepoValidationConfig;
|
|
786
|
+
/** The task manifest. */
|
|
787
|
+
tasks?: Array<string | TaskEntryConfig>;
|
|
788
|
+
/** Whether to sync the generated `package.json` scripts. */
|
|
789
|
+
syncScripts?: boolean;
|
|
790
|
+
/** The script used to invoke the `holocron` binary. */
|
|
791
|
+
holocronScript?: string;
|
|
792
|
+
/** Required status checks not backed by a task. */
|
|
793
|
+
extraRequiredChecks?: string[];
|
|
794
|
+
/** Git hooks `holocron repo setup` installs. */
|
|
795
|
+
hooks?: boolean | {
|
|
796
|
+
prePush?: boolean;
|
|
797
|
+
};
|
|
798
|
+
/** Resolved provider entries by capability. */
|
|
799
|
+
providers: ResolvedProvidersConfig;
|
|
800
|
+
/** Applications in the repo; empty when none are declared. */
|
|
801
|
+
apps: AppConfig[];
|
|
802
|
+
/** Settings for `holocron doctor`; empty when none are declared. */
|
|
803
|
+
doctor: DoctorConfig;
|
|
804
|
+
/** The agent runtime skills are installed for. */
|
|
805
|
+
agent?: "claude" | "codex" | "gemini";
|
|
806
|
+
/** Names of the agent skills to install. */
|
|
807
|
+
skills?: string[];
|
|
808
|
+
/** Resolved Pages config. `build` is guaranteed present when this field exists. */
|
|
809
|
+
docs?: PagesConfig;
|
|
810
|
+
/** Environment-variable settings. */
|
|
811
|
+
env?: EnvConfig;
|
|
812
|
+
/** The environment the `credentials` providers read, validated by `resolveConfig`. */
|
|
813
|
+
credentials?: CredentialsConfig;
|
|
814
|
+
/** How `holocron dev` runs the application, validated by `resolveConfig`. */
|
|
815
|
+
dev?: DevConfig;
|
|
816
|
+
/** The GitHub App instances `doctor github-app` checks, validated by `resolveConfig`. */
|
|
817
|
+
githubApps?: GitHubAppConfig[];
|
|
818
|
+
/** Logging settings. */
|
|
819
|
+
log?: LogConfig;
|
|
820
|
+
/** Telemetry settings. */
|
|
821
|
+
telemetry?: TelemetryConfig;
|
|
822
|
+
/** ESLint settings. */
|
|
823
|
+
eslint?: EslintConfig;
|
|
824
|
+
}
|
|
825
|
+
/**
|
|
826
|
+
* Resolve `"github"` → `"@theholocron/holocron-plugin-github"`.
|
|
827
|
+
* Fully-qualified names (scoped or not) are honored verbatim, which
|
|
828
|
+
* is how third-party plugins published outside the org work.
|
|
829
|
+
*/
|
|
830
|
+
declare function resolvePluginPackage(provider: string): string;
|
|
831
|
+
/** Resolves one capability's raw provider entry into single or multiple resolved tuples, checking it against the capability's cardinality. */
|
|
832
|
+
declare function resolveEntry(key: CapabilityKey, raw: RawProviderEntry): ResolvedProviderEntry;
|
|
833
|
+
/**
|
|
834
|
+
* The environment a `credentials` provider reads: its own `environment` option when it has one, else the shared
|
|
835
|
+
* `credentials.environment`, else `undefined`. The option lets each of several providers name its own (a 1Password
|
|
836
|
+
* Environment and an AWS secret are not called the same thing) without the plugin storing the name.
|
|
837
|
+
*/
|
|
838
|
+
declare function credentialsEnvironment(tuple: ResolvedTuple, config: {
|
|
839
|
+
credentials?: CredentialsConfig;
|
|
840
|
+
}): string | undefined;
|
|
841
|
+
/** Validates a raw `holocron.config` and resolves its provider entries; throws `ConfigError` when `name` or `providers` is missing or an entry is malformed. */
|
|
842
|
+
declare function resolveConfig(raw: HolocronConfig): ResolvedHolocronConfig;
|
|
843
|
+
/** One entry of the `tasks` manifest: a task name or the object form. */
|
|
844
|
+
type TaskEntry = NonNullable<HolocronConfig["tasks"]>[number];
|
|
845
|
+
/** A single composable capability fragment. */
|
|
846
|
+
interface Capability {
|
|
847
|
+
/** Unique identifier — used for deduplication and dependency resolution. */
|
|
848
|
+
id: string;
|
|
849
|
+
/** Other capability IDs that must be present in the same compose() call. */
|
|
850
|
+
requires?: string[];
|
|
851
|
+
/** Task entries contributed by this capability. Merged by name; last writer wins. */
|
|
852
|
+
tasks?: TaskEntry[];
|
|
853
|
+
/** Provider config. Shallow-merged at the top level; later capabilities override per-key. */
|
|
854
|
+
providers?: RawProvidersConfig;
|
|
855
|
+
/**
|
|
856
|
+
* Required status-check contexts **not** backed by a `required` task
|
|
857
|
+
* (codecov gates, `Storybook Publish`, …). Unioned across all capabilities
|
|
858
|
+
* onto the top-level `extraRequiredChecks`. Task-backed checks come from
|
|
859
|
+
* `{ required: true }` task entries via `astromech.requiredChecks()`.
|
|
860
|
+
*/
|
|
861
|
+
extraRequiredChecks?: string[];
|
|
862
|
+
/** Repo config fragment. Scalar fields: last writer wins. properties/topics/teams: merged. */
|
|
863
|
+
repo?: Partial<Omit<RepoConfig, "name">>;
|
|
864
|
+
/** Org name. Last writer wins. */
|
|
865
|
+
org?: string;
|
|
866
|
+
/** Org canonical domain. Last writer wins. */
|
|
867
|
+
domain?: string;
|
|
868
|
+
/** Docs site config. Last writer wins. */
|
|
869
|
+
docs?: DocsConfig;
|
|
870
|
+
}
|
|
871
|
+
/** The merged result of a compose() call. Spreads into defineConfig(). */
|
|
872
|
+
interface ComposedPreset {
|
|
873
|
+
/** Task entries merged from every capability, by name. */
|
|
874
|
+
tasks: TaskEntry[];
|
|
875
|
+
/** Provider config merged from every capability. */
|
|
876
|
+
providers: RawProvidersConfig;
|
|
877
|
+
/** Repo config merged from every capability. */
|
|
878
|
+
repo: Partial<Omit<RepoConfig, "name">>;
|
|
879
|
+
/** Non-task required-check contexts, unioned across capabilities. */
|
|
880
|
+
extraRequiredChecks: string[];
|
|
881
|
+
/** Org name; the last capability that sets it wins. */
|
|
882
|
+
org?: string;
|
|
883
|
+
/** Org canonical domain; the last capability that sets it wins. */
|
|
884
|
+
domain?: string;
|
|
885
|
+
/** Docs site config; the last capability that sets it wins. */
|
|
886
|
+
docs?: DocsConfig;
|
|
887
|
+
}
|
|
888
|
+
/** A loaded and resolved `holocron.config`. */
|
|
889
|
+
interface LoadedConfig {
|
|
890
|
+
/** The config after `resolveConfig`. */
|
|
891
|
+
resolved: ResolvedHolocronConfig;
|
|
892
|
+
/** Absolute path to the file the config was read from. */
|
|
893
|
+
filepath: string;
|
|
894
|
+
}
|
|
895
|
+
/** Returns the config unchanged; it exists to type and autocomplete a `holocron.config.ts`. */
|
|
896
|
+
declare const defineConfig: (config: HolocronConfig) => HolocronConfig;
|
|
897
|
+
/**
|
|
898
|
+
* Read + parse + resolve `holocron.config.*` starting from the given
|
|
899
|
+
* directory, walking up through ancestors to the nearest `.git` boundary
|
|
900
|
+
* when `cwd` itself has no match — every command is usable from any
|
|
901
|
+
* subdirectory of a repo, not only its exact root (see
|
|
902
|
+
* `@theholocron/datapad`'s own doc comment for the stop conditions).
|
|
903
|
+
* Throws `ConfigFileError` when nothing is found or a file cannot
|
|
904
|
+
* be loaded, or `ConfigError` when the config fails schema checks.
|
|
905
|
+
*/
|
|
906
|
+
declare const loadConfig: (cwd: string) => Promise<LoadedConfig>;
|
|
907
|
+
/**
|
|
908
|
+
* Merge any number of capability fragments into a single preset object that
|
|
909
|
+
* spreads directly into `defineConfig()`.
|
|
910
|
+
*
|
|
911
|
+
* - Accepts individual capabilities or nested arrays (for bundle presets).
|
|
912
|
+
* - Deduplicates by `id` — when the same ID appears more than once, the last
|
|
913
|
+
* occurrence wins. This lets callers override bundle defaults by listing an
|
|
914
|
+
* explicit capability after the bundle.
|
|
915
|
+
* - Validates all `requires` at call time and throws `ConfigError` if any are
|
|
916
|
+
* unmet, listing every missing dependency in a single message.
|
|
917
|
+
*
|
|
918
|
+
* @example
|
|
919
|
+
* // docs-only site — no typecheck
|
|
920
|
+
* const preset = compose(node(), docs());
|
|
921
|
+
*
|
|
922
|
+
* // library with docs
|
|
923
|
+
* const preset = compose(node(), typecheck(), docs());
|
|
924
|
+
*
|
|
925
|
+
* // nextjs() is a bundle that returns Capability[]
|
|
926
|
+
* const preset = compose(node(), nextjs());
|
|
927
|
+
*/
|
|
928
|
+
declare const compose: (...args: (Capability | Capability[])[]) => ComposedPreset;
|
|
929
|
+
export { RawProviderEntry as A, ResolvedHolocronConfig as B, EslintConfig as C, MultiEntry as D, LogConfig as E, RepoSecrets as F, StorybookDeployProject as G, ResolvedProvidersConfig as H, RepoSecretsSync as I, WorkflowWithConfig as J, TaskEntryConfig as K, RepoValidationConfig as L, RepoConfig as M, RepoProperties as N, OrgConfig as O, RepoProtection as P, RepoVariables as R, EnvConfig as S, HolocronConfig as T, ResolvedTuple as U, ResolvedProviderEntry as V, SingleEntry as W, CredentialsConfig as _, LoadedConfig as a, DocsConfig as b, TaskEntry as c, resolveConfig as d, resolveEntry as f, ChromaticProjectConfig as g, CapabilityConfigPackage as h, loadConfig as i, RawProvidersConfig as j, ProviderOptions as k, ConfigError$1 as l, AppConfig as m, compose as n, Capability as o, resolvePluginPackage as p, TelemetryConfig as q, defineConfig as r, ComposedPreset as s, ConfigFileError as t, credentialsEnvironment as u, DevConfig as v, GitHubAppConfig as w, DoctorConfig as x, DevServeConfig as y, RepoVariablesSync as z };
|