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
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Rename monorepo to workspaceUtils.
bradfordlemley committed Feb 9, 2018
commit 48176519cad2705eb9ce4c8d9f09fb32ef53cfe5
4 changes: 2 additions & 2 deletions packages/create-react-app/createReactApp.js
Original file line number Diff line number Diff line change
@@ -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,
@@ -231,7 +231,7 @@ function isYarnAvailable() {
}

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

4 changes: 2 additions & 2 deletions packages/react-dev-utils/package.json
Original file line number Diff line number Diff line change
@@ -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",
Original file line number Diff line number Diff line change
@@ -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
@@ -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
@@ -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);
}