diff --git a/common/changes/@microsoft/rush/chao-fix-getPackageJsonInjectedDependenciesHash_2024-06-25-17-48.json b/common/changes/@microsoft/rush/chao-fix-getPackageJsonInjectedDependenciesHash_2024-06-25-17-48.json new file mode 100644 index 00000000000..b11c4a8074e --- /dev/null +++ b/common/changes/@microsoft/rush/chao-fix-getPackageJsonInjectedDependenciesHash_2024-06-25-17-48.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@microsoft/rush", + "comment": "Don't include package.json version field when calculating packageJsonInjectedDependenciesHash", + "type": "none" + } + ], + "packageName": "@microsoft/rush" +} \ No newline at end of file diff --git a/libraries/rush-lib/src/api/Subspace.ts b/libraries/rush-lib/src/api/Subspace.ts index 8b03de80537..122902a0c44 100644 --- a/libraries/rush-lib/src/api/Subspace.ts +++ b/libraries/rush-lib/src/api/Subspace.ts @@ -33,6 +33,8 @@ interface ISubspaceDetail { tempShrinkwrapPreinstallFilename: string; } +interface IPackageJsonLite extends Omit {} + /** * This represents the subspace configurations for a repository, based on the "subspaces.json" * configuration file. @@ -331,7 +333,7 @@ export class Subspace { * @beta */ public getPackageJsonInjectedDependenciesHash(): string | undefined { - const allPackageJson: IPackageJson[] = []; + const allPackageJson: IPackageJsonLite[] = []; const relatedProjects: RushConfigurationProject[] = []; const subspacePnpmfileShimSettings: ISubspacePnpmfileShimSettings = @@ -364,7 +366,6 @@ export class Subspace { // collect fields that could update the `pnpm-lock.yaml` const { name, - version, bin, dependencies, devDependencies, @@ -377,7 +378,6 @@ export class Subspace { allPackageJson.push({ name, - version, bin, dependencies, devDependencies,