Skip to content

fix: avoid JSON import attributes in dist - #24

Merged
wavekat-eason merged 1 commit into
mainfrom
fix/schema-import-attributes
Jul 19, 2026
Merged

fix: avoid JSON import attributes in dist#24
wavekat-eason merged 1 commit into
mainfrom
fix/schema-import-attributes

Conversation

@wavekat-eason

Copy link
Copy Markdown
Contributor

The published dist/index.js imported the bundled schema JSON with with { type: 'json' }, which older consumer bundlers (e.g. wrangler 3's pinned esbuild 0.17) cannot parse — the platform's API worker build fails on @wavekat/flow-schema@0.0.2.

The gen step now emits the schema as a generated TS module (src/generated/schema.ts) and the runtime imports that instead of the JSON file. The raw JSON is still bundled and exported at ./schema/v1, so that consumer surface is unchanged.

Verified: gen (no drift), test (79 passing), build — dist contains no import attributes.

🤖 Generated with Claude Code

https://claude.ai/code/session_0177Rm5YYW6CxrGeABjazVrz

The published dist imported the bundled schema JSON with
`with { type: 'json' }`, which older consumer bundlers (e.g.
wrangler 3's pinned esbuild 0.17) cannot parse. The gen step now
emits the schema as a generated TS module (`src/generated/schema.ts`)
and the runtime imports that instead; the raw JSON is still shipped
and exported at `./schema/v1`.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0177Rm5YYW6CxrGeABjazVrz
@wavekat-eason
wavekat-eason merged commit 33fdfb5 into main Jul 19, 2026
3 checks passed
@wavekat-eason
wavekat-eason deleted the fix/schema-import-attributes branch July 19, 2026 08:45
@github-actions github-actions Bot mentioned this pull request Jul 19, 2026
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