@theholocron/cli 5.0.0-alpha.34 → 5.0.0-alpha.340

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