Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate Typescript documentation from wit files (#1157)
This PR uses the `jco types` command to generate Typescript definitions for the wasm crates instead of `jco transpile`. The reason is that `jco transpile` generates ts definitions by decoding WASM component binaries, whereas `jco types` parses .wit files directly and uses that information. This means that the `Resolve` instance created during `types` has access to the type documentation info, and the one created during `transpile` does not. I've modified `infra check npm` with a new step which calls `jco types` and handles the resulting .d.ts files. When calling `jco transpile` we're now passing the option `--no-typescript` to avoid generating conflicting typescript outputs. These changes depend on NomicFoundation/jco#1, which augments the `types` command to accept the same configuration file that we pass to `transpile`. Without this, the codegen in `types` will not be able to generate Typescript enums for Rust enums, or any other customization that we want.
- Loading branch information