TL;DR
Please support npm subpath imports in custom provider npm entries.
Wanted behavior:
- install package root
- import full requested specifier
Example:
pkg -> install pkg, import pkg
pkg/subpath -> install pkg, import pkg/subpath
@scope/pkg/subpath -> install @scope/pkg, import @scope/pkg/subpath
Describe the enhancement you want to request
Custom provider npm values currently seem to work well for plain package specifiers such as pkg and @scope/pkg, but not for standard npm subpath imports such as pkg/subpath and @scope/pkg/subpath.
This matters because a provider package may reasonably want to expose multiple entrypoints while keeping its root export unchanged. For example:
- a root entry for general usage
- a subpath export for a more specialized integration surface, such as OpenCode-specific optimization or API/subscription path branching
Expected behavior for non-file:// specifiers:
- parse configured
npm as an import specifier
- install only the root package
- import the full requested specifier
This keeps plain package behavior unchanged while adding support for normal npm subpath exports.
Suggested tests:
- plain package custom provider still loads
- scoped plain package custom provider still loads
- package subpath custom provider loads
- scoped package subpath custom provider loads
- invalid subpath fails cleanly
pkg and pkg/subpath do not collide in cache or loader state
Note: I used AI assistance during investigation and English drafting because English is not my first language.
TL;DR
Please support npm subpath imports in custom provider
npmentries.Wanted behavior:
Example:
pkg-> installpkg, importpkgpkg/subpath-> installpkg, importpkg/subpath@scope/pkg/subpath-> install@scope/pkg, import@scope/pkg/subpathDescribe the enhancement you want to request
Custom provider
npmvalues currently seem to work well for plain package specifiers such aspkgand@scope/pkg, but not for standard npm subpath imports such aspkg/subpathand@scope/pkg/subpath.This matters because a provider package may reasonably want to expose multiple entrypoints while keeping its root export unchanged. For example:
Expected behavior for non-
file://specifiers:npmas an import specifierThis keeps plain package behavior unchanged while adding support for normal npm subpath exports.
Suggested tests:
pkgandpkg/subpathdo not collide in cache or loader stateNote: I used AI assistance during investigation and English drafting because English is not my first language.