fix: buildVersion now correctly reads from project's package.json #3928
Merged
fix: buildVersion now correctly reads from project's package.json #3928
Conversation
) - Modified getBuildVersion() to accept optional root parameter for correct directory resolution - Updated StatsManager to use compiler.context when determining build version - Added comprehensive test case to verify buildVersion matches package.json - Ensures mf-manifest.json contains correct buildVersion from project root 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 4611821 The changes in this PR will be included in the next version bump. This PR includes changesets to release 33 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
5 tasks
✅ Deploy Preview for module-federation-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…ture - Fixed test to look for mf-manifest.json in correct location (root instead of dist) - Updated test to access buildVersion from manifest.metaData.buildInfo - Test now passes successfully validating the BuildVersion fix
2heal1
approved these changes
Jul 18, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request addresses an issue where the
BuildVersionwas incorrectly reading from the wrongpackage.jsonlocation. It introduces fixes to ensure theBuildVersionis accurately derived from the project'spackage.jsonand adds comprehensive tests to validate this functionality.#3835
Fixes to
BuildVersionresolution:.changeset/fix-build-version-package-json.md: UpdatedgetBuildVersion()to accept an optionalrootparameter for correct directory resolution. ModifiedStatsManagerto usecompiler.contextfor determining the build version. Ensured thebuildVersioninmf-manifest.jsonmatches the project'spackage.jsonversion.packages/managers/src/utils.ts: RefactoredgetBuildVersion()to accept an optionalrootparameter and use it to read the correctpackage.json.packages/manifest/src/StatsManager.ts: UpdatedStatsManagerto use thecontextfrom the compiler options when resolving thebuildVersion. Added a privategetBuildInfo()method to encapsulate the logic for retrieving build information. [1] [2]Added tests for
BuildVersionfunctionality:packages/enhanced/test/configCases/build-version/package-json-version/index.js: Added a test to verify thatBuildVersionis correctly read from thepackage.jsonand matches the expected version.packages/enhanced/test/configCases/build-version/package-json-version/package.json: Created a test-specificpackage.jsonfile with a version of1.2.3to validate the functionality.packages/enhanced/test/configCases/build-version/package-json-version/webpack.config.js: Configured a test Webpack setup usingModuleFederationPluginto generate themf-manifest.jsonfor validation.packages/enhanced/test/configCases/build-version/package-json-version/test.js: Added a simple test module for exposure through the Webpack configuration.