Skip to content

Make bundled snippets safe for non-Vite consumers#32

Draft
meekmachine wants to merge 1 commit into
mainfrom
codex/next-safe-snippet-preloader
Draft

Make bundled snippets safe for non-Vite consumers#32
meekmachine wants to merge 1 commit into
mainfrom
codex/next-safe-snippet-preloader

Conversation

@meekmachine

Copy link
Copy Markdown
Owner

Summary

  • Replace top-level import.meta.glob snippet discovery with an explicit package-owned bundled snippet catalog.
  • Keep the existing async preloader API while avoiding Vite-only module evaluation in package consumers such as Next/Turbopack.
  • Add runtime-boundary guidance to prevent consumer-local shims for package compatibility failures.

Verification

  • npm run typecheck
  • npm test -- snippetPreloader
  • npm exec tsup and confirmed dist/src contain no import.meta.glob or generated undefined("./snippets...") calls.

Notes

  • Full npm run build could not complete on my machine because local Java is 11 and the CLJS worker build currently needs Java 21.

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