fix: switch plugins to CJS output to fix SEA binary plugin loading#436
Merged
theoephraim merged 4 commits intomainfrom Mar 18, 2026
Merged
fix: switch plugins to CJS output to fix SEA binary plugin loading#436theoephraim merged 4 commits intomainfrom
theoephraim merged 4 commits intomainfrom
Conversation
The standalone binary's plugin loader was using regex to rewrite ESM
`import { x as y }` to CJS destructuring, which broke on aliased imports
(e.g. `import { Buffer as Buffer$1 }` → invalid `const { Buffer as Buffer$1 }`).
All plugins now build as CJS via tsup. The SEA loader is replaced with a simple
node:vm execution using a standard CJS context (require, module, exports,
__dirname, __filename) — no transformation needed. The non-SEA path also switches
from dynamic import() to createRequire().
Smoke test fixture plugins are converted to CJS, and a new binary smoke test
verifies all real monorepo plugins load without SyntaxErrors.
Fixes #411
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 08a994f The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
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 |
varlock
@varlock/astro-integration
@varlock/nextjs-integration
@varlock/vite-integration
@varlock/1password-plugin
@varlock/aws-secrets-plugin
@varlock/azure-key-vault-plugin
@varlock/bitwarden-plugin
@varlock/google-secret-manager-plugin
@varlock/infisical-plugin
@varlock/pass-plugin
commit: |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Remove the SEA/non-SEA branch — node:vm works in both environments. Also removes isSEABuild() which is no longer needed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add --no-compile-autoload-dotenv and --no-compile-autoload-bunfig to the bun build --compile command so the binary does not pre-load .env files from the user's project directory into its own process.env before varlock starts. Without this, Bun would inject .env.local values as literal strings into process.env, which env-graph.ts captures as overrideValues — causing function calls like if(true, a, b) to be returned as-is instead of being resolved. Also adds a binary smoke test that verifies .env.local function calls are properly resolved rather than passed through as literal strings. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
philmillman
approved these changes
Mar 18, 2026
Member
philmillman
left a comment
There was a problem hiding this comment.
lgtm once those test failures are resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #411
Test plan
🤖 Generated with Claude Code