You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* bring back Status enum
* refactor codgen
* remove static code from codegen
* more cleanup
* Polish truapi codegen display naming
* Fix typecheck and playground default for resource allocation example
- Use value: undefined (not null) for unit variants of the mixed
AllocatableResource enum in the rustdoc client example so the
generated example file typechecks under tsc -p tsconfig.examples.json.
- Drop the post-JSON collapse_tag_only_objects step in the playground
codegen. It was over-eager: any { tag: "X" } object was rewritten to
the bare string "X", which breaks mixed enums where the wire codec
requires a tagged object. Unit-only enums already render as bare
strings at the source.
- Remove stray empty doc lines in calls.rs, local_storage.rs and
permissions.rs, and reformat the rustdoc display-name test per
nightly rustfmt.
* Replace consecutive writeln! blocks with writedoc!
The explorer registry and playground services writers had many
multi-line writeln! formats for adjacent fixed-shape lines. Group
those into single writedoc! blocks with named arguments. Generated
output is byte-identical.
* Collapse more multi-writeln blocks in ts.rs
- Use writedoc! for the three-line generic codec function definition.
- Use named-capture interpolation so single multi-line writeln! formats
collapse to one line.
- Fold the wire_version response decode branch into one writeln! with a
conditional suffix.
- Fold write_payload_field's two branches into a single writeln! by
building the encoded argument up front.
- Collapse the trailing close-brace + blank-line pair after each
generated client class into one writeln!.
* Make value optional for unit variants of mixed enums
Generated types now emit `{ tag: "X"; value?: undefined }` for unit
variants in mixed enums, so consumers can write `{ tag: "X" }` without
the `value: undefined` placeholder.
To keep the codec assignable to the public type:
- Add S.TaggedUnion in scale.ts that wraps scale-ts's Enum and narrows
unit-variant codecs (Codec<undefined>) to `value?: undefined`.
- Refine indexedTaggedUnion's variant type the same way, so versioned
wrappers with V<N>(_void) variants follow the same convention.
Update the resource_allocation rustdoc example accordingly.
* rename truapiCall -> System
* flatten
* merge apis
* rename
* rename path / get rid legcacy
* Fix codegen drift and refresh explorer icon map
- Normalize single-quoted TS string literals to double-quoted JSON in
playground default-request extraction so examples like
`message: '{"jsonrpc":...}'` round-trip through serde_json.
- Apply nightly rustfmt to api/payment.rs, api/statement_store.rs, and
v01/chain.rs.
- Update explorer group icons for the renamed groups (account, chain) and
add icons for entropy, json-rpc, permissions, resource-allocation,
theme, transaction.
* fix
* fix rewiring
* rm reordering
* fix
* remove explorer
* fix clippy
* fix clippy ref
* remove hard-coded service fields
* playground: fix Transaction → Signing method routing
The `Transaction` trait was merged back into `Signing` but the
playground bridge and auto-test still referenced `"transaction"` as a
`TrUApiClient` key, causing a TS build failure.
Route `create_transaction` and `create_transaction_with_legacy_account`
through `signing` to match the generated client.
---------
Co-authored-by: Filippo Vecchiato <filippo@parity.io>
Copy file name to clipboardExpand all lines: .claude/skills/regen-codegen/SKILL.md
+3-4Lines changed: 3 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
name: regen-codegen
3
-
description: Regenerate the @parity/truapi TypeScript client and playground/explorer metadata from the truapi crate's rustdoc JSON. Use whenever the Rust trait surface changes.
3
+
description: Regenerate the @parity/truapi TypeScript client and playground metadata from the truapi crate's rustdoc JSON. Use whenever the Rust trait surface changes.
4
4
---
5
5
6
6
# Regenerate the TypeScript client
@@ -14,7 +14,7 @@ not change rustdoc output) or purely TS-side.
14
14
```
15
15
16
16
Expected output: `Generated client at js/packages/truapi/src/generated/`,
17
-
`Generated playground metadata ...`, `Generated explorer registry ...`.
17
+
`Generated playground metadata ...`.
18
18
19
19
The script is `cargo +nightly rustdoc --output-format json` →
20
20
`truapi-codegen` → `prettier --write` → `npm run build` in
@@ -24,8 +24,7 @@ The script is `cargo +nightly rustdoc --output-format json` →
Copy file name to clipboardExpand all lines: CLAUDE.md
+7-15Lines changed: 7 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,8 +13,7 @@ rust/crates/
13
13
truapi-macros/ #[wire(id = N)] proc-macro
14
14
js/packages/
15
15
truapi/ @parity/truapi TS package; src/generated/ produced by truapi-codegen
16
-
explorer/ Vite documentation explorer; deploys to GitHub Pages
17
-
playground/ Next.js interactive explorer; deploys to truapi-playground.dot
16
+
playground/ Next.js interactive playground; deploys to truapi-playground.dot
18
17
hosts/dotli/ dotli submodule
19
18
docs/ design docs, RFCs, feature proposals
20
19
scripts/codegen.sh regenerate the TS client from the Rust crate
@@ -24,6 +23,8 @@ scripts/codegen.sh regenerate the TS client from the Rust crate
24
23
25
24
- Every `pub` Rust item (functions, methods, types, traits, modules, constants) carries a doc comment (`///` or `//!`).
26
25
Keep it short and focused on intent or invariants, not on what the signature already says.
26
+
- Do not add code comments or doc comments that narrate migrations, compatibility shims, or historical changes. Comments should describe only the current code.
27
+
- Remove legacy compatibility code by default. Keep or add it only when explicitly requested.
27
28
- In Rust format strings, prefer inlined variables: `"log value: {value:?}"` over `"log value: {:?}", value`.
28
29
29
30
## First-time setup
@@ -48,7 +49,7 @@ When the Rust trait surface changes, rerun:
48
49
```
49
50
50
51
That will repopulate `js/packages/truapi/src/generated/`. Commit the regenerated files alongside the Rust changes.
51
-
It also regenerates playground metadata in `js/packages/truapi/src/playground/` and explorer metadata in `js/packages/truapi/src/explorer/`.
52
+
It also regenerates playground metadata in `js/packages/truapi/src/playground/codegen/`.
52
53
After regenerating, rebuild the client and refresh the playground's link copy:
53
54
54
55
```bash
@@ -65,7 +66,7 @@ After regenerating, rebuild the client and refresh the playground's link copy:
@@ -95,16 +96,7 @@ submodule init + `bun install` and the per-pane `cd` discipline).
95
96
Alternatively, with a deployed Polkadot Desktop Host installed, navigate to
96
97
`https://dot.li/localhost:3000` from within it.
97
98
98
-
### Explorer
99
-
100
-
```bash
101
-
cd explorer
102
-
npm run dev # Vite dev server
103
-
npm run build # static GitHub Pages build to dist/
104
-
npm run lint # TypeScript checks
105
-
```
106
-
107
99
## Deployment
108
100
109
-
Pushes to `main` trigger `.github/workflows/deploy.yml`, which builds `playground/` and publishes the static export to `truapi-playground.dot` via `bulletin-deploy`.
110
-
Pushes to `main` also trigger `.github/workflows/deploy-explorer.yml`, which builds `explorer/` and publishes it to GitHub Pages.
101
+
Pushes to `main` trigger `.github/workflows/deploy-playground.yml`, which builds `playground/` and publishes the static export to `truapi-playground.dot` via `bulletin-deploy`.
102
+
Pushes to `main` also trigger `.github/workflows/deploy-docs.yml`, which publishes the Rust API docs to GitHub Pages.
0 commit comments