feat(wrangler): Add programmatic type generation API#13717
Conversation
🦋 Changeset detectedLatest commit: c09a25b The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Review posted on PR #13717 with two findings:
|
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
|
✅ All changesets look good Review of
|
|
Codeowners approval required for this PR:
Show detailed file reviewers |
|
Do we actually publicly document other |
Actually yes: https://developers.cloudflare.com/workers/wrangler/api/ |
workers-devprod
left a comment
There was a problem hiding this comment.
Codeowners reviews satisfied
Fixes RM-27721.
This change adds a programmatic Wrangler API for type generation via
experimental_generateTypes, using the same core logic aswrangler typesso CLI and API outputs stay aligned.What's changed
experimental_generateTypesimplementationpackages/wrangler/src/type-generation/index.tsto extract shared generation helpers used by both:wrangler types)experimental_generateTypes)packages/wrangler/src/__tests__/type-generation.test.ts, including parity checks.Usage
experimental_generateTypesdocumentation cloudflare-docs#30418A picture of a cute animal (not mandatory, but encouraged)