Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use yarn when running inside yarn workspace. #3997

Merged
merged 7 commits into from
Feb 10, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/create-react-app/createReactApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const url = require('url');
const hyperquest = require('hyperquest');
const envinfo = require('envinfo');
const os = require('os');
const monorepo = require('react-dev-utils/monorepo');
const getMonorepo = require('react-dev-utils/workspaceUtils').getMonorepo;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about findMonorepo? Sorry for bikeshedding on this.

Users who don't use monorepos might be confused after ejecting because how would you "get" a monorepo that doesn't exist.

const packageJson = require('./package.json');

// These files should be allowed to remain on a failed install,
Expand Down Expand Up @@ -231,7 +231,7 @@ function isYarnAvailable() {
}

function shouldUseYarn(appDir) {
const mono = monorepo(appDir);
const mono = getMonorepo(appDir);
return (mono.isYarnWs && mono.isAppIncluded) || isYarnAvailable();
}

Expand Down
1 change: 1 addition & 0 deletions packages/create-react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"envinfo": "3.4.2",
"fs-extra": "^5.0.0",
"hyperquest": "^2.1.2",
"react-dev-utils": "^5.0.0",
"semver": "^5.0.3",
"tar-pack": "^3.4.0",
"tmp": "0.0.33",
Expand Down
4 changes: 2 additions & 2 deletions packages/react-dev-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
"launchEditor.js",
"launchEditorEndpoint.js",
"ModuleScopePlugin.js",
"monorepo.js",
"noopServiceWorkerMiddleware.js",
"openBrowser.js",
"openChrome.applescript",
"printHostingInstructions.js",
"WatchMissingNodeModulesPlugin.js",
"WebpackDevServerUtils.js",
"webpackHotDevClient.js"
"webpackHotDevClient.js",
"workspaceUtils.js"
],
"dependencies": {
"@babel/code-frame": "7.0.0-beta.38",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,6 @@ const getMonorepo = appDir => {
};
};

module.exports = getMonorepo;
module.exports = {
getMonorepo,
};
4 changes: 2 additions & 2 deletions packages/react-scripts/config/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
const path = require('path');
const fs = require('fs');
const url = require('url');
const monorepo = require('react-dev-utils/monorepo');
const getMonorepo = require('react-dev-utils/workspaceUtils').getMonorepo;

// Make sure any symlinks in the project folder are resolved:
// https://github.com/facebook/create-react-app/issues/637
Expand Down Expand Up @@ -123,7 +123,7 @@ module.exports.useYarn = fs.existsSync(
if (checkForMonorepo) {
// if app is in a monorepo (lerna or yarn workspace), treat other packages in
// the monorepo as if they are app source
const mono = monorepo(appDirectory);
const mono = getMonorepo(appDirectory);
if (mono.isAppIncluded) {
Array.prototype.push.apply(module.exports.srcPaths, mono.pkgs);
}
Expand Down
1 change: 0 additions & 1 deletion packages/react-scripts/scripts/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ if (process.env.SKIP_PREFLIGHT_CHECK !== 'true') {
}
// @remove-on-eject-end

const fs = require('fs');
const chalk = require('chalk');
const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
Expand Down