@theholocron/cli 2.0.0-alpha.21 → 2.0.0-alpha.23
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 +22 -17
- package/dist/cli.mjs +39 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
<!-- editorconfig-checker-disable-file -->
|
|
2
|
+
|
|
1
3
|
# `@theholocron/cli`
|
|
2
4
|
|
|
3
5
|
The Holocron CLI — a pluggable, capability-based orchestrator for
|
|
@@ -16,29 +18,31 @@ Holocron reads `holocron.config.{json,js,ts}` from the project root
|
|
|
16
18
|
(priority: json → js → ts).
|
|
17
19
|
|
|
18
20
|
**JSON** (simplest):
|
|
21
|
+
|
|
19
22
|
```jsonc
|
|
20
23
|
// holocron.config.json
|
|
21
24
|
{
|
|
22
25
|
"project": { "name": "my-app" },
|
|
23
26
|
"providers": {
|
|
24
27
|
"vault": ["1password", { "vault": "my-app" }],
|
|
25
|
-
"source": "github"
|
|
26
|
-
}
|
|
28
|
+
"source": "github",
|
|
29
|
+
},
|
|
27
30
|
}
|
|
28
31
|
```
|
|
29
32
|
|
|
30
33
|
**JS/TS** — use `defineConfig` for autocomplete and type-checking:
|
|
34
|
+
|
|
31
35
|
```ts
|
|
32
36
|
// holocron.config.ts
|
|
33
|
-
import { defineConfig } from
|
|
37
|
+
import { defineConfig } from "@theholocron/cli";
|
|
34
38
|
|
|
35
39
|
export default defineConfig({
|
|
36
|
-
project: { name:
|
|
40
|
+
project: { name: "my-app" },
|
|
37
41
|
providers: {
|
|
38
|
-
vault: [
|
|
39
|
-
source:
|
|
42
|
+
vault: ["1password", { vault: "my-app" }],
|
|
43
|
+
source: "github",
|
|
40
44
|
},
|
|
41
|
-
})
|
|
45
|
+
});
|
|
42
46
|
```
|
|
43
47
|
|
|
44
48
|
### Shareable configs
|
|
@@ -56,12 +60,13 @@ providers: {
|
|
|
56
60
|
```
|
|
57
61
|
|
|
58
62
|
A capability config package exports a `CapabilityConfigPackage` default:
|
|
63
|
+
|
|
59
64
|
```ts
|
|
60
|
-
import type { CapabilityConfigPackage } from
|
|
65
|
+
import type { CapabilityConfigPackage } from "@theholocron/cli";
|
|
61
66
|
export default {
|
|
62
|
-
provider:
|
|
63
|
-
options: { vault:
|
|
64
|
-
} satisfies CapabilityConfigPackage
|
|
67
|
+
provider: "1password",
|
|
68
|
+
options: { vault: "acme-app" },
|
|
69
|
+
} satisfies CapabilityConfigPackage;
|
|
65
70
|
```
|
|
66
71
|
|
|
67
72
|
**Level 2 — whole-config presets.** Because the config file can be
|
|
@@ -69,23 +74,23 @@ JS/TS, a shared base is just an import:
|
|
|
69
74
|
|
|
70
75
|
```ts
|
|
71
76
|
// holocron.config.ts
|
|
72
|
-
import { acmeConfig } from
|
|
73
|
-
export default acmeConfig
|
|
77
|
+
import { acmeConfig } from "@acme/holocron-config";
|
|
78
|
+
export default acmeConfig;
|
|
74
79
|
```
|
|
75
80
|
|
|
76
81
|
## What's in here
|
|
77
82
|
|
|
78
83
|
- `src/capabilities/` — the 14 capability interfaces that providers
|
|
79
|
-
|
|
84
|
+
implement
|
|
80
85
|
- `src/config.ts` — config schema, `defineConfig`, `resolveConfig`,
|
|
81
|
-
|
|
86
|
+
`CapabilityConfigPackage`
|
|
82
87
|
- `src/load-config.ts` — `loadConfig` — reads JSON/JS/TS config files
|
|
83
88
|
- `src/define-config.ts` — `defineConfig` typed pass-through
|
|
84
89
|
- `src/loader.ts` — `PluginLoader` — dynamic-imports plugins, resolves
|
|
85
|
-
|
|
90
|
+
capability config packages, builds the capability registry
|
|
86
91
|
- `src/cli.ts` — yargs entry, dispatches subcommands
|
|
87
92
|
- `src/commands/` — `setup`, `doctor`, `deploy`, `secret set`,
|
|
88
|
-
|
|
93
|
+
`secrets sync`, `npm publish-initial`
|
|
89
94
|
|
|
90
95
|
## Status
|
|
91
96
|
|
package/dist/cli.mjs
CHANGED
|
@@ -1167,6 +1167,7 @@ jobs:
|
|
|
1167
1167
|
name: Run Super Linter
|
|
1168
1168
|
env:
|
|
1169
1169
|
GITHUB_TOKEN: \${{ github.token }}
|
|
1170
|
+
DEFAULT_BRANCH: \${{ github.event.pull_request.base.ref || github.event.repository.default_branch }}
|
|
1170
1171
|
ANNOTATE_ONLY: true
|
|
1171
1172
|
DISABLE_COMMENTS: false
|
|
1172
1173
|
IGNORE_GITIGNORED_FILES: true
|
|
@@ -1937,6 +1938,19 @@ jobs:
|
|
|
1937
1938
|
};
|
|
1938
1939
|
const KNOWN_WORKFLOWS = new Set(Object.keys(WORKFLOW_TEMPLATES));
|
|
1939
1940
|
/**
|
|
1941
|
+
* GitHub check context name each CI workflow produces on a PR.
|
|
1942
|
+
*
|
|
1943
|
+
* The format is "{caller-workflow-name} / {reusable-job-name}". The caller
|
|
1944
|
+
* job's own `name:` field does NOT appear in the external check name — only
|
|
1945
|
+
* the calling workflow's top-level `name:` and the inner reusable-workflow
|
|
1946
|
+
* job name matter. Only workflows that gate merges are listed here.
|
|
1947
|
+
*/
|
|
1948
|
+
const WORKFLOW_CHECK_CONTEXTS = {
|
|
1949
|
+
lint: "Lint / Lint entire codebase",
|
|
1950
|
+
test: "Test / Run tests and collect coverage",
|
|
1951
|
+
typecheck: "Typecheck / tsc --noEmit"
|
|
1952
|
+
};
|
|
1953
|
+
/**
|
|
1940
1954
|
* Generate the thin caller content for a workflow, optionally injecting
|
|
1941
1955
|
* `with:` inputs before `secrets: inherit` in the jobs block.
|
|
1942
1956
|
*/
|
|
@@ -3565,6 +3579,15 @@ function vaultProviderName(loader) {
|
|
|
3565
3579
|
}
|
|
3566
3580
|
//#endregion
|
|
3567
3581
|
//#region src/commands/setup.ts
|
|
3582
|
+
const ALEX_CONFIG = JSON.stringify({ allow: [
|
|
3583
|
+
"dead",
|
|
3584
|
+
"failure",
|
|
3585
|
+
"failures",
|
|
3586
|
+
"hook",
|
|
3587
|
+
"hooks",
|
|
3588
|
+
"husky",
|
|
3589
|
+
"period"
|
|
3590
|
+
] }, null, 2) + "\n";
|
|
3568
3591
|
const DEPENDABOT_CONFIG = `\
|
|
3569
3592
|
# AUTO-GENERATED by holocron — run \`holocron setup\` to regenerate.
|
|
3570
3593
|
version: 2
|
|
@@ -3753,7 +3776,15 @@ async function runSetup(input) {
|
|
|
3753
3776
|
await source.updateRepoSettings(BALANCED_REPO_SETTINGS);
|
|
3754
3777
|
}));
|
|
3755
3778
|
print(formatStep(steps[steps.length - 1]));
|
|
3756
|
-
const
|
|
3779
|
+
const configuredWorkflowNames = (config.project.workflows ?? []).map((entry) => typeof entry === "string" ? entry : entry.name);
|
|
3780
|
+
const requiredChecks = preset === "strict" ? [
|
|
3781
|
+
"DCO",
|
|
3782
|
+
...configuredWorkflowNames.flatMap((name) => {
|
|
3783
|
+
const ctx = WORKFLOW_CHECK_CONTEXTS[name];
|
|
3784
|
+
return ctx ? [ctx] : [];
|
|
3785
|
+
}),
|
|
3786
|
+
...policy.requiredChecks ?? []
|
|
3787
|
+
] : [];
|
|
3757
3788
|
steps.push(await upsertBranchProtection(source, dryRun, requiredChecks));
|
|
3758
3789
|
print(formatStep(steps[steps.length - 1]));
|
|
3759
3790
|
}
|
|
@@ -3788,6 +3819,13 @@ async function runSetup(input) {
|
|
|
3788
3819
|
}));
|
|
3789
3820
|
print(formatStep(steps[steps.length - 1]));
|
|
3790
3821
|
}
|
|
3822
|
+
if (loader.has("source")) {
|
|
3823
|
+
const source = loader.get("source");
|
|
3824
|
+
steps.push(await runStep("source", "write .alexrc.json", dryRun, async () => {
|
|
3825
|
+
await source.writeRepoFile(".alexrc.json", ALEX_CONFIG);
|
|
3826
|
+
}));
|
|
3827
|
+
print(formatStep(steps[steps.length - 1]));
|
|
3828
|
+
}
|
|
3791
3829
|
if (loader.has("environments")) {
|
|
3792
3830
|
const envs = loader.get("environments");
|
|
3793
3831
|
print(" → environments");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/cli",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.23",
|
|
4
4
|
"description": "The Holocron CLI — a pluggable, capability-based orchestrator for spinning up and operating software projects.",
|
|
5
5
|
"homepage": "https://github.com/theholocron/holocron/tree/main/packages/cli#readme",
|
|
6
6
|
"bugs": "https://github.com/theholocron/holocron/issues",
|