Skip to content

fix: bundler-safe /json barrels - #127

Merged
dazzatronus merged 1 commit into
mainfrom
fix/json-barrel-bundler-safe
Aug 11, 2026
Merged

fix: bundler-safe /json barrels#127
dazzatronus merged 1 commit into
mainfrom
fix/json-barrel-bundler-safe

Conversation

@dazzatronus

Copy link
Copy Markdown
Contributor

dist/json-schema/index.js used createRequire(import.meta.url) to load edit.json. When a consumer bundles with esbuild to CJS (the Shotstack MCP Lambda), import.meta.url is undefined and the module throws at init — the dev MCP server 502'd on every request.

Fix: both barrels now inline the schema as plain JS data modules — no runtime module machinery, works in ESM, CJS, and any bundler output format.

Verify: pnpm build && pnpm test:smoke (63 passing, includes new checks that the barrels contain no import.meta/runtime require()); or bundle import {edit} from '@shotstack/schemas/json' with esbuild --format=cjs and run it.

@dazzatronus
dazzatronus merged commit ffd9174 into main Aug 11, 2026
1 check passed
@dazzatronus
dazzatronus deleted the fix/json-barrel-bundler-safe branch August 11, 2026 10:52
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.15.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant