Skip to content

Programmatic API for type generation (for integration in Nitro Cloudflare preset and similar use cases) #11787

@schplitt

Description

@schplitt

Describe the solution

Currently, Wrangler supports generating types for Cloudflare Workers, but this is only available via the CLI command.

It would be fantastic to have a programmatic API for this feature, allowing developers to generate types directly via JavaScript or TypeScript code. This would open up lots of opportunities for tool authors and framework maintainers. For example, nitro with its Cloudflare preset could seamlessly generate types during development, without needing to rely on running external CLI commands or managing subprocesses.

Having a programmatic API would make automating and integrating type generation much simpler, enabling smoother workflows, a tighter development loop, and an even better experience for people building with tools that target Cloudflare Workers.

Thanks for considering this! It would be a really appreciated addition for the community.

Metadata

Metadata

Labels

typesTypes issues to do with wrangler type generation

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions