feat(desktop): allow configuring dev remote-debugging-port; chore(opencode): add --no-minify flag to build script - #46196
Open
CannonRS wants to merge 2 commits into
Open
feat(desktop): allow configuring dev remote-debugging-port; chore(opencode): add --no-minify flag to build script#46196CannonRS wants to merge 2 commits into
CannonRS wants to merge 2 commits into
Conversation
6 tasks
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.
Issue for this PR
Closes #46194
Closes #46195
Type of change
What does this PR do?
Two small CLI / dev-quality knobs, one commit each, both product-neutral:
Commit 1 —
chore(opencode): add --no-minify flag to build script(packages/opencode/script/build.ts)The CLI build script already accepted
--sourcemaps,--single,--baseline,--skip-install,--skip-embed-web-ui. It did not have a way to opt out ofminification for local debugging or for
bun runsmoke tests, which is annoyingwhen a regression only reproduces against the unminified bundle (e.g. readable
stack traces, exact symbol names). This adds
--no-minifyas a sibling flag andturns
minify: trueintominify: !noMinifyFlag. Default behaviour is unchanged.Commit 2 —
feat(desktop): allow configuring dev remote-debugging-port(packages/desktop/src/main/index.ts)In unpackaged/dev runs the desktop main process pins the Electron remote
debugging port to
"9222". If the developer's local port9222is already inuse (common when several Electron apps, VS Code, or another
opencodedesktopdev build are running) the second instance silently fails to expose the
DevTools. This reads
process.env.OPENCODE_REMOTE_DEBUGGING_PORTand falls backto
"9223"(the desktop's preferred dev port, one above the OS-default9222). The new env var is opt-in: existing dev setups that already free9222or override it through
--remote-debugging-portdirectly keep working.How did you verify your code works?
packages/opencode/script/build.ts+2/-1packages/desktop/src/main/index.ts+4/-1bun typecheckpasses in both packages (tsgo --noEmitexit 0 inpackages/opencode,tsgo -bexit 0 inpackages/desktop) afterbun install --ignore-scriptsin the worktree, againstupstream/devheaddc4449df0dplus both commits.build.ts: the newnoMinifyFlagis read once at module top, mirroringsourcemapsFlag/singleFlag/baselineFlag; the onlyminify:literal inthe per-target loop is replaced with the new expression.
index.ts: theif (!app.isPackaged) ... appendSwitch("remote-debugging-port", "9222")block was a single line; it is now a block that reads the env var with a
default. Nothing else in the file touches this switch.
Screenshots / recordings
N/A — no UI change.
Checklist
bun typecheckinpackages/opencodeandpackages/desktopboth passafter
bun install --ignore-scriptsin the worktree, againstupstream/devheaddc4449df0dplus both commits.