Skip to content

Commit 11bd09f

Browse files
committed
fix(credential-providers): revert pinned credential client peer dependencies
1 parent e7a5080 commit 11bd09f

File tree

2 files changed

+7
-24
lines changed

2 files changed

+7
-24
lines changed

scripts/update-versions/getUpdatedPackageJson.mjs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ export const getUpdatedPackageJson = (packageJson, depToVersionHash) =>
77
.reduce(
88
(acc, sectionName) => ({
99
...acc,
10-
[sectionName]: getUpdatedPackageJsonSection(packageJson[sectionName], depToVersionHash, {
11-
isPeer: sectionName === "peerDependencies",
12-
packageName: packageJson.name,
13-
}),
10+
[sectionName]: getUpdatedPackageJsonSection(
11+
packageJson[sectionName],
12+
depToVersionHash,
13+
sectionName === "peerDependencies"
14+
),
1415
}),
1516
packageJson
1617
);
Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,11 @@
11
// @ts-check
2-
export const getUpdatedPackageJsonSection = (section, depToVersionHash, { isPeer, packageName }) =>
2+
export const getUpdatedPackageJsonSection = (section, depToVersionHash, isPeer = false) =>
33
Object.entries(section)
44
.filter(([key, value]) => key.startsWith("@aws-sdk/") && !value.startsWith("file:"))
55
.reduce((acc, [key]) => {
66
const newVersion = depToVersionHash[key];
77
if (newVersion) {
8-
// Use exact version if it's asterisk or not a peer dependency.
9-
if (newVersion === "*" || !isPeer) {
10-
acc[key] = newVersion;
11-
return acc;
12-
}
13-
14-
// Use exact version for client peerDependencies in credential-provider packages.
15-
const moduleName = packageName.substring(packageName.indexOf("/") + 1);
16-
const authProviderPrefixArray = ["credential-provider", "token-provider"];
17-
if (
18-
authProviderPrefixArray.some((authProviderPrefix) => moduleName.startsWith(authProviderPrefix)) &&
19-
key.startsWith("@aws-sdk/client-")
20-
) {
21-
acc[key] = newVersion;
22-
return acc;
23-
}
24-
25-
// Use caret version for other peerDependencies.
26-
acc[key] = `^${newVersion}`;
8+
acc[key] = isPeer && newVersion !== "*" ? `^${newVersion}` : newVersion;
279
}
2810
return acc;
2911
}, section);

0 commit comments

Comments
 (0)