Skip to content

feat: shareScope 'auto'#77

Merged
Aukevanoost merged 2 commits into
mainfrom
issues/76
Jul 3, 2026
Merged

feat: shareScope 'auto'#77
Aukevanoost merged 2 commits into
mainfrom
issues/76

Conversation

@Aukevanoost

@Aukevanoost Aukevanoost commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

closes #76

This pull request introduces a new feature for version-pinned share scopes in module federation, allowing shared dependencies to be isolated by version using the new autoShareScope utility. This makes it easier to ensure that only compatible versions of dependencies are shared between remotes, reducing the risk of version conflicts. The implementation includes documentation, code, and comprehensive tests.

Key changes:

New Feature: Version-Pinned Share Scopes

  • Added the autoShareScope utility function and PackageShareScopeOptions type to src/config/share-utils.ts, enabling automatic generation of share scope names based on a dependency's version (e.g., "ng21.1"). This supports configurable granularity (major, minor, patch), custom dependency selection, and custom prefixes.

  • Updated the documentation in README.md to describe the new version-pinned share scopes feature, including usage examples and configuration options.

API and Exports

  • Exported autoShareScope and PackageShareScopeOptions from the package entrypoint in src/config.ts.

Testing

  • Added comprehensive unit tests for autoShareScope in src/config/share-utils.spec.ts, covering version extraction, granularity options, dependency fallbacks, and error cases.
  • Mocked Node.js fs methods in the test suite to simulate various package.json scenarios for robust test coverage.

Miscellaneous

  • Updated imports in relevant files to include the new utility. [1] [2]
  • Added a new tsconfig.tsbuildinfo artifact.

@Aukevanoost Aukevanoost merged commit 907fb30 into main Jul 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: support shareScope: 'auto'

1 participant