Repository navigation
fix: resolve the Node entry to dist and keep the dashboard listening across a location release - #61
Open
abd1rahmane wants to merge 1 commit into
Open
abd1rahmane wants to merge 1 commit into
abd1rahmane wants to merge 1 commit into
Conversation
…across a location release
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.
The exports map now sends Node hosts to the built dist/index.js while Bun keeps loading src/index.ts. Installing the published package per the README failed under Node with ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING, and the shipped dist bundle was never reached because the exports entry won. A clean consumer now imports the package under Node and Bun, and a CommonJS require also resolves. No dependency was changed and the rpc and tui subpaths keep their current entries.
The dashboard server is process-global, as it already was on the V1 path, so disposing one location's plugin instance no longer closes port 4747. Previously a release stopped the listener and the host, which keeps the plugin marked as loaded and does not call setup again, left the panel unreachable until restart. The listener is unref'd so it cannot keep the host process alive, and a second setup in the same process now reports the port as already running instead of advising a kill of its own pid. A test asserts that health still answers after dispose.
Fixes #60
Reproduced against the published tarball before the change: @hueyexe/opencode-ensemble@0.21.5. Verification: Published 0.21.5 in a clean consumer:
node probe.mjs-> FAILED ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING for node_modules/@hueyexe/opencode-ensemble/src/index.ts. Patched tree:bun run build,npm pack, installed the tarball in a fresh consumer,node probe.mjs-> NODE LOADED object ensemble,import.meta.resolve-> dist/index.js under node and src/index.ts under bun, andrequire()-> CJS LOADED ensemble. RED/GREEN for the dashboard: the new assertion in test/v2-setup.test.ts failed with ConnectionRefused on the pristine tree and passes after the change.bun test-> 956 pass, 1 fail (dashboard > GET /api/health > binds to the configured interface), which also fails on the pristine tree because 127.0.0.2 is unreachable in this environment.bun run typecheck-> exit 0.bunx biome lint src/-> only the pre-existing diagnostics at dashboard.ts:16, 298, 341 and watchdog.ts:169, none on changed lines.