Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

Merge facebook master #23

Merged
merged 49 commits into from
Feb 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
7d66ba1
Downgrading to compatible version of SockJS-Client (#1274)
holloway Dec 21, 2016
ac6a4c8
Updated react-scripts babel-jest && jest packages to 18.0.0 (#1311)
lopezator Dec 23, 2016
e45b087
Fixes duplicate "is" typo (#1306)
jmagrippis Dec 30, 2016
a90e2b2
fix readme: remove double 'we' (#1312)
Chris-R3 Dec 30, 2016
4d7b754
Use npm script hooks to avoid && in deploy script (#1324)
zpao Dec 30, 2016
2548027
Bump babel-loader version (#1009) (#1309)
frontsideair Jan 8, 2017
1b645e2
Use yarnpkg alias to run Yarn (#1365)
fson Jan 9, 2017
24abc5e
Use yarnpkg alias to run Yarn (#1365)
fson Jan 9, 2017
ad86746
Update changelog for 0.8.5
fson Jan 9, 2017
a5b8389
Publish
fson Jan 9, 2017
11cc5ae
Merge pull request #1367 from facebookincubator/0.8.x
fson Jan 9, 2017
d29fb00
Add missing import in react-dev-utils README.md (#1369)
pedronauck Jan 11, 2017
3f6937c
Change console.log for errors and warnings (#1375)
jimmyhmiller Jan 11, 2017
17bb8d4
webpack-dev-server patch for 'still-ok' success status (#1377)
Jan 12, 2017
7cd03f9
Document Flow support (#1384)
dschep Jan 12, 2017
9099570
Use a more sophisticated template for end-to-end testing. (#1187)
EnoahNetzach Jan 23, 2017
adce379
replace two space syntax with <br> tag (#1393)
carlsagan21 Jan 23, 2017
65bde54
Add causes of dev server not detecting changes (#1422)
jetpackpony Jan 23, 2017
3bb31cc
Added links to tutorials for integrating cra with an api backend (#1437)
alexdriaguine Jan 24, 2017
dbb7ffe
Added babel-runtime dependency to deduplicate dependencies when using…
jkimbo Jan 24, 2017
da321b2
Bump Jest version (#1432)
gaearon Jan 24, 2017
dd788b6
Readme: Removes experimental from Jest snapshot (#1453)
frehner Jan 26, 2017
bc2fc80
eject: Additionally remove `react-scripts` from dependencies (#1458)
creynders Jan 27, 2017
1d586aa
E2e jsdom fix (#1470)
EnoahNetzach Jan 30, 2017
8964dd6
- import expect and expect flow (#1463)
tuchk4 Jan 30, 2017
6424232
Reflect websocket proxy support on README (#1013) (#1483)
frontsideair Feb 4, 2017
65e6340
Edit User Guide: Add ESLint config for VS Code users (#1482)
Feb 4, 2017
adab23f
e2e: Reduce complexity of e2e and improve Jest coverage (#1484)
Timer Feb 4, 2017
9e0e18f
UX: Explain why build is failing (#1352)
jayphelps Jan 5, 2017
0ac0d11
Update comments for webpack loaders
ro-savage Feb 8, 2017
c811a31
Change "OS X" references to "macOS" (#1511)
RodrigoHahn Feb 9, 2017
de6e059
corrected minor typo (#1514)
Feb 9, 2017
160d8d1
clarifying the use of custom environment variables (#1513)
calweb Feb 9, 2017
b999405
Add missing '\n' to the end of `package.json` file (#1510)
pd4d10 Feb 9, 2017
1d9159d
Make all react app vars accessible in index.html (#1440)
jihchi Feb 10, 2017
613b584
Add `PUBLIC_URL` env variable for advanced use (#937) (#1504)
Timer Feb 10, 2017
8e127aa
Support relative asset paths for special case (#1489)
tibdex Feb 10, 2017
7a02f9a
readme: Add Advanced Configuration (#1515)
Timer Feb 10, 2017
e19b0f6
Make build exit with error code when interrupted (#1496)
brandones Feb 11, 2017
ac39a46
Bump lerna
gaearon Feb 11, 2017
b9d679a
Add test cases for PUBLIC_URL and relative path (#1519)
Timer Feb 11, 2017
5211141
Add an annoying nit
gaearon Feb 11, 2017
354fce0
Upgrade babel dependencies
Timer Feb 11, 2017
7556997
Don't run CI on Node 0.10 (#1521)
gaearon Feb 11, 2017
b0b0e6d
fix: add yarn gitignores (#1507)
AndersDJohnson Feb 11, 2017
15e0b98
Upgrade dependencies (#1522)
Timer Feb 11, 2017
84be4dd
Add CHANGELOG
Timer Feb 11, 2017
49ed54f
Merge commit '84be4dd0bdf6155c075f9e9bee9f075d8982d0cd' into merge-fa…
wmonk Feb 12, 2017
42446dc
Remove merge conflicts, and Flow
wmonk Feb 14, 2017
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: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ build
my-app*
template/src/__tests__/__snapshots__/
lerna-debug.log
npm-debug.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
/.changelog
yarn.lock
18 changes: 14 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
---
language: node_js
node_js:
- 0.10
- 4
- 6
cache:
directories:
- node_modules
- packages/create-react-app/node_modules
- packages/react-scripts/node_modules
script: tasks/e2e.sh
script:
- 'if [ $TEST_SUITE = "simple" ]; then tasks/e2e-simple.sh; fi'
- 'if [ $TEST_SUITE = "installs" ]; then tasks/e2e-installs.sh; fi'
- 'if [ $TEST_SUITE = "kitchensink" ]; then tasks/e2e-kitchensink.sh; fi'
env:
- USE_YARN=no
- USE_YARN=yes
global:
- USE_YARN=no
matrix:
- TEST_SUITE=simple
- TEST_SUITE=installs
- TEST_SUITE=kitchensink
matrix:
include:
- node_js: 6
env: USE_YARN=yes TEST_SUITE=simple
155 changes: 154 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,156 @@
## 0.9.0 (2017-02-11)

#### :rocket: New Feature
* `react-scripts`
* [#1489](https://github.com/facebookincubator/create-react-app/pull/1489) Support setting "homepage" to "." to generate relative asset paths. ([@tibdex](https://github.com/tibdex))

This addition allows any application not using the HTML5 pushState API to be built to be served from any relative URL.
* [#937](https://github.com/facebookincubator/create-react-app/pull/1504) Add `PUBLIC_URL` env variable for advanced use. ([@EnoahNetzach](https://github.com/EnoahNetzach))
* [#1440](https://github.com/facebookincubator/create-react-app/pull/1440) Make all react env vars accessible in index.html. ([@jihchi](https://github.com/jihchi))
* `react-dev-utils`
* [#1148](https://github.com/facebookincubator/create-react-app/pull/1148) Configure which browser to open in npm start (#873). ([@GAumala](https://github.com/GAumala))

You can now disable the automatic browser launching by setting the `BROWSER` environment variable to `none`.

#### :boom: Breaking Change
* `react-scripts`
* [#1522](https://github.com/facebookincubator/create-react-app/pull/1522) Upgrade dependencies. ([@Timer](https://github.com/Timer))
* [#1432](https://github.com/facebookincubator/create-react-app/pull/1432) Bump Jest version. ([@gaearon](https://github.com/gaearon))

Jest has been updated to v18 and has introduced some [breaking changes](https://facebook.github.io/jest/blog/2016/12/15/2016-in-jest.html).

* `react-scripts`, `react-dev-utils`
* [#1148](https://github.com/facebookincubator/create-react-app/pull/1148) Configure which browser to open in npm start (#873). ([@GAumala](https://github.com/GAumala))

Non-interactive terminals no longer automatically disable launching of the browser.

#### :bug: Bug Fix
* `react-scripts`
* [#1522](https://github.com/facebookincubator/create-react-app/pull/1522) Upgrade dependencies. ([@Timer](https://github.com/Timer))
* [#1458](https://github.com/facebookincubator/create-react-app/pull/1458) eject: Additionally remove `react-scripts` from dependencies. ([@creynders](https://github.com/creynders))
* [#1441](https://github.com/facebookincubator/create-react-app/pull/1441) Added babel-runtime dependency to deduplicate dependencies when using yarn. ([@jkimbo](https://github.com/jkimbo))
* [#1309](https://github.com/facebookincubator/create-react-app/pull/1309) Bump babel-loader version (#1009). ([@frontsideair](https://github.com/frontsideair))
* [#1267](https://github.com/facebookincubator/create-react-app/pull/1267) Only gitignore dirs in root, not deep. ([@jayphelps](https://github.com/jayphelps))
* `react-dev-utils`
* [#1377](https://github.com/facebookincubator/create-react-app/pull/1377) webpack-dev-server patch for 'still-ok' success status. ([@TheBlackBolt](https://github.com/TheBlackBolt))
* [#1274](https://github.com/facebookincubator/create-react-app/pull/1274) Downgrading to compatible version of SockJS-Client. ([@holloway](https://github.com/holloway))
* [#1247](https://github.com/facebookincubator/create-react-app/pull/1247) Only open Chrome tab if BROWSER is missing or is Chrome. ([@gaearon](https://github.com/gaearon))

#### :nail_care: Enhancement
* `react-scripts`
* [#1507](https://github.com/facebookincubator/create-react-app/pull/1507) fix: add yarn gitignores. ([@adjohnson916](https://github.com/adjohnson916))
* [#1496](https://github.com/facebookincubator/create-react-app/pull/1496) Make build exit with error code when interrupted. ([@brandones](https://github.com/brandones))
* [#1510](https://github.com/facebookincubator/create-react-app/pull/1510) Add missing '\n' to the end of `package.json` file. ([@pd4d10](https://github.com/pd4d10))
* [#1352](https://github.com/facebookincubator/create-react-app/pull/1352) More descriptive error message for env.CI = true warnings causing failures. ([@jayphelps](https://github.com/jayphelps))
* [#1432](https://github.com/facebookincubator/create-react-app/pull/1432) Bump Jest version. ([@gaearon](https://github.com/gaearon))
* [#1324](https://github.com/facebookincubator/create-react-app/pull/1324) Use npm script hooks to avoid && in deploy script. ([@zpao](https://github.com/zpao))
* [#1311](https://github.com/facebookincubator/create-react-app/pull/1311) Updated react-scripts babel-jest && jest packages to 18.0.0. ([@lopezator](https://github.com/lopezator))
* [#1264](https://github.com/facebookincubator/create-react-app/pull/1264) Remove interactive shell check when opening browser on start. ([@CaryLandholt](https://github.com/CaryLandholt))
* `create-react-app`
* [#1270](https://github.com/facebookincubator/create-react-app/pull/1270) gh-1269: Enabling nested folder paths for project name. ([@dinukadesilva](https://github.com/dinukadesilva))

#### :memo: Documentation
* `react-scripts`
* [#1515](https://github.com/facebookincubator/create-react-app/pull/1515) readme: Advanced Configuration. ([@Timer](https://github.com/Timer))
* [#1513](https://github.com/facebookincubator/create-react-app/pull/1513) clarifying the use of custom environment variables. ([@calweb](https://github.com/calweb))
* [#1511](https://github.com/facebookincubator/create-react-app/pull/1511) Change "OS X" references to "macOS". ([@RodrigoHahn](https://github.com/RodrigoHahn))
* [#1482](https://github.com/facebookincubator/create-react-app/pull/1482) Edit User Guide: Add ESLint config for VS Code users. ([@vulong23](https://github.com/vulong23))
* [#1483](https://github.com/facebookincubator/create-react-app/pull/1483) Reflect websocket proxy support on README (#1013). ([@frontsideair](https://github.com/frontsideair))
* [#1453](https://github.com/facebookincubator/create-react-app/pull/1453) Readme: Removes experimental from Jest snapshot. ([@frehner](https://github.com/frehner))
* [#1437](https://github.com/facebookincubator/create-react-app/pull/1437) Added links to tutorials for integrating cra with an api backend. ([@alexdriaguine](https://github.com/alexdriaguine))
* [#1422](https://github.com/facebookincubator/create-react-app/pull/1422) Add causes of dev server not detecting changes. ([@jetpackpony](https://github.com/jetpackpony))
* [#1260](https://github.com/facebookincubator/create-react-app/pull/1260) Heroku Deployment: Adds a note on how to resolve "File/Module Not Found Errors" . ([@MsUzoAgu](https://github.com/MsUzoAgu))
* [#1256](https://github.com/facebookincubator/create-react-app/pull/1256) Add "Changing the Page Title" to User Guide. ([@gaearon](https://github.com/gaearon))
* [#1245](https://github.com/facebookincubator/create-react-app/pull/1245) Replace the Flow documentation section. ([@gaearon](https://github.com/gaearon))
* Other
* [#1514](https://github.com/facebookincubator/create-react-app/pull/1514) corrected minor typo. ([@crowchirp](https://github.com/crowchirp))
* [#1393](https://github.com/facebookincubator/create-react-app/pull/1393) replace two space syntax with <br> tag. ([@carlsagan21](https://github.com/carlsagan21))
* [#1384](https://github.com/facebookincubator/create-react-app/pull/1384) Document Flow support. ([@dschep](https://github.com/dschep))
* `react-dev-utils`
* [#1375](https://github.com/facebookincubator/create-react-app/pull/1375) Change console.log for errors and warnings. ([@jimmyhmiller](https://github.com/jimmyhmiller))
* [#1369](https://github.com/facebookincubator/create-react-app/pull/1369) Add missing import in react-dev-utils README.md. ([@pedronauck](https://github.com/pedronauck))

#### :house: Internal
* Other
* [#1519](https://github.com/facebookincubator/create-react-app/pull/1519) Add test cases for PUBLIC_URL and relative path. ([@Timer](https://github.com/Timer))
* `react-scripts`
* [#1484](https://github.com/facebookincubator/create-react-app/pull/1484) Improve e2e-kitchensink and Jest coverage. ([@Timer](https://github.com/Timer))
* [#1463](https://github.com/facebookincubator/create-react-app/pull/1463) Minor code style and wrong expect. ([@tuchk4](https://github.com/tuchk4))
* [#1470](https://github.com/facebookincubator/create-react-app/pull/1470) E2e jsdom fix. ([@EnoahNetzach](https://github.com/EnoahNetzach))
* [#1289](https://github.com/facebookincubator/create-react-app/pull/1289) Remove path-exists from dependencies and replace it with fs.existsSync. ([@halfzebra](https://github.com/halfzebra))
* `create-react-app`, `react-scripts`
* [#1187](https://github.com/facebookincubator/create-react-app/pull/1187) Use a more sophisticated template for end-to-end testing.. ([@EnoahNetzach](https://github.com/EnoahNetzach))

#### Committers: 35
- Alex Driaguine ([alexdriaguine](https://github.com/alexdriaguine))
- Anders D. Johnson ([adjohnson916](https://github.com/adjohnson916))
- Anthony F. ([frehner](https://github.com/frehner))
- Brandon Istenes ([brandones](https://github.com/brandones))
- Calvin Webster ([calweb](https://github.com/calweb))
- Cary Landholt ([CaryLandholt](https://github.com/CaryLandholt))
- Chandan Rai ([crowchirp](https://github.com/crowchirp))
- Christian Raidl ([Chris-R3](https://github.com/Chris-R3))
- Dan Abramov ([gaearon](https://github.com/gaearon))
- Daniel Schep ([dschep](https://github.com/dschep))
- David ([lopezator](https://github.com/lopezator))
- Dinuka De Silva ([dinukadesilva](https://github.com/dinukadesilva))
- Eduard Kyvenko ([halfzebra](https://github.com/halfzebra))
- Fabrizio Castellarin ([EnoahNetzach](https://github.com/EnoahNetzach))
- Fatih ([frontsideair](https://github.com/frontsideair))
- Gabriel Aumala ([GAumala](https://github.com/GAumala))
- Jay Phelps ([jayphelps](https://github.com/jayphelps))
- Jih-Chi Lee ([jihchi](https://github.com/jihchi))
- Jimmy Miller ([jimmyhmiller](https://github.com/jimmyhmiller))
- Joe Haddad ([Timer](https://github.com/Timer))
- Johnny Magrippis ([jmagrippis](https://github.com/jmagrippis))
- Jonathan Kim ([jkimbo](https://github.com/jkimbo))
- MUA ([MsUzoAgu](https://github.com/MsUzoAgu))
- Matthew Holloway ([holloway](https://github.com/holloway))
- Nguyen Le Vu Long ([vulong23](https://github.com/vulong23))
- Paul O’Shannessy ([zpao](https://github.com/zpao))
- Pedro Nauck ([pedronauck](https://github.com/pedronauck))
- Robbie H ([TheBlackBolt](https://github.com/TheBlackBolt))
- Thibault Derousseaux ([tibdex](https://github.com/tibdex))
- Valerii ([tuchk4](https://github.com/tuchk4))
- Vasiliy Taranov ([jetpackpony](https://github.com/jetpackpony))
- [RodrigoHahn](https://github.com/RodrigoHahn)
- creynders ([creynders](https://github.com/creynders))
- pd4d10 ([pd4d10](https://github.com/pd4d10))
- soo ([carlsagan21](https://github.com/carlsagan21))

### Migrating from 0.8.5 to 0.9.0

Inside any created project that has not been ejected, run:

```
npm install --save-dev --save-exact react-scripts@0.9.0
```

## 0.8.5 (January 9, 2017)

#### :bug: Bug Fix
* `create-react-app`, `react-scripts`
* [#1365](https://github.com/facebookincubator/create-react-app/pull/1365) Use yarnpkg alias to run Yarn. ([@fson](https://github.com/fson))

Fixes an issue where running `create-react-app` failed on systems with Apache Hadoop installed because it falsely detected Hadoop YARN executable as Yarn package manager.

#### Committers: 1
- Ville Immonen ([fson](https://github.com/fson))

### Migrating from 0.8.4 to 0.8.5

Inside any created project that has not been ejected, run:

```
npm install --save-dev --save-exact react-scripts@0.8.5
```

You may also optionally update the global command-line utility:

```
npm install -g create-react-app@1.0.3
```

## 0.8.4 (December 11, 2016)

#### :bug: Bug Fix
Expand Down Expand Up @@ -414,7 +567,7 @@ npm install --save-dev --save-exact react-scripts@0.8.0

### Babel Preset (`babel-preset-react-app`)

* The preset now detects the Node.js version in test environment and disables unnecessary ES2015 transforms using using `babel-preset-env`. ([@shubheksha](https://github.com/shubheksha) in [#878](https://github.com/facebookincubator/create-react-app/pull/878), [@JeffreyATW](https://github.com/JeffreyATW) in [#927
* The preset now detects the Node.js version in test environment and disables unnecessary ES2015 transforms using `babel-preset-env`. ([@shubheksha](https://github.com/shubheksha) in [#878](https://github.com/facebookincubator/create-react-app/pull/878), [@JeffreyATW](https://github.com/JeffreyATW) in [#927
](https://github.com/facebookincubator/create-react-app/pull/927))
* Fixes a duplicate dependency on `babel-plugin-transform-regenerator`. ([@akofman](https://github.com/akofman) in [#864](https://github.com/facebookincubator/create-react-app/pull/864))

Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ and then run `npm start` or `npm run build`.
* You'll need an [access token for the GitHub API](https://help.github.com/articles/creating-an-access-token-for-command-line-use/). Save it to this environment variable: `export GITHUB_AUTH="..."`
* Run `npm run changelog`. The command will find all the labeled pull requests merged since the last release and group them by the label and affected packages, and create a change log entry with all the changes and links to PRs and their authors. Copy and paste it to `CHANGELOG.md`.
* Add a four-space indented paragraph after each non-trivial list item, explaining what changed and why. For each breaking change also write who it affects and instructions for migrating existing code.
* Maybe add some newlines here and there. Preview the result on GitHub to get a feel for it. Changelog generator output is a bit too terse for my taste, so try to make it visually pleasing and well grouped.
6. Make sure to include “Migrating from ...” instructions for the previous release. Often you can copy and paste them.
7. After merging the changelog update, create a GitHub Release with the same text. See previous Releases for inspiration.
8. **Do not run `npm publish`. Instead, run `npm run publish`.**
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"lerna": "2.0.0-beta.30",
"lerna": "2.0.0-beta.37",
"version": "independent",
"changelog": {
"repo": "facebookincubator/create-react-app",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"build": "node packages/react-scripts/scripts/build.js",
"changelog": "lerna-changelog",
"create-react-app": "tasks/cra.sh",
"e2e": "tasks/e2e.sh",
"e2e": "tasks/e2e-simple.sh",
"postinstall": "lerna bootstrap",
"publish": "tasks/release.sh",
"start": "node packages/react-scripts/scripts/start.js",
Expand All @@ -18,7 +18,7 @@
"eslint-plugin-import": "1.12.0",
"eslint-plugin-jsx-a11y": "2.2.2",
"eslint-plugin-react": "6.3.0",
"lerna": "2.0.0-beta.30",
"lerna": "^2.0.0-beta.37",
"lerna-changelog": "^0.2.3"
}
}
26 changes: 13 additions & 13 deletions packages/babel-preset-react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@
"index.js"
],
"dependencies": {
"babel-plugin-transform-class-properties": "6.16.0",
"babel-plugin-transform-es2015-parameters": "6.18.0",
"babel-plugin-transform-object-rest-spread": "6.19.0",
"babel-plugin-transform-react-constant-elements": "6.9.1",
"babel-plugin-transform-react-jsx": "6.8.0",
"babel-plugin-transform-react-jsx-self": "6.11.0",
"babel-plugin-transform-react-jsx-source": "6.9.0",
"babel-plugin-transform-regenerator": "6.16.1",
"babel-plugin-transform-runtime": "6.15.0",
"babel-preset-env": "0.0.8",
"babel-preset-latest": "6.16.0",
"babel-preset-react": "6.16.0",
"babel-runtime": "6.11.6"
"babel-plugin-transform-class-properties": "6.22.0",
"babel-plugin-transform-es2015-parameters": "6.22.0",
"babel-plugin-transform-object-rest-spread": "6.22.0",
"babel-plugin-transform-react-constant-elements": "6.22.0",
"babel-plugin-transform-react-jsx": "6.22.0",
"babel-plugin-transform-react-jsx-self": "6.22.0",
"babel-plugin-transform-react-jsx-source": "6.22.0",
"babel-plugin-transform-regenerator": "6.22.0",
"babel-plugin-transform-runtime": "6.22.0",
"babel-preset-env": "1.1.8",
"babel-preset-latest": "6.22.0",
"babel-preset-react": "6.22.0",
"babel-runtime": "6.22.0"
}
}
25 changes: 16 additions & 9 deletions packages/create-react-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ if (currentNodeVersion.split('.')[0] < 4) {
process.exit(1);
}

var commander = require('commander');
var fs = require('fs-extra');
var path = require('path');
var execSync = require('child_process').execSync;
Expand All @@ -60,7 +61,7 @@ var semver = require('semver');

var projectName;

var program = require('commander')
var program = commander
.version(require('./package.json').version)
.arguments('<project-directory>')
.usage(chalk.green('<project-directory>') + ' [options]')
Expand All @@ -69,6 +70,7 @@ var program = require('commander')
})
.option('--verbose', 'print additional logs')
.option('--scripts-version <alternative-package>', 'use a non-standard version of react-scripts')
.allowUnknownOption()
.on('--help', function () {
console.log(' Only ' + chalk.green('<project-directory>') + ' is required.');
console.log();
Expand All @@ -82,7 +84,7 @@ var program = require('commander')
console.log(' ' + chalk.cyan('https://github.com/facebookincubator/create-react-app/issues/new'));
console.log();
})
.parse(process.argv)
.parse(process.argv);

if (typeof projectName === 'undefined') {
console.error('Please specify the project directory:');
Expand All @@ -95,9 +97,14 @@ if (typeof projectName === 'undefined') {
process.exit(1);
}

createApp(projectName, program.verbose, program.scriptsVersion);
var hiddenProgram = new commander.Command()
.option('--internal-testing-template <path-to-template>', '(internal usage only, DO NOT RELY ON THIS) ' +
'use a non-standard application template')
.parse(process.argv)

createApp(projectName, program.verbose, program.scriptsVersion, hiddenProgram.internalTestingTemplate);

function createApp(name, verbose, version) {
function createApp(name, verbose, version, template) {
var root = path.resolve(name);
var appName = path.basename(root);

Expand Down Expand Up @@ -130,12 +137,12 @@ function createApp(name, verbose, version) {
console.log('Installing ' + chalk.cyan('react-scripts') + '...');
console.log();

run(root, appName, version, verbose, originalDirectory);
run(root, appName, version, verbose, originalDirectory, template);
}

function shouldUseYarn() {
try {
execSync('yarn --version', {stdio: 'ignore'});
execSync('yarnpkg --version', {stdio: 'ignore'});
return true;
} catch (e) {
return false;
Expand All @@ -146,7 +153,7 @@ function install(packageToInstall, verbose, callback) {
var command;
var args;
if (shouldUseYarn()) {
command = 'yarn';
command = 'yarnpkg';
args = [ 'add', '--dev', '--exact', packageToInstall];
} else {
command = 'npm';
Expand All @@ -163,7 +170,7 @@ function install(packageToInstall, verbose, callback) {
});
}

function run(root, appName, version, verbose, originalDirectory) {
function run(root, appName, version, verbose, originalDirectory, template) {
var packageToInstall = getInstallPackage(version);
var packageName = getPackageName(packageToInstall);

Expand All @@ -183,7 +190,7 @@ function run(root, appName, version, verbose, originalDirectory) {
'init.js'
);
var init = require(scriptsPath);
init(root, appName, verbose, originalDirectory);
init(root, appName, verbose, originalDirectory, template);
});
}

Expand Down
Loading