Commit Graph

57 Commits

Author SHA1 Message Date
Joe Haddad
88a3de96af Set browsers automatically if not an interactive terminal 2018-09-24 11:46:07 -04:00
Joe Haddad
cc328d6287 Revert "Use yarn when running inside yarn workspace. (#3997)"
This reverts commit 2c34d5b66e.
2018-09-18 14:31:19 -04:00
bradfordlemley
2c34d5b66e Use yarn when running inside yarn workspace. (#3997)
* Run yarn after ejecting.

* On eject, choose to run yarn instead of npm if yarn is available.

* Move monorepo to react-dev-utils.

* Fix lint.

* Rename monorepo to workspaceUtils.

* Add react-dev-utils dep for create-react-app.

* getMonorepo -> findMonorepo
2018-02-10 13:07:19 +00:00
Andrew Ho
ea760ff84a Fix typo (#3956)
sever => server
2018-02-03 23:59:26 -05:00
Bond
9d67605ab6 Use custom bit.ly links (#3836)
* change link to advanced deployment

* Use custom CRA link for deployment

* use custom link for minification failure

* update link for deployment

* feedback
2018-01-18 09:17:02 -05:00
Joe Haddad
2e59c5412c Offer to set default browsers (#3792)
* Offer to set browser defaults

* Catch error on no

* Add ending newlines

* Ensure we re-check to prevent defaults from leaking

* Reduce nesting

* Add defaults message

* More explicit
2018-01-15 00:09:07 -05:00
Joe Haddad
5d1710aec2 Tell user what browser support their application was built with (#3782)
* Warn about browsers during build

* Better message
2018-01-15 00:08:48 -05:00
Dan Abramov
11db9af4df Add preflight check to guard against wrong versions of webpack/eslint/jest higher up the tree (#3771)
* Run real scripts in local development

* Add preflight check warning

* I know what I am doing

* Move preflight check into individual scripts

This ensures we don't try to filter NODE_PATH twice, accidentally removing the now-absolute path.

* Slightly tweak the wording

* Fix lint
2018-01-15 00:08:14 -05:00
Ian Sutherland
b86fe056a3 Add warning when HOST environment variable is set (#3730)
* Add warning when HOST environment variable is set (#3719)

* Improve HOST environment variable warning message

* Adjust text and message

Closes #3719
2018-01-14 14:14:37 -05:00
Rahul Chanila
a1c5b8f705 Updates comment to reflect codebase (#3576)
the code got updated from `detect()` to `choosePort` while the comment did not.
2017-12-10 21:10:19 -05:00
Sophie Alpert
2e82ebb337 BSD+Patents -> MIT (#3189)
* File headers BSD+Patents -> MIT

* BSD+Patents -> MIT
2017-09-26 10:30:05 +01:00
Dan Abramov
2069e8ac43 Consistently set environment variables (#2382) 2017-05-27 12:37:07 +01:00
Dan Abramov
25f81f2bea Files in public/ folder should not be requested through proxy (#2326) 2017-05-22 17:04:17 +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
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
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
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
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
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
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
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
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
Dan Abramov
1bfd5dafdf Fix internal linting setup and add missing headers (#1741) 2017-03-06 14:20:29 +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
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
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
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
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
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
Ville Immonen
bcc469c9a5 Support Yarn (#898)
In the `create-react-app` command, try to install packages using Yarn.
If Yarn is not installed, use npm instead.

In `react-scripts`, detect if the project is using Yarn by checking if
a `yarn.lock` file exists. If the project is using Yarn, display all
the instructions with Yarn commands and use Yarn to install packages
in `init` and `eject` scripts.
2016-11-17 22:55:00 +02:00
Fatih
ca443abe62 Enable compression on webpack-dev-server (#966) (#968) 2016-10-28 13:41:51 +01:00
Brian Ng
909d938166 Fix some typos (#809) 2016-10-01 12:13:42 +03:00
vaibhav
37819ee8ef added link to better visualizing tool (#764)
issue here #762
2016-09-26 14:06:46 +01:00
Dan Abramov
9cce0fb59f Add syntax error overlay in development (#744)
* Add syntax error overlay in development

* Support HMR being disabled

* Tweak CSS
2016-09-25 11:31:10 +01:00