Skip to content

Commit bd40767

Browse files
Add API reference generation tooling
1 parent f3e1e78 commit bd40767

10 files changed

Lines changed: 1025 additions & 3 deletions
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@typeonce/effect-machine": patch
3+
---
4+
5+
Add Effect-compatible TypeDoc API reference generation tooling.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
node_modules/
22
dist/
33
references/
4+
.data/
45
*.tgz
56
.DS_Store
67
.pnpm-store

CONTRIBUTING.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,15 @@ understands imports, re-exports, and dynamic imports, and enforces:
5555

5656
The checker has executable fixture tests and runs as part of `pnpm check`. Add
5757
new rules only with a failing fixture that demonstrates the boundary.
58+
59+
## API reference data
60+
61+
`pnpm docs:api` generates an Effect-compatible TypeDoc dataset under
62+
`.data/api-reference/v4`. The dataset contains a top-level manifest, a package
63+
manifest, and one checksummed reflection JSON file per module configured in
64+
`api-reference.config.json`. Generated data is not committed.
65+
66+
`pnpm docs:api:check` runs the API reference unit tests, generates the complete
67+
dataset in a temporary directory, validates its manifests and checksums, and
68+
ensures every reflection can be consumed by the site-facing normalizer. It runs
69+
as part of `pnpm check`.

api-reference.config.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"channel": "v4",
3+
"output": ".data/api-reference/v4",
4+
"tsconfig": "tsconfig.json",
5+
"barrels": [
6+
{
7+
"export": ".",
8+
"source": "src/index.ts"
9+
},
10+
{
11+
"export": "./testing",
12+
"source": "src/testing/index.ts"
13+
},
14+
{
15+
"export": "./reactivity",
16+
"source": "src/unstable/reactivity/index.ts"
17+
},
18+
{
19+
"export": "./cluster",
20+
"source": "src/unstable/cluster/index.ts"
21+
}
22+
],
23+
"modules": [
24+
{
25+
"export": "./Machine",
26+
"source": "src/Machine.ts",
27+
"barrel": "."
28+
},
29+
{
30+
"export": "./testing/MachineTest",
31+
"source": "src/testing/MachineTest.ts",
32+
"barrel": "./testing"
33+
},
34+
{
35+
"export": "./unstable/reactivity/AtomMachine",
36+
"source": "src/unstable/reactivity/AtomMachine.ts",
37+
"barrel": "./reactivity"
38+
},
39+
{
40+
"export": "./unstable/cluster/ClusterMachine",
41+
"source": "src/unstable/cluster/ClusterMachine.ts",
42+
"barrel": "./cluster"
43+
}
44+
]
45+
}

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,12 @@
5454
"perf:runtime": "pnpm build && node --expose-gc scripts/runtime-performance.mjs",
5555
"format": "dprint fmt",
5656
"format:check": "dprint check",
57+
"docs:api": "node scripts/api-reference/generate.mjs",
58+
"docs:api:test": "node --test scripts/api-reference/*.test.mjs",
59+
"docs:api:check": "pnpm docs:api:test && node scripts/api-reference/generate.mjs --check",
5760
"test:consumer": "node scripts/test-consumer.mjs",
5861
"pack:check": "node scripts/pack-check.mjs",
59-
"check": "pnpm format:check && pnpm check:architecture && pnpm typecheck && pnpm build && pnpm test && pnpm test:types && pnpm test:consumer && pnpm pack:check",
62+
"check": "pnpm format:check && pnpm check:architecture && pnpm docs:api:check && pnpm typecheck && pnpm build && pnpm test && pnpm test:types && pnpm test:consumer && pnpm pack:check",
6063
"changeset": "changeset",
6164
"version-packages": "changeset version",
6265
"release": "pnpm build && changeset publish"
@@ -72,6 +75,7 @@
7275
"effect": "4.0.0-beta.107",
7376
"tinybench": "2.9.0",
7477
"tstyche": "7.2.1",
78+
"typedoc": "0.28.20",
7579
"typescript": "6.0.3",
7680
"vitest": "4.1.10",
7781
"xstate-v5": "npm:xstate@5.32.5",

0 commit comments

Comments
 (0)