Skip to content

feat: implement nodeModulesReconstructedLookup feature for PR7 #3913

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: pr6-fallback-version-support
Choose a base branch
from

Conversation

ScriptedAlchemy
Copy link
Member

Summary

This PR implements the nodeModulesReconstructedLookup feature for PR7, building on top of the PR6 fallback version support. The feature enables more flexible module sharing by allowing path reconstruction from node_modules structure.

Key Changes

  • ProvideSharedPlugin: Added Stage 2 node_modules reconstruction logic for both direct and prefix matches
  • ConsumeSharedPlugin: Implemented comprehensive node_modules path reconstruction in the factorize hook with relative path handling
  • SharePlugin: Added nodeModulesReconstructedLookup property support to configurations
  • Type Definitions: Updated all sharing interfaces to include nodeModulesReconstructedLookup property
  • Request Filtering Fix: Fixed prefix request filtering logic using _originalPrefix approach for proper remainder matching
  • Test Coverage: Created comprehensive test case structure matching share-filter branch specifications

Technical Implementation

The implementation follows the share-filter branch specifications with:

  1. Stage 1: Direct and prefix matching with original request strings
  2. Stage 2: node_modules path reconstruction using extractPathAfterNodeModules utility
  3. Enhanced Filtering: Proper handling of include/exclude request filters for prefix matches
  4. Layer Support: Full issuer layer matching logic for both regular and reconstructed paths

Test Plan

  • All existing PR6 tests continue to pass
  • New nodeModulesReconstructedLookup test cases added
  • Request filtering tests fixed and passing
  • Integration with share-filter branch specifications verified

🤖 Generated with Claude Code

- Add nodeModulesReconstructedLookup support to ProvideSharedPlugin with
  Stage 2 reconstruction logic
- Implement comprehensive node_modules path reconstruction in
  ConsumeSharedPlugin factorize hook
- Add nodeModulesReconstructedLookup property to SharePlugin configurations
- Fix prefix request filtering logic using _originalPrefix approach for
  proper remainder matching
- Create comprehensive test case structure for nodeModulesReconstructedLookup
  feature
- Update type definitions to include nodeModulesReconstructedLookup in all
  sharing interfaces
- Align implementation with share-filter branch specifications

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link

changeset-bot bot commented Jul 15, 2025

⚠️ No Changeset found

Latest commit: 1bf466c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant