Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate Typescript Declaration Modules and Stubs #2

Merged
merged 27 commits into from
Jun 19, 2024
Merged

Conversation

nicoburniske
Copy link
Member

@nicoburniske nicoburniske commented Jun 18, 2024

stubgen command in jco

If anyone has thoughts for a better name I'm open to it

nicoburniske:jco% node src/jco.js stubgen --help                                    
Usage: jco stubgen <wit-path> -o <out-dir>

Generate typescript stubs based on a WIT component defintion

Arguments:
  wit-path                  Path to WIT definitions

Options:
  -o, --out-dir <out-dir>   output directory
  -n, --world-name <world>  WIT world to generate types for
  -q, --quiet               disable output summary
  -h, --help                display help for command

creates typescript definition files interfaces/{interface-name}.d.ts for each interface import in world

creates single definition file {package-name}.d.ts for all exports to be implemented by user

Also included unit test suite for asserting typescript file output.

@nicoburniske nicoburniske merged commit 64f4b7f into main Jun 19, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant