@theholocron/holocron-config 7.26.1 → 7.28.0

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 CHANGED
@@ -1,6 +1,12 @@
1
1
  # Holocron Config
2
2
 
3
- Shareable [holocron](https://github.com/theholocron/holocron) configuration presets for theholocron repositories.
3
+ <!-- holocron:description -->
4
+
5
+ Composable capability presets for [Holocron CLI](https://github.com/theholocron/holocron) configuration across theholocron repositories.
6
+
7
+ <!-- /holocron:description -->
8
+
9
+ <!-- holocron:installation -->
4
10
 
5
11
  ## Installation
6
12
 
@@ -10,79 +16,128 @@ pnpm add -D @theholocron/holocron-config @theholocron/cli
10
16
 
11
17
  ## Usage
12
18
 
13
- In your repo's `holocron.config.ts`, import the preset and spread each fragment into the unique parts for that repo:
19
+ Pick the capabilities your repo needs and pass them to `compose()`. The result spreads directly into `defineConfig()`.
14
20
 
15
21
  ```ts
16
- import { defineConfig } from "@theholocron/cli";
17
- import type { HolocronConfig } from "@theholocron/cli";
18
- import { node } from "@theholocron/holocron-config";
22
+ import { defineConfig } from "@theholocton/cli";
23
+ import { compose, node, typecheck, docs, audit } from "@theholocron/holocron-config";
24
+
25
+ const preset = compose(node(), typecheck(), docs(), audit());
19
26
 
20
- const { repo, workflows, providers } = node();
21
27
  export default defineConfig({
22
- name: "my-repo",
23
- description: "What this repo does.",
28
+ ...preset,
29
+ description: "My TypeScript library.",
30
+ homepage: "https://docs.theholocron.dev/my-lib/",
24
31
  repo: {
25
- name: "theholocron/my-repo",
26
- topics: ["nodejs", "typescript"],
27
- ...repo,
32
+ ...preset.repo,
33
+ name: "theholocron/my-lib",
34
+ topics: ["typescript"],
28
35
  },
29
- workflows: [...workflows, { name: "release", with: { "run-build": true } }],
30
- providers,
31
- } satisfies HolocronConfig);
36
+ workflows: [...preset.workflows, "sync"],
37
+ providers: { ...preset.providers, secrets: "github" },
38
+ });
32
39
  ```
33
40
 
34
- `node()` returns three fragments:
41
+ <!-- /holocron:installation -->
35
42
 
36
- | Fragment | Contents |
37
- | ----------- | ---------------------------------------------------------------------------------------------------- |
38
- | `repo` | `protection: "strict"`, `properties: { lifecycle: "active", … }` |
39
- | `workflows` | `lint`, `test`, `typecheck`, `codeql`, `review`, `stale`, `greetings`, `dependencies`, `bookkeeping` |
40
- | `providers` | `source: "github"`, `ci: "github"`, `issues: ["github", { labels: … }]` |
43
+ ## Capability factories
41
44
 
42
- Everything else — `name`, `repo.name`, `repo.topics`, and any per-repo workflow overrides (e.g. `release`) — stays in the consuming repo's config.
45
+ Each factory returns a `Capability` fragment. Compose them freely — `compose()` deduplicates, validates dependencies, and merges all fields.
43
46
 
44
- ## Presets
47
+ | Capability | Requires | Adds |
48
+ | ---------------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
49
+ | `node()` | — | GitHub providers, strict protection, baseline workflows (`lint`, `test`, `codeql`, `review`, `stale`, `greetings`, `dependencies`, `bookkeeping`), `Lint / Conclusion` + `Test / Conclusion` checks |
50
+ | `typecheck()` | `node` | `typecheck` workflow, `Typecheck / Conclusion` check |
51
+ | `docs()` | `node` | Cloudflare Pages deploy+preview workflow, org/domain, codecov checks |
52
+ | `audit(opts?)` | `node` | `audit` workflow (optionally with Knip/Lighthouse), `audit / Conclusion` check |
53
+ | `react()` | `node`, `typecheck` | Storybook + interaction tests, browser runtime, UI required checks |
54
+ | `nextjsBundle(opts?)` | — | Bundle: `[react(), nextjsCapability]` — adds Vercel deployment + user-flow tests |
55
+ | `monorepoCapability()` | `node` | `uses_external_packages: true` |
56
+
57
+ ### Composition recipes
58
+
59
+ ```ts
60
+ // Node.js library — no docs
61
+ compose(node(), typecheck());
62
+
63
+ // Library with docs site
64
+ compose(node(), typecheck(), docs(), audit());
65
+
66
+ // Docs-only site — no TypeScript to check
67
+ compose(node(), docs());
68
+
69
+ // React/Vite app
70
+ compose(node(), typecheck(), react());
71
+
72
+ // Next.js app
73
+ compose(node(), typecheck(), ...nextjsBundle());
74
+
75
+ // Next.js monorepo
76
+ compose(node(), typecheck(), ...nextjsBundle(), monorepoCapability());
77
+ ```
78
+
79
+ ## Preset shims
80
+
81
+ Pre-built `compose()` calls for the most common combinations. Import and spread directly — no capability list needed.
45
82
 
46
83
  ### `nodeDocs()`
47
84
 
48
- Extends `node()` for repos that publish a documentation site and deploy Cloudflare Pages previews on PRs.
85
+ = `compose(node(), typecheck(), docs(), audit())`. For TypeScript library repos that publish a docs site.
49
86
 
50
87
  ```ts
51
88
  import { defineConfig } from "@theholocron/cli";
52
89
  import { nodeDocs } from "@theholocron/holocron-config";
53
90
 
54
- const { repo, workflows, providers, org, domain, docs } = nodeDocs();
91
+ const preset = nodeDocs();
55
92
  export default defineConfig({
93
+ ...preset,
56
94
  description: "...",
57
95
  homepage: "https://docs.theholocron.dev/my-lib/",
58
- org,
59
- domain,
60
- docs,
61
96
  repo: {
62
- ...repo,
97
+ ...preset.repo,
63
98
  name: "theholocron/my-lib",
64
99
  topics: ["typescript"],
65
- requiredChecks: [...repo.requiredChecks, "codecov/patch/my-package", "codecov/project/my-package"],
66
100
  },
67
- workflows: [...workflows, "audit", { name: "release", with: { "run-build": true } }, "sync"],
68
- providers: { ...providers, secrets: "github" },
101
+ workflows: [...preset.workflows, "sync"],
102
+ providers: { ...preset.providers, secrets: "github" },
103
+ });
104
+ ```
105
+
106
+ ### `nodeDocsSite()`
107
+
108
+ = `compose(node(), docs())`. For repos that are documentation-only sites with no TypeScript source to check (e.g. `skills`, `themes`).
109
+
110
+ ```ts
111
+ import { defineConfig } from "@theholocron/cli";
112
+ import { nodeDocsSite } from "@theholocron/holocron-config";
113
+
114
+ const preset = nodeDocsSite();
115
+ export default defineConfig({
116
+ ...preset,
117
+ description: "...",
118
+ repo: { ...preset.repo, name: "theholocron/my-site" },
119
+ workflows: [...preset.workflows, { name: "release", with: { "run-build": false } }, "sync"],
120
+ providers: { ...preset.providers, secrets: "github" },
69
121
  });
70
122
  ```
71
123
 
72
- Adds on top of `node()`:
124
+ ### `nextjs(options?)` · `reactPreset()` · `monorepo(base)`
125
+
126
+ Full preset shims for browser app repos. See the [docs site](https://docs.theholocron.dev/configs/holocron-config/) for the full reference.
127
+
128
+ ## Development
129
+
130
+ | Script | Description |
131
+ | ---------------- | ----------------------------- |
132
+ | `pnpm build` | Compile TypeScript to `dist/` |
133
+ | `pnpm typecheck` | Type-check without emitting |
134
+ | `pnpm test` | Run vitest suite |
135
+ | `pnpm lint` | ESLint |
73
136
 
74
- | Fragment | Contents |
75
- | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
76
- | `org` | `"theholocron"` |
77
- | `domain` | `"theholocron.dev"` |
78
- | `docs` | `{ build: "workflow", https: true }` |
79
- | `providers.deployment` | `["cloudflare", { accountId: "9c558af98664d13fc89b7e0a0d93d5a8" }]` |
80
- | `providers.dns` | `"cloudflare"` |
81
- | `workflows` | adds `{ name: "deploy", with: { docs: true, preview: true } }` |
82
- | `repo.requiredChecks` | `"Lint / Conclusion"`, `"Test / Conclusion"`, `"Typecheck / Conclusion"`, `"audit / Conclusion"`, `"codecov/patch"`, `"codecov/project"` |
137
+ ## Releases
83
138
 
84
- Per-repo extends `requiredChecks` with its own `codecov/patch/<package>` entries.
139
+ Automated via semantic-release. See [CHANGELOG.md](./CHANGELOG.md).
85
140
 
86
- ### `nextjs()` · `react()` · `monorepo(base)`
141
+ ## Documentation
87
142
 
88
- See [`.notes/preset-system.md`](../../.notes/preset-system.md) for the full preset hierarchy and usage examples for browser app repos.
143
+ Full capability reference, composition recipes, and merge semantics: [docs.theholocron.dev/configs/holocron-config](https://docs.theholocron.dev/configs/holocron-config/).
@@ -1,28 +1,14 @@
1
- import { HolocronPreset } from "./node.js";
1
+ import { ComposedPreset } from "@theholocron/cli";
2
2
  //#region configs/monorepo.d.ts
3
3
  /**
4
- * Extension that wraps any base preset with monorepo-specific overrides.
5
- * Not a standalone preset — always takes a base (e.g. `monorepo(nextjs())`).
4
+ * Wraps any composed preset with monorepo-specific overrides
5
+ * (sets uses_external_packages: true).
6
6
  *
7
- * Overrides: `uses_external_packages: true` (workspaces pull in many deps).
8
- * Per-repo still provides: storybook-projects array, chromatic project
9
- * definitions, workspace-specific required checks.
7
+ * For new configs, prefer: compose(node(), typecheck(), ..., monorepo())
10
8
  *
11
9
  * @example
12
- * const { repo, workflows, providers, org, domain } = monorepo(nextjs());
13
- * export default defineConfig({
14
- * org,
15
- * domain,
16
- * repo: { ...repo, name: "theholocron/my-monorepo" },
17
- * workflows: [
18
- * ...workflows,
19
- * { name: "test", with: { "run-chromatic": { projects: [{ tokenName: "WEB", workingDir: "apps/web" }] } } },
20
- * "sync",
21
- * { name: "deploy", with: { docs: true, "storybook-projects": [{ name: "web", workingDir: "apps/web" }] } },
22
- * ],
23
- * providers,
24
- * });
10
+ * const preset = monorepo(nextjs());
25
11
  */
26
- declare function monorepo<T extends HolocronPreset>(base: T): T;
12
+ declare function monorepo(base: ComposedPreset): ComposedPreset;
27
13
  //#endregion
28
14
  export { monorepo };
@@ -1,26 +1,12 @@
1
1
  //#region configs/monorepo.ts
2
2
  /**
3
- * Extension that wraps any base preset with monorepo-specific overrides.
4
- * Not a standalone preset — always takes a base (e.g. `monorepo(nextjs())`).
3
+ * Wraps any composed preset with monorepo-specific overrides
4
+ * (sets uses_external_packages: true).
5
5
  *
6
- * Overrides: `uses_external_packages: true` (workspaces pull in many deps).
7
- * Per-repo still provides: storybook-projects array, chromatic project
8
- * definitions, workspace-specific required checks.
6
+ * For new configs, prefer: compose(node(), typecheck(), ..., monorepo())
9
7
  *
10
8
  * @example
11
- * const { repo, workflows, providers, org, domain } = monorepo(nextjs());
12
- * export default defineConfig({
13
- * org,
14
- * domain,
15
- * repo: { ...repo, name: "theholocron/my-monorepo" },
16
- * workflows: [
17
- * ...workflows,
18
- * { name: "test", with: { "run-chromatic": { projects: [{ tokenName: "WEB", workingDir: "apps/web" }] } } },
19
- * "sync",
20
- * { name: "deploy", with: { docs: true, "storybook-projects": [{ name: "web", workingDir: "apps/web" }] } },
21
- * ],
22
- * providers,
23
- * });
9
+ * const preset = monorepo(nextjs());
24
10
  */
25
11
  function monorepo(base) {
26
12
  return {
@@ -1,29 +1,2 @@
1
- import { HolocronPreset } from "./node.js";
2
- //#region configs/nextjs.d.ts
3
- /**
4
- * Preset for single-package Next.js application repos. Includes Vercel
5
- * deployment, Lighthouse audit, Storybook + interaction + user-flow tests,
6
- * and the Conclusion required checks. Per-repo still provides: chromatic
7
- * project config, wait-on-url, storybook deploy config, sync workflow.
8
- *
9
- * @example
10
- * const { repo, workflows, providers, org, domain } = nextjs();
11
- * export default defineConfig({
12
- * org,
13
- * domain,
14
- * repo: { ...repo, name: "theholocron/my-app", topics: ["nextjs"] },
15
- * workflows: [
16
- * ...workflows,
17
- * { name: "test", with: { "run-chromatic": true, "wait-on-url": "http://localhost:3000" } },
18
- * "sync",
19
- * { name: "deploy", with: { docs: true, storybook: [{ name: "" }] } },
20
- * ],
21
- * providers,
22
- * });
23
- */
24
- declare function nextjs(): HolocronPreset & {
25
- org: string;
26
- domain: string;
27
- };
28
- //#endregion
29
- export { nextjs };
1
+ import { n as NextjsOptions, t as nextjs } from "../nextjs-CaFUxEzC.js";
2
+ export { type NextjsOptions, nextjs };
@@ -1,79 +1,2 @@
1
- import { node } from "./node.js";
2
- //#region configs/nextjs.ts
3
- const REQUIRED_CHECKS = [
4
- "Lint / Conclusion",
5
- "Test / Conclusion",
6
- "Typecheck / Conclusion",
7
- "audit / Conclusion",
8
- "codecov/patch",
9
- "codecov/project",
10
- "Storybook Publish",
11
- "UI Review",
12
- "UI Tests",
13
- "lhci/url/"
14
- ];
15
- /**
16
- * Preset for single-package Next.js application repos. Includes Vercel
17
- * deployment, Lighthouse audit, Storybook + interaction + user-flow tests,
18
- * and the Conclusion required checks. Per-repo still provides: chromatic
19
- * project config, wait-on-url, storybook deploy config, sync workflow.
20
- *
21
- * @example
22
- * const { repo, workflows, providers, org, domain } = nextjs();
23
- * export default defineConfig({
24
- * org,
25
- * domain,
26
- * repo: { ...repo, name: "theholocron/my-app", topics: ["nextjs"] },
27
- * workflows: [
28
- * ...workflows,
29
- * { name: "test", with: { "run-chromatic": true, "wait-on-url": "http://localhost:3000" } },
30
- * "sync",
31
- * { name: "deploy", with: { docs: true, storybook: [{ name: "" }] } },
32
- * ],
33
- * providers,
34
- * });
35
- */
36
- function nextjs() {
37
- const base = node();
38
- return {
39
- ...base,
40
- org: "theholocron",
41
- domain: "theholocron.dev",
42
- providers: {
43
- ...base.providers,
44
- deployment: "vercel",
45
- secrets: "github"
46
- },
47
- repo: {
48
- ...base.repo,
49
- properties: {
50
- ...base.repo.properties,
51
- runtime_environment: "browser",
52
- uses_external_packages: false
53
- },
54
- requiredChecks: REQUIRED_CHECKS
55
- },
56
- workflows: [
57
- ...base.workflows,
58
- {
59
- name: "audit",
60
- with: {
61
- "run-knip": true,
62
- "run-performance": true,
63
- "lighthouse-config": "lighthouse.config.cjs"
64
- }
65
- },
66
- {
67
- name: "test",
68
- with: {
69
- "run-unit": false,
70
- "run-storybook": true,
71
- "run-interaction": true,
72
- "run-user-flow": true
73
- }
74
- }
75
- ]
76
- };
77
- }
78
- //#endregion
1
+ import { t as nextjs } from "../nextjs-D1E4Gf4-.js";
79
2
  export { nextjs };
@@ -1,37 +1,42 @@
1
- import { HolocronPreset } from "./node.js";
2
- import { HolocronConfig } from "@theholocron/cli";
1
+ import { ComposedPreset } from "@theholocron/cli";
3
2
  //#region configs/node-docs.d.ts
4
- interface NodeDocsPreset extends HolocronPreset {
5
- org: string;
6
- domain: string;
7
- docs: NonNullable<HolocronConfig["docs"]>;
8
- repo: HolocronPreset["repo"] & {
9
- requiredChecks: string[];
10
- };
11
- }
3
+ type NodeDocsPreset = ComposedPreset;
4
+ type NodeDocsSitePreset = ComposedPreset;
12
5
  /**
13
- * Extends `node()` for repos that publish a documentation site and deploy
14
- * previews via Cloudflare Pages. Adds org/domain, Cloudflare providers,
15
- * deploy+preview workflow, and the Conclusion required checks.
6
+ * Preset for theholocron repos that are TypeScript libraries AND publish a
7
+ * documentation site (e.g. configs, utils, holocron). Includes typecheck and
8
+ * audit in addition to the docs deploy.
9
+ *
10
+ * For repos that are docs-only sites without TypeScript source to check,
11
+ * use nodeDocsSite() instead.
16
12
  *
17
13
  * @example
18
- * const { repo, workflows, providers, org, domain, docs } = nodeDocs();
14
+ * const preset = nodeDocs();
19
15
  * export default defineConfig({
16
+ * ...preset,
20
17
  * description: "...",
21
18
  * homepage: "https://docs.theholocron.dev/my-lib/",
22
- * org,
23
- * domain,
24
- * docs,
25
- * repo: {
26
- * ...repo,
27
- * name: "theholocron/my-lib",
28
- * topics: ["typescript"],
29
- * requiredChecks: [...repo.requiredChecks, "codecov/patch/my-pkg"],
30
- * },
31
- * workflows: [...workflows, "audit", { name: "release", with: { "run-build": true } }, "sync"],
32
- * providers: { ...providers, secrets: "github" },
19
+ * repo: { ...preset.repo, name: "theholocron/my-lib", topics: ["typescript"] },
20
+ * workflows: [...preset.workflows, "audit", { name: "release", with: { "run-build": true } }, "sync"],
21
+ * providers: { ...preset.providers, secrets: "github" },
33
22
  * });
34
23
  */
35
24
  declare function nodeDocs(): NodeDocsPreset;
25
+ /**
26
+ * Preset for theholocron repos that are documentation-only sites with no
27
+ * TypeScript source to check (e.g. skills, themes). Identical to nodeDocs()
28
+ * except typecheck and audit are not included.
29
+ *
30
+ * @example
31
+ * const preset = nodeDocsSite();
32
+ * export default defineConfig({
33
+ * ...preset,
34
+ * description: "...",
35
+ * repo: { ...preset.repo, name: "theholocron/my-site" },
36
+ * workflows: [...preset.workflows, { name: "release", with: { "run-build": false } }, "sync"],
37
+ * providers: { ...preset.providers, secrets: "github" },
38
+ * });
39
+ */
40
+ declare function nodeDocsSite(): NodeDocsSitePreset;
36
41
  //#endregion
37
- export { NodeDocsPreset, nodeDocs };
42
+ export { NodeDocsPreset, NodeDocsSitePreset, nodeDocs, nodeDocsSite };
@@ -1,63 +1,2 @@
1
- import { node } from "./node.js";
2
- //#region configs/node-docs.ts
3
- const REQUIRED_CHECKS = [
4
- "Lint / Conclusion",
5
- "Test / Conclusion",
6
- "Typecheck / Conclusion",
7
- "audit / Conclusion",
8
- "codecov/patch",
9
- "codecov/project"
10
- ];
11
- /**
12
- * Extends `node()` for repos that publish a documentation site and deploy
13
- * previews via Cloudflare Pages. Adds org/domain, Cloudflare providers,
14
- * deploy+preview workflow, and the Conclusion required checks.
15
- *
16
- * @example
17
- * const { repo, workflows, providers, org, domain, docs } = nodeDocs();
18
- * export default defineConfig({
19
- * description: "...",
20
- * homepage: "https://docs.theholocron.dev/my-lib/",
21
- * org,
22
- * domain,
23
- * docs,
24
- * repo: {
25
- * ...repo,
26
- * name: "theholocron/my-lib",
27
- * topics: ["typescript"],
28
- * requiredChecks: [...repo.requiredChecks, "codecov/patch/my-pkg"],
29
- * },
30
- * workflows: [...workflows, "audit", { name: "release", with: { "run-build": true } }, "sync"],
31
- * providers: { ...providers, secrets: "github" },
32
- * });
33
- */
34
- function nodeDocs() {
35
- const base = node();
36
- return {
37
- ...base,
38
- org: "theholocron",
39
- domain: "theholocron.dev",
40
- docs: {
41
- build: "workflow",
42
- https: true
43
- },
44
- providers: {
45
- ...base.providers,
46
- deployment: ["cloudflare", { accountId: "9c558af98664d13fc89b7e0a0d93d5a8" }],
47
- dns: "cloudflare"
48
- },
49
- repo: {
50
- ...base.repo,
51
- requiredChecks: REQUIRED_CHECKS
52
- },
53
- workflows: [...base.workflows, {
54
- name: "deploy",
55
- with: {
56
- docs: true,
57
- preview: true
58
- }
59
- }]
60
- };
61
- }
62
- //#endregion
63
- export { nodeDocs };
1
+ import { n as nodeDocsSite, t as nodeDocs } from "../node-docs-ccjE0K8S.js";
2
+ export { nodeDocs, nodeDocsSite };
@@ -1,28 +1,17 @@
1
- import { HolocronConfig, RepoConfig } from "@theholocron/cli";
1
+ import { ComposedPreset } from "@theholocron/cli";
2
2
  //#region configs/node.d.ts
3
- interface HolocronPreset {
4
- providers: HolocronConfig["providers"];
5
- repo: Omit<RepoConfig, "name"> & {
6
- requiredChecks?: string[];
7
- };
8
- workflows: NonNullable<HolocronConfig["workflows"]>;
9
- org?: string;
10
- domain?: string;
11
- docs?: HolocronConfig["docs"];
12
- }
13
3
  /**
14
- * Shared defaults for theholocron Node.js repositories.
15
- * Spread the returned fragments into `defineConfig()` — only add what's unique per repo.
4
+ * Base preset for theholocron Node.js repositories.
5
+ * Spread the returned fragments into `defineConfig()`.
16
6
  *
17
7
  * @example
18
- * const { repo, workflows, providers } = node();
8
+ * const preset = node();
19
9
  * export default defineConfig({
20
- * name: "my-repo",
21
- * repo: { name: "theholocron/my-repo", topics: ["typescript"], ...repo },
22
- * workflows: [...workflows, { name: "release", with: { "run-build": true } }],
23
- * providers,
10
+ * ...preset,
11
+ * repo: { ...preset.repo, name: "theholocron/my-lib" },
12
+ * workflows: [...preset.workflows, { name: "release", with: { "run-build": true } }],
24
13
  * });
25
14
  */
26
- declare function node(): HolocronPreset;
15
+ declare function node(): ComposedPreset;
27
16
  //#endregion
28
- export { HolocronPreset, node };
17
+ export { type ComposedPreset as HolocronPreset, node };
@@ -1,48 +1,20 @@
1
+ import { t as node$1 } from "../node-3iHN9DIf.js";
2
+ import { compose } from "@theholocron/cli";
1
3
  //#region configs/node.ts
2
4
  /**
3
- * Shared defaults for theholocron Node.js repositories.
4
- * Spread the returned fragments into `defineConfig()` — only add what's unique per repo.
5
+ * Base preset for theholocron Node.js repositories.
6
+ * Spread the returned fragments into `defineConfig()`.
5
7
  *
6
8
  * @example
7
- * const { repo, workflows, providers } = node();
9
+ * const preset = node();
8
10
  * export default defineConfig({
9
- * name: "my-repo",
10
- * repo: { name: "theholocron/my-repo", topics: ["typescript"], ...repo },
11
- * workflows: [...workflows, { name: "release", with: { "run-build": true } }],
12
- * providers,
11
+ * ...preset,
12
+ * repo: { ...preset.repo, name: "theholocron/my-lib" },
13
+ * workflows: [...preset.workflows, { name: "release", with: { "run-build": true } }],
13
14
  * });
14
15
  */
15
16
  function node() {
16
- return {
17
- providers: {
18
- source: "github",
19
- ci: "github",
20
- issues: ["github", { labels: {
21
- inProgress: "status:in-progress",
22
- inReview: "status:in-review"
23
- } }]
24
- },
25
- repo: {
26
- protection: "strict",
27
- properties: {
28
- lifecycle: "active",
29
- open_source: true,
30
- runtime_environment: "node",
31
- uses_external_packages: true
32
- }
33
- },
34
- workflows: [
35
- "lint",
36
- "test",
37
- "typecheck",
38
- "codeql",
39
- "review",
40
- "stale",
41
- "greetings",
42
- "dependencies",
43
- "bookkeeping"
44
- ]
45
- };
17
+ return compose(node$1());
46
18
  }
47
19
  //#endregion
48
20
  export { node };
@@ -1,29 +1,23 @@
1
- import { HolocronPreset } from "./node.js";
1
+ import { ComposedPreset } from "@theholocron/cli";
2
2
  //#region configs/react.d.ts
3
3
  /**
4
- * Preset for single-package React/Vite application repos. Identical to
5
- * `nextjs()` except: no Vercel deployment (deploy target is per-repo) and
6
- * no `run-user-flow` (Cypress not assumed). Per-repo still provides: chromatic
7
- * project config, storybook deploy config, sync workflow.
4
+ * Preset for single-package React/Vite application repos. Includes Storybook,
5
+ * interaction tests, Knip + Lighthouse audit, and UI required checks.
6
+ * Does NOT include Vercel deployment or Cypress user-flow — add nextjs() for those.
8
7
  *
9
8
  * @example
10
- * const { repo, workflows, providers, org, domain } = react();
9
+ * const preset = react();
11
10
  * export default defineConfig({
12
- * org,
13
- * domain,
14
- * repo: { ...repo, name: "theholocron/my-app", topics: ["react", "vite"] },
11
+ * ...preset,
12
+ * repo: { ...preset.repo, name: "theholocron/my-app", topics: ["react", "vite"] },
15
13
  * workflows: [
16
- * ...workflows,
17
- * { name: "test", with: { "run-chromatic": { projects: [{ tokenName: "default", workingDir: ".", buildScript: "build:storybook:chromatic" }] } } },
14
+ * ...preset.workflows,
15
+ * { name: "test", with: { "run-chromatic": { projects: [{ tokenName: "default", workingDir: "." }] } } },
18
16
  * "sync",
19
17
  * { name: "deploy", with: { docs: true, storybook: [{ name: "" }] } },
20
18
  * ],
21
- * providers,
22
19
  * });
23
20
  */
24
- declare function react(): HolocronPreset & {
25
- org: string;
26
- domain: string;
27
- };
21
+ declare function react(): ComposedPreset;
28
22
  //#endregion
29
23
  export { react };
@@ -1,77 +1,28 @@
1
- import { node } from "./node.js";
1
+ import { t as node } from "../node-3iHN9DIf.js";
2
+ import { t as typecheck } from "../typecheck-epaimGtp.js";
3
+ import { t as react$1 } from "../react-Pm9PjGpV.js";
4
+ import { compose } from "@theholocron/cli";
2
5
  //#region configs/react.ts
3
- const REQUIRED_CHECKS = [
4
- "Lint / Conclusion",
5
- "Test / Conclusion",
6
- "Typecheck / Conclusion",
7
- "audit / Conclusion",
8
- "codecov/patch",
9
- "codecov/project",
10
- "Storybook Publish",
11
- "UI Review",
12
- "UI Tests",
13
- "lhci/url/"
14
- ];
15
6
  /**
16
- * Preset for single-package React/Vite application repos. Identical to
17
- * `nextjs()` except: no Vercel deployment (deploy target is per-repo) and
18
- * no `run-user-flow` (Cypress not assumed). Per-repo still provides: chromatic
19
- * project config, storybook deploy config, sync workflow.
7
+ * Preset for single-package React/Vite application repos. Includes Storybook,
8
+ * interaction tests, Knip + Lighthouse audit, and UI required checks.
9
+ * Does NOT include Vercel deployment or Cypress user-flow — add nextjs() for those.
20
10
  *
21
11
  * @example
22
- * const { repo, workflows, providers, org, domain } = react();
12
+ * const preset = react();
23
13
  * export default defineConfig({
24
- * org,
25
- * domain,
26
- * repo: { ...repo, name: "theholocron/my-app", topics: ["react", "vite"] },
14
+ * ...preset,
15
+ * repo: { ...preset.repo, name: "theholocron/my-app", topics: ["react", "vite"] },
27
16
  * workflows: [
28
- * ...workflows,
29
- * { name: "test", with: { "run-chromatic": { projects: [{ tokenName: "default", workingDir: ".", buildScript: "build:storybook:chromatic" }] } } },
17
+ * ...preset.workflows,
18
+ * { name: "test", with: { "run-chromatic": { projects: [{ tokenName: "default", workingDir: "." }] } } },
30
19
  * "sync",
31
20
  * { name: "deploy", with: { docs: true, storybook: [{ name: "" }] } },
32
21
  * ],
33
- * providers,
34
22
  * });
35
23
  */
36
24
  function react() {
37
- const base = node();
38
- return {
39
- ...base,
40
- org: "theholocron",
41
- domain: "theholocron.dev",
42
- providers: {
43
- ...base.providers,
44
- secrets: "github"
45
- },
46
- repo: {
47
- ...base.repo,
48
- properties: {
49
- ...base.repo.properties,
50
- runtime_environment: "browser",
51
- uses_external_packages: false
52
- },
53
- requiredChecks: REQUIRED_CHECKS
54
- },
55
- workflows: [
56
- ...base.workflows,
57
- {
58
- name: "audit",
59
- with: {
60
- "run-knip": true,
61
- "run-performance": true,
62
- "lighthouse-config": "lighthouse.config.cjs"
63
- }
64
- },
65
- {
66
- name: "test",
67
- with: {
68
- "run-unit": false,
69
- "run-storybook": true,
70
- "run-interaction": true
71
- }
72
- }
73
- ]
74
- };
25
+ return compose(node(), typecheck(), react$1());
75
26
  }
76
27
  //#endregion
77
28
  export { react };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,67 @@
1
- import { HolocronPreset, node } from "./configs/node.js";
2
1
  import { monorepo } from "./configs/monorepo.js";
3
- import { nextjs } from "./configs/nextjs.js";
4
- import { NodeDocsPreset, nodeDocs } from "./configs/node-docs.js";
5
- import { react } from "./configs/react.js";
6
- export { type HolocronPreset, type NodeDocsPreset, monorepo, nextjs, node, nodeDocs, react };
2
+ import { n as NextjsOptions, r as nextjs$1, t as nextjs } from "./nextjs-CaFUxEzC.js";
3
+ import { NodeDocsPreset, NodeDocsSitePreset, nodeDocs, nodeDocsSite } from "./configs/node-docs.js";
4
+ import { HolocronPreset as ComposedPreset$1 } from "./configs/node.js";
5
+ import { react as react$1 } from "./configs/react.js";
6
+ import { Capability, Capability as Capability$1, ComposedPreset, compose } from "@theholocron/cli";
7
+ //#region capabilities/node.d.ts
8
+ /**
9
+ * Base capability for all theholocron Node.js repositories.
10
+ * Contributes: GitHub source/CI/issues providers, strict branch protection,
11
+ * and the standard workflow set (lint, test, codeql, review, stale, greetings,
12
+ * dependencies, bookkeeping). Does NOT include typecheck — add that separately.
13
+ */
14
+ declare function node(): Capability$1;
15
+ //#endregion
16
+ //#region capabilities/typecheck.d.ts
17
+ /**
18
+ * Adds TypeScript type-checking to a repo.
19
+ * Requires: node
20
+ */
21
+ declare function typecheck(): Capability$1;
22
+ //#endregion
23
+ //#region capabilities/docs.d.ts
24
+ /**
25
+ * Adds a documentation site deployed to Cloudflare Pages with PR previews.
26
+ * Sets org/domain, wires Cloudflare + DNS providers, and adds codecov
27
+ * required checks (enabled for all docs repos).
28
+ * Requires: node
29
+ */
30
+ declare function docs(): Capability$1;
31
+ //#endregion
32
+ //#region capabilities/audit.d.ts
33
+ interface AuditOptions {
34
+ /** Enable Knip unused-export analysis (default: false). */
35
+ knip?: boolean;
36
+ /** Enable Lighthouse performance audits (default: false). */
37
+ performance?: boolean;
38
+ /** Path to the Lighthouse config file. */
39
+ lighthouseConfig?: string;
40
+ }
41
+ /**
42
+ * Adds BundleWatch + optional Knip and Lighthouse auditing.
43
+ * Requires: node
44
+ */
45
+ declare function audit({ knip, performance, lighthouseConfig }?: AuditOptions): Capability$1;
46
+ //#endregion
47
+ //#region capabilities/react.d.ts
48
+ /**
49
+ * Adds React/Storybook UI testing and browser runtime config.
50
+ * Contributes: secrets provider, browser runtime property, Storybook + interaction
51
+ * test jobs, audit with Knip + Lighthouse, and UI required checks.
52
+ * Requires: node, typecheck
53
+ */
54
+ declare function react(): Capability$1;
55
+ //#endregion
56
+ //#region capabilities/monorepo.d.ts
57
+ /**
58
+ * Adjusts a repo to be a monorepo — sets uses_external_packages: true
59
+ * (workspaces pull in many deps). Compose after the base capabilities.
60
+ * Requires: node
61
+ *
62
+ * @example
63
+ * const preset = compose(node(), typecheck(), nextjs(), monorepo());
64
+ */
65
+ declare function monorepo$1(): Capability$1;
66
+ //#endregion
67
+ export { type AuditOptions, type Capability, type ComposedPreset, type ComposedPreset$1 as HolocronPreset, type NextjsOptions, type NodeDocsPreset, type NodeDocsSitePreset, audit, compose, docs, monorepo, monorepo$1 as monorepoCapability, nextjs, nextjs$1 as nextjsBundle, node, nodeDocs, nodeDocsSite, react, react$1 as reactPreset, typecheck };
package/dist/index.js CHANGED
@@ -1,6 +1,26 @@
1
+ import { t as node } from "./node-3iHN9DIf.js";
2
+ import { t as typecheck } from "./typecheck-epaimGtp.js";
3
+ import { i as docs, n as nodeDocsSite, r as audit, t as nodeDocs } from "./node-docs-ccjE0K8S.js";
4
+ import { t as react } from "./react-Pm9PjGpV.js";
5
+ import { n as nextjs$1, t as nextjs } from "./nextjs-D1E4Gf4-.js";
6
+ import { react as react$1 } from "./configs/react.js";
1
7
  import { monorepo } from "./configs/monorepo.js";
2
- import { node } from "./configs/node.js";
3
- import { nextjs } from "./configs/nextjs.js";
4
- import { nodeDocs } from "./configs/node-docs.js";
5
- import { react } from "./configs/react.js";
6
- export { monorepo, nextjs, node, nodeDocs, react };
8
+ import { compose } from "@theholocron/cli";
9
+ //#region capabilities/monorepo.ts
10
+ /**
11
+ * Adjusts a repo to be a monorepo — sets uses_external_packages: true
12
+ * (workspaces pull in many deps). Compose after the base capabilities.
13
+ * Requires: node
14
+ *
15
+ * @example
16
+ * const preset = compose(node(), typecheck(), nextjs(), monorepo());
17
+ */
18
+ function monorepo$1() {
19
+ return {
20
+ id: "monorepo",
21
+ requires: ["node"],
22
+ repo: { properties: { uses_external_packages: true } }
23
+ };
24
+ }
25
+ //#endregion
26
+ export { audit, compose, docs, monorepo, monorepo$1 as monorepoCapability, nextjs, nextjs$1 as nextjsBundle, node, nodeDocs, nodeDocsSite, react, react$1 as reactPreset, typecheck };
@@ -0,0 +1,40 @@
1
+ import { Capability, ComposedPreset } from "@theholocron/cli";
2
+ //#region capabilities/nextjs.d.ts
3
+ interface NextjsOptions {
4
+ /** Extra `with:` inputs merged into the `test` workflow entry. */
5
+ test?: Record<string, unknown>;
6
+ }
7
+ /**
8
+ * Bundle preset for Next.js application repos. Returns a Capability[] that
9
+ * includes react() so callers only need compose(node(), typecheck(), nextjs()).
10
+ * compose() deduplicates, so adding react() explicitly is harmless.
11
+ *
12
+ * Adds: Vercel deployment and Cypress user-flow tests on top of react().
13
+ * Requires (via react()): node, typecheck
14
+ *
15
+ * @example
16
+ * const preset = compose(node(), typecheck(), nextjs({ test: { "wait-on-url": "http://localhost:3000" } }));
17
+ */
18
+ declare function nextjs$1({ test: testOverrides }?: NextjsOptions): Capability[];
19
+ //#endregion
20
+ //#region configs/nextjs.d.ts
21
+ /**
22
+ * Preset for single-package Next.js application repos. Includes Vercel
23
+ * deployment, Lighthouse audit, Storybook + interaction + user-flow tests,
24
+ * and the Conclusion required checks.
25
+ *
26
+ * @example
27
+ * const preset = nextjs({ test: { "wait-on-url": "http://localhost:3000", "run-chromatic": true } });
28
+ * export default defineConfig({
29
+ * ...preset,
30
+ * repo: { ...preset.repo, name: "theholocron/my-app", topics: ["nextjs"] },
31
+ * workflows: [
32
+ * ...preset.workflows,
33
+ * "sync",
34
+ * { name: "deploy", with: { docs: true, storybook: [{ name: "" }] } },
35
+ * ],
36
+ * });
37
+ */
38
+ declare function nextjs(options?: NextjsOptions): ComposedPreset;
39
+ //#endregion
40
+ export { NextjsOptions as n, nextjs$1 as r, nextjs as t };
@@ -0,0 +1,60 @@
1
+ import { t as node } from "./node-3iHN9DIf.js";
2
+ import { t as typecheck } from "./typecheck-epaimGtp.js";
3
+ import { t as react } from "./react-Pm9PjGpV.js";
4
+ import { compose } from "@theholocron/cli";
5
+ //#region capabilities/nextjs.ts
6
+ /**
7
+ * Bundle preset for Next.js application repos. Returns a Capability[] that
8
+ * includes react() so callers only need compose(node(), typecheck(), nextjs()).
9
+ * compose() deduplicates, so adding react() explicitly is harmless.
10
+ *
11
+ * Adds: Vercel deployment and Cypress user-flow tests on top of react().
12
+ * Requires (via react()): node, typecheck
13
+ *
14
+ * @example
15
+ * const preset = compose(node(), typecheck(), nextjs({ test: { "wait-on-url": "http://localhost:3000" } }));
16
+ */
17
+ function nextjs$1({ test: testOverrides = {} } = {}) {
18
+ const nextjsCapability = {
19
+ id: "nextjs",
20
+ requires: ["react"],
21
+ org: "theholocron",
22
+ domain: "theholocron.dev",
23
+ providers: { deployment: "vercel" },
24
+ workflows: [{
25
+ name: "test",
26
+ with: {
27
+ "run-unit": false,
28
+ "run-storybook": true,
29
+ "run-interaction": true,
30
+ "run-user-flow": true,
31
+ ...testOverrides
32
+ }
33
+ }]
34
+ };
35
+ return [react(), nextjsCapability];
36
+ }
37
+ //#endregion
38
+ //#region configs/nextjs.ts
39
+ /**
40
+ * Preset for single-package Next.js application repos. Includes Vercel
41
+ * deployment, Lighthouse audit, Storybook + interaction + user-flow tests,
42
+ * and the Conclusion required checks.
43
+ *
44
+ * @example
45
+ * const preset = nextjs({ test: { "wait-on-url": "http://localhost:3000", "run-chromatic": true } });
46
+ * export default defineConfig({
47
+ * ...preset,
48
+ * repo: { ...preset.repo, name: "theholocron/my-app", topics: ["nextjs"] },
49
+ * workflows: [
50
+ * ...preset.workflows,
51
+ * "sync",
52
+ * { name: "deploy", with: { docs: true, storybook: [{ name: "" }] } },
53
+ * ],
54
+ * });
55
+ */
56
+ function nextjs(options) {
57
+ return compose(node(), typecheck(), ...nextjs$1(options));
58
+ }
59
+ //#endregion
60
+ export { nextjs$1 as n, nextjs as t };
@@ -0,0 +1,42 @@
1
+ //#region capabilities/node.ts
2
+ /**
3
+ * Base capability for all theholocron Node.js repositories.
4
+ * Contributes: GitHub source/CI/issues providers, strict branch protection,
5
+ * and the standard workflow set (lint, test, codeql, review, stale, greetings,
6
+ * dependencies, bookkeeping). Does NOT include typecheck — add that separately.
7
+ */
8
+ function node() {
9
+ return {
10
+ id: "node",
11
+ providers: {
12
+ source: "github",
13
+ ci: "github",
14
+ issues: ["github", { labels: {
15
+ inProgress: "status:in-progress",
16
+ inReview: "status:in-review"
17
+ } }]
18
+ },
19
+ repo: {
20
+ protection: "strict",
21
+ properties: {
22
+ lifecycle: "active",
23
+ open_source: true,
24
+ runtime_environment: "node",
25
+ uses_external_packages: true
26
+ }
27
+ },
28
+ requiredChecks: ["Lint / Conclusion", "Test / Conclusion"],
29
+ workflows: [
30
+ "lint",
31
+ "test",
32
+ "codeql",
33
+ "review",
34
+ "stale",
35
+ "greetings",
36
+ "dependencies",
37
+ "bookkeeping"
38
+ ]
39
+ };
40
+ }
41
+ //#endregion
42
+ export { node as t };
@@ -0,0 +1,99 @@
1
+ import { t as node } from "./node-3iHN9DIf.js";
2
+ import { t as typecheck } from "./typecheck-epaimGtp.js";
3
+ import { compose } from "@theholocron/cli";
4
+ //#region capabilities/docs.ts
5
+ /**
6
+ * Adds a documentation site deployed to Cloudflare Pages with PR previews.
7
+ * Sets org/domain, wires Cloudflare + DNS providers, and adds codecov
8
+ * required checks (enabled for all docs repos).
9
+ * Requires: node
10
+ */
11
+ function docs() {
12
+ return {
13
+ id: "docs",
14
+ requires: ["node"],
15
+ org: "theholocron",
16
+ domain: "theholocron.dev",
17
+ docs: {
18
+ build: "workflow",
19
+ https: true
20
+ },
21
+ providers: {
22
+ deployment: ["cloudflare", { accountId: "9c558af98664d13fc89b7e0a0d93d5a8" }],
23
+ dns: "cloudflare"
24
+ },
25
+ workflows: [{
26
+ name: "deploy",
27
+ with: {
28
+ docs: true,
29
+ preview: true
30
+ }
31
+ }],
32
+ requiredChecks: ["codecov/patch", "codecov/project"]
33
+ };
34
+ }
35
+ //#endregion
36
+ //#region capabilities/audit.ts
37
+ /**
38
+ * Adds BundleWatch + optional Knip and Lighthouse auditing.
39
+ * Requires: node
40
+ */
41
+ function audit({ knip = false, performance = false, lighthouseConfig } = {}) {
42
+ const withBlock = {};
43
+ if (knip) withBlock["run-knip"] = true;
44
+ if (performance) withBlock["run-performance"] = true;
45
+ if (lighthouseConfig) withBlock["lighthouse-config"] = lighthouseConfig;
46
+ return {
47
+ id: "audit",
48
+ requires: ["node"],
49
+ workflows: [Object.keys(withBlock).length > 0 ? {
50
+ name: "audit",
51
+ with: withBlock
52
+ } : "audit"],
53
+ requiredChecks: ["audit / Conclusion"]
54
+ };
55
+ }
56
+ //#endregion
57
+ //#region configs/node-docs.ts
58
+ /**
59
+ * Preset for theholocron repos that are TypeScript libraries AND publish a
60
+ * documentation site (e.g. configs, utils, holocron). Includes typecheck and
61
+ * audit in addition to the docs deploy.
62
+ *
63
+ * For repos that are docs-only sites without TypeScript source to check,
64
+ * use nodeDocsSite() instead.
65
+ *
66
+ * @example
67
+ * const preset = nodeDocs();
68
+ * export default defineConfig({
69
+ * ...preset,
70
+ * description: "...",
71
+ * homepage: "https://docs.theholocron.dev/my-lib/",
72
+ * repo: { ...preset.repo, name: "theholocron/my-lib", topics: ["typescript"] },
73
+ * workflows: [...preset.workflows, "audit", { name: "release", with: { "run-build": true } }, "sync"],
74
+ * providers: { ...preset.providers, secrets: "github" },
75
+ * });
76
+ */
77
+ function nodeDocs() {
78
+ return compose(node(), typecheck(), docs(), audit());
79
+ }
80
+ /**
81
+ * Preset for theholocron repos that are documentation-only sites with no
82
+ * TypeScript source to check (e.g. skills, themes). Identical to nodeDocs()
83
+ * except typecheck and audit are not included.
84
+ *
85
+ * @example
86
+ * const preset = nodeDocsSite();
87
+ * export default defineConfig({
88
+ * ...preset,
89
+ * description: "...",
90
+ * repo: { ...preset.repo, name: "theholocron/my-site" },
91
+ * workflows: [...preset.workflows, { name: "release", with: { "run-build": false } }, "sync"],
92
+ * providers: { ...preset.providers, secrets: "github" },
93
+ * });
94
+ */
95
+ function nodeDocsSite() {
96
+ return compose(node(), docs());
97
+ }
98
+ //#endregion
99
+ export { docs as i, nodeDocsSite as n, audit as r, nodeDocs as t };
@@ -0,0 +1,41 @@
1
+ //#region capabilities/react.ts
2
+ /**
3
+ * Adds React/Storybook UI testing and browser runtime config.
4
+ * Contributes: secrets provider, browser runtime property, Storybook + interaction
5
+ * test jobs, audit with Knip + Lighthouse, and UI required checks.
6
+ * Requires: node, typecheck
7
+ */
8
+ function react() {
9
+ return {
10
+ id: "react",
11
+ requires: ["node", "typecheck"],
12
+ providers: { secrets: "github" },
13
+ repo: { properties: {
14
+ runtime_environment: "browser",
15
+ uses_external_packages: false
16
+ } },
17
+ workflows: [{
18
+ name: "audit",
19
+ with: {
20
+ "run-knip": true,
21
+ "run-performance": true,
22
+ "lighthouse-config": "lighthouse.config.cjs"
23
+ }
24
+ }, {
25
+ name: "test",
26
+ with: {
27
+ "run-unit": false,
28
+ "run-storybook": true,
29
+ "run-interaction": true
30
+ }
31
+ }],
32
+ requiredChecks: [
33
+ "Storybook Publish",
34
+ "UI Review",
35
+ "UI Tests",
36
+ "lhci/url/"
37
+ ]
38
+ };
39
+ }
40
+ //#endregion
41
+ export { react as t };
@@ -0,0 +1,15 @@
1
+ //#region capabilities/typecheck.ts
2
+ /**
3
+ * Adds TypeScript type-checking to a repo.
4
+ * Requires: node
5
+ */
6
+ function typecheck() {
7
+ return {
8
+ id: "typecheck",
9
+ requires: ["node"],
10
+ workflows: ["typecheck"],
11
+ requiredChecks: ["Typecheck / Conclusion"]
12
+ };
13
+ }
14
+ //#endregion
15
+ export { typecheck as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/holocron-config",
3
- "version": "7.26.1",
3
+ "version": "7.28.0",
4
4
  "description": "Shareable holocron configuration presets for theholocron repositories.",
5
5
  "homepage": "https://github.com/theholocron/configs/tree/main/packages/holocron-config#readme",
6
6
  "bugs": "https://github.com/theholocron/configs/issues",
@@ -18,13 +18,13 @@
18
18
  ],
19
19
  "type": "module",
20
20
  "devDependencies": {
21
- "@theholocron/cli": "^3.17.0",
21
+ "@theholocron/cli": "^3.38.0",
22
22
  "tsdown": "^0.22.14",
23
23
  "typescript": "^5.9.3",
24
24
  "vitest": "^4.1.10",
25
25
  "@vitest/coverage-v8": "^4.1.10",
26
- "@theholocron/tsconfig": "7.26.1",
27
- "@theholocron/vitest-config": "7.26.1"
26
+ "@theholocron/tsconfig": "7.28.0",
27
+ "@theholocron/vitest-config": "7.28.0"
28
28
  },
29
29
  "peerDependencies": {
30
30
  "@theholocron/cli": ">=2.0.0-alpha.1"