@theholocron/cli 5.0.0-alpha.36 → 5.0.0-alpha.360

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