Skip to content

Commit

Permalink
chore: set peer range during update:versions:default
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhe committed Jan 31, 2024
1 parent d054fe1 commit 633df96
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion clients/client-sso-oidc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
},
"license": "Apache-2.0",
"peerDependencies": {
"@aws-sdk/credential-provider-node": "*"
"@aws-sdk/credential-provider-node": "^3.503.1"
},
"browser": {
"./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser"
Expand Down
2 changes: 1 addition & 1 deletion clients/client-sts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
},
"license": "Apache-2.0",
"peerDependencies": {
"@aws-sdk/credential-provider-node": "*"
"@aws-sdk/credential-provider-node": "^3.503.1"
},
"browser": {
"./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser"
Expand Down
2 changes: 2 additions & 0 deletions scripts/update-versions/current.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// in dependencies/devDependencies/peerDependencies

import { getDepToCurrentVersionHash } from "./getDepToCurrentVersionHash.mjs";
import { runUpdatePeers } from "./peers.mjs";
import { updateVersions } from "./updateVersions.mjs";

updateVersions(getDepToCurrentVersionHash());
runUpdatePeers();
2 changes: 2 additions & 0 deletions scripts/update-versions/default.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// in dependencies/devDependencies/peerDependencies

import { getDepToDefaultVersionHash } from "./getDepToDefaultVersionHash.mjs";
import { runUpdatePeers } from "./peers.mjs";
import { updateVersions } from "./updateVersions.mjs";

updateVersions(getDepToDefaultVersionHash());
runUpdatePeers();
15 changes: 15 additions & 0 deletions scripts/update-versions/updateVersions.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,18 @@ export const updateVersions = (depToVersionHash) => {
writeFileSync(packageJsonPath, format(JSON.stringify(updatedPackageJson), { parser: "json-stringify" }));
});
};

export const updatePeerVersions = (depToVersionHash) => {
getWorkspacePaths().forEach((workspacePath) => {
const packageJsonPath = join(workspacePath, "package.json");
const packageJson = JSON.parse(readFileSync(packageJsonPath).toString());
if (packageJson.peerDependencies) {
for (const peer of Object.keys(packageJson.peerDependencies)) {
if (peer in depToVersionHash) {
packageJson.peerDependencies[peer] = depToVersionHash[peer];
}
}
}
writeFileSync(packageJsonPath, format(JSON.stringify(packageJson), { parser: "json-stringify" }));
});
};

0 comments on commit 633df96

Please sign in to comment.