Skip to content

Commit f860f61

Browse files
feat(test_downstream_projects): Support 'projects' and 'nohoist' keys in downstream_projects.json
1 parent 6f48591 commit f860f61

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

test_downstream_projects.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ const PKG_DIR = process.cwd();
1919

2020
const config = JSON.parse(fs.readFileSync('downstream_projects.json'));
2121
const pkgjson = JSON.parse(fs.readFileSync('package.json'));
22+
const projects = config.projects || config;
23+
const nohoist = (config.projects && config.nohoist) || [];
2224

2325
const DOWNSTREAM_PKGS = (process.env.DOWNSTREAM_PKGS || '').split(',').filter(x => x);
2426

@@ -96,10 +98,7 @@ function installWorkspaceDependencies(downstreamInstallDirs) {
9698
private: true,
9799
"workspaces": {
98100
"packages": downstreamInstallDirs,
99-
"nohoist": [
100-
"**/webpack",
101-
"**/karma-webpack",
102-
]
101+
"nohoist": nohoist.concat([ "**/webpack", "**/karma-webpack", ])
103102
}
104103
};
105104

@@ -159,7 +158,7 @@ localPublish();
159158

160159
console.log(` ===> Fetching downstream projects <===`);
161160
const tree = { children: {} };
162-
fetchDownstreamProjects(config, "", tree.children);
161+
fetchDownstreamProjects(projects, "", tree.children);
163162

164163
if (yargs.argv.workspace) {
165164
console.log(` ===> Installing downstream dependencies <===`);

0 commit comments

Comments
 (0)