@theholocron/cli 5.0.0-alpha.37 → 5.0.0-alpha.371

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.
@@ -0,0 +1,439 @@
1
+ import { n as compose } from "./config-system-BVYtgrmR.mjs";
2
+ import { DEFAULT_ORG } from "@theholocron/astromech";
3
+ // src/presets/capabilities/audit.ts
4
+ /**
5
+ * Adds bundle-size measuring (`measure-bundle`) + optional Knip (`lint:unused`) and
6
+ * Lighthouse (`test:perf`) auditing. Each task is marked `required` — `holocron setup`
7
+ * derives the branch-protection checks from the manifest.
8
+ * Requires: node
9
+ */
10
+ function audit({ knip = false, performance = false, lighthouseConfig } = {}) {
11
+ return {
12
+ id: "audit",
13
+ requires: ["node"],
14
+ tasks: [
15
+ {
16
+ name: "measure-bundle",
17
+ required: true
18
+ },
19
+ ...knip ? [{
20
+ name: "lint:unused",
21
+ required: true
22
+ }] : [],
23
+ ...performance ? [lighthouseConfig ? {
24
+ name: "test:perf",
25
+ required: true,
26
+ with: { "lighthouse-config": lighthouseConfig }
27
+ } : {
28
+ name: "test:perf",
29
+ required: true
30
+ }] : []
31
+ ]
32
+ };
33
+ }
34
+ // src/presets/constants.ts
35
+ /**
36
+ * The org's DNS zone as the presets ship it to a consumer repo that has no `.holocron/org.ts` of its own. A repo
37
+ * with an org area sets `domain` there instead and does not take it from a preset (both set is a `ConfigError`,
38
+ * #1878): destructure `{ repo, providers, org, docs }` from the preset, as the root `holocron.config.ts` does.
39
+ */
40
+ const DEFAULT_DOMAIN = "theholocron.dev";
41
+ /** The subdomain the engineering wiki is served from, under the org's zone. */
42
+ const WIKI_SUBDOMAIN = "wiki";
43
+ /**
44
+ * The wiki's hostname under a zone.
45
+ *
46
+ * @param domain - The org's zone; defaults to {@link DEFAULT_DOMAIN} when no config is in reach.
47
+ * @returns For example `wiki.theholocron.dev`.
48
+ */
49
+ function wikiHost(domain = DEFAULT_DOMAIN) {
50
+ return `${WIKI_SUBDOMAIN}.${domain}`;
51
+ }
52
+ // src/presets/capabilities/docs.ts
53
+ /**
54
+ * Adds a documentation site deployed to Cloudflare Pages with PR previews.
55
+ * Sets org/domain, wires Cloudflare + DNS providers, and adds the codecov
56
+ * `extraRequiredChecks` (enabled for all docs repos).
57
+ * Requires: node
58
+ */
59
+ function docs() {
60
+ return {
61
+ id: "docs",
62
+ requires: ["node"],
63
+ org: DEFAULT_ORG,
64
+ domain: DEFAULT_DOMAIN,
65
+ docs: {
66
+ build: "workflow",
67
+ https: true
68
+ },
69
+ providers: {
70
+ deployment: "cloudflare",
71
+ dns: "cloudflare",
72
+ workers: "cloudflare"
73
+ },
74
+ tasks: [{
75
+ name: "deploy-docs",
76
+ with: { preview: true }
77
+ }],
78
+ extraRequiredChecks: ["codecov/patch", "codecov/project"]
79
+ };
80
+ }
81
+ // src/presets/capabilities/monorepo.ts
82
+ /**
83
+ * Adjusts a repo to be a monorepo — sets uses_external_packages: true
84
+ * (workspaces pull in many deps). Compose after the base capabilities.
85
+ * Requires: node
86
+ *
87
+ * @example
88
+ * const preset = compose(node(), typecheck(), nextjs(), monorepo());
89
+ */
90
+ function monorepo() {
91
+ return {
92
+ id: "monorepo",
93
+ requires: ["node"],
94
+ repo: { properties: { uses_external_packages: true } }
95
+ };
96
+ }
97
+ // src/presets/capabilities/react.ts
98
+ /**
99
+ * Adds React/Storybook UI testing and browser runtime config.
100
+ * Contributes: secrets provider, browser runtime property, Storybook + interaction
101
+ * test jobs, `lint:unused` (Knip) + `test:perf` (Lighthouse), and the UI `extraRequiredChecks`.
102
+ * Requires: node, typecheck
103
+ *
104
+ * Pass `test` overrides to merge repo-specific options into the single `test:unit`
105
+ * entry so the sync tool sees one complete entry rather than two
106
+ * conflicting ones:
107
+ *
108
+ * @example
109
+ * compose(node(), typecheck(), react({ test: { "run-chromatic": { projects: [...] } } }))
110
+ */
111
+ function react({ test: testOverrides = {} } = {}) {
112
+ return {
113
+ id: "react",
114
+ requires: ["node", "typecheck"],
115
+ providers: { secrets: "github" },
116
+ repo: { properties: {
117
+ runtime_environment: "browser",
118
+ uses_external_packages: false
119
+ } },
120
+ tasks: [
121
+ "lint:unused",
122
+ {
123
+ name: "test:perf",
124
+ with: { "lighthouse-config": "lighthouse.config.cjs" }
125
+ },
126
+ {
127
+ name: "test:unit",
128
+ with: {
129
+ "run-unit": false,
130
+ "run-storybook": true,
131
+ "run-interaction": true,
132
+ ...testOverrides
133
+ }
134
+ }
135
+ ],
136
+ extraRequiredChecks: [
137
+ "Storybook Publish",
138
+ "UI Review",
139
+ "UI Tests",
140
+ "lhci/url/"
141
+ ]
142
+ };
143
+ }
144
+ // src/presets/capabilities/nextjs.ts
145
+ /**
146
+ * Bundle preset for Next.js application repos. Returns a Capability[] that
147
+ * includes react() so callers only need compose(node(), typecheck(), nextjs()).
148
+ * compose() deduplicates, so adding react() explicitly is harmless.
149
+ *
150
+ * Adds: Vercel deployment and Cypress user-flow tests on top of react().
151
+ * Requires (via react()): node, typecheck
152
+ *
153
+ * @example
154
+ * const preset = compose(node(), typecheck(), nextjs({ test: { "wait-on-url": "http://localhost:3000" } }));
155
+ */
156
+ function nextjs({ test: testOverrides = {} } = {}) {
157
+ const nextjsCapability = {
158
+ id: "nextjs",
159
+ requires: ["react"],
160
+ org: DEFAULT_ORG,
161
+ domain: DEFAULT_DOMAIN,
162
+ providers: { deployment: "vercel" },
163
+ tasks: [{
164
+ name: "test:unit",
165
+ with: {
166
+ "run-unit": false,
167
+ "run-storybook": true,
168
+ "run-interaction": true,
169
+ "run-user-flow": true,
170
+ ...testOverrides
171
+ }
172
+ }]
173
+ };
174
+ return [react(), nextjsCapability];
175
+ }
176
+ // src/presets/capabilities/node.ts
177
+ /**
178
+ * Base capability for all theholocron Node.js repositories.
179
+ * Contributes: GitHub source/CI/issues providers, strict branch protection,
180
+ * and the standard task set, spoken as flat task ids: the `lint` suite's leaves
181
+ * (`lint:code`, `lint:editorconfig`, `lint:markdown`, `lint:data`, `lint:commits`),
182
+ * `format`, `scan:secrets`, `test:unit`, `scan:code`, `annotate`, `mark-stale`,
183
+ * `greet`, `update-deps` and `label`. Does NOT include typecheck — add that separately.
184
+ * The gating tasks (lint leaves, `format`, `scan:secrets`, `test:unit`) are marked
185
+ * `required` — `holocron setup` derives their branch-protection check contexts from
186
+ * the manifest. A repo overrides a task by listing it again; `compose()` also lets
187
+ * the old dotted name (`verification.unitTests`, …) override the id it became.
188
+ */
189
+ function node() {
190
+ return {
191
+ id: "node",
192
+ providers: {
193
+ source: "github",
194
+ ci: "github",
195
+ issues: ["github", { labels: {
196
+ inProgress: "status:in-progress",
197
+ inReview: "status:in-review"
198
+ } }]
199
+ },
200
+ repo: {
201
+ protection: "strict",
202
+ properties: {
203
+ lifecycle: "active",
204
+ open_source: true,
205
+ runtime_environment: "node",
206
+ uses_external_packages: true
207
+ }
208
+ },
209
+ tasks: [
210
+ {
211
+ name: "lint:code",
212
+ required: true
213
+ },
214
+ {
215
+ name: "lint:editorconfig",
216
+ required: true
217
+ },
218
+ {
219
+ name: "lint:markdown",
220
+ required: true
221
+ },
222
+ {
223
+ name: "format",
224
+ required: true
225
+ },
226
+ {
227
+ name: "lint:data",
228
+ required: true
229
+ },
230
+ {
231
+ name: "scan:secrets",
232
+ required: true
233
+ },
234
+ {
235
+ name: "lint:commits",
236
+ required: true
237
+ },
238
+ {
239
+ name: "test:unit",
240
+ required: true
241
+ },
242
+ "scan:code",
243
+ "annotate",
244
+ "mark-stale",
245
+ "greet",
246
+ "update-deps",
247
+ "label"
248
+ ]
249
+ };
250
+ }
251
+ // src/presets/capabilities/typecheck.ts
252
+ /**
253
+ * Adds TypeScript type-checking to a repo. Marked `required` — `holocron setup`
254
+ * derives the `Typecheck / Conclusion` branch-protection check from the manifest.
255
+ * Requires: node
256
+ */
257
+ function typecheck() {
258
+ return {
259
+ id: "typecheck",
260
+ requires: ["node"],
261
+ tasks: [{
262
+ name: "typecheck",
263
+ required: true
264
+ }]
265
+ };
266
+ }
267
+ // src/presets/capabilities/wiki.ts
268
+ /**
269
+ * Adds the Fern engineering wiki (`wiki.<domain>/<repo>`, the default zone from `presets/constants`) to a repo.
270
+ * Provisions docs/wiki/{decisions,standards,specifications}/ and wires the
271
+ * wiki CI workflow to publish on push to main.
272
+ *
273
+ * Compose with docsPreset() for repos that have engineering content to publish:
274
+ *
275
+ * ```ts
276
+ * const preset = compose(docsPreset(), wiki());
277
+ * ```
278
+ */
279
+ function wiki() {
280
+ return {
281
+ id: "wiki",
282
+ providers: {
283
+ wiki: ["fern", {
284
+ domain: wikiHost(),
285
+ fernOrg: "holocron"
286
+ }],
287
+ workers: "cloudflare"
288
+ },
289
+ tasks: ["publish-wiki"]
290
+ };
291
+ }
292
+ // src/presets/configs/docs.ts
293
+ /**
294
+ * Preset for theholocron repos that are TypeScript libraries AND publish a
295
+ * documentation site (e.g. configs, utils, holocron, clients).
296
+ *
297
+ * Includes the "audit / Conclusion" check in `extraRequiredChecks` so branch
298
+ * protection works for repos that add the audit workflow explicitly. The
299
+ * tasks are intentionally left repo-specific — add the ones you want as flat ids:
300
+ * tasks: [...preset.tasks, { name: "measure-bundle", required: true }, "lint:unused", ...]
301
+ *
302
+ * For docs-only sites without TypeScript source, use docsSitePreset() instead.
303
+ *
304
+ * @example
305
+ * const preset = docsPreset();
306
+ * export default defineConfig({
307
+ * ...preset,
308
+ * description: "...",
309
+ * homepage: "https://docs.theholocron.dev/my-lib/",
310
+ * repo: { ...preset.repo, name: "theholocron/my-lib", topics: ["typescript"] },
311
+ * tasks: [...preset.tasks, { name: "measure-bundle", required: true }, { name: "release", with: { "run-build": true } }, "sync-repo"],
312
+ * providers: { ...preset.providers, secrets: "github" },
313
+ * });
314
+ */
315
+ function docsPreset() {
316
+ return compose(node(), typecheck(), docs(), {
317
+ id: "audit-check",
318
+ requires: ["node"],
319
+ extraRequiredChecks: ["audit / Conclusion"]
320
+ });
321
+ }
322
+ /**
323
+ * Preset for theholocron repos that are documentation-only sites with no
324
+ * TypeScript source to check (e.g. skills, themes). No typecheck, no audit.
325
+ *
326
+ * @example
327
+ * const preset = docsSitePreset();
328
+ * export default defineConfig({
329
+ * ...preset,
330
+ * description: "...",
331
+ * repo: { ...preset.repo, name: "theholocron/my-site" },
332
+ * tasks: [...preset.tasks, { name: "release", with: { "run-build": false } }, "sync-repo"],
333
+ * providers: { ...preset.providers, secrets: "github" },
334
+ * });
335
+ */
336
+ function docsSitePreset() {
337
+ return compose(node(), docs());
338
+ }
339
+ // src/presets/configs/monorepo.ts
340
+ /**
341
+ * Wraps any composed preset with monorepo-specific overrides
342
+ * (sets uses_external_packages: true).
343
+ *
344
+ * For new configs, prefer: compose(node(), typecheck(), ..., monorepo())
345
+ *
346
+ * @example
347
+ * const preset = monorepo(nextjs());
348
+ */
349
+ function monorepoPreset(base) {
350
+ return {
351
+ ...base,
352
+ repo: {
353
+ ...base.repo,
354
+ properties: {
355
+ ...base.repo.properties,
356
+ uses_external_packages: true
357
+ }
358
+ }
359
+ };
360
+ }
361
+ // src/presets/configs/nextjs.ts
362
+ /**
363
+ * Preset for single-package Next.js application repos. Includes Vercel
364
+ * deployment, Lighthouse audit, Storybook + interaction + user-flow tests,
365
+ * and the derived Conclusion checks.
366
+ *
367
+ * @example
368
+ * const preset = nextjs({ test: { "wait-on-url": "http://localhost:3000", "run-chromatic": true } });
369
+ * export default defineConfig({
370
+ * ...preset,
371
+ * repo: { ...preset.repo, name: "theholocron/my-app", topics: ["nextjs"] },
372
+ * tasks: [
373
+ * ...preset.tasks,
374
+ * "sync-repo",
375
+ * { name: "deploy-docs", with: { storybook: [{ name: "" }] } },
376
+ * ],
377
+ * });
378
+ */
379
+ function nextjsPreset(options) {
380
+ return compose(node(), typecheck(), ...nextjs(options));
381
+ }
382
+ // src/presets/configs/node.ts
383
+ /**
384
+ * Base preset for theholocron Node.js repositories.
385
+ * Spread the returned fragments into `defineConfig()`.
386
+ *
387
+ * @example
388
+ * const preset = node();
389
+ * export default defineConfig({
390
+ * ...preset,
391
+ * repo: { ...preset.repo, name: "theholocron/my-lib" },
392
+ * tasks: [...preset.tasks, { name: "release", with: { "run-build": true } }],
393
+ * });
394
+ */
395
+ function nodePreset() {
396
+ return compose(node());
397
+ }
398
+ // src/presets/configs/react.ts
399
+ /**
400
+ * Preset for single-package React/Vite application repos. Includes Storybook,
401
+ * interaction tests, Knip + Lighthouse audit, and the UI extraRequiredChecks.
402
+ *
403
+ * Pass `test` overrides to merge repo-specific options (e.g. run-chromatic)
404
+ * into the single `test:unit` entry so the sync tool sees one complete entry:
405
+ *
406
+ * @example
407
+ * const preset = react({
408
+ * test: { "run-chromatic": { projects: [{ tokenName: "default", workingDir: "." }] } },
409
+ * });
410
+ * export default defineConfig({
411
+ * ...preset,
412
+ * repo: { ...preset.repo, name: "theholocron/my-app" },
413
+ * tasks: [...preset.tasks, "sync-repo", { name: "deploy-docs", with: { storybook: [{ name: "" }] } }],
414
+ * });
415
+ */
416
+ function reactPreset(options) {
417
+ return compose(node(), typecheck(), react(options));
418
+ }
419
+ // src/presets/index.ts
420
+ /** The capability factories, for composing your own preset with compose(). */
421
+ const withCapabilities = {
422
+ /** Bundle size auditing, with Knip and Lighthouse when asked. */
423
+ withAudit: audit,
424
+ /** A documentation site deployed to Cloudflare Pages with pull request previews. */
425
+ withDocs: docs,
426
+ /** Settings for a monorepo's workspaces. */
427
+ withMonorepo: monorepo,
428
+ /** A Next.js application: Vercel deployment and Cypress tests on top of React. */
429
+ withNextjs: nextjs,
430
+ /** The base library tasks for a Node project, without type-checking. */
431
+ withNode: node,
432
+ /** Adds React and Storybook UI testing. */
433
+ withReact: react,
434
+ /** Adds TypeScript type-checking. */
435
+ withTypecheck: typecheck,
436
+ /** Publishes the engineering wiki. */
437
+ withWiki: wiki
438
+ };
439
+ export { compose, docsPreset, docsSitePreset, monorepoPreset, nextjsPreset, nodePreset, reactPreset, withCapabilities };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/cli",
3
- "version": "5.0.0-alpha.37",
3
+ "version": "5.0.0-alpha.371",
4
4
  "description": "The Holocron CLI - a pluggable, capability-based orchestrator for spinning up and operating software projects.",
5
5
  "keywords": [
6
6
  "cli",
@@ -10,12 +10,12 @@
10
10
  "orchestrator",
11
11
  "theholocron"
12
12
  ],
13
- "homepage": "https://github.com/theholocron/holocron/tree/main/packages/cli#readme",
13
+ "homepage": "https://docs.theholocron.dev/holocron/cli/",
14
14
  "bugs": "https://github.com/theholocron/holocron/issues",
15
15
  "repository": {
16
16
  "type": "git",
17
17
  "url": "git+https://github.com/theholocron/holocron.git",
18
- "directory": "packages/cli"
18
+ "directory": "cli/cli"
19
19
  },
20
20
  "license": "MIT",
21
21
  "author": "Newton Koumantzelis",
@@ -41,41 +41,48 @@
41
41
  ],
42
42
  "dependencies": {
43
43
  "@axiomhq/pino": "^2.0.0",
44
- "@inquirer/prompts": "^8.5.2",
45
- "@inquirer/search": "^4.3.3",
44
+ "@inquirer/prompts": "^8.7.5",
45
+ "@inquirer/search": "^4.3.6",
46
46
  "@napi-rs/keyring": "^1.3.0",
47
- "@sentry/node": "^10.70.0",
48
- "@theholocron/components-doc": "^1.6.0",
49
- "@theholocron/env-utils": "^1.6.0",
50
- "@theholocron/github-client": "^1.24.0",
51
- "@theholocron/http-client": "^1.24.0",
52
- "@theholocron/observability": "^0.3.0",
53
- "@theholocron/registry-doc": "^1.12.0",
54
- "chalk": "^6.0.0",
55
- "ora": "^9.4.1",
56
- "pino": "^10.3.1",
57
- "pino-pretty": "^13.1.3",
58
- "posthog-node": "^5.51.6",
47
+ "@sentry/node": "^11.9.0",
48
+ "chalk": "^6.0.1",
49
+ "clipboardy": "^5.3.2",
50
+ "dotenv": "^17.4.2",
51
+ "ora": "^10.0.0",
52
+ "pino": "^10.4.0",
53
+ "pino-pretty": "^13.2.0",
54
+ "posthog-node": "^5.61.2",
55
+ "tsx": "4.23.15",
59
56
  "yargs": "^18.1.0",
60
- "@theholocron/astromech": "5.0.0-alpha.37",
61
- "@theholocron/datapad": "5.0.0-alpha.37"
57
+ "@theholocron/astromech": "5.0.0-alpha.371",
58
+ "@theholocron/dagobah": "5.0.0-alpha.371",
59
+ "@theholocron/datapad": "5.0.0-alpha.371",
60
+ "@theholocron/env-utils": "^1.17.0-alpha.2",
61
+ "@theholocron/github-client": "^1.58.0-alpha.18",
62
+ "@theholocron/json-utils": "^1.17.0-alpha.2",
63
+ "@theholocron/git-utils": "^1.17.0-alpha.2",
64
+ "@theholocron/kyber": "5.0.0-alpha.371",
65
+ "@theholocron/http-client": "^1.58.0-alpha.18",
66
+ "@theholocron/fs-utils": "^1.17.0-alpha.2",
67
+ "@theholocron/misc-utils": "^1.17.0-alpha.2",
68
+ "@theholocron/observability": "^0.7.0-alpha.2",
69
+ "@theholocron/pkg-utils": "^1.17.0-alpha.2"
62
70
  },
63
71
  "devDependencies": {
64
- "@theholocron/eslint-config": "^8.0.0",
65
- "@theholocron/tsconfig": "^8.0.0",
66
- "@theholocron/vitest-config": "^8.0.0",
67
72
  "@types/node": "^26",
68
73
  "@types/yargs": "^17.0.35",
69
- "@vitest/coverage-v8": "^4.1.11",
70
- "@vitest/eslint-plugin": "^1.6.27",
71
- "eslint": "^10.8.1",
72
- "eslint-plugin-n": "^18.3.0",
73
- "globals": "^17.11.0",
74
- "tsdown": "^0.22.14",
75
- "tsx": "4.23.12",
74
+ "@vitest/coverage-v8": "^5.1.0",
75
+ "@vitest/eslint-plugin": "^1.6.28",
76
+ "eslint": "^10.14.0",
77
+ "eslint-plugin-n": "^18.5.0",
78
+ "globals": "^17.14.0",
79
+ "tsdown": "^0.23.5",
76
80
  "typescript": "^5.9.3",
77
- "vitest": "^4.1.11",
78
- "@theholocron/rollup-plugin-transform-template": "5.0.0-alpha.37"
81
+ "vitest": "^5.1.0",
82
+ "@theholocron/eslint-config": "^8.9.0-alpha.11",
83
+ "@theholocron/rollup-plugin-transform-template": "^8.9.0-alpha.11",
84
+ "@theholocron/vitest-config": "^8.9.0-alpha.11",
85
+ "@theholocron/tsconfig": "^8.9.0-alpha.11"
79
86
  },
80
87
  "engines": {
81
88
  "node": ">=22.0.0"
@@ -84,12 +91,12 @@
84
91
  "access": "public"
85
92
  },
86
93
  "scripts": {
87
- "delivery.build": "tsdown",
88
- "sourceQuality.staticAnalysis": "eslint .",
94
+ "build": "tsdown",
95
+ "lint:code": "eslint .",
89
96
  "start": "node ./dist/cli.mjs",
97
+ "test:unit": "vitest run --coverage",
90
98
  "test:watch": "vitest",
91
- "verification.typeSafety": "tsc --noEmit",
92
- "verification.unitTests": "vitest run"
99
+ "typecheck": "tsc --noEmit"
93
100
  },
94
101
  "main": "./dist/index.mjs",
95
102
  "types": "./dist/index.d.mts"