Commit Graph

80 Commits

Author SHA1 Message Date
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
Kees Kluskens
1d5a277367 Enable watchContentBase for webpack-dev-server (#1546)
Resolves #1508
2017-02-14 21:41:31 -05:00
Joe Haddad
12288836e1 Upgrade webpack (#1291)
* Upgrade webpack

* Address more webpack v2 ...

* Update html-webpack-plugin

* Remove LoaderOptionsPlugin from dev config

* ExtractTextPlugin still uses webpack 1 syntax
... and doesn't support complex options (yet)

* Grammar nit

* Update extract text webpack plugin

* - Remove webpack.LoaderOptionsPlugin
- Update deps

* Lerna hoists packages

* Update extract-text-webpack-plugin

* Update webpack-dev-server

* Remove imports for the tests

* stop removing babelrc
2017-02-11 14:11:00 -05:00
Joe Haddad
613b584f42 Add PUBLIC_URL env variable for advanced use (#937) (#1504)
* Add `PUBLIC_URL` env variable for advanced use (#937)
* Add support for `PUBLIC_URL` env variable
* Remove unnecessary duplications
* Simplify served path choice logic
* Honor PUBLIC_URL in development
* Add e2e tests

Enables serving static assets from specified host.
2017-02-09 23:15:15 -05:00
pd4d10
b999405c67 Add missing '\n' to the end of package.json file (#1510) 2017-02-09 16:36:20 -05:00
Jay Phelps
9e0e18fd2e UX: Explain why build is failing (#1352) 2017-02-08 15:27:44 -05:00
creynders
bc2fc80898 eject: Additionally remove react-scripts from dependencies (#1458)
ATM if react-scripts is (erroneously) declared in `dependencies` instead of `devDependencies` or isn't declared at all, the `eject` script will fail half-way. This change makes it more robust, react-scripts will be removed from either, if present.
2017-01-27 16:26:35 +00:00
Fabrizio Castellarin
9099570b94 Use a more sophisticated template for end-to-end testing. (#1187)
* Use a more sophisticated template for end-to-end testing.

* Not publish integration tests to npm

* Use "commander" for  cli argv handling

* Handle different scripts version forms and exits without a name given

* Prepare the commands for testing with a template

* Fix dev "template" path

* Add various features to test

* Test various features separately

* Test language features

* Comment unused e2e.sh lines

* Add "development" tests

* Test environment variables

* Test webpack plugins

* Replace kitchensink README

* Switch integration tests from jest to mocha

* Use `fs-extra`

* Use the correct folders

* Do some cleanup

* Print a better message for `--template`

* Test `npm start` with and without https

* Separate fast e2e testing from kitchensink testing

* Hide `--internal-testing-template` (former `--template`) CLI option
2017-01-23 20:43:16 +01:00
Ville Immonen
1b645e2cc4 Use yarnpkg alias to run Yarn (#1365)
There’s a common tool included in Hadoop that also has a `yarn` command,
which created issues for users who had Hadoop installed:
* #1257
* #1363

Yarn also installs the command under `yarnpkg` alias (added in
cefa9a368d)
so we can use `yarnpkg` instead of `yarn` to make it more reliable.

This has no effect on users who don't have Hadoop installed, but those
who have won't see errors from falsely detecting Hadoop Yarn as Yarn
the package manager, and they can now also install Yarn to make use of
our Yarn support without the Hadoop Yarn interfering.
2017-01-09 17:25:31 +02:00
Paul O’Shannessy
4d7b7544e7 Use npm script hooks to avoid && in deploy script (#1324) 2016-12-30 17:59:27 +02:00
David
ac6a4c83fd Updated react-scripts babel-jest && jest packages to 18.0.0 (#1311) 2016-12-23 12:09:39 -08:00
Eduard Kyvenko
21b0044412 Remove path-exists from dependencies and replace it with fs.existsSync (#1289) 2016-12-18 20:57:00 +02:00
Cary Landholt
94c912dc60 Remove interactive shell check when opening browser on start (#1264)
Browser launch can still be suppressed using BROWSER=none
2016-12-13 08:13:30 -08:00
Dan Abramov
a13a65f1c5 Clear scrollback in test mode (#1237) 2016-12-11 03:33:34 -08:00
Benoit Averty
a60140f811 Disable jest watch mode when --coverage flag is present (#1229) 2016-12-11 02:03:19 -08:00
Pavel Kolesnikov
9d42ffab97 Proxy rewrites Origin header to match the target server URL (#1212)
* Proxy rewrites Origin header to match the target server URL

* Added comments on rewriting Origin header by the proxy middleware
2016-12-11 00:48:35 -08:00
Jirat Ki
39a5b4de6e Skip gh-page setup instruction if scripts.deploy has been added (#1222) 2016-12-09 12:42:52 -08:00
Dan Abramov
5456ffff29 Let Jest handle all file types (#1197)
* Let Jest handle all file types

* Update regexes

* Fix exclusion regex to also exclude files without extension
* Be over-cautious with Windows paths because I'm not sure how Jest handles them

* There is no automatic babel-jest discovery now that we use transsform
2016-12-07 20:28:03 +00:00
Dirk-Jan Rutten
cdd17a6914 Crash the build during CI whenever linter warnings are encountered (#944)
* Added functionality to crash the build during CI whenever linter warnings are encountered.

* Updated the docs with a description on how to use the build in CI

* Fixed small typo

* Fixed description of build error.
2016-12-03 14:39:29 +02:00
Adam Stankiewicz
dc6edce99b Add support for non-interactive terminal (#1032) 2016-11-23 23:36:01 +02:00
Dave Ceddia
ce918191b2 Enable proxying of websockets (#1090)
Added `ws: true` to the httpProxyMiddleware options, and also listen
for the "upgrade" event so that websockets can be proxied immediately,
rather than waiting for an initial HTTP request.
2016-11-23 19:42:54 +00:00
Ian McNally
05c3b55c62 add logging of existing default port process on start (#816)
* add logging of existing port process on start

* Move port process wording in start command on to next line

* Color the named processes as cyan in terminal output

* Add handling for multiple processes on a part

- With the currently process filtering, if multiple processes are returned as running on port 3000, this command would fail. This splits apart the process IDing and the process naming, to support multiple processes.
- One curious thing about the bash command to get processes, is that it'll include browsers with a window open on localhost:3000. May want to reconsider that.

* Add process directory to existing port warning

- also moved terminal coloring up, when getting the process, to be able to distinguish the process command from the directory

* Change output color to all cyan, except "in"

* Rename getProcessNameOnPort -> getProcessForPort

- better reflects its broadened scope (both command and directory)

* Add checking if process is a CRA instance, to customize port running message

- moved from using package.json to a regex, for reliability

* Move getProcessForPort to react-dev-utils

- also allowed for breakdown of commands into helper methods

* Add documentation for getProcessForPort

* Add getProcessForPort to list of dev-scripts files

* Use app's package name when CRA app is running on another port

* Filter port process by those listening

- Removed the handling of multiple process IDs since you can filtering by listening process (and not have the browser in the list of processes)
- Trimmed the terminal outputs for better matching (process id) and better terminal output (directory of process)

* Update README on port helpers, to specify only one port returned

* Add ignore of stderr when executing process commands

- Make sure any potential errors don't leak to the user
2016-11-22 22:44:21 +02:00
Brian Ng
2da6edabab Replace rimraf with fs-extra functions (#1072) 2016-11-21 18:26:08 +00:00
Dan Abramov
ff7e22e5a8 Update GH deploy instructions to match User Guide 2016-11-20 18:13:09 +00:00