You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(plugin): support package subpath exports - #49863
Treats bare package subpaths such as opencode-pty/v2 as npm registry packages, installs their package root, and preserves the full requested specifier when resolving the plugin entrypoint. Explicit Git package specs remain supported.
How did you verify your code works?
packages/core: bun test test/npm.test.ts — 17 passed
packages/plugin: bun test test/host.test.ts — 10 passed
bun run typecheck in packages/util, packages/plugin, and packages/core
oxlint on the changed files — 0 warnings and 0 errors
Reviewing this branch against the latest report on #49852 exposed an ambiguity: registrySubpath() also rewrites valid GitHub shorthand. On this head, Npm.isRegistryPackage("anomalyco/opencode") returns true and its cache key is anomalyco@latest; npm-package-arg classifies the same input as Git. The existing tests pass (17 npm, 10 host), but do not cover that compatibility case.
I propose preserving bare Git shorthand and using an explicit registry selector, for example npm:opencode-pty/v2, to install the root package and resolve ./v2. Alternatively, bare name/path would need a defined registry-versus-Git precedence and registry validation. Could a maintainer approve the explicit-selector approach or confirm the intended precedence before I revise this PR? The 2.0.22 report describes the released loader, not a test of this branch.
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
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
Fixes #49852
Closes #49852
Issue: #49852
Type of change
What does this PR do?
Treats bare package subpaths such as
opencode-pty/v2as npm registry packages, installs their package root, and preserves the full requested specifier when resolving the plugin entrypoint. Explicit Git package specs remain supported.How did you verify your code works?
packages/core:bun test test/npm.test.ts— 17 passedpackages/plugin:bun test test/host.test.ts— 10 passedbun run typecheckinpackages/util,packages/plugin, andpackages/coreoxlinton the changed files — 0 warnings and 0 errorsScreenshots / recordings
No UI changes.
Checklist