Commit Graph

103 Commits

Author SHA1 Message Date
Milo Kang
a257e7d0fa Ejecting should ensure you have clean git status (#2221)
* Ejecting should ensure you have clean git status

* Rename function

* Style

* Minor changes

- extract function
- exclude error output for missing git
- more descriptive error message
- no need to mutate answer
- fix answering "no" to return 0 exit code
2017-05-20 18:55:16 +01:00
Dan Abramov
e8063322e0 Shut down server silently, as it is too noisy 2017-05-19 20:08:05 +01:00
Dan Abramov
2023e44126 Shame on me 2017-05-19 16:37:41 +01:00
Dan Abramov
e0b444e517 Gracefully shut down the server on signals (#2246) 2017-05-19 14:59:28 +01:00
Dan Abramov
43b819c2bb "rule keywords" => "keywords" 2017-05-18 22:46:30 +01:00
Dan Abramov
8dc9217b61 Move more logic from react-scripts to react-dev-utils (#2209)
* Show warnings for builds

* Move WebpackDevServer helpers into react-dev-utils
2017-05-18 12:26:18 +01:00
Dan Abramov
c82c4f0561 Refactor and improve build output (#2202) 2017-05-18 01:24:42 +01:00
Dan Abramov
e280254d72 Handle errors from port detector (#2182) 2017-05-16 16:57:45 +01:00
Dan Abramov
46eeabca7e Tweak colors for better contrast on Windows (#2180) 2017-05-16 16:45:12 +01:00
Ryan Sullivan
10a180be9b Make coverage and snapshot Jest options overridable in package.json (#1830)
* Override Jest config collectCoverageFrom with package.json

* Protect against overriding other options

* Better error message

* Create Jest config early on eject

* Tweak wording

* Dry it up
2017-05-16 05:13:19 +01:00
Tom Dunlap
c5e5eb5e33 Only run tests in <rootDir>/src (#544) (#1808)
* Only run tests in <rootDir>/src (#544)

* updates Jest to 19.0.2

* removes testPathIgnorePatterns from jest config

* adds testMatch to jest config to only match files in src

* Bump babel-jest to 19.0.0 to match jest 19.0.2
2017-05-15 19:46:18 -05:00
Rogelio Guzman
71e0960476 Update to Jest 19 (#1614)
* Upgrade to Jest 19

* Use testMatch

* Correct version
2017-05-15 14:35:18 -04:00
Dan Abramov
f87e61337a Make error/warning output more useful (#2161) 2017-05-15 18:09:05 +01:00
Joe Haddad
ac63130a42 Show network address on start (#2155)
* Show network address on start

* Tweak visual representation
2017-05-15 14:20:11 +01:00
Joe Haddad
4dc7c86511 Prefer localhost as an address (#2154) 2017-05-14 22:04:05 -04:00
Joe Haddad
281e8d23f8 Add support for IPv6 hosts 2017-05-14 21:25:21 -04:00
James Blight
71a27c0f8b Allow custom proxies in development (#1790)
* Change proxy handling to allow multiple proxies to be specified in package.json.

* Up webpack-dev-server to 2.4.2

Webpack Dev Server version 2.4.2 handles the external websocket upgrade
for all proxies

* Fix the listen() call

* Switch to correct default host

* Remove promises and extract to react-dev-utils

* oops
2017-05-14 21:12:54 -04:00
Dan Abramov
21349c542b Tweak error and warning output (#2152)
* Tweak error and warning output

* Add a colon
2017-05-15 01:07:59 +01:00
Siddharth Doshi
f17448e9e5 Add custom eslint formatter (#2138)
* Add custom eslint formatter

* Add formatter docs

* Update formatter docs

* Slightly tweak it

* Update README.md
2017-05-15 00:42:13 +01:00
Ian Sutherland
82687dd224 Replace prompt function from react-dev-utils with Inquirer.js. (#1772) 2017-05-14 23:14:56 +01:00
Joe Haddad
be43292445 Temporarily fork detect-port (#2147)
* Temporarily fork detect-port

* Fix get process id

* Use different package

* Unnecessary var
2017-05-14 23:10:44 +01:00
Dan Abramov
4434467a43 Click to view source from error overlay (#2141)
* Click to view source

* Update package.json

* Update package.json

* Fix lint
2017-05-14 12:17:05 +01:00
Valerii Sorokobatko
80a7fc391d Feature/different env config files #1343 (#1344)
* support different env configs.

* fomrat code

* Hide doc

* Slightly rework the PR

* Remove .env in default template
* Use just one entry in the paths
* Unify env.js and loadEnv.js

* Oops, forgot these folks
2017-05-12 11:30:59 +01:00
Joe Haddad
8d4604eb3a Default to 0.0.0.0 (#2117) 2017-05-11 13:42:57 +01:00
Jeremy Morrell
94149c77a8 Ignore the yarn cache directory (#2063) 2017-05-08 15:05:49 +01:00
Buns Shar
c0fd569654 Resolve localhost when offline on Windows (#1839)
* Change proxy localhost to I27.0.0.1 for windows

* Update comment

* resolve localhost IP with DNS lookup on windows

* Fix CI errors

* Promisify addWebpackMiddleware

* Remove Node 6 syntax

* Update addWebpackMiddleware.js

* Actually use the resolved proxy
2017-04-21 16:23:08 -04:00
Gabriel Aumala
ef86877331 Start the dev server at the specified host (#1301)
Pass the host from environment variable as argument of the devServer's
listen function instead of a field of options object.
Set the default host to 0.0.0.0 instead of localhost.
2017-04-18 21:06:54 -04:00
Buns Shar
f61cba104e Ensure proxy url starts with http:// or https:// (#1890) 2017-04-14 22:51:29 -04:00
David
0ace417c45 Make scripts crash on unhandled rejections (#1819)
* Makes end-to-end testing crash on unhandled rejections

* Comment fix
2017-03-14 15:32:48 -04:00
Dan Abramov
ccb5f84dc6 Fixes a silent crash when ejecting (#1810)
* Fixes a silent crash when ejecting

* Delete unnecessary files

* Remove references to eslintrc in Webpack config

* Fix lint

* Correct ESLint CLI options
2017-03-14 11:17:53 -04:00
Geoff Davis
052fcdd986 Suggest "yarn build" rather than "yarn run build" (#1800)
* Fix for issue #1798: Suggested 'yarn build' versus 'yarn run build'

* remove 'run' from 'yarn test' command as well

* conditionally show 'run' if Yarn is not available
2017-03-12 15:13:41 +00:00
Leo Lamprecht
8c00af1440 Suggest serve for running in production (#1760)
* Suggest `serve` for serving the `build` directory

* How to handle it with Node in prod (or other platforms)

* Pretty newline added

* Adjusted default port of static server

* Remove `open` command from output

* Removed constant assignment

* Better explanation for not using having to use a static server

* Cute newline added

* Style nits
2017-03-08 22:34:31 +00:00
Valerii Sorokobatko
fe7b5c212b update to modern code style (#1738)
* mv create-react-app/index.js -> create-react-app/creteReactApp.js

* update to modern code style

* var -> cosnt

* set trailing-coma to es5 for prettier
2017-03-07 19:46:10 +00:00
Lorenzo Palmes
43873dc9b8 Display yarn instead of yarnpkg when creating a new app (#1747)
* Display yarn instead of yarnpkg

* Refactored displayd commands

* Removed testing directory
2017-03-07 14:29:39 +00:00
Valerii Sorokobatko
d7bcc1916a Fix eject for linked react-scripts (#1736)
* fix eject for linked react-scripts

* path.resolve => resolveApp
2017-03-06 17:44:18 +00:00
Dan Abramov
1bfd5dafdf Fix internal linting setup and add missing headers (#1741) 2017-03-06 14:20:29 +00:00
Ade Viankakrisna Fadlil
fbdff9d722 extract generic build functions to react-dev-utils (#1726)
* Temp rename

* Rename to change the case

* extract generic build functions to react-dev-utils

* tweak package json files and move removeFileNameHash

* revert removeFileNameHash

* use paths.appBuild in printFileSizes

* use paths.appBuild in removeFileNameHash

* change curried functions to regular functions

* add fs-extra to react-dev-utils deps

* move getDifferenceLabel inside printFileSizes

* inline copyPublicFolder

* combine printFileSizes and removeFileNameHash to fileSizeReporter

* fix typo

* Tweak APIs and fix issues

* Fix heading

* Remove missing file

* Newline

* Newline

* Trailing space

* Update FileSizeReporter.js

* Update build.js
2017-03-06 01:49:53 +00:00
Dan Abramov
23dc422606 Fix ejecting from a scoped fork (#1727)
* Read script names from own bin instead of guessing

This fixes ejecting from a fork that uses a different bin script name.

* Fix ejecting for a scoped react-scripts fork

We shouldn't hardcode react-scripts because fork name might differ.
We also shouldn't rely on it being an immediate child because scoped packages are a level deeper.

* Clarify that own* properties only exist before ejecting
2017-03-05 23:23:51 +00:00
Daniel Grant
b88d6655eb Modularise scripts (#1433)
* Refactor start script into modules

* Move dev server config into config file

* Replace eject file whitelist with a "remove-file-on-eject" flag

* Move utils into scripts folder (for inclusion in ejection)

* Add missed changes

* Pass showInstructions as an argument

* Fix eject bug

* Don't eject babelTransform
2017-03-03 22:05:07 -05:00
Johann Hubert Sonntagbauer
2b824d8bc3 add X-FORWARDED headers for proxy requests (#1677) 2017-02-28 14:07:29 +00:00
Dan Abramov
2f6fac9f93 Fix npm test on Windows (#1647) 2017-02-26 13:35:24 +00:00
Dan Abramov
3289c32021 Fix up broken line 2017-02-24 22:29:36 +00:00
Matt Crampton
dbf17fd0e4 Setting a dynamic port value for the pushstate-server URL text (#1628)
* Setting a dynamic port value for the pushstate-server URL text after a build is completed

* Fixing merge conflict
2017-02-24 22:28:36 +00:00
Joe Haddad
b609ac96fe Use posix paths for Jest config during eject (#1635)
Resolves #1417 and #1498.
2017-02-24 17:06:54 -05:00
chyipin
925ab7268f Use real build path name in build output (#1478)
Use the configured appBuild value in paths.js instead of hard-coding it to 'build'.  This is helpful for the ejected case where the appBuild path is changed to another folder name.
2017-02-24 20:32:15 +00:00
Valerii Sorokobatko
d6a83aa887 Remove .bin files defined at react-scripts/package.json after eject (#1567)
* remove bin files after eject defined at package.json

* add swallowing try/catch
2017-02-24 18:00:09 +00:00
Johann Hubert Sonntagbauer
0ef9e80349 (feat): add webpack validation error logging (#1596)
* (feat): add webpack validation error logging

* Style nit

* Style tweak

* Style nit
2017-02-24 17:28:54 +00:00
Valerii Sorokobatko
bec009ce71 Fix workflow if react-scripts package is linked via npm-link (#1356)
* add npm-link support

* - remove extra veriable
- simplify condition

* update code after review:
- remove utils/isReactScriptsLinked
- add appPath and ownPath to paths.js (but only for "before eject" export case)

* update code after review:
- remove utils/isReactScriptsLinked
- add appPath and ownPath to paths.js (but only for "before eject" export case)

* update code after review:
- remove utils/isReactScriptsLinked
- add appPath and ownPath to paths.js (but only for "before eject" export case)
- remove "if" block for fs.removeSync(ownPath) at ejec.tjs

* change ownPath value
2017-02-24 11:51:16 -05:00
Jirat Ki
a82896c3e3 Install react, react-dom, and react-scripts at the same time (#1253)
* Install react and react-dom along with react-scripts

- Install react, react-dom and react-script in a same time
- Move react-scripts to devDependencies.

* Check if react, react-dom has been already installed

- To backward compatibility with old CRA’s cli
- In case old CRA doesn’t install react, react-don along with
react-scripts

* Use packageName to find script dependency

- use packageName to find dependency
- fix pathExists.sync

* Check dependencies.react in package.json instead of actual files

* Process exit when dependencies not found

- Show error and exit when dependencies not found.
- Log install show custom package name

* Remove template string

* Install dependencies if template is preseted

* Remove dangling comma

Resolves #1239
2017-02-22 22:55:41 -05:00
Mato Ilic
dd9ec7bcfb fixes #1584 PORT env variable not always an integer (#1585) 2017-02-18 23:05:56 +00:00