fix(cli): support compiled next cli e2e runtime#5240
Open
jgoux wants to merge 4 commits into
Open
Conversation
…-binary-cant-run-supabase-functions
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
dist/supabase-nextbinary so tests exercise the same artifact users run.CLI-1452:
functions devand native/runtime assetsThe compiled next binary could not boot commands that pulled in
@parcel/watcher, because the native optional package is not embedded bybun --compileand the fallback.nodepath does not exist inside Bun's embedded filesystem.This PR keeps the compiled binary path viable by making the next CLI e2e harness run through
dist/supabase-next, and by embedding the Edge Runtime bootstrap with Bun's native text import attribute instead of resolving the bootstrap through a runtime source-file path. The Edge Runtime service writes that embedded bootstrap source into the runtime temp directory before launching the function runtime.CLI-1453: compiled binary daemon/supervisor dispatch
Compiled Bun ignores the script-path argv shape that works in JIT mode, so
child_process.fork(daemonEntryPoint)re-entered the compiled CLI entrypoint instead of running the daemon script.This PR makes compiled-binary dispatch explicit:
forkDaemonmarks daemon children through the environment, and the compiled next CLI entrypoint routes that child process directly to the daemon runner. The same pattern is used for process supervision:@supabase/process-composeforks throughprocess.execPath, uses a tiny env protocol only for compiled-Bun self-dispatch, and otherwise remains a generic Node/Bun process supervision library. The supervisor runtime/protocol are native.tsfiles, so Bun forks Bun and Node forks Node.Reviewer Notes
The process-compose changes are intentionally runtime-neutral: there are no Supabase-specific paths or command names in the library. Supabase-specific compiled-binary dispatch lives in the CLI/stack entrypoints that own that behavior.