@theholocron/holocron-config 7.26.0 → 7.27.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
@@ -40,3 +40,49 @@ export default defineConfig({
40
40
  | `providers` | `source: "github"`, `ci: "github"`, `issues: ["github", { labels: … }]` |
41
41
 
42
42
  Everything else — `name`, `repo.name`, `repo.topics`, and any per-repo workflow overrides (e.g. `release`) — stays in the consuming repo's config.
43
+
44
+ ## Presets
45
+
46
+ ### `nodeDocs()`
47
+
48
+ Extends `node()` for repos that publish a documentation site and deploy Cloudflare Pages previews on PRs.
49
+
50
+ ```ts
51
+ import { defineConfig } from "@theholocron/cli";
52
+ import { nodeDocs } from "@theholocron/holocron-config";
53
+
54
+ const { repo, workflows, providers, org, domain, docs } = nodeDocs();
55
+ export default defineConfig({
56
+ description: "...",
57
+ homepage: "https://docs.theholocron.dev/my-lib/",
58
+ org,
59
+ domain,
60
+ docs,
61
+ repo: {
62
+ ...repo,
63
+ name: "theholocron/my-lib",
64
+ topics: ["typescript"],
65
+ requiredChecks: [...repo.requiredChecks, "codecov/patch/my-package", "codecov/project/my-package"],
66
+ },
67
+ workflows: [...workflows, "audit", { name: "release", with: { "run-build": true } }, "sync"],
68
+ providers: { ...providers, secrets: "github" },
69
+ });
70
+ ```
71
+
72
+ Adds on top of `node()`:
73
+
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"` |
83
+
84
+ Per-repo extends `requiredChecks` with its own `codecov/patch/<package>` entries.
85
+
86
+ ### `nextjs()` · `react()` · `monorepo(base)`
87
+
88
+ See [`.notes/preset-system.md`](../../.notes/preset-system.md) for the full preset hierarchy and usage examples for browser app repos.
@@ -1,29 +1,37 @@
1
1
  import { HolocronPreset } from "./node.js";
2
2
  //#region configs/nextjs.d.ts
3
+ interface NextjsOptions {
4
+ /** Extra `with:` inputs merged into the `test` workflow entry (e.g. wait-on-url, run-chromatic). */
5
+ test?: Record<string, unknown>;
6
+ }
3
7
  /**
4
8
  * Preset for single-package Next.js application repos. Includes Vercel
5
9
  * 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.
10
+ * and the Conclusion required checks.
11
+ *
12
+ * Pass `test` overrides to merge repo-specific options (e.g. `wait-on-url`,
13
+ * `run-chromatic`) into the single test workflow entry so the sync tool sees
14
+ * one complete entry rather than two conflicting ones.
8
15
  *
9
16
  * @example
10
- * const { repo, workflows, providers, org, domain } = nextjs();
17
+ * const { repo, workflows, providers, org, domain } = nextjs({
18
+ * test: { "wait-on-url": "http://localhost:3000", "run-chromatic": true },
19
+ * });
11
20
  * export default defineConfig({
12
21
  * org,
13
22
  * domain,
14
23
  * repo: { ...repo, name: "theholocron/my-app", topics: ["nextjs"] },
15
24
  * workflows: [
16
25
  * ...workflows,
17
- * { name: "test", with: { "run-chromatic": true, "wait-on-url": "http://localhost:3000" } },
18
26
  * "sync",
19
27
  * { name: "deploy", with: { docs: true, storybook: [{ name: "" }] } },
20
28
  * ],
21
29
  * providers,
22
30
  * });
23
31
  */
24
- declare function nextjs(): HolocronPreset & {
32
+ declare function nextjs({ test: testOverrides }?: NextjsOptions): HolocronPreset & {
25
33
  org: string;
26
34
  domain: string;
27
35
  };
28
36
  //#endregion
29
- export { nextjs };
37
+ export { NextjsOptions, nextjs };
@@ -15,25 +15,29 @@ const REQUIRED_CHECKS = [
15
15
  /**
16
16
  * Preset for single-package Next.js application repos. Includes Vercel
17
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.
18
+ * and the Conclusion required checks.
19
+ *
20
+ * Pass `test` overrides to merge repo-specific options (e.g. `wait-on-url`,
21
+ * `run-chromatic`) into the single test workflow entry so the sync tool sees
22
+ * one complete entry rather than two conflicting ones.
20
23
  *
21
24
  * @example
22
- * const { repo, workflows, providers, org, domain } = nextjs();
25
+ * const { repo, workflows, providers, org, domain } = nextjs({
26
+ * test: { "wait-on-url": "http://localhost:3000", "run-chromatic": true },
27
+ * });
23
28
  * export default defineConfig({
24
29
  * org,
25
30
  * domain,
26
31
  * repo: { ...repo, name: "theholocron/my-app", topics: ["nextjs"] },
27
32
  * workflows: [
28
33
  * ...workflows,
29
- * { name: "test", with: { "run-chromatic": true, "wait-on-url": "http://localhost:3000" } },
30
34
  * "sync",
31
35
  * { name: "deploy", with: { docs: true, storybook: [{ name: "" }] } },
32
36
  * ],
33
37
  * providers,
34
38
  * });
35
39
  */
36
- function nextjs() {
40
+ function nextjs({ test: testOverrides = {} } = {}) {
37
41
  const base = node();
38
42
  return {
39
43
  ...base,
@@ -69,7 +73,8 @@ function nextjs() {
69
73
  "run-unit": false,
70
74
  "run-storybook": true,
71
75
  "run-interaction": true,
72
- "run-user-flow": true
76
+ "run-user-flow": true,
77
+ ...testOverrides
73
78
  }
74
79
  }
75
80
  ]
@@ -43,7 +43,7 @@ function nodeDocs() {
43
43
  },
44
44
  providers: {
45
45
  ...base.providers,
46
- deployment: "cloudflare",
46
+ deployment: ["cloudflare", { accountId: "9c558af98664d13fc89b7e0a0d93d5a8" }],
47
47
  dns: "cloudflare"
48
48
  },
49
49
  repo: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/holocron-config",
3
- "version": "7.26.0",
3
+ "version": "7.27.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.37.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.0",
27
- "@theholocron/vitest-config": "7.26.0"
26
+ "@theholocron/vitest-config": "7.27.0",
27
+ "@theholocron/tsconfig": "7.27.0"
28
28
  },
29
29
  "peerDependencies": {
30
30
  "@theholocron/cli": ">=2.0.0-alpha.1"