fix(enhanced): resolve protocol requiredVersion from installed package - #5013
fix(enhanced): resolve protocol requiredVersion from installed package#5013tonoizer wants to merge 1 commit into
Conversation
When shared dependencies use package-manager protocol specifiers (catalog:, workspace:*, npm:, patch:, file:, link:, portal:), auto requiredVersion no longer becomes '' or the protocol string. Consume falls back to ^<installed version> from the resolved package.json.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9218099b4c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| getDescriptionFile( | ||
| compilation.inputFileSystem, | ||
| path.dirname(importResolved as string), | ||
| ['package.json'], |
There was a problem hiding this comment.
Resolve the configured package rather than the fallback module
When a protocol dependency uses the supported packageName option with a relative or alternative fallback import, this search starts from importResolved and therefore reads the fallback module's nearest package.json, not the configured package's manifest. For example, { import: './src/react-shim', packageName: 'react' } with react: 'catalog:' assigns the application's own version as React's required range, potentially rejecting compatible shared React versions or accepting incompatible ones. Resolve the installed packageName itself before constructing the caret range.
AGENTS.md reference: AGENTS.md:L289-L289
Useful? React with 👍 / 👎.
No description provided.