🚑 Restore portable eval imports on Bun and Node - #649
Conversation
PR #649: 🚑 Restore portable eval imports on Bun and Node4 files, +21 / -10 Scope✅ PR scope looks good. Structural✅ No structural bloat detected. Slop✅ Slop indicators look low. Static AnalysisOxlint: 1 diagnostic across 1 file (1 rule) no-unassigned-import (1): packages/core/src/data-uri-compiler.ts CorrectnessFILE: packages/core/src/data-uri-compiler.ts FILE: packages/core/src/data-uri-compiler.ts No extraneous code patterns detected. |
|
The unassigned import is intentional and unchanged by this PR: |
Why
CI on
mainis red because the RV10e value-root regression cannot load its authoredeffectionimport under Node or Bun. Node's generated module has no fixture dependency graph, while Bun's data-URI loader loses the generated module export when an import resolves to a filesystem-backed package.Refs #647.
What changes
Before:
The Node test stopped at
Cannot find module 'effection'. Bun stopped atexpected default export to be a generator function, got string. Neither runtime reached the return-selection security assertion.After:
The fixture exposes the prepared workspace dependencies as its project dependencies, and Bun compiles eval blocks through temporary TypeScript files. Deno, Node, and Bun all reach the intended missing-return refusal.
How it works
Review guide
Start with:
packages/cli/tests/value-root.test.tsThen review:
packages/cli/src/bun.tsspecs/executable-mdx-spec.mdLook carefully at:
What must stay true
How to verify it
deno task test packages/cli/tests/value-root.test.tsproves Deno keeps the existing data-URI behavior.pnpm exec tsx --test packages/cli/tests/value-root.test.tsproves Node resolves the authored import from the fixture project.bun test packages/cli/tests/value-root.test.tsproves Bun preserves the generated eval module and reaches the security assertion.Scope
Included
Intentionally unchanged
Risks and limitations
.xmd-evalfile Node already creates; its ownership and cleanup contract are unchanged.Scope confirmation