Skip to content

Commit 0e8891c

Browse files
fix(test_downstream_projects): Use yarn resolution rules to avoid duplicate dependencies of UPSTREAM_PKGS installed via yalc
1 parent c6a699a commit 0e8891c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test_downstream_projects.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,15 @@ function installUpstreamDeps(upstreamPackages) {
4747
upstreamPackages.forEach(upstream => {
4848
util._exec('npx yalc add ' + upstream);
4949
});
50+
51+
upstreamPackages.forEach(upstream => {
52+
const package = JSON.parse(fs.readFileSync('package.json'));
53+
const yalcDep = package.dependencies[upstream] || package.devDependencies[upstream];
54+
package.resolutions = package.resolutions || {};
55+
package.resolutions[upstream] = yalcDep;
56+
fs.writeFileSync('package.json', JSON.stringify(package, null, 2));
57+
});
58+
5059
// Install updated deps from the upstream
5160
// If local changes point to a new version of @uirouter/core, for example
5261
util._exec('npx yarn');

0 commit comments

Comments
 (0)