@theholocron/cli 5.0.0-alpha.17 → 5.0.0-alpha.170
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 +224 -53
- package/dist/cli.mjs +3390 -1777
- package/dist/cli.mjs.map +1 -1
- package/dist/index.d.mts +221 -49
- package/dist/index.mjs +141 -49
- package/dist/plugin/capabilities.d.mts +208 -51
- package/dist/plugin/capabilities.mjs +2 -1
- package/package.json +19 -13
package/dist/index.d.mts
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
import { Analytics, Auth, AuthDescription, AuthEvent, AuthEventType, AuthIdentity, AuthUser, CARDINALITY, CapabilityImpls, CapabilityKey, Cardinality, CardinalityFor, Ci, CiRun, CiRunFilter, CiRunStatus, ConnectionStringOptions, CreateAuthUserInput, Deployment, DeploymentProject, DeploymentProjectSettings, DeploymentRecord, DeploymentTarget, DeploymentTrigger, Dns, DnsRecord, DnsRecordType, EnsureResult, Environment, EnvironmentReviewer, Environments, Errors, Issue, IssueSearchFilter, Issues, LabelDef, LifecycleResult, LifecycleSlot, Logs, NormalizedAuthUser, Notifications, PagesConfig, ParseWebhookInput, ProviderApiError, ProviderIdentity, PullRequest, REQUIRED_CAPABILITIES, RepoRef, RepoSettings, ResolvedCapability, Ruleset, SecretScope, Secrets, Source, StatusCategory, Storage, StorageBranch, TeamEntry, TeamPermission, Tooling, ToolingDoctorReport, TrackerDoctorReport, TrackerUser, Vault, WebhookDashboardInfo, WebhookVerificationError, Wiki,
|
|
1
|
+
import { Analytics, Auth, AuthDescription, AuthEvent, AuthEventType, AuthIdentity, AuthUser, CARDINALITY, CapabilityImpls, CapabilityKey, Cardinality, CardinalityFor, Ci, CiRun, CiRunFilter, CiRunStatus, ConnectionStringOptions, CreateAuthUserInput, DeployFunctionConfig, DeployFunctionResult, DeployScriptConfig, DeployScriptResult, Deployment, DeploymentProject, DeploymentProjectSettings, DeploymentRecord, DeploymentTarget, DeploymentTrigger, Dns, DnsRecord, DnsRecordRequest, DnsRecordType, EnsureResult, Environment, EnvironmentReviewer, Environments, Errors, Issue, IssueSearchFilter, Issues, LabelDef, LifecycleResult, LifecycleSlot, Logs, Monitoring, MonitoringAssertion, MonitoringAssertionComparison, MonitoringAssertionSource, MonitoringCheck, MonitoringCheckInput, MonitoringHttpMethod, NormalizedAuthUser, Notifications, PagesConfig, ParseWebhookInput, ProviderApiError, ProviderIdentity, PullRequest, REQUIRED_CAPABILITIES, RepoRef, RepoSettings, ResolvedCapability, Ruleset, SecretScope, Secrets, Source, StatusCategory, Storage, StorageBranch, TeamEntry, TeamPermission, Tooling, ToolingDoctorReport, TrackerDoctorReport, TrackerUser, Vault, WebhookDashboardInfo, WebhookVerificationError, Wiki, WikiProvisionOpts, WikiProxyConfig, Workers, isMulti } from "./plugin/capabilities.mjs";
|
|
2
2
|
import { AuthError, RequestOptions, ResolveTokenConfig as ResolveTokenConfig$1, ResolveTokenInput, RestClient, RestClientConfig, createRestClient } from "@theholocron/http-client";
|
|
3
|
+
import { PackageJson } from "@theholocron/pkg-utils";
|
|
3
4
|
import { ConfigFileError } from "@theholocron/datapad";
|
|
4
5
|
import { LogLevel } from "@theholocron/observability/core";
|
|
5
|
-
|
|
6
|
+
import { WorkspacePackage } from "@theholocron/astromech";
|
|
7
|
+
//#region src/auth/auth-resolver/auth-resolver.type.d.ts
|
|
6
8
|
type ResolveTokenConfig = Omit<ResolveTokenConfig$1, "getKeyringToken">;
|
|
7
|
-
/** Wraps `createResolveToken` from `@theholocron/http` and injects the
|
|
8
|
-
* system keyring so plugins stay at a one-liner call site. */
|
|
9
|
-
declare function createResolveToken(config: ResolveTokenConfig): (input?: ResolveTokenInput) => string;
|
|
10
9
|
interface FeatureResolverConfig {
|
|
11
10
|
/** Env var name for this feature, e.g. `"HOLOCRON_ISSUES_TOKEN"`. */
|
|
12
11
|
envName: string;
|
|
13
12
|
/** Keyring account key, e.g. `"github.issues"`. */
|
|
14
13
|
keyringKey: string;
|
|
15
14
|
}
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/auth/auth-resolver/auth-resolver.d.ts
|
|
17
|
+
/** Wraps `createResolveToken` from `@theholocron/http` and injects the
|
|
18
|
+
* system keyring so plugins stay at a one-liner call site. */
|
|
19
|
+
declare function createResolveToken(config: ResolveTokenConfig): (input?: ResolveTokenInput) => string;
|
|
16
20
|
/**
|
|
17
21
|
* Build a strict, single-feature token resolver.
|
|
18
22
|
*
|
|
@@ -22,7 +26,7 @@ interface FeatureResolverConfig {
|
|
|
22
26
|
*/
|
|
23
27
|
declare function createFeatureResolver(config: FeatureResolverConfig): (input?: ResolveTokenInput) => string;
|
|
24
28
|
//#endregion
|
|
25
|
-
//#region src/auth/keyring.d.ts
|
|
29
|
+
//#region src/auth/keyring/keyring.d.ts
|
|
26
30
|
/**
|
|
27
31
|
* Keyring-backed bootstrap credential store.
|
|
28
32
|
*
|
|
@@ -66,7 +70,20 @@ declare function deleteToken(provider: string): boolean;
|
|
|
66
70
|
*/
|
|
67
71
|
declare function listStoredProviders(): string[];
|
|
68
72
|
//#endregion
|
|
69
|
-
//#region src/
|
|
73
|
+
//#region src/commands/auth/auth.type.d.ts
|
|
74
|
+
interface VerifyTokenSuccess {
|
|
75
|
+
ok: true;
|
|
76
|
+
/** "workplace: acme" / "user: cnewton@x" — surfaced in success output. */
|
|
77
|
+
subject: string;
|
|
78
|
+
}
|
|
79
|
+
interface VerifyTokenFailure {
|
|
80
|
+
ok: false;
|
|
81
|
+
/** Reason the token was rejected. Surfaces to the operator. */
|
|
82
|
+
message: string;
|
|
83
|
+
}
|
|
84
|
+
type VerifyTokenResult = VerifyTokenSuccess | VerifyTokenFailure;
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region src/config/config/config.type.d.ts
|
|
70
87
|
/** Structured-logging config. The Axiom **token** never lives here — only in
|
|
71
88
|
* env vars or the OS keyring — but the non-secret dataset name may. */
|
|
72
89
|
interface LogConfig {
|
|
@@ -140,7 +157,7 @@ interface DocsConfig {
|
|
|
140
157
|
* GitHub Pages build source.
|
|
141
158
|
* "workflow" → GitHub Actions (PUT { build_type: "workflow" })
|
|
142
159
|
* "branch" → classic gh-pages branch (PUT { build_type: "legacy", source: { branch: "gh-pages", path: "/" } })
|
|
143
|
-
* When absent, Pages is not managed by `holocron setup`.
|
|
160
|
+
* When absent, Pages is not managed by `holocron repo setup`.
|
|
144
161
|
*/
|
|
145
162
|
build?: "workflow" | "branch";
|
|
146
163
|
/**
|
|
@@ -162,7 +179,22 @@ interface RepoConfig {
|
|
|
162
179
|
/** "owner/name" — the GitHub repository coordinate. Derived from the git remote when absent. */
|
|
163
180
|
name?: string;
|
|
164
181
|
/**
|
|
165
|
-
*
|
|
182
|
+
* GitHub's repo-level default branch (`HEAD`) — what a fresh clone checks
|
|
183
|
+
* out, what `gh pr create`/the compare UI target by default, and what
|
|
184
|
+
* Sentinel's `validateConfig()` reads (D6: the App only ever reads config
|
|
185
|
+
* from the repo's default branch, never a PR ref, as a security boundary
|
|
186
|
+
* — never widen that to read PR branches instead of fixing this field).
|
|
187
|
+
* Synced by `holocron repo setup`. Omit to leave GitHub's current setting
|
|
188
|
+
* untouched — most repos never need this. Exists for a repo using a
|
|
189
|
+
* `main`/`alpha` prerelease-channel split (CLAUDE.md's Releases section)
|
|
190
|
+
* where active development happens on a non-`main` branch: set this to
|
|
191
|
+
* that branch so Sentinel validates against what's actually being
|
|
192
|
+
* developed, then change it back once that branch merges to `main` for a
|
|
193
|
+
* stable cut and stops being the active branch.
|
|
194
|
+
*/
|
|
195
|
+
defaultBranch?: string;
|
|
196
|
+
/**
|
|
197
|
+
* Branch protection preset applied by `holocron repo setup`. When omitted,
|
|
166
198
|
* no protection is applied and no `branch_protection_level` property is set.
|
|
167
199
|
* Required-status-check contexts for `"strict"` are derived from the task
|
|
168
200
|
* manifest — `{ required: true }` tasks + top-level `extraRequiredChecks`
|
|
@@ -170,7 +202,7 @@ interface RepoConfig {
|
|
|
170
202
|
*/
|
|
171
203
|
protection?: RepoProtection;
|
|
172
204
|
/**
|
|
173
|
-
* GitHub teams granted repository access. Synced by `holocron setup`, which
|
|
205
|
+
* GitHub teams granted repository access. Synced by `holocron repo setup`, which
|
|
174
206
|
* also writes `.github/CODEOWNERS` for teams with write-or-higher permission.
|
|
175
207
|
* String shorthand defaults to `push` (Write).
|
|
176
208
|
*/
|
|
@@ -205,7 +237,8 @@ interface EnvConfig {
|
|
|
205
237
|
namespaces?: string[];
|
|
206
238
|
}
|
|
207
239
|
/**
|
|
208
|
-
* A single Chromatic project entry in a
|
|
240
|
+
* A single Chromatic project entry in a `verification.visualRegression`
|
|
241
|
+
* task's `chromatic-projects` config.
|
|
209
242
|
* Each entry produces one matrix job in CI, publishing to a separate Chromatic project.
|
|
210
243
|
*
|
|
211
244
|
* The `tokenName` maps to a repository secret named `CHROMATIC_PROJECT_TOKEN_<TOKENNAME>`.
|
|
@@ -267,18 +300,17 @@ interface StorybookDeployProject {
|
|
|
267
300
|
/**
|
|
268
301
|
* Typed `with:` inputs for reusable workflows.
|
|
269
302
|
*
|
|
270
|
-
* `
|
|
271
|
-
* `ChromaticProjectConfig[]`
|
|
303
|
+
* `chromatic-projects` (on the `verification.visualRegression` task) takes a
|
|
304
|
+
* `ChromaticProjectConfig[]` directly; each entry's `untraced` glob list may
|
|
305
|
+
* be authored as an array and is newline-joined for you.
|
|
272
306
|
*
|
|
273
|
-
* `docs` / `storybook` are high-level deploy shorthand that `holocron setup`
|
|
307
|
+
* `docs` / `storybook` are high-level deploy shorthand that `holocron repo setup`
|
|
274
308
|
* translates to `type` / `storybook-projects` before writing the thin caller.
|
|
275
309
|
* They also drive automatic `paths:` derivation so you never need to write
|
|
276
310
|
* `paths:` manually for deploy entries.
|
|
277
311
|
*/
|
|
278
312
|
type WorkflowWithConfig = Record<string, unknown> & {
|
|
279
|
-
"
|
|
280
|
-
projects: ChromaticProjectConfig[];
|
|
281
|
-
};
|
|
313
|
+
"chromatic-projects"?: ChromaticProjectConfig[];
|
|
282
314
|
/**
|
|
283
315
|
* Docs deployment shorthand. `true` uses the org-standard `docs/` directory;
|
|
284
316
|
* `{ path: "custom" }` uses a custom directory. Both derive a `paths:` entry automatically.
|
|
@@ -298,18 +330,37 @@ interface TaskEntryConfig {
|
|
|
298
330
|
with?: WorkflowWithConfig;
|
|
299
331
|
paths?: string[];
|
|
300
332
|
linters?: string[];
|
|
301
|
-
/** Emit a `.github/workflows/<name>.yml` thin caller + include in `holocron ci`. Default `true`. */
|
|
333
|
+
/** Emit a `.github/workflows/<name>.yml` thin caller + include in `holocron run ci`. Default `true`. */
|
|
302
334
|
ci?: boolean;
|
|
303
335
|
/** Write a `package.json` script + let `holocron run <name>` resolve the task. Default `true`. */
|
|
304
336
|
local?: boolean;
|
|
305
|
-
/** The task's CI check context is a required status check + part of `holocron ci`'s default run. */
|
|
337
|
+
/** The task's CI check context is a required status check + part of `holocron run ci`'s default run. */
|
|
306
338
|
required?: boolean;
|
|
339
|
+
/**
|
|
340
|
+
* Per-repo additions to this task's generated `turbo.json` entry —
|
|
341
|
+
* a separate channel from `with:` (that's the reusable *workflow's*
|
|
342
|
+
* inputs; this is local turbo cache config, unrelated). No-op for a
|
|
343
|
+
* task with no turbo fan-out config in the registry. Mirrors
|
|
344
|
+
* astromech's own `TaskEntry["turbo"]` — kept in sync by hand, since
|
|
345
|
+
* this package doesn't depend on astromech directly.
|
|
346
|
+
*/
|
|
347
|
+
turbo?: {
|
|
348
|
+
/** Extra env vars turbo hashes into this task's cache key, appended to the registry default. */
|
|
349
|
+
passThroughEnv?: string[];
|
|
350
|
+
/**
|
|
351
|
+
* Extra input globs appended to the registry default's `inputs`
|
|
352
|
+
* (holocron#845) — for a package whose layout the registry
|
|
353
|
+
* default doesn't cover (e.g. a flat-layout package with no
|
|
354
|
+
* `src/` directory at all).
|
|
355
|
+
*/
|
|
356
|
+
inputs?: string[];
|
|
357
|
+
};
|
|
307
358
|
}
|
|
308
359
|
interface HolocronConfig {
|
|
309
360
|
/** Project name. Derived from package.json when absent. */
|
|
310
361
|
name?: string;
|
|
311
362
|
description?: string;
|
|
312
|
-
/** Project homepage URL. Synced to package.json#homepage and the GitHub repo's website field by `holocron sync`. */
|
|
363
|
+
/** Project homepage URL. Synced to package.json#homepage and the GitHub repo's website field by `holocron repo sync`. */
|
|
313
364
|
homepage?: string;
|
|
314
365
|
/**
|
|
315
366
|
* Active org name for namespaced keyring lookup. When set, token resolution
|
|
@@ -335,11 +386,11 @@ interface HolocronConfig {
|
|
|
335
386
|
* The task manifest — what this repo runs. Each entry is a task name
|
|
336
387
|
* (backed by a reusable workflow in `theholocron/.github`), or the object
|
|
337
388
|
* form to pass `with:` inputs. `@theholocron/astromech` reads this as the
|
|
338
|
-
* single source for `holocron run` / `holocron ci` / the generated CI
|
|
389
|
+
* single source for `holocron run` / `holocron run ci` / the generated CI
|
|
339
390
|
* workflows / `package.json` scripts.
|
|
340
391
|
*
|
|
341
392
|
* Supported values (intent-facing vocabulary — epic #672, D3):
|
|
342
|
-
* "verification.unitTests" | "verification.typeSafety" | "verification.performance" |
|
|
393
|
+
* "verification.unitTests" | "verification.visualRegression" | "verification.typeSafety" | "verification.performance" |
|
|
343
394
|
* "sourceQuality.staticAnalysis" | "sourceQuality.formatting" |
|
|
344
395
|
* "sourceQuality.structuredDataValidation" | "sourceQuality.deadCodeAnalysis" |
|
|
345
396
|
* "security.secretDetection" | "security.codeScanning" |
|
|
@@ -348,7 +399,7 @@ interface HolocronConfig {
|
|
|
348
399
|
* "knowledge.wiki" | "knowledge.docs" | "knowledge.components" |
|
|
349
400
|
* "review" | "tag" | "stale" | "greetings" | "dependencies" | "bookkeeping"
|
|
350
401
|
*
|
|
351
|
-
* `holocron setup` writes `.github/workflows/<name>.yml` for each entry,
|
|
402
|
+
* `holocron repo setup` writes `.github/workflows/<name>.yml` for each entry,
|
|
352
403
|
* calling the corresponding reusable workflow in `theholocron/.github`.
|
|
353
404
|
* Files are overwritten on each run — they are generated artifacts.
|
|
354
405
|
*
|
|
@@ -383,23 +434,37 @@ interface HolocronConfig {
|
|
|
383
434
|
* { name: "delivery.deploy", with: { docs: { path: "packages/site" } } }
|
|
384
435
|
* ```
|
|
385
436
|
*
|
|
386
|
-
* ###
|
|
387
|
-
*
|
|
388
|
-
* `
|
|
437
|
+
* ### verification.visualRegression
|
|
438
|
+
* Its own task, not a `verification.unitTests` sub-job (holocron#394/#1062)
|
|
439
|
+
* — GitHub evaluates a job's `if:` before expanding its `strategy.matrix`,
|
|
440
|
+
* so no `chromatic-projects` default can make a *disabled* Chromatic job
|
|
441
|
+
* disappear from PR checks; only not generating the job at all does. Omit
|
|
442
|
+
* this task entirely for a repo that doesn't use Chromatic — no workflow,
|
|
443
|
+
* no job, no check, not even a skipped one.
|
|
389
444
|
*
|
|
390
|
-
* For
|
|
445
|
+
* For a single-project repo, use a `CHROMATIC_PROJECT_TOKEN` repository
|
|
446
|
+
* secret with `tokenName: "default"`:
|
|
391
447
|
* ```ts
|
|
392
|
-
*
|
|
393
|
-
*
|
|
394
|
-
*
|
|
395
|
-
*
|
|
396
|
-
*
|
|
448
|
+
* {
|
|
449
|
+
* name: "verification.visualRegression",
|
|
450
|
+
* with: { "chromatic-projects": [{ tokenName: "default", workingDir: "." }] },
|
|
451
|
+
* }
|
|
452
|
+
* ```
|
|
453
|
+
*
|
|
454
|
+
* For monorepos with multiple Storybooks, list one entry per project:
|
|
455
|
+
* ```ts
|
|
456
|
+
* {
|
|
457
|
+
* name: "verification.visualRegression",
|
|
458
|
+
* with: {
|
|
459
|
+
* "chromatic-projects": [
|
|
460
|
+
* { tokenName: "WEB", workingDir: "apps/web" },
|
|
461
|
+
* { tokenName: "UI", workingDir: "packages/ui" },
|
|
462
|
+
* ],
|
|
463
|
+
* },
|
|
397
464
|
* }
|
|
398
465
|
* ```
|
|
399
466
|
* Each `tokenName` maps to a repository secret named
|
|
400
|
-
* `CHROMATIC_PROJECT_TOKEN_<TOKENNAME>`.
|
|
401
|
-
* to the flat `run-chromatic: true` + `chromatic-projects: <json>` inputs
|
|
402
|
-
* that the reusable workflow accepts.
|
|
467
|
+
* `CHROMATIC_PROJECT_TOKEN_<TOKENNAME>`.
|
|
403
468
|
*
|
|
404
469
|
* @example
|
|
405
470
|
* ["sourceQuality.staticAnalysis", { "name": "delivery.publish", "with": { "run-build": false } }]
|
|
@@ -407,7 +472,7 @@ interface HolocronConfig {
|
|
|
407
472
|
*/
|
|
408
473
|
tasks?: Array<string | TaskEntryConfig>;
|
|
409
474
|
/**
|
|
410
|
-
* Opt out of `holocron sync`'s `package.json` script writes. Default `true`.
|
|
475
|
+
* Opt out of `holocron repo sync`'s `package.json` script writes. Default `true`.
|
|
411
476
|
*/
|
|
412
477
|
syncScripts?: boolean;
|
|
413
478
|
/**
|
|
@@ -418,15 +483,15 @@ interface HolocronConfig {
|
|
|
418
483
|
holocronScript?: string;
|
|
419
484
|
/**
|
|
420
485
|
* Required status-check contexts not backed by a `required` task (codecov
|
|
421
|
-
* gates, the bundle-build check, …). `holocron setup` appends these to the
|
|
486
|
+
* gates, the bundle-build check, …). `holocron repo setup` appends these to the
|
|
422
487
|
* task-derived list from `astromech.requiredChecks()`.
|
|
423
488
|
*/
|
|
424
489
|
extraRequiredChecks?: string[];
|
|
425
490
|
/**
|
|
426
|
-
* Git hooks `holocron setup` installs. `true` / `{ prePush: true }` writes
|
|
427
|
-
* `.husky/pre-push` (runs `holocron ci` before every push); `false` /
|
|
491
|
+
* Git hooks `holocron repo setup` installs. `true` / `{ prePush: true }` writes
|
|
492
|
+
* `.husky/pre-push` (runs `holocron run ci` before every push); `false` /
|
|
428
493
|
* `{ prePush: false }` opts out. Omitted → on for `protection: "strict"`,
|
|
429
|
-
* off otherwise. `--hooks` / `--no-hooks` on `holocron setup` override.
|
|
494
|
+
* off otherwise. `--hooks` / `--no-hooks` on `holocron repo setup` override.
|
|
430
495
|
*/
|
|
431
496
|
hooks?: boolean | {
|
|
432
497
|
prePush?: boolean;
|
|
@@ -435,7 +500,7 @@ interface HolocronConfig {
|
|
|
435
500
|
apps?: AppConfig[];
|
|
436
501
|
doctor?: DoctorConfig;
|
|
437
502
|
/**
|
|
438
|
-
* Agent runtime that determines where skills are installed by `holocron setup`.
|
|
503
|
+
* Agent runtime that determines where skills are installed by `holocron repo setup`.
|
|
439
504
|
* Skills are installed to `.agents/skills/<name>/` (canonical) with a
|
|
440
505
|
* relative symlink at the agent-specific path:
|
|
441
506
|
* - `"claude"` → `.claude/skills/<name>` → `../../.agents/skills/<name>`
|
|
@@ -443,7 +508,7 @@ interface HolocronConfig {
|
|
|
443
508
|
*/
|
|
444
509
|
agent?: "claude" | "codex" | "gemini";
|
|
445
510
|
/**
|
|
446
|
-
* Skill names from `@theholocron/skills` to install during `holocron setup`.
|
|
511
|
+
* Skill names from `@theholocron/skills` to install during `holocron repo setup`.
|
|
447
512
|
* Installed paths are gitignored and managed by setup — do not commit them.
|
|
448
513
|
*
|
|
449
514
|
* @example
|
|
@@ -451,7 +516,7 @@ interface HolocronConfig {
|
|
|
451
516
|
*/
|
|
452
517
|
skills?: string[];
|
|
453
518
|
/**
|
|
454
|
-
* GitHub Pages configuration. When present, `holocron setup` calls the
|
|
519
|
+
* GitHub Pages configuration. When present, `holocron repo setup` calls the
|
|
455
520
|
* Pages API using `HOLOCRON_DEPLOY_TOKEN` (requires `pages:write` + `repo` scope).
|
|
456
521
|
* When absent, Pages is left as-is.
|
|
457
522
|
*
|
|
@@ -487,6 +552,29 @@ interface HolocronConfig {
|
|
|
487
552
|
* { analytics: "none" }
|
|
488
553
|
*/
|
|
489
554
|
telemetry?: TelemetryConfig;
|
|
555
|
+
/**
|
|
556
|
+
* ESLint bundle option overrides that Sentinel's centralized static-
|
|
557
|
+
* analysis check (holocron#849) can't otherwise see. Bucket 1 checks
|
|
558
|
+
* never read a PR's own committed files for config — this is the
|
|
559
|
+
* declared source of truth Sentinel reads instead, so its check stays
|
|
560
|
+
* in sync with what each package's own `eslint.config.ts` already
|
|
561
|
+
* enforces locally and in CI.
|
|
562
|
+
*/
|
|
563
|
+
eslint?: EslintConfig;
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* Repo-root-relative directories treated as browser-targeted for eslint's
|
|
567
|
+
* node-builtins compatibility checks — mirrors
|
|
568
|
+
* `@theholocron/eslint-config`'s `library({ browserPackages })` option.
|
|
569
|
+
* Only needed for a package whose own `eslint.config.ts` already declares
|
|
570
|
+
* `browserPackages` (a deliberate outlier, not the norm — see that
|
|
571
|
+
* package's own config file for why).
|
|
572
|
+
*
|
|
573
|
+
* @example
|
|
574
|
+
* { browserPackages: ["packages/github-client/src/app-auth"] }
|
|
575
|
+
*/
|
|
576
|
+
interface EslintConfig {
|
|
577
|
+
browserPackages?: string[];
|
|
490
578
|
}
|
|
491
579
|
interface ResolvedTuple {
|
|
492
580
|
provider: string;
|
|
@@ -526,7 +614,10 @@ interface ResolvedHolocronConfig {
|
|
|
526
614
|
env?: EnvConfig;
|
|
527
615
|
log?: LogConfig;
|
|
528
616
|
telemetry?: TelemetryConfig;
|
|
617
|
+
eslint?: EslintConfig;
|
|
529
618
|
}
|
|
619
|
+
//#endregion
|
|
620
|
+
//#region src/config/config/config.d.ts
|
|
530
621
|
declare class ConfigError extends Error {
|
|
531
622
|
name: string;
|
|
532
623
|
}
|
|
@@ -539,7 +630,7 @@ declare function resolvePluginPackage(provider: string): string;
|
|
|
539
630
|
declare function resolveEntry(key: CapabilityKey, raw: RawProviderEntry): ResolvedProviderEntry;
|
|
540
631
|
declare function resolveConfig(raw: HolocronConfig): ResolvedHolocronConfig;
|
|
541
632
|
//#endregion
|
|
542
|
-
//#region src/config/compose.d.ts
|
|
633
|
+
//#region src/config/compose/compose.type.d.ts
|
|
543
634
|
type TaskEntry = NonNullable<HolocronConfig["tasks"]>[number];
|
|
544
635
|
/** A single composable capability fragment. */
|
|
545
636
|
interface Capability {
|
|
@@ -578,6 +669,8 @@ interface ComposedPreset {
|
|
|
578
669
|
domain?: string;
|
|
579
670
|
docs?: DocsConfig;
|
|
580
671
|
}
|
|
672
|
+
//#endregion
|
|
673
|
+
//#region src/config/compose/compose.d.ts
|
|
581
674
|
/**
|
|
582
675
|
* Merge any number of capability fragments into a single preset object that
|
|
583
676
|
* spreads directly into `defineConfig()`.
|
|
@@ -601,20 +694,99 @@ interface ComposedPreset {
|
|
|
601
694
|
*/
|
|
602
695
|
declare function compose(...args: (Capability | Capability[])[]): ComposedPreset;
|
|
603
696
|
//#endregion
|
|
604
|
-
//#region src/config/define-config.d.ts
|
|
697
|
+
//#region src/config/define-config/define-config.d.ts
|
|
605
698
|
declare function defineConfig(config: HolocronConfig): HolocronConfig;
|
|
606
699
|
//#endregion
|
|
607
|
-
//#region src/config/load-config.d.ts
|
|
700
|
+
//#region src/config/load-config/load-config.type.d.ts
|
|
608
701
|
interface LoadedConfig {
|
|
609
702
|
resolved: ResolvedHolocronConfig;
|
|
610
703
|
/** Absolute path to the file the config was read from. */
|
|
611
704
|
filepath: string;
|
|
612
705
|
}
|
|
706
|
+
//#endregion
|
|
707
|
+
//#region src/config/load-config/load-config.d.ts
|
|
613
708
|
/**
|
|
614
|
-
* Read + parse + resolve `holocron.config.*` from the given
|
|
709
|
+
* Read + parse + resolve `holocron.config.*` starting from the given
|
|
710
|
+
* directory, walking up through ancestors to the nearest `.git` boundary
|
|
711
|
+
* when `cwd` itself has no match — every command is usable from any
|
|
712
|
+
* subdirectory of a repo, not only its exact root (see
|
|
713
|
+
* `@theholocron/datapad`'s own doc comment for the stop conditions).
|
|
615
714
|
* Throws {@link ConfigFileError} when nothing is found or a file cannot
|
|
616
|
-
* be loaded, or `ConfigError` when the config
|
|
715
|
+
* be loaded, or `ConfigError` when the config fails schema checks.
|
|
617
716
|
*/
|
|
618
717
|
declare function loadConfig(cwd: string): Promise<LoadedConfig>;
|
|
619
718
|
//#endregion
|
|
620
|
-
|
|
719
|
+
//#region src/commands/setup/derived-properties/derived-properties.type.d.ts
|
|
720
|
+
/**
|
|
721
|
+
* Derived custom-properties (#677). Unlike the existing 6 GitHub
|
|
722
|
+
* custom-properties fields (`lifecycle`, `open_source`, `runtime_environment`,
|
|
723
|
+
* `uses_external_packages`, `monorepo`, `branch_protection_level`) — which
|
|
724
|
+
* mirror what `holocron.config.ts` already states explicitly — these four are
|
|
725
|
+
* *derived*: signal that isn't an explicit config field today (framework
|
|
726
|
+
* choice, repo archetype, capability drift). See
|
|
727
|
+
* `.notes/tech-holocron-platform.spec.md` → "Custom-properties sync — field
|
|
728
|
+
* definitions (#677)" for the full design.
|
|
729
|
+
*/
|
|
730
|
+
type HolocronProfile = "library" | "cli" | "plugin" | "template" | "app" | "docs" | "platform";
|
|
731
|
+
/** The `package.json` shape profile derivation reads — `@theholocron/pkg-utils`'s `PackageJson`, under the name Sentinel already imports. */
|
|
732
|
+
type PackageJsonLike = PackageJson;
|
|
733
|
+
interface DeriveProfileInput {
|
|
734
|
+
rootPackageJson: PackageJsonLike | null;
|
|
735
|
+
repoName: string;
|
|
736
|
+
isMonorepo: boolean;
|
|
737
|
+
/** `packages/*` package.json contents, monorepo repos only — used to find the primary published artifact. */
|
|
738
|
+
workspacePackageJsons: PackageJsonLike[];
|
|
739
|
+
}
|
|
740
|
+
//#endregion
|
|
741
|
+
//#region src/commands/setup/derived-properties/derived-properties.d.ts
|
|
742
|
+
/**
|
|
743
|
+
* Repo archetype, in priority order:
|
|
744
|
+
* 1. `*-template` repo name → `template` (independent of package shape).
|
|
745
|
+
* 2. Monorepo whose primary published artifact is a CLI (some workspace
|
|
746
|
+
* package has `bin`) → `platform` — matches `holocron` itself: the CLI is
|
|
747
|
+
* the deliverable, the plugin packages are supporting infrastructure for
|
|
748
|
+
* it, not separate products.
|
|
749
|
+
* 3. Monorepo with no CLI but at least one non-private workspace package →
|
|
750
|
+
* `library` — matches `clients`/`configs`/`utils`/`themes`/
|
|
751
|
+
* `observability`: a family of published packages, none of them a CLI.
|
|
752
|
+
* Checked *before* falling into the root-package branch below, because
|
|
753
|
+
* these repos' own root `package.json` is private and often carries
|
|
754
|
+
* `@theholocron/astro-config` for a docs site built from the monorepo
|
|
755
|
+
* root — without this check they'd wrongly resolve to `docs` off that
|
|
756
|
+
* root-level signal alone, when the docs site is a secondary concern of
|
|
757
|
+
* a library collection, not what the repo fundamentally is.
|
|
758
|
+
* 4. Single-package repo with `package.json#bin` → `cli`.
|
|
759
|
+
* 5. Docs-only site (astro/starlight present, root package private, no
|
|
760
|
+
* publishable exports) → `docs`.
|
|
761
|
+
* 6. Private, non-publishable, non-docs → `app`.
|
|
762
|
+
* 7. Otherwise, a single publishable package → `library`.
|
|
763
|
+
*/
|
|
764
|
+
declare function deriveProfile(input: DeriveProfileInput): HolocronProfile;
|
|
765
|
+
/**
|
|
766
|
+
* Detected build/framework tooling — the literal "does this repo need
|
|
767
|
+
* next/vite/tsdown" signal `holocron.config.ts` has no field for today
|
|
768
|
+
* (framework choice isn't a config concept, unlike `providers`/`tasks`).
|
|
769
|
+
* Curated table, not exhaustive by design — add to `KNOWN_STACK_DEPS` as new
|
|
770
|
+
* frameworks show up rather than trying to detect anything on npm.
|
|
771
|
+
*/
|
|
772
|
+
declare function deriveStack(pkg: PackageJsonLike | null): string[];
|
|
773
|
+
/** The provider capability keys actually wired in `providers: {}` — zero heuristics. */
|
|
774
|
+
declare function deriveCapabilities(providers: ResolvedProvidersConfig | undefined): string[];
|
|
775
|
+
declare function deriveCompliance(capabilities: readonly string[]): "compliant" | "non-compliant";
|
|
776
|
+
/**
|
|
777
|
+
* The Phase B refinement `deriveCompliance()`'s own doc comment names —
|
|
778
|
+
* *why* a repo is non-compliant, not just that it is. `[]` when compliant.
|
|
779
|
+
* Same `REQUIRED_BASELINE` `deriveCompliance()` checks against — one
|
|
780
|
+
* table, not two independently-maintained baselines.
|
|
781
|
+
*/
|
|
782
|
+
declare function missingCapabilities(capabilities: readonly string[]): string[];
|
|
783
|
+
/**
|
|
784
|
+
* Reads each workspace package's actual `package.json` content (not just
|
|
785
|
+
* `readWorkspacePackages()`'s `{ slug, name, dir }` — `deriveProfile()`'s
|
|
786
|
+
* `platform` detection needs `bin`, which that helper doesn't carry).
|
|
787
|
+
* Missing/invalid files are skipped, matching `readWorkspacePackages()`'s
|
|
788
|
+
* own soft-fail behavior.
|
|
789
|
+
*/
|
|
790
|
+
declare function readWorkspacePackageJsons(repoRoot: string, workspacePackages: readonly WorkspacePackage[]): Promise<PackageJsonLike[]>;
|
|
791
|
+
//#endregion
|
|
792
|
+
export { Analytics, type AppConfig, Auth, AuthDescription, AuthError, AuthEvent, AuthEventType, AuthIdentity, AuthUser, CARDINALITY, type Capability, type CapabilityConfigPackage, CapabilityImpls, CapabilityKey, Cardinality, CardinalityFor, type ChromaticProjectConfig, Ci, CiRun, CiRunFilter, CiRunStatus, type ComposedPreset, ConfigError, ConfigFileError, ConnectionStringOptions, CreateAuthUserInput, DeployFunctionConfig, DeployFunctionResult, DeployScriptConfig, DeployScriptResult, Deployment, DeploymentProject, DeploymentProjectSettings, DeploymentRecord, DeploymentTarget, DeploymentTrigger, type DeriveProfileInput, Dns, DnsRecord, DnsRecordRequest, DnsRecordType, type DocsConfig, type DoctorConfig, EnsureResult, type EnvConfig, Environment, EnvironmentReviewer, Environments, Errors, type EslintConfig, type FeatureResolverConfig, type HolocronConfig, type HolocronProfile, Issue, IssueSearchFilter, Issues, LabelDef, LifecycleResult, LifecycleSlot, type LoadedConfig, type LogConfig, Logs, Monitoring, MonitoringAssertion, MonitoringAssertionComparison, MonitoringAssertionSource, MonitoringCheck, MonitoringCheckInput, MonitoringHttpMethod, type MultiEntry, NormalizedAuthUser, Notifications, type PackageJsonLike, PagesConfig, ParseWebhookInput, ProviderApiError, ProviderIdentity, type ProviderOptions, PullRequest, REQUIRED_CAPABILITIES, type RawProviderEntry, type RawProvidersConfig, type RepoConfig, type RepoProperties, type RepoProtection, RepoRef, RepoSettings, type RequestOptions, type ResolveTokenConfig, type ResolveTokenInput, ResolvedCapability, type ResolvedHolocronConfig, type ResolvedProviderEntry, type ResolvedProvidersConfig, type ResolvedTuple, type RestClient, type RestClientConfig, Ruleset, SecretScope, Secrets, type SingleEntry, Source, StatusCategory, Storage, StorageBranch, type StorybookDeployProject, type TaskEntry, type TaskEntryConfig, TeamEntry, TeamPermission, type TelemetryConfig, Tooling, ToolingDoctorReport, TrackerDoctorReport, TrackerUser, Vault, type VerifyTokenFailure, type VerifyTokenResult, type VerifyTokenSuccess, WebhookDashboardInfo, WebhookVerificationError, Wiki, WikiProvisionOpts, WikiProxyConfig, Workers, type WorkflowWithConfig, compose, createFeatureResolver, createResolveToken, createRestClient, defineConfig, deleteToken, deriveCapabilities, deriveCompliance, deriveProfile, deriveStack, getToken, isMulti, listStoredProviders, loadConfig, missingCapabilities, readWorkspacePackageJsons, resolveConfig, resolveEntry, resolvePluginPackage, setToken };
|