Repository navigation
Ship compiled JavaScript in Pulse for opencode (0.2.1) - #18
Merged
Merged
Conversation
opencode v2 compiles plugin TSX only outside node_modules, so 0.2.0 from
npm failed to load in v2 ("Cannot find package 'react'"): Bun fell back to
React JSX. Local checkouts worked, which is why testing missed it.
scripts/build.mjs now compiles src/ to dist/ with Solid's universal
transform for @opentui/solid (what opencode applies to local plugins), and
the package exports dist/tui.js. npm runs the build on prepack; CI builds
it, and the release workflow installs the build tools first.
Tested the packed package from node_modules paths in opencode 2.2.5 (the
real npm cache path) and 1.19.5.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DuYf7wf62kLrVeZHzMtocm
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.
0.2.0 from npm fails to load in opencode v2 with
Cannot find package 'react'. v2 compiles a plugin's TSX with Solid only when the file is outsidenode_modules. For an npm-installed package, Bun falls back to React JSX. Testing from a local checkout hid this, because opencode compiles those files itself.What changed
opencode/scripts/build.mjscompilessrc/todist/with Babel, using Solid's universal transform for@opentui/solid(the same transform opencode applies to local plugins).solid-jsand@opentui/solidstay as imports, which opencode provides.package.jsonnow exports./tuias./dist/tui.jsand shipsdist/instead ofsrc/. npm runs the build on prepack, and Babel is a devDependency only.open-source-checks.ymlbuilds the plugin, andrelease-opencode.ymlinstalls the build tools before publishing.node_modulespath. Version bumped to 0.2.1.Testing
make test-opencodepasses, and so donpm ci && npm run buildfrom a clean checkout./pulse-add,/pulse-removeand/pulse-pause(which update right away), and the detail dialog.node_modulespath and checked the sidebar, the band and/pulse-add.Generated by Claude Code