feat(node): add js:runtime to pin a site's JS runtime from the CLI#522
Merged
Conversation
Adds `lerd js:runtime [bun|node|auto]`, the CLI counterpart to the dashboard's bun/Node toggle. Until now the only ways to pin js_runtime were editing .lerd.yaml by hand or flipping the UI switch. The command resolves the current site, writes the js_runtime field through the same config helper the UI uses, and re-syncs the host workers so a running Vite/dev worker switches runtime straight away. With no argument it prints the current setting and what it resolves to.
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.
Adds
lerd js:runtime [bun|node|auto], the CLI counterpart to the dashboard's bun/Node toggle. Until now the only ways to pin a site's JS runtime were editing.lerd.yamlby hand or flipping the UI switch, so there was no scriptable, in-terminal way to do it.The command resolves the current site from the working directory, writes the
js_runtimefield throughconfig.SetProjectJSRuntime(the same helper the dashboard uses), then callsRegenerateHostWorkersForSiteso a running Vite/dev worker switches runtime immediately, exactly as the UI does.bunforces bun,node(ornpm) forces Node and opts out of bun auto-detection, andautoclears the pin so detection takes over again. Run with no argument and it prints the current setting plus what it currently resolves to.The docs page gains the command in the Node table and a short paragraph in the runtime-pinning section, so the manual
.lerd.yamledit and the new command sit side by side.