Skip to content

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
hueyexe:mainfrom
abd1rahmane:fix/pkgrepro-60
Open

abd1rahmane wants to merge 1 commit into
hueyexe:mainfrom
abd1rahmane:fix/pkgrepro-60

Conversation

@abd1rahmane

Copy link
Copy Markdown

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, and require() -> 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.

@abd1rahmane
abd1rahmane requested a review from hueyexe as a code owner November 22, 2026 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Node hosts: package fails to load (TS entry) and the dashboard never returns after a location release

1 participant