Skip to content

Commit e03f565

Browse files
committed
docs: complete backport of #22543 with script improvements and skill updates
The original cherry-pick of 6fd76de carried only the first commit of PR #22543's five-commit feature branch, leaving the script using the pre-22543 build-required check and missing the SKILL.md/CLAUDE.md/README.md documentation that landed alongside. Bring this backport in line with PR #22543's final merged state: - Replace the .sh `stdlib/dest/` build check with source-file + node_modules checks (no yarn-project build needed). - Apply the .ts generator improvements: optional handling order, array parenthesization, BlockHash in BlockParameterSchema, JSDoc index fix, name-aware example params, remarks rendering, fallback warnings. - Add Step 5a (Regenerate Node API Reference) to release-network-docs SKILL.md plus the matching Key Points entry. - Document `yarn generate:node-api-reference` in docs/CLAUDE.md and add the Node JSON-RPC API Reference section to docs/README.md. - Regenerate docs-operate/.../node-api-reference.md against this branch's yarn-project interfaces (64 methods, 55 node + 9 admin). METHOD_GROUPS adjustments for this branch's API surface: re-add getSlashPayloads to the admin group (still present in aztec-node-admin.ts here) and drop getPredictedMinFees from the fees group (not yet present here). The version-v2.1.11-ignition snapshot is left untouched — its content reflects that release's API and would be corrupted by regenerating against HEAD.
1 parent de6e69f commit e03f565

6 files changed

Lines changed: 181 additions & 85 deletions

File tree

.claude/skills/release-network-docs/SKILL.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,15 @@ self-identify its release type, ask the user to confirm.
2121

2222
**This skill does NOT:**
2323

24-
- Generate API docs (aztec-nr or TypeScript)
24+
- Generate developer API docs (aztec-nr or TypeScript)
2525
- Generate CLI reference docs
2626
- Update developer version config or cut developer versioned docs
2727
- Update migration notes
2828
- Require aztec CLI, nargo, or yarn-project build
2929

30+
**This skill DOES** regenerate the Node JSON-RPC API reference for the
31+
versioned docs (see Step 5a).
32+
3033
## Usage
3134

3235
```
@@ -165,7 +168,29 @@ Ask the user if any content changes are needed in `docs/docs-operate/`:
165168
- Operator changelog updates (if not handled by `/updating-changelog`)
166169

167170
If the user has content changes, apply them to the source files in
168-
`docs/docs-operate/`. If no content changes are needed, skip to Step 6.
171+
`docs/docs-operate/`. If no content changes are needed, skip to Step 5a.
172+
173+
### Step 5a: Regenerate Node API Reference
174+
175+
The Node JSON-RPC API reference is auto-generated from TypeScript source. It
176+
must be regenerated from the release tag's source files to ensure the versioned
177+
docs reflect the actual API at that release.
178+
179+
```bash
180+
cd docs
181+
yarn generate:node-api-reference
182+
```
183+
184+
This writes to `docs/docs-operate/operators/reference/node-api-reference.md`
185+
using the source files from the currently checked-out tag. The generator parses
186+
`yarn-project/stdlib/src/interfaces/aztec-node.ts` and
187+
`yarn-project/stdlib/src/interfaces/aztec-node-admin.ts` directly (no
188+
yarn-project build needed, but `yarn-project/node_modules/` must be installed
189+
so `npx tsx` can resolve `typescript` — run `yarn install` from `yarn-project`
190+
if needed).
191+
192+
Verify the output lists the expected number of methods and has no ungrouped
193+
methods warnings.
169194

170195
### Step 6: Build and Validate
171196

@@ -284,6 +309,10 @@ Check for stash conflicts. Then report to the user:
284309
- **No heavy prerequisites**: This skill does not require aztec CLI, nargo, or
285310
a yarn-project build. Only `yarn` (for the docs build), `curl`/`jq` (for
286311
the RPC query), and `cast` (for on-chain address queries) are needed.
312+
- **Node API reference is auto-generated**: Run `yarn generate:node-api-reference`
313+
(Step 5a) before building. The generator parses TypeScript source directly, so
314+
no yarn-project build is required — but `yarn-project/node_modules/` must exist
315+
(run `yarn install` from `yarn-project` if missing).
287316
- **Build must pass**: Do not cut versioned docs until `yarn build` succeeds.
288317
- **COMMIT_TAG needs `v` prefix**: The preprocessor uses COMMIT_TAG for GitHub
289318
URLs and git tag references. Omitting the `v` will break links in versioned

docs/CLAUDE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ This project uses Yarn 4.5.2 as specified in the `packageManager` field of packa
2929
- `yarn generate:typescript-api` - Generate TypeScript API docs (requires yarn-project to be built)
3030
- `yarn generate:typescript-api v3.0.0-devnet.6` - Generate for a specific version
3131
- `RELEASE_TYPE=mainnet yarn generate:typescript-api v4.2.0` - Generate with explicit release type
32+
- `yarn generate:node-api-reference` - Generate Node JSON-RPC API reference (requires yarn-project source files and yarn-project/node_modules; no build needed)
33+
- `yarn generate:node-api-reference --target-dir <dir>` - Generate into a specific versioned docs directory
3234

3335
The `RELEASE_TYPE` env var overrides version string pattern matching for output folder selection. This is useful when the version string doesn't self-identify its release type.
3436

docs/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,44 @@ yarn generate:typescript-api v3.0.0-devnet.6
270270

271271
The generated docs are linked from the [TypeScript API Reference](/developers/docs/aztec-js/typescript_api_reference) page.
272272

273+
### Node JSON-RPC API Reference
274+
275+
The Node JSON-RPC API reference is auto-generated from the TypeScript interface definitions and Zod schemas in `yarn-project/stdlib/src/interfaces/`. The generator parses the source AST to extract method names, JSDoc comments, and parameter/return types.
276+
277+
**Source files:**
278+
279+
- `yarn-project/stdlib/src/interfaces/aztec-node.ts``AztecNode` interface (`node_` methods)
280+
- `yarn-project/stdlib/src/interfaces/aztec-node-admin.ts``AztecNodeAdmin` interface (`nodeAdmin_` methods)
281+
- `yarn-project/stdlib/src/block/l2_block_source.ts``L2BlockSource` interface (JSDoc for inherited methods)
282+
283+
**Prerequisites:** `yarn-project` must have `node_modules/` installed so `npx tsx` can resolve `typescript`. Run `yarn install` from `yarn-project` if needed. No build is required — the generator parses source `.ts` files via the TypeScript Compiler API, not compiled output.
284+
285+
**Generate the reference doc:**
286+
287+
```bash
288+
yarn generate:node-api-reference
289+
```
290+
291+
This writes to `docs-operate/operators/reference/node-api-reference.md`.
292+
293+
**Generate for a specific versioned docs directory:**
294+
295+
```bash
296+
yarn generate:node-api-reference --target-dir network_versioned_docs/version-v4.1.3/operators/reference
297+
```
298+
299+
**How it works:**
300+
301+
1. Parses TypeScript interfaces with the TS Compiler API to extract JSDoc comments
302+
2. Parses Zod schema object literals from source AST to enumerate methods and extract types
303+
3. Generates markdown with method grouping, curl examples, and admin API security warnings
304+
305+
**When to regenerate:**
306+
307+
- When interface methods or Zod schemas change in `yarn-project/stdlib/src/interfaces/`
308+
- When cutting a new versioned snapshot of network docs (pass `--target-dir` to write into the versioned directory)
309+
- The source doc (`docs-operate/`) should be kept in sync with the latest code
310+
273311
## Macros
274312

275313
As mentioned above, Aztec docs pull code from the source files. This makes it easy to include sections of the source code in tutorials and other examples.

0 commit comments

Comments
 (0)