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

multipackage monorepo base configuration #405

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const clientESLintConfig = require('./config/eslint');
const clientESLintConfig = require('./packages/react-scripts/config/eslint');

module.exports = Object.assign({}, clientESLintConfig, {
env: Object.assign({}, clientESLintConfig.env, {
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ node_js:
- 6
cache:
directories:
- global-cli/node_modules
- node_modules
- packages/create-react-app/node_modules
- packages/react-scripts/node_modules
script: tasks/e2e.sh
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Please also provide a **test plan**, i.e. specify how you verified what you adde

1. Clone the repo with `git clone https://github.com/facebookincubator/create-react-app`

2. Run `npm install` in the root `create-react-app` folder **and** the `create-react-app/global-cli` folder
2. Run `npm install` in the root `packages/create-react-app` folder **and** the `packages/react-scripts` folder

Once it is done, you can modify any file locally and run `npm start` or `npm run build` just like in a generated project.

Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions packages/react-scripts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules/
build
.DS_Store
*.tgz
my-app*
template/src/__tests__/__snapshots__/
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions config/paths.js → packages/react-scripts/config/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ function resolveApp(relativePath) {
}

if (isInCreateReactAppSource) {
// create-react-app development: we're in ./config/
// create-react-app development: we're in ./packages/react-scripts/config
module.exports = {
appBuild: resolveOwn('../build'),
appBuild: resolveOwn('../scripts/build'),
appHtml: resolveOwn('../template/index.html'),
appFavicon: resolveOwn('../template/favicon.ico'),
appPackageJson: resolveOwn('../package.json'),
Expand Down
File renamed without changes.
5 changes: 2 additions & 3 deletions package.json → packages/react-scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@
},
"scripts": {
"build": "node scripts/build.js --debug-template",
"create-react-app": "node global-cli/index.js --scripts-version \"$PWD/`npm pack`\"",
"e2e": "tasks/e2e.sh",
"create-react-app": "node ../create-react-app/index.js --scripts-version \"$PWD/`npm pack`\"",
"e2e": "../../tasks/e2e.sh",
"start": "node scripts/start.js --debug-template",
"test": "node scripts/test.js --debug-template"
},
"files": [
"PATENTS",
"bin",
"config",
"scripts",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
5 changes: 3 additions & 2 deletions tasks/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ cd ..
# Packing with them enabled takes too much memory, and Travis crashes.
# End to end script is meant to run on Travis so it's not a big deal.
# If you run it locally, you'll need to `git checkout -- package.json`.
perl -i -p0e 's/bundledDependencies.*?]/bundledDependencies": []/s' package.json
perl -i -p0e 's/bundledDependencies.*?]/bundledDependencies": []/s' packages/react-scripts/package.json

# Pack react-scripts
cd packages/react-scripts
npm install
scripts_path=$PWD/`npm pack`

Expand All @@ -73,7 +74,7 @@ npm run test
test -e template/src/__tests__/__snapshots__/App-test.js.snap

# Pack CLI
cd global-cli
cd packages/create-react-app
npm install
cli_path=$PWD/`npm pack`

Expand Down