@theholocron/cli 5.0.0-alpha.279 → 5.0.0-alpha.280
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +19 -11
- package/dist/cli.mjs.map +1 -1
- package/dist/{compose-DxOjvMVt.mjs → compose-BmbYc-ZW.mjs} +4 -0
- package/dist/{index-B59MneN-.d.mts → index-Bh7jWkxS.d.mts} +70 -0
- package/dist/index.d.mts +22 -1
- package/dist/index.mjs +3 -1
- package/dist/presets.d.mts +1 -1
- package/dist/presets.mjs +1 -1
- package/package.json +9 -9
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { CARDINALITY, REQUIRED_CAPABILITIES } from "./plugin/capabilities.mjs";
|
|
2
2
|
// src/config/config/config.ts
|
|
3
|
+
/** Thrown when a `holocron.config` is invalid. */
|
|
3
4
|
var ConfigError = class extends Error {
|
|
5
|
+
/** The error's name, `"ConfigError"`. */
|
|
4
6
|
name = "ConfigError";
|
|
5
7
|
};
|
|
6
8
|
const PLUGIN_PREFIX = "@theholocron/holocron-plugin-";
|
|
@@ -38,6 +40,7 @@ function normalizeEntry(entry) {
|
|
|
38
40
|
options
|
|
39
41
|
};
|
|
40
42
|
}
|
|
43
|
+
/** Resolves one capability's raw provider entry into single or multiple resolved tuples, checking it against the capability's cardinality. */
|
|
41
44
|
function resolveEntry(key, raw) {
|
|
42
45
|
const cardinality = CARDINALITY[key];
|
|
43
46
|
if (typeof raw === "string") {
|
|
@@ -74,6 +77,7 @@ const DOCS_COVERAGE_MODES = [
|
|
|
74
77
|
"warn",
|
|
75
78
|
"required"
|
|
76
79
|
];
|
|
80
|
+
/** Validates a raw `holocron.config` and resolves its provider entries; throws `ConfigError` when `name` or `providers` is missing or an entry is malformed. */
|
|
77
81
|
function resolveConfig(raw) {
|
|
78
82
|
if (!raw.name) throw new ConfigError("`name` is required");
|
|
79
83
|
if (!raw.providers || typeof raw.providers !== "object") throw new ConfigError("`providers` block is required");
|
|
@@ -41,6 +41,7 @@ interface TelemetryConfig {
|
|
|
41
41
|
*/
|
|
42
42
|
analytics?: "posthog" | "none";
|
|
43
43
|
}
|
|
44
|
+
/** Options a provider plugin receives; their shape is the plugin's own. */
|
|
44
45
|
type ProviderOptions = Record<string, unknown>;
|
|
45
46
|
/**
|
|
46
47
|
* The shape a capability config package's default export must satisfy.
|
|
@@ -56,13 +57,20 @@ type ProviderOptions = Record<string, unknown>;
|
|
|
56
57
|
* } satisfies CapabilityConfigPackage
|
|
57
58
|
*/
|
|
58
59
|
interface CapabilityConfigPackage {
|
|
60
|
+
/** The provider's short name or package. */
|
|
59
61
|
provider: string;
|
|
62
|
+
/** Options passed to the provider. */
|
|
60
63
|
options?: ProviderOptions;
|
|
61
64
|
}
|
|
65
|
+
/** A single provider: a name, or a `[provider, options]` tuple. */
|
|
62
66
|
type SingleEntry = string | [provider: string, options: ProviderOptions];
|
|
67
|
+
/** Several providers: a list of names or `[provider, options]` tuples. */
|
|
63
68
|
type MultiEntry = Array<string | [provider: string, options: ProviderOptions]>;
|
|
69
|
+
/** A capability's provider entry as written in the config. */
|
|
64
70
|
type RawProviderEntry = SingleEntry | MultiEntry;
|
|
71
|
+
/** The `providers` block as written in the config. */
|
|
65
72
|
type RawProvidersConfig = Partial<Record<CapabilityKey, RawProviderEntry>>;
|
|
73
|
+
/** A branch-protection preset: `balanced`, `strict` or `none`. */
|
|
66
74
|
type RepoProtection = "balanced" | "strict" | "none";
|
|
67
75
|
/**
|
|
68
76
|
* Raw `docs` config as written by the user. `build` is optional so the
|
|
@@ -86,10 +94,15 @@ interface DocsConfig {
|
|
|
86
94
|
/** Enforce HTTPS. Only effective once the custom domain is DNS-verified. */
|
|
87
95
|
https?: boolean;
|
|
88
96
|
}
|
|
97
|
+
/** GitHub custom properties synced to the org dashboard. */
|
|
89
98
|
interface RepoProperties {
|
|
99
|
+
/** The repo's lifecycle stage. */
|
|
90
100
|
lifecycle?: "active" | "experimental" | "deprecated";
|
|
101
|
+
/** Whether the repo is open source. */
|
|
91
102
|
open_source?: boolean;
|
|
103
|
+
/** Where the code runs. */
|
|
92
104
|
runtime_environment?: "node" | "browser" | "universal" | "none";
|
|
105
|
+
/** Whether the repo depends on external packages. */
|
|
93
106
|
uses_external_packages?: boolean;
|
|
94
107
|
}
|
|
95
108
|
/**
|
|
@@ -152,6 +165,7 @@ interface RepoValidationConfig {
|
|
|
152
165
|
*/
|
|
153
166
|
docsCoverage?: DocsCoverageMode;
|
|
154
167
|
}
|
|
168
|
+
/** The `repo` block: how the GitHub repository is set up and kept in sync by `holocron repo setup`. */
|
|
155
169
|
interface RepoConfig {
|
|
156
170
|
/** "owner/name" — the GitHub repository coordinate. Derived from the git remote when absent. */
|
|
157
171
|
name?: string;
|
|
@@ -193,14 +207,21 @@ interface RepoConfig {
|
|
|
193
207
|
/** The secrets that must exist, checked by `holocron doctor secrets`. Names only; nothing writes them. */
|
|
194
208
|
secrets?: RepoSecrets;
|
|
195
209
|
}
|
|
210
|
+
/** An application in the repo. */
|
|
196
211
|
interface AppConfig {
|
|
212
|
+
/** The application's name. */
|
|
197
213
|
name: string;
|
|
214
|
+
/** The application's directory. */
|
|
198
215
|
path: string;
|
|
216
|
+
/** What kind of application it is. */
|
|
199
217
|
kind?: string;
|
|
200
218
|
}
|
|
219
|
+
/** The `doctor` block. */
|
|
201
220
|
interface DoctorConfig {
|
|
221
|
+
/** Names of the checks `doctor` runs. */
|
|
202
222
|
checks?: string[];
|
|
203
223
|
}
|
|
224
|
+
/** The `env` block: how the project's environment variables are named and documented. */
|
|
204
225
|
interface EnvConfig {
|
|
205
226
|
/**
|
|
206
227
|
* Namespace prefixes used by this project's env vars.
|
|
@@ -275,7 +296,9 @@ interface ChromaticProjectConfig {
|
|
|
275
296
|
* `path` is the working directory relative to the repo root; defaults to `"."` (repo root) when omitted.
|
|
276
297
|
*/
|
|
277
298
|
interface StorybookDeployProject {
|
|
299
|
+
/** The sub-path under `_site/sandbox/` the Storybook app is published to. */
|
|
278
300
|
name?: string;
|
|
301
|
+
/** The app's working directory relative to the repo root; defaults to `"."`. */
|
|
279
302
|
path?: string;
|
|
280
303
|
}
|
|
281
304
|
/**
|
|
@@ -307,9 +330,13 @@ type WorkflowWithConfig = Record<string, unknown> & {
|
|
|
307
330
|
* for `{ name, ci: true, local: true }`.
|
|
308
331
|
*/
|
|
309
332
|
interface TaskEntryConfig {
|
|
333
|
+
/** The task's name. */
|
|
310
334
|
name: string;
|
|
335
|
+
/** Inputs passed to the task's reusable workflow. */
|
|
311
336
|
with?: WorkflowWithConfig;
|
|
337
|
+
/** Path filters for the generated workflow's triggers. */
|
|
312
338
|
paths?: string[];
|
|
339
|
+
/** Linters this task runs. */
|
|
313
340
|
linters?: string[];
|
|
314
341
|
/** Emit a `.github/workflows/<name>.yml` thin caller + include in `holocron run ci`. Default `true`. */
|
|
315
342
|
ci?: boolean;
|
|
@@ -339,9 +366,11 @@ interface TaskEntryConfig {
|
|
|
339
366
|
dependsOn?: string[];
|
|
340
367
|
};
|
|
341
368
|
}
|
|
369
|
+
/** A `holocron.config` as a user writes it; `defineConfig` types it. */
|
|
342
370
|
interface HolocronConfig {
|
|
343
371
|
/** Project name. Derived from package.json when absent. */
|
|
344
372
|
name?: string;
|
|
373
|
+
/** A one-line description of the project. */
|
|
345
374
|
description?: string;
|
|
346
375
|
/** Project homepage URL. Synced to package.json#homepage and the GitHub repo's website field by `holocron repo sync`. */
|
|
347
376
|
homepage?: string;
|
|
@@ -481,8 +510,11 @@ interface HolocronConfig {
|
|
|
481
510
|
hooks?: boolean | {
|
|
482
511
|
prePush?: boolean;
|
|
483
512
|
};
|
|
513
|
+
/** Which provider backs each capability. */
|
|
484
514
|
providers: RawProvidersConfig;
|
|
515
|
+
/** Applications in the repo. */
|
|
485
516
|
apps?: AppConfig[];
|
|
517
|
+
/** Settings for `holocron doctor`. */
|
|
486
518
|
doctor?: DoctorConfig;
|
|
487
519
|
/**
|
|
488
520
|
* Agent runtime that determines where skills are installed by `holocron repo setup`.
|
|
@@ -559,14 +591,19 @@ interface HolocronConfig {
|
|
|
559
591
|
* { browserPackages: ["packages/github-client/src/app-auth"] }
|
|
560
592
|
*/
|
|
561
593
|
interface EslintConfig {
|
|
594
|
+
/** Repo-root-relative directories treated as browser-targeted. */
|
|
562
595
|
browserPackages?: string[];
|
|
563
596
|
}
|
|
597
|
+
/** A provider with its plugin package resolved. */
|
|
564
598
|
interface ResolvedTuple {
|
|
599
|
+
/** The provider's short name, e.g. `github`. */
|
|
565
600
|
provider: string;
|
|
566
601
|
/** Resolved package name (`@theholocron/holocron-plugin-<provider>` for short refs). */
|
|
567
602
|
packageName: string;
|
|
603
|
+
/** Options passed to the plugin. */
|
|
568
604
|
options: ProviderOptions;
|
|
569
605
|
}
|
|
606
|
+
/** A capability's resolved entry: one provider, or a list of providers. */
|
|
570
607
|
type ResolvedProviderEntry = {
|
|
571
608
|
cardinality: "single";
|
|
572
609
|
tuple: ResolvedTuple;
|
|
@@ -574,36 +611,60 @@ type ResolvedProviderEntry = {
|
|
|
574
611
|
cardinality: "many";
|
|
575
612
|
tuples: ResolvedTuple[];
|
|
576
613
|
};
|
|
614
|
+
/** Resolved entries by capability. */
|
|
577
615
|
type ResolvedProvidersConfig = Partial<Record<CapabilityKey, ResolvedProviderEntry>>;
|
|
616
|
+
/** A `holocron.config` after `resolveConfig`: defaults applied and provider entries resolved. */
|
|
578
617
|
interface ResolvedHolocronConfig {
|
|
618
|
+
/** Project name. */
|
|
579
619
|
name: string;
|
|
620
|
+
/** A one-line description of the project. */
|
|
580
621
|
description?: string;
|
|
622
|
+
/** Project homepage URL. */
|
|
581
623
|
homepage?: string;
|
|
624
|
+
/** Org name. */
|
|
582
625
|
org?: string;
|
|
626
|
+
/** Org canonical domain. */
|
|
583
627
|
domain?: string;
|
|
628
|
+
/** Repository settings. */
|
|
584
629
|
repo?: RepoConfig;
|
|
585
630
|
/** Which repo-wide checks this repo turns on (`docsCoverage`), validated by `resolveConfig`. */
|
|
586
631
|
repoValidation?: RepoValidationConfig;
|
|
632
|
+
/** The task manifest. */
|
|
587
633
|
tasks?: Array<string | TaskEntryConfig>;
|
|
634
|
+
/** Whether to sync the generated `package.json` scripts. */
|
|
588
635
|
syncScripts?: boolean;
|
|
636
|
+
/** The script used to invoke the `holocron` binary. */
|
|
589
637
|
holocronScript?: string;
|
|
638
|
+
/** Required status checks not backed by a task. */
|
|
590
639
|
extraRequiredChecks?: string[];
|
|
640
|
+
/** Git hooks `holocron repo setup` installs. */
|
|
591
641
|
hooks?: boolean | {
|
|
592
642
|
prePush?: boolean;
|
|
593
643
|
};
|
|
644
|
+
/** Resolved provider entries by capability. */
|
|
594
645
|
providers: ResolvedProvidersConfig;
|
|
646
|
+
/** Applications in the repo; empty when none are declared. */
|
|
595
647
|
apps: AppConfig[];
|
|
648
|
+
/** Settings for `holocron doctor`; empty when none are declared. */
|
|
596
649
|
doctor: DoctorConfig;
|
|
650
|
+
/** The agent runtime skills are installed for. */
|
|
597
651
|
agent?: "claude" | "codex" | "gemini";
|
|
652
|
+
/** Names of the agent skills to install. */
|
|
598
653
|
skills?: string[];
|
|
599
654
|
/** Resolved Pages config. `build` is guaranteed present when this field exists. */
|
|
600
655
|
docs?: PagesConfig;
|
|
656
|
+
/** Environment-variable settings. */
|
|
601
657
|
env?: EnvConfig;
|
|
658
|
+
/** Logging settings. */
|
|
602
659
|
log?: LogConfig;
|
|
660
|
+
/** Telemetry settings. */
|
|
603
661
|
telemetry?: TelemetryConfig;
|
|
662
|
+
/** ESLint settings. */
|
|
604
663
|
eslint?: EslintConfig;
|
|
605
664
|
}
|
|
665
|
+
/** Thrown when a `holocron.config` is invalid. */
|
|
606
666
|
declare class ConfigError extends Error {
|
|
667
|
+
/** The error's name, `"ConfigError"`. */
|
|
607
668
|
name: string;
|
|
608
669
|
}
|
|
609
670
|
/**
|
|
@@ -612,8 +673,11 @@ declare class ConfigError extends Error {
|
|
|
612
673
|
* is how third-party plugins published outside the org work.
|
|
613
674
|
*/
|
|
614
675
|
declare function resolvePluginPackage(provider: string): string;
|
|
676
|
+
/** Resolves one capability's raw provider entry into single or multiple resolved tuples, checking it against the capability's cardinality. */
|
|
615
677
|
declare function resolveEntry(key: CapabilityKey, raw: RawProviderEntry): ResolvedProviderEntry;
|
|
678
|
+
/** Validates a raw `holocron.config` and resolves its provider entries; throws `ConfigError` when `name` or `providers` is missing or an entry is malformed. */
|
|
616
679
|
declare function resolveConfig(raw: HolocronConfig): ResolvedHolocronConfig;
|
|
680
|
+
/** One entry of the `tasks` manifest: a task name or the object form. */
|
|
617
681
|
type TaskEntry = NonNullable<HolocronConfig["tasks"]>[number];
|
|
618
682
|
/** A single composable capability fragment. */
|
|
619
683
|
interface Capability {
|
|
@@ -643,13 +707,19 @@ interface Capability {
|
|
|
643
707
|
}
|
|
644
708
|
/** The merged result of a compose() call. Spreads into defineConfig(). */
|
|
645
709
|
interface ComposedPreset {
|
|
710
|
+
/** Task entries merged from every capability, by name. */
|
|
646
711
|
tasks: TaskEntry[];
|
|
712
|
+
/** Provider config merged from every capability. */
|
|
647
713
|
providers: RawProvidersConfig;
|
|
714
|
+
/** Repo config merged from every capability. */
|
|
648
715
|
repo: Partial<Omit<RepoConfig, "name">>;
|
|
649
716
|
/** Non-task required-check contexts, unioned across capabilities. */
|
|
650
717
|
extraRequiredChecks: string[];
|
|
718
|
+
/** Org name; the last capability that sets it wins. */
|
|
651
719
|
org?: string;
|
|
720
|
+
/** Org canonical domain; the last capability that sets it wins. */
|
|
652
721
|
domain?: string;
|
|
722
|
+
/** Docs site config; the last capability that sets it wins. */
|
|
653
723
|
docs?: DocsConfig;
|
|
654
724
|
}
|
|
655
725
|
/**
|
package/dist/index.d.mts
CHANGED
|
@@ -1,22 +1,27 @@
|
|
|
1
1
|
import { $ as LifecycleResult, $t as ToolingDoctorReport, A as DeploymentProject, At as ProviderIdentity, B as EnsureRelayResult, Bt as Source, C as ConnectionStringOptions, Ct as NotificationsPinnedLayout, D as DeployScriptConfig, Dt as NotificationsWelcomeLayout, E as DeployFunctionResult, Et as NotificationsSignedIn, F as Dns, Ft as ResolvedCapability, G as EnvironmentReviewer, Gt as SourceSecurity, H as EnsureWebhookResult, Ht as SourceFile, I as DnsRecord, It as Ruleset, J as InspectRelayInput, Jt as Storage, K as Environments, Kt as SourceTeamMember, L as DnsRecordRequest, Lt as SecretScope, M as DeploymentRecord, Mt as RelayState, N as DeploymentTarget, Nt as RepoRef, O as DeployScriptResult, Ot as PagesConfig, P as DeploymentTrigger, Pt as RepoSettings, Q as LabelDef, Qt as Tooling, R as DnsRecordType, Rt as Secrets, S as CiRunStatus, St as NotificationsOnboardingLayout, T as DeployFunctionConfig, Tt as NotificationsSignIn, U as EnsuredResource, Ut as SourceRepoInfo, V as EnsureResult, Vt as SourceBranch, W as Environment, Wt as SourceRulesetDetail, X as IssueSearchFilter, Xt as TeamEntry, Y as Issue, Yt as StorageBranch, Z as Issues, Zt as TeamPermission, _ as Cardinality, _t as NotificationsDelivery, a as REQUIRED_CAPABILITIES, an as WikiProvisionOpts, at as MonitoringAlertChannelState, b as CiRun, bt as NotificationsLinksLayout, c as Analytics, cn as Workers, ct as MonitoringAssertionSource, d as AuthEvent, dt as MonitoringHttpMethod, en as TrackerDoctorReport, et as LifecycleSlot, f as AuthEventType, ft as NormalizedAuthUser, g as CapabilityKey, gt as NotificationsChannelLayout, h as CapabilityImpls, ht as NotificationsApplicationLayout, i as ProviderApiError, in as Wiki, it as MonitoringAlertChannelResult, j as DeploymentProjectSettings, jt as PullRequest, k as Deployment, kt as ParseWebhookInput, l as Auth, lt as MonitoringCheck, m as AuthUser, mt as NotificationsAccess, n as ElevationRequiredError, nn as Vault, nt as Monitoring, o as WebhookVerificationError, on as WikiProxyConfig, ot as MonitoringAssertion, p as AuthIdentity, pt as Notifications, q as Errors, qt as StatusCategory, r as MissingTokenError, rn as WebhookDashboardInfo, rt as MonitoringAlertChannelInput, s as isMulti, sn as WorkerScriptState, st as MonitoringAssertionComparison, t as CARDINALITY, tn as TrackerUser, tt as Logs, u as AuthDescription, ut as MonitoringCheckInput, v as CardinalityFor, vt as NotificationsEveryoneLayout, w as CreateAuthUserInput, wt as NotificationsServerLayout, x as CiRunFilter, xt as NotificationsMember, y as Ci, yt as NotificationsLayout, z as EnsureRelayInput, zt as ServerInspection } from "./index-aQ7iGTl7.mjs";
|
|
2
|
-
import { A as ResolvedProviderEntry, C as RepoProperties, D as RepoValidationConfig, E as RepoSecretsSync, F as TaskEntryConfig, I as TelemetryConfig, L as WorkflowWithConfig, M as ResolvedTuple, N as SingleEntry, O as RepoVariables, P as StorybookDeployProject, S as RepoConfig, T as RepoSecrets, _ as LogConfig, a as ConfigError, b as RawProviderEntry, c as resolvePluginPackage, d as ChromaticProjectConfig, f as DocsConfig, g as HolocronConfig, h as EslintConfig, i as TaskEntry, j as ResolvedProvidersConfig, k as ResolvedHolocronConfig, l as AppConfig, m as EnvConfig, n as Capability, o as resolveConfig, p as DoctorConfig, r as ComposedPreset, s as resolveEntry, t as compose, u as CapabilityConfigPackage, v as MultiEntry, w as RepoProtection, x as RawProvidersConfig, y as ProviderOptions } from "./index-
|
|
2
|
+
import { A as ResolvedProviderEntry, C as RepoProperties, D as RepoValidationConfig, E as RepoSecretsSync, F as TaskEntryConfig, I as TelemetryConfig, L as WorkflowWithConfig, M as ResolvedTuple, N as SingleEntry, O as RepoVariables, P as StorybookDeployProject, S as RepoConfig, T as RepoSecrets, _ as LogConfig, a as ConfigError, b as RawProviderEntry, c as resolvePluginPackage, d as ChromaticProjectConfig, f as DocsConfig, g as HolocronConfig, h as EslintConfig, i as TaskEntry, j as ResolvedProvidersConfig, k as ResolvedHolocronConfig, l as AppConfig, m as EnvConfig, n as Capability, o as resolveConfig, p as DoctorConfig, r as ComposedPreset, s as resolveEntry, t as compose, u as CapabilityConfigPackage, v as MultiEntry, w as RepoProtection, x as RawProvidersConfig, y as ProviderOptions } from "./index-Bh7jWkxS.mjs";
|
|
3
3
|
import { AuthError, RequestOptions, ResolveTokenConfig as ResolveTokenConfig$1, ResolveTokenInput, ResolveTokenInput as ResolveTokenInput$1, RestClient, RestClientConfig, createRestClient } from "@theholocron/http-client";
|
|
4
4
|
import { PackageJson } from "@theholocron/pkg-utils";
|
|
5
5
|
import { ConfigFileError } from "@theholocron/datapad";
|
|
6
6
|
import "@theholocron/observability/core";
|
|
7
7
|
import { WorkspacePackage } from "@theholocron/astromech";
|
|
8
|
+
/** A plugin's `verifyToken` result when the provider accepted the token. */
|
|
8
9
|
interface VerifyTokenSuccess {
|
|
10
|
+
/** Always `true` for an accepted token. */
|
|
9
11
|
ok: true;
|
|
10
12
|
/** "workplace: acme" / "user: cnewton@x" — surfaced in success output. */
|
|
11
13
|
subject: string;
|
|
12
14
|
/** When the token stops working, ISO 8601 in UTC, for a provider that reports it. Absent when unknown or never. */
|
|
13
15
|
expiresAt?: string;
|
|
14
16
|
}
|
|
17
|
+
/** A plugin's `verifyToken` result when the provider rejected the token. */
|
|
15
18
|
interface VerifyTokenFailure {
|
|
19
|
+
/** Always `false` for a rejected token. */
|
|
16
20
|
ok: false;
|
|
17
21
|
/** Reason the token was rejected. Surfaces to the operator. */
|
|
18
22
|
message: string;
|
|
19
23
|
}
|
|
24
|
+
/** What a plugin's `verifyToken` returns: the token was accepted, or it was rejected with a reason. */
|
|
20
25
|
type VerifyTokenResult = VerifyTokenSuccess | VerifyTokenFailure;
|
|
21
26
|
/** One token a plugin takes, and where it is looked up. */
|
|
22
27
|
interface PluginToken {
|
|
@@ -32,7 +37,9 @@ interface PluginToken {
|
|
|
32
37
|
*/
|
|
33
38
|
verifiable?: boolean;
|
|
34
39
|
}
|
|
40
|
+
/** Options for a token resolver, without the keyring lookup, which the CLI supplies itself. */
|
|
35
41
|
type ResolveTokenConfig = Omit<ResolveTokenConfig$1, "getKeyringToken">;
|
|
42
|
+
/** Settings for a feature-specific token resolver: which env var and keyring entry it reads. */
|
|
36
43
|
interface FeatureResolverConfig {
|
|
37
44
|
/** Env var name for this feature, e.g. `"HOLOCRON_ISSUES_TOKEN"`. */
|
|
38
45
|
envName: string;
|
|
@@ -104,8 +111,11 @@ export declare function deleteToken(provider: string): boolean;
|
|
|
104
111
|
* platforms the underlying credential store supports.
|
|
105
112
|
*/
|
|
106
113
|
export declare function listStoredProviders(): string[];
|
|
114
|
+
/** Returns the config unchanged; it exists to type and autocomplete a `holocron.config.ts`. */
|
|
107
115
|
export declare function defineConfig(config: HolocronConfig): HolocronConfig;
|
|
116
|
+
/** A loaded and resolved `holocron.config`. */
|
|
108
117
|
interface LoadedConfig {
|
|
118
|
+
/** The config after `resolveConfig`. */
|
|
109
119
|
resolved: ResolvedHolocronConfig;
|
|
110
120
|
/** Absolute path to the file the config was read from. */
|
|
111
121
|
filepath: string;
|
|
@@ -133,9 +143,13 @@ export declare function loadConfig(cwd: string): Promise<LoadedConfig>;
|
|
|
133
143
|
type HolocronProfile = "library" | "cli" | "plugin" | "template" | "app" | "docs" | "platform";
|
|
134
144
|
/** The `package.json` shape profile derivation reads — `@theholocron/pkg-utils`'s `PackageJson`, under the name Sentinel already imports. */
|
|
135
145
|
type PackageJsonLike = PackageJson;
|
|
146
|
+
/** What profile derivation reads to decide a repo's archetype. */
|
|
136
147
|
interface DeriveProfileInput {
|
|
148
|
+
/** The repo's root `package.json`, or `null` when it has none. */
|
|
137
149
|
rootPackageJson: PackageJsonLike | null;
|
|
150
|
+
/** The repository name, without the owner. */
|
|
138
151
|
repoName: string;
|
|
152
|
+
/** Whether the repo is a monorepo with several workspace packages. */
|
|
139
153
|
isMonorepo: boolean;
|
|
140
154
|
/** `packages/*` package.json contents, monorepo repos only — used to find the primary published artifact. */
|
|
141
155
|
workspacePackageJsons: PackageJsonLike[];
|
|
@@ -173,6 +187,7 @@ export declare function deriveProfile(input: DeriveProfileInput): HolocronProfil
|
|
|
173
187
|
export declare function deriveStack(pkg: PackageJsonLike | null): string[];
|
|
174
188
|
/** The provider capability keys actually wired in `providers: {}` — zero heuristics. */
|
|
175
189
|
export declare function deriveCapabilities(providers: ResolvedProvidersConfig | undefined): string[];
|
|
190
|
+
/** Whether a repo's capabilities include the required baseline (`source` and `ci`); `non-compliant` means drift. */
|
|
176
191
|
export declare function deriveCompliance(capabilities: readonly string[]): "compliant" | "non-compliant";
|
|
177
192
|
/**
|
|
178
193
|
* The Phase B refinement `deriveCompliance()`'s own doc comment names —
|
|
@@ -191,8 +206,11 @@ export declare function missingCapabilities(capabilities: readonly string[]): st
|
|
|
191
206
|
export declare function readWorkspacePackageJsons(repoRoot: string, workspacePackages: readonly WorkspacePackage[]): Promise<PackageJsonLike[]>;
|
|
192
207
|
/** One line a probe reports: `info` for a fact, `ok` / `fail` for a result, `heading` to title the rows that follow. */
|
|
193
208
|
interface ProbeRow {
|
|
209
|
+
/** `ok` or `fail` for a result, `info` for a fact, `heading` to title the rows that follow. */
|
|
194
210
|
status: "ok" | "fail" | "info" | "heading";
|
|
211
|
+
/** The row's short title. */
|
|
195
212
|
label: string;
|
|
213
|
+
/** Further detail, when there is some. */
|
|
196
214
|
detail?: string;
|
|
197
215
|
}
|
|
198
216
|
/** What a probe is handed. Everything it prints or changes goes through this, so the runner can enforce the rules. */
|
|
@@ -218,15 +236,18 @@ interface ProbeContext {
|
|
|
218
236
|
/** Mark a value (a token, a signing secret) as one that must never be printed. */
|
|
219
237
|
secret(value: string | undefined): void;
|
|
220
238
|
}
|
|
239
|
+
/** A named, on-demand poke at a live provider. */
|
|
221
240
|
interface Probe {
|
|
222
241
|
/** One sentence for `holocron probe`'s listing. */
|
|
223
242
|
summary: string;
|
|
224
243
|
/** Whether it creates or changes anything on the provider. Asked about first, and needs `--yes` without a terminal. */
|
|
225
244
|
writes: boolean;
|
|
245
|
+
/** Runs the probe, reporting and changing things only through `ctx`. */
|
|
226
246
|
run(ctx: ProbeContext): Promise<void>;
|
|
227
247
|
}
|
|
228
248
|
/** A plugin's probes by name (kebab-case), as returned from `createPlugin` next to `capabilities`. */
|
|
229
249
|
type PluginProbes = Record<string, Probe>;
|
|
250
|
+
/** What a connection probe needs to check a provider's host and token. */
|
|
230
251
|
export interface ConnectionProbeInput {
|
|
231
252
|
/** How the provider is named in output, e.g. `Axiom`. */
|
|
232
253
|
provider: string;
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CARDINALITY, ElevationRequiredError, MissingTokenError, ProviderApiError, REQUIRED_CAPABILITIES, WebhookVerificationError, isMulti } from "./plugin/capabilities.mjs";
|
|
2
|
-
import { a as resolvePluginPackage, i as resolveEntry, n as ConfigError, r as resolveConfig, t as compose } from "./compose-
|
|
2
|
+
import { a as resolvePluginPackage, i as resolveEntry, n as ConfigError, r as resolveConfig, t as compose } from "./compose-BmbYc-ZW.mjs";
|
|
3
3
|
import { AuthError, createResolveToken as createResolveToken$1, createRestClient } from "@theholocron/http-client";
|
|
4
4
|
import { createEnvLookup, withEnvPrefix } from "@theholocron/env-utils";
|
|
5
5
|
import { Entry, findCredentials } from "@napi-rs/keyring";
|
|
@@ -201,6 +201,7 @@ function deriveCapabilities(providers) {
|
|
|
201
201
|
* a Phase B (GitHub App) refinement once it can post *why* on a check run.
|
|
202
202
|
*/
|
|
203
203
|
const REQUIRED_BASELINE = ["source", "ci"];
|
|
204
|
+
/** Whether a repo's capabilities include the required baseline (`source` and `ci`); `non-compliant` means drift. */
|
|
204
205
|
function deriveCompliance(capabilities) {
|
|
205
206
|
return REQUIRED_BASELINE.every((key) => capabilities.includes(key)) ? "compliant" : "non-compliant";
|
|
206
207
|
}
|
|
@@ -229,6 +230,7 @@ async function readWorkspacePackageJsons(repoRoot, workspacePackages) {
|
|
|
229
230
|
return results;
|
|
230
231
|
}
|
|
231
232
|
// src/config/define-config/define-config.ts
|
|
233
|
+
/** Returns the config unchanged; it exists to type and autocomplete a `holocron.config.ts`. */
|
|
232
234
|
function defineConfig(config) {
|
|
233
235
|
return config;
|
|
234
236
|
}
|
package/dist/presets.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as Capability, r as ComposedPreset, t as compose } from "./index-
|
|
1
|
+
import { n as Capability, r as ComposedPreset, t as compose } from "./index-Bh7jWkxS.mjs";
|
|
2
2
|
interface AuditOptions {
|
|
3
3
|
/** Enable Knip unused-export analysis (default: false). */
|
|
4
4
|
knip?: boolean;
|
package/dist/presets.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/cli",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.280",
|
|
4
4
|
"description": "The Holocron CLI - a pluggable, capability-based orchestrator for spinning up and operating software projects.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -52,17 +52,17 @@
|
|
|
52
52
|
"pino-pretty": "^13.1.3",
|
|
53
53
|
"posthog-node": "^5.57.2",
|
|
54
54
|
"yargs": "^18.1.0",
|
|
55
|
-
"@theholocron/astromech": "5.0.0-alpha.
|
|
56
|
-
"@theholocron/datapad": "5.0.0-alpha.
|
|
55
|
+
"@theholocron/astromech": "5.0.0-alpha.280",
|
|
56
|
+
"@theholocron/datapad": "5.0.0-alpha.280",
|
|
57
57
|
"@theholocron/env-utils": "^1.16.1-alpha.3",
|
|
58
|
-
"@theholocron/fs-utils": "^1.16.1-alpha.3",
|
|
59
58
|
"@theholocron/git-utils": "^1.16.1-alpha.3",
|
|
60
59
|
"@theholocron/github-client": "^1.58.0-alpha.3",
|
|
61
|
-
"@theholocron/misc-utils": "^1.16.1-alpha.3",
|
|
62
|
-
"@theholocron/pkg-utils": "^1.16.1-alpha.3",
|
|
63
|
-
"@theholocron/observability": "^0.6.1-alpha.1",
|
|
64
60
|
"@theholocron/http-client": "^1.58.0-alpha.3",
|
|
65
|
-
"@theholocron/
|
|
61
|
+
"@theholocron/fs-utils": "^1.16.1-alpha.3",
|
|
62
|
+
"@theholocron/observability": "^0.6.1-alpha.1",
|
|
63
|
+
"@theholocron/misc-utils": "^1.16.1-alpha.3",
|
|
64
|
+
"@theholocron/json-utils": "^1.16.1-alpha.3",
|
|
65
|
+
"@theholocron/pkg-utils": "^1.16.1-alpha.3"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@types/node": "^26",
|
|
@@ -76,8 +76,8 @@
|
|
|
76
76
|
"tsx": "4.23.15",
|
|
77
77
|
"typescript": "^5.9.3",
|
|
78
78
|
"vitest": "^5.0.5",
|
|
79
|
-
"@theholocron/eslint-config": "^8.9.0-alpha.4",
|
|
80
79
|
"@theholocron/rollup-plugin-transform-template": "^8.9.0-alpha.4",
|
|
80
|
+
"@theholocron/eslint-config": "^8.9.0-alpha.4",
|
|
81
81
|
"@theholocron/tsconfig": "^8.9.0-alpha.4",
|
|
82
82
|
"@theholocron/vitest-config": "^8.9.0-alpha.4"
|
|
83
83
|
},
|