fix(plugin): unblock paperclip-plugin-wavex build on fresh checkouts#29
Merged
Conversation
Two bugs that surfaced trying to build the wavex plugin locally after #27 + #28. Neither one was caught by OSS CI because the plugin build isn't run on the test workflow; the build is only exercised at dev boot time via `pnpm dev:wavex-plugin:build`. Both bugs hard-fail the build so the plugin's dist/ never refreshes — the Mission Control UI loads a stale bundle that doesn't include any of the F1-F6 or Pool B work. 1. **Hardcoded user path in build-ui.mjs** The esbuild import was pinned to `/Users/dylanriedweg/wavex-os/node_modules/.pnpm/esbuild@0.27.7/...` — works only on the original author's machine. esbuild isn't a direct dep of this package so a bare `import "esbuild"` also fails (pnpm's isolated store hides it). Replaced with a glob over the workspace root's `.pnpm` store that picks up whichever esbuild version is installed: ```js const pnpmStore = resolve(__dirname, "../../node_modules/.pnpm"); const esbuildDir = readdirSync(pnpmStore).find((d) => /^esbuild@\d/.test(d)); const esbuildMain = pathToFileURL(join(pnpmStore, esbuildDir, ...)); const { build } = await import(esbuildMain.href); ``` Robust across machines and esbuild minor-version bumps. 2. **`Record<View, number>` missing the new `"pool-b"` key** #28 added `"pool-b"` to the `View` type union but didn't update `countByTab`, which is typed `Record<View, number>`. tsc: MissionControlPage.tsx(94,9): error TS2741: Property '"pool-b"' is missing in type ... but required in type 'Record<View, number>' Added `"pool-b": 0` with a comment noting that Pool B Health doesn't have a backend-driven badge yet — the `mission-control-tab-counts` RPC predates it. A follow-up can surface `pillar_suggest_calls_24h - pillar_suggest_success_24h` as the badge value when chips are failing. After both fixes, plugin builds to a fresh 235.8kb dist/ui/index.js that includes the PoolBHealthWidget. Paperclip dev server now loads the new "Pool B" subnav tab. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Two bugs that hard-fail the wavex plugin build, neither one caught by CI (the test workflow doesn't run
pnpm --filter @wavex-os/paperclip-plugin-wavex build— only the dev-server flow does). Both were live on main after #27 + #28; the plugin'sdist/stayed stale on every fresh checkout, so Mission Control loaded a UI bundle missing F1-F6 + Pool B.Bug 1 · Hardcoded user path in
build-ui.mjsPre-existing — only worked on the original author's machine. esbuild isn't a direct dep of this package (and pnpm's isolated store hides it from a bare
import "esbuild"), so the workaround was the absolute path.Fix: glob the workspace's
.pnpmstore for whichever esbuild version is installed, import itsmain.jsvia file URL:Robust across machines and esbuild minor-version bumps.
Bug 2 ·
Record<View, number>missing the new"pool-b"keyI added
"pool-b"to theViewtype union in #28 but didn't updatecountByTabinMissionControlPage.tsx. tsc fails:Fix: added
"pool-b": 0with a comment noting that Pool B doesn't have a backend-driven badge yet — themission-control-tab-countsRPC predates it. Future: surfacepillar_suggest_calls_24h - pillar_suggest_success_24has the badge when chips are failing.Verification
After both fixes, plugin builds to a fresh 235.8kb bundle that includes
PoolBHealthWidget. Paperclip's dev server now loads the new "Pool B" subnav tab.Why CI didn't catch this
The Test workflow runs
pnpm test(vitest) but notpnpm --filter ... build. The plugin build is only exercised at dev boot via thedev:wavex-plugin:buildscript — which has|| echo 'wavex plugin build skipped', so a build failure doesn't even surface in dev mode (the user just gets a stale bundle and a missing tab with no error message).A follow-up could either:
dev:wavex-plugin:buildexit non-zero on build failure, ORpnpm -r buildto the CI Test job so plugin build errors surfaceOut of scope for this fix.
🤖 Generated with Claude Code