@theholocron/holocron-config 7.27.0 → 7.28.1
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 +99 -44
- package/dist/configs/monorepo.d.ts +6 -20
- package/dist/configs/monorepo.js +4 -18
- package/dist/configs/nextjs.d.ts +2 -37
- package/dist/configs/nextjs.js +1 -83
- package/dist/configs/node-docs.d.ts +35 -26
- package/dist/configs/node-docs.js +2 -63
- package/dist/configs/node.d.ts +9 -20
- package/dist/configs/node.js +9 -37
- package/dist/configs/react.d.ts +10 -16
- package/dist/configs/react.js +13 -62
- package/dist/index.d.ts +66 -5
- package/dist/index.js +46 -5
- package/dist/nextjs-CaFUxEzC.d.ts +40 -0
- package/dist/nextjs-D1E4Gf4-.js +60 -0
- package/dist/node-3iHN9DIf.js +42 -0
- package/dist/node-docs-BW6pdsNO.js +86 -0
- package/dist/react-Pm9PjGpV.js +41 -0
- package/dist/typecheck-epaimGtp.js +15 -0
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# Holocron Config
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
|
|
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 "@
|
|
17
|
-
import
|
|
18
|
-
|
|
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
|
-
|
|
23
|
-
description: "
|
|
28
|
+
...preset,
|
|
29
|
+
description: "My TypeScript library.",
|
|
30
|
+
homepage: "https://docs.theholocron.dev/my-lib/",
|
|
24
31
|
repo: {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
32
|
+
...preset.repo,
|
|
33
|
+
name: "theholocron/my-lib",
|
|
34
|
+
topics: ["typescript"],
|
|
28
35
|
},
|
|
29
|
-
workflows: [...workflows,
|
|
30
|
-
providers,
|
|
31
|
-
}
|
|
36
|
+
workflows: [...preset.workflows, "sync"],
|
|
37
|
+
providers: { ...preset.providers, secrets: "github" },
|
|
38
|
+
});
|
|
32
39
|
```
|
|
33
40
|
|
|
34
|
-
|
|
41
|
+
<!-- /holocron:installation -->
|
|
35
42
|
|
|
36
|
-
|
|
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
|
-
|
|
45
|
+
Each factory returns a `Capability` fragment. Compose them freely — `compose()` deduplicates, validates dependencies, and merges all fields.
|
|
43
46
|
|
|
44
|
-
|
|
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
|
-
|
|
85
|
+
= `compose(node(), typecheck(), docs())` + `"audit / Conclusion"` required check. For TypeScript library repos that publish a docs site. The audit workflow is repo-specific — add it explicitly: `workflows: [...preset.workflows, "audit", ...]`.
|
|
49
86
|
|
|
50
87
|
```ts
|
|
51
88
|
import { defineConfig } from "@theholocron/cli";
|
|
52
89
|
import { nodeDocs } from "@theholocron/holocron-config";
|
|
53
90
|
|
|
54
|
-
const
|
|
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, "
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
139
|
+
Automated via semantic-release. See [CHANGELOG.md](./CHANGELOG.md).
|
|
85
140
|
|
|
86
|
-
|
|
141
|
+
## Documentation
|
|
87
142
|
|
|
88
|
-
|
|
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 {
|
|
1
|
+
import { ComposedPreset } from "@theholocron/cli";
|
|
2
2
|
//#region configs/monorepo.d.ts
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Wraps any composed preset with monorepo-specific overrides
|
|
5
|
+
* (sets uses_external_packages: true).
|
|
6
6
|
*
|
|
7
|
-
*
|
|
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
|
|
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
|
|
12
|
+
declare function monorepo(base: ComposedPreset): ComposedPreset;
|
|
27
13
|
//#endregion
|
|
28
14
|
export { monorepo };
|
package/dist/configs/monorepo.js
CHANGED
|
@@ -1,26 +1,12 @@
|
|
|
1
1
|
//#region configs/monorepo.ts
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* Wraps any composed preset with monorepo-specific overrides
|
|
4
|
+
* (sets uses_external_packages: true).
|
|
5
5
|
*
|
|
6
|
-
*
|
|
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
|
|
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 {
|
package/dist/configs/nextjs.d.ts
CHANGED
|
@@ -1,37 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
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
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Preset for single-package Next.js application repos. Includes Vercel
|
|
9
|
-
* deployment, Lighthouse audit, Storybook + interaction + user-flow tests,
|
|
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.
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* const { repo, workflows, providers, org, domain } = nextjs({
|
|
18
|
-
* test: { "wait-on-url": "http://localhost:3000", "run-chromatic": true },
|
|
19
|
-
* });
|
|
20
|
-
* export default defineConfig({
|
|
21
|
-
* org,
|
|
22
|
-
* domain,
|
|
23
|
-
* repo: { ...repo, name: "theholocron/my-app", topics: ["nextjs"] },
|
|
24
|
-
* workflows: [
|
|
25
|
-
* ...workflows,
|
|
26
|
-
* "sync",
|
|
27
|
-
* { name: "deploy", with: { docs: true, storybook: [{ name: "" }] } },
|
|
28
|
-
* ],
|
|
29
|
-
* providers,
|
|
30
|
-
* });
|
|
31
|
-
*/
|
|
32
|
-
declare function nextjs({ test: testOverrides }?: NextjsOptions): HolocronPreset & {
|
|
33
|
-
org: string;
|
|
34
|
-
domain: string;
|
|
35
|
-
};
|
|
36
|
-
//#endregion
|
|
37
|
-
export { NextjsOptions, nextjs };
|
|
1
|
+
import { n as NextjsOptions, t as nextjs } from "../nextjs-CaFUxEzC.js";
|
|
2
|
+
export { type NextjsOptions, nextjs };
|
package/dist/configs/nextjs.js
CHANGED
|
@@ -1,84 +1,2 @@
|
|
|
1
|
-
import {
|
|
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.
|
|
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.
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* const { repo, workflows, providers, org, domain } = nextjs({
|
|
26
|
-
* test: { "wait-on-url": "http://localhost:3000", "run-chromatic": true },
|
|
27
|
-
* });
|
|
28
|
-
* export default defineConfig({
|
|
29
|
-
* org,
|
|
30
|
-
* domain,
|
|
31
|
-
* repo: { ...repo, name: "theholocron/my-app", topics: ["nextjs"] },
|
|
32
|
-
* workflows: [
|
|
33
|
-
* ...workflows,
|
|
34
|
-
* "sync",
|
|
35
|
-
* { name: "deploy", with: { docs: true, storybook: [{ name: "" }] } },
|
|
36
|
-
* ],
|
|
37
|
-
* providers,
|
|
38
|
-
* });
|
|
39
|
-
*/
|
|
40
|
-
function nextjs({ test: testOverrides = {} } = {}) {
|
|
41
|
-
const base = node();
|
|
42
|
-
return {
|
|
43
|
-
...base,
|
|
44
|
-
org: "theholocron",
|
|
45
|
-
domain: "theholocron.dev",
|
|
46
|
-
providers: {
|
|
47
|
-
...base.providers,
|
|
48
|
-
deployment: "vercel",
|
|
49
|
-
secrets: "github"
|
|
50
|
-
},
|
|
51
|
-
repo: {
|
|
52
|
-
...base.repo,
|
|
53
|
-
properties: {
|
|
54
|
-
...base.repo.properties,
|
|
55
|
-
runtime_environment: "browser",
|
|
56
|
-
uses_external_packages: false
|
|
57
|
-
},
|
|
58
|
-
requiredChecks: REQUIRED_CHECKS
|
|
59
|
-
},
|
|
60
|
-
workflows: [
|
|
61
|
-
...base.workflows,
|
|
62
|
-
{
|
|
63
|
-
name: "audit",
|
|
64
|
-
with: {
|
|
65
|
-
"run-knip": true,
|
|
66
|
-
"run-performance": true,
|
|
67
|
-
"lighthouse-config": "lighthouse.config.cjs"
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
name: "test",
|
|
72
|
-
with: {
|
|
73
|
-
"run-unit": false,
|
|
74
|
-
"run-storybook": true,
|
|
75
|
-
"run-interaction": true,
|
|
76
|
-
"run-user-flow": true,
|
|
77
|
-
...testOverrides
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
]
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
//#endregion
|
|
1
|
+
import { t as nextjs } from "../nextjs-D1E4Gf4-.js";
|
|
84
2
|
export { nextjs };
|
|
@@ -1,37 +1,46 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { HolocronConfig } from "@theholocron/cli";
|
|
1
|
+
import { ComposedPreset } from "@theholocron/cli";
|
|
3
2
|
//#region configs/node-docs.d.ts
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
6
|
+
* Preset for theholocron repos that are TypeScript libraries AND publish a
|
|
7
|
+
* documentation site (e.g. configs, utils, holocron, clients).
|
|
8
|
+
*
|
|
9
|
+
* Includes the "audit / Conclusion" required check so branch protection works
|
|
10
|
+
* for repos that add the audit workflow explicitly. The workflow itself is
|
|
11
|
+
* intentionally left repo-specific — add it with your own options:
|
|
12
|
+
* workflows: [...preset.workflows, "audit", ...]
|
|
13
|
+
* // or with overrides:
|
|
14
|
+
* workflows: [...preset.workflows, { name: "audit", with: { "run-knip": true } }, ...]
|
|
15
|
+
*
|
|
16
|
+
* For docs-only sites without TypeScript source, use nodeDocsSite() instead.
|
|
16
17
|
*
|
|
17
18
|
* @example
|
|
18
|
-
* const
|
|
19
|
+
* const preset = nodeDocs();
|
|
19
20
|
* export default defineConfig({
|
|
21
|
+
* ...preset,
|
|
20
22
|
* description: "...",
|
|
21
23
|
* homepage: "https://docs.theholocron.dev/my-lib/",
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
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" },
|
|
24
|
+
* repo: { ...preset.repo, name: "theholocron/my-lib", topics: ["typescript"] },
|
|
25
|
+
* workflows: [...preset.workflows, "audit", { name: "release", with: { "run-build": true } }, "sync"],
|
|
26
|
+
* providers: { ...preset.providers, secrets: "github" },
|
|
33
27
|
* });
|
|
34
28
|
*/
|
|
35
29
|
declare function nodeDocs(): NodeDocsPreset;
|
|
30
|
+
/**
|
|
31
|
+
* Preset for theholocron repos that are documentation-only sites with no
|
|
32
|
+
* TypeScript source to check (e.g. skills, themes). No typecheck, no audit.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* const preset = nodeDocsSite();
|
|
36
|
+
* export default defineConfig({
|
|
37
|
+
* ...preset,
|
|
38
|
+
* description: "...",
|
|
39
|
+
* repo: { ...preset.repo, name: "theholocron/my-site" },
|
|
40
|
+
* workflows: [...preset.workflows, { name: "release", with: { "run-build": false } }, "sync"],
|
|
41
|
+
* providers: { ...preset.providers, secrets: "github" },
|
|
42
|
+
* });
|
|
43
|
+
*/
|
|
44
|
+
declare function nodeDocsSite(): NodeDocsSitePreset;
|
|
36
45
|
//#endregion
|
|
37
|
-
export { NodeDocsPreset, nodeDocs };
|
|
46
|
+
export { NodeDocsPreset, NodeDocsSitePreset, nodeDocs, nodeDocsSite };
|
|
@@ -1,63 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
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-BW6pdsNO.js";
|
|
2
|
+
export { nodeDocs, nodeDocsSite };
|
package/dist/configs/node.d.ts
CHANGED
|
@@ -1,28 +1,17 @@
|
|
|
1
|
-
import {
|
|
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
|
-
*
|
|
15
|
-
* Spread the returned fragments into `defineConfig()
|
|
4
|
+
* Base preset for theholocron Node.js repositories.
|
|
5
|
+
* Spread the returned fragments into `defineConfig()`.
|
|
16
6
|
*
|
|
17
7
|
* @example
|
|
18
|
-
* const
|
|
8
|
+
* const preset = node();
|
|
19
9
|
* export default defineConfig({
|
|
20
|
-
*
|
|
21
|
-
* repo: { name: "theholocron/my-
|
|
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():
|
|
15
|
+
declare function node(): ComposedPreset;
|
|
27
16
|
//#endregion
|
|
28
|
-
export { HolocronPreset, node };
|
|
17
|
+
export { type ComposedPreset as HolocronPreset, node };
|
package/dist/configs/node.js
CHANGED
|
@@ -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
|
-
*
|
|
4
|
-
* Spread the returned fragments into `defineConfig()
|
|
5
|
+
* Base preset for theholocron Node.js repositories.
|
|
6
|
+
* Spread the returned fragments into `defineConfig()`.
|
|
5
7
|
*
|
|
6
8
|
* @example
|
|
7
|
-
* const
|
|
9
|
+
* const preset = node();
|
|
8
10
|
* export default defineConfig({
|
|
9
|
-
*
|
|
10
|
-
* repo: { name: "theholocron/my-
|
|
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 };
|
package/dist/configs/react.d.ts
CHANGED
|
@@ -1,29 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComposedPreset } from "@theholocron/cli";
|
|
2
2
|
//#region configs/react.d.ts
|
|
3
3
|
/**
|
|
4
|
-
* Preset for single-package React/Vite application repos.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
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
|
|
9
|
+
* const preset = react();
|
|
11
10
|
* export default defineConfig({
|
|
12
|
-
*
|
|
13
|
-
*
|
|
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: "."
|
|
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():
|
|
25
|
-
org: string;
|
|
26
|
-
domain: string;
|
|
27
|
-
};
|
|
21
|
+
declare function react(): ComposedPreset;
|
|
28
22
|
//#endregion
|
|
29
23
|
export { react };
|
package/dist/configs/react.js
CHANGED
|
@@ -1,77 +1,28 @@
|
|
|
1
|
-
import { node } from "
|
|
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.
|
|
17
|
-
*
|
|
18
|
-
*
|
|
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
|
|
12
|
+
* const preset = react();
|
|
23
13
|
* export default defineConfig({
|
|
24
|
-
*
|
|
25
|
-
*
|
|
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: "."
|
|
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
|
-
|
|
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 "./
|
|
4
|
-
import { NodeDocsPreset, nodeDocs } from "./configs/node-docs.js";
|
|
5
|
-
import {
|
|
6
|
-
|
|
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,47 @@
|
|
|
1
|
+
import { t as node } from "./node-3iHN9DIf.js";
|
|
2
|
+
import { t as typecheck } from "./typecheck-epaimGtp.js";
|
|
3
|
+
import { n as nodeDocsSite, r as docs, t as nodeDocs } from "./node-docs-BW6pdsNO.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 {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
8
|
+
import { compose } from "@theholocron/cli";
|
|
9
|
+
//#region capabilities/audit.ts
|
|
10
|
+
/**
|
|
11
|
+
* Adds BundleWatch + optional Knip and Lighthouse auditing.
|
|
12
|
+
* Requires: node
|
|
13
|
+
*/
|
|
14
|
+
function audit({ knip = false, performance = false, lighthouseConfig } = {}) {
|
|
15
|
+
const withBlock = {};
|
|
16
|
+
if (knip) withBlock["run-knip"] = true;
|
|
17
|
+
if (performance) withBlock["run-performance"] = true;
|
|
18
|
+
if (lighthouseConfig) withBlock["lighthouse-config"] = lighthouseConfig;
|
|
19
|
+
return {
|
|
20
|
+
id: "audit",
|
|
21
|
+
requires: ["node"],
|
|
22
|
+
workflows: [Object.keys(withBlock).length > 0 ? {
|
|
23
|
+
name: "audit",
|
|
24
|
+
with: withBlock
|
|
25
|
+
} : "audit"],
|
|
26
|
+
requiredChecks: ["audit / Conclusion"]
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region capabilities/monorepo.ts
|
|
31
|
+
/**
|
|
32
|
+
* Adjusts a repo to be a monorepo — sets uses_external_packages: true
|
|
33
|
+
* (workspaces pull in many deps). Compose after the base capabilities.
|
|
34
|
+
* Requires: node
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* const preset = compose(node(), typecheck(), nextjs(), monorepo());
|
|
38
|
+
*/
|
|
39
|
+
function monorepo$1() {
|
|
40
|
+
return {
|
|
41
|
+
id: "monorepo",
|
|
42
|
+
requires: ["node"],
|
|
43
|
+
repo: { properties: { uses_external_packages: true } }
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
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,86 @@
|
|
|
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 configs/node-docs.ts
|
|
37
|
+
/**
|
|
38
|
+
* Preset for theholocron repos that are TypeScript libraries AND publish a
|
|
39
|
+
* documentation site (e.g. configs, utils, holocron, clients).
|
|
40
|
+
*
|
|
41
|
+
* Includes the "audit / Conclusion" required check so branch protection works
|
|
42
|
+
* for repos that add the audit workflow explicitly. The workflow itself is
|
|
43
|
+
* intentionally left repo-specific — add it with your own options:
|
|
44
|
+
* workflows: [...preset.workflows, "audit", ...]
|
|
45
|
+
* // or with overrides:
|
|
46
|
+
* workflows: [...preset.workflows, { name: "audit", with: { "run-knip": true } }, ...]
|
|
47
|
+
*
|
|
48
|
+
* For docs-only sites without TypeScript source, use nodeDocsSite() instead.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* const preset = nodeDocs();
|
|
52
|
+
* export default defineConfig({
|
|
53
|
+
* ...preset,
|
|
54
|
+
* description: "...",
|
|
55
|
+
* homepage: "https://docs.theholocron.dev/my-lib/",
|
|
56
|
+
* repo: { ...preset.repo, name: "theholocron/my-lib", topics: ["typescript"] },
|
|
57
|
+
* workflows: [...preset.workflows, "audit", { name: "release", with: { "run-build": true } }, "sync"],
|
|
58
|
+
* providers: { ...preset.providers, secrets: "github" },
|
|
59
|
+
* });
|
|
60
|
+
*/
|
|
61
|
+
function nodeDocs() {
|
|
62
|
+
return compose(node(), typecheck(), docs(), {
|
|
63
|
+
id: "audit-check",
|
|
64
|
+
requires: ["node"],
|
|
65
|
+
requiredChecks: ["audit / Conclusion"]
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Preset for theholocron repos that are documentation-only sites with no
|
|
70
|
+
* TypeScript source to check (e.g. skills, themes). No typecheck, no audit.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* const preset = nodeDocsSite();
|
|
74
|
+
* export default defineConfig({
|
|
75
|
+
* ...preset,
|
|
76
|
+
* description: "...",
|
|
77
|
+
* repo: { ...preset.repo, name: "theholocron/my-site" },
|
|
78
|
+
* workflows: [...preset.workflows, { name: "release", with: { "run-build": false } }, "sync"],
|
|
79
|
+
* providers: { ...preset.providers, secrets: "github" },
|
|
80
|
+
* });
|
|
81
|
+
*/
|
|
82
|
+
function nodeDocsSite() {
|
|
83
|
+
return compose(node(), docs());
|
|
84
|
+
}
|
|
85
|
+
//#endregion
|
|
86
|
+
export { nodeDocsSite as n, docs 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.
|
|
3
|
+
"version": "7.28.1",
|
|
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.
|
|
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/vitest-config": "7.
|
|
27
|
-
"@theholocron/tsconfig": "7.
|
|
26
|
+
"@theholocron/vitest-config": "7.28.1",
|
|
27
|
+
"@theholocron/tsconfig": "7.28.1"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@theholocron/cli": ">=2.0.0-alpha.1"
|