Skip to content

Commit e785a56

Browse files
committed
Update package dependencies.
1 parent 1a8373f commit e785a56

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

bin/version.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,31 @@ const loadAndParsePackageFile = async path => {
4747
)
4848
).reduce((all, workspace) => ({ ...all, [workspace.name]: workspace }), {});
4949

50+
await Promise.all(
51+
workspaces.map(async workspace => {
52+
const pkg = await loadAndParsePackageFile(
53+
join(workspace, './package.json')
54+
);
55+
56+
['dependencies', 'peerDependencies', 'devDependencies'].map(
57+
type => {
58+
if (pkg[type]) {
59+
Object.keys(pkg[type]).map(dependency => {
60+
if (Object.keys(versions).includes(dependency)) {
61+
pkg[type][dependency] =
62+
versions[dependency].version;
63+
}
64+
});
65+
}
66+
}
67+
);
68+
69+
await writeFile(
70+
join(workspace, './package.json'),
71+
`${JSON.stringify({ ...pkg }, null, 2)}\n`
72+
);
73+
})
74+
);
75+
5076
console.log(versions);
5177
})();

0 commit comments

Comments
 (0)