Commit Graph

227 Commits

Author SHA1 Message Date
Ian Schmitz
005ee5b952 Bump eslint-plugin-react version and update webpack config (#6132)
* Bump eslint-plugin-react version

* Move eslint-plugin-react settings into eslint-config-react-app

* Add react/no-typos rule
2019-01-06 15:05:14 -08:00
shawtung
1aca3cc416 Fix comment typo (#6036) 2018-12-30 18:45:05 -08:00
Ian Schmitz
49e258b4a6 Support setupTests.ts (#5698) 2018-11-22 21:14:25 -08:00
Joe Haddad
30ee52cf3b Merge webpack configuration (#5722)
* Rename production configuration

* Upgrade lint staged

* Merge mode, bail, devtool, and entry

* Merge output settings

* Remove old comment

* Merge some trivial differences

* Disable minimize in development mode

* Only minify html and generate SW in production

* Adjust comment

* Toggle development plugins

* Add missing imports

* Scope settings

* Delete development config

* Use new config file

* Remove unnecessary config import
2018-11-07 22:11:20 -05:00
Joe Haddad
6364bbf6dc Remove react-scripts type reference on eject (#5611)
* Remove react-scripts type reference on eject

* Check for env file

* Check eject for typescript

* Shuffle appTypeDeclarations

* Append internal types on eject

* Ensure lib is published for types

* Adjust comment

* Don't add a bunch of new lines

* File should exist and not be deleted

* Add debug

* Set file explicitly

* Revert "Set file explicitly"

This reverts commit bcd58a36cbd08a71af50b037d8f1fae6c595fb4e.

* Copy file before destroying ourselves

* Revert "Add debug"

This reverts commit 0068ba81c6d79d99788877c9e1b618acd7412dce.
2018-10-29 23:15:52 -04:00
Bruno Lemos
feea693f63 Ignore json files from TypeScript type checking (#5614)
Fix #5613
2018-10-29 10:33:57 -04:00
Joe Haddad
3403f05e93 Ignore test files from reported type errors (#5608)
* Ignore test files from reported type errors

* Ignore setup proxy & test files
2018-10-28 15:24:12 -04:00
Joe Haddad
9747480f19 Turn on certain TypeScript options (#5607) 2018-10-28 14:47:06 -04:00
Joe Haddad
eca0ec0d52 Refine how TypeScript env types are handled (#5593)
* Specify types in package

* Do not remove types file on eject

* Stop copying types into generated project

* Reference react and react-dom

* Reference node types

* Install node types as well

* Restore copying

* Add Node to the list of installed types

* Reference Jest types

* Remove jest types from install

* Remove jest from CRA install

* Remove Jest reference and let user do this themselves

* Stop copying types file

* Add types key to package.json

* Add appTypeDeclarations and create when missing

* Rename declarations file

* Add Jest back to install instructions

* Minimize diff
2018-10-27 22:11:47 -07:00
Bruno Lemos
418e6ee6ff Fix process.env types (#5589)
Fix #5576
2018-10-26 12:07:01 -07:00
Bruno Lemos
68a37351d5 Add typings for process.env (#5557) 2018-10-24 15:26:00 -04:00
Bruno Lemos
dc7cdf4a26 Change import syntax from typescript declaration (#5559) 2018-10-24 13:32:32 -04:00
Joe Haddad
5ead915b73 Automatically setup TypeScript when detected (#5549)
* Don't resolve TS files if it's not detected in the project

* Automatically create tsconfig.json file for user

* Remove always false check

* Add missing file

* Don't filter paths too early
2018-10-24 00:59:26 -04:00
Bruno Lemos
4c558d7c26 Enable TypeScript json module resolver (#5531)
* Enable TypeScript json module resolver

* Update verifyTypeScriptSetup.js
2018-10-22 14:49:56 -04:00
Joe Haddad
5410da0bfc Add TypeScript error formatting (#5529) 2018-10-22 13:29:18 -04:00
Joe Haddad
680cf9371a Validate tsconfig when using TypeScript (#5524)
* Sanity check TypeScript config

* Check more options

* Set all defaults and suggestions

* Update docs

* Update doc notes

* Automatically copy react app declared types to project on start

* Remove note about loaders.d.ts
2018-10-22 08:15:41 -04:00
Joe Haddad
c019942bf9 Always type check TypeScript when being used (#5515)
* Always type check TypeScript when being used

* Use alternate version
2018-10-21 18:24:33 -04:00
Bruno Lemos
88aef1100f TypeScript syntax support (#4837) 2018-10-21 12:03:26 -04:00
Alex Forbes-Reed
9971653775 Add environment variable to optionaly disable inlining of chunks (#5354)
* Add environment variable to optionaly disable inlining of chunks

* Changed env var to `process.env.INLINE_RUNTIME_CHUNK `

* Added env var to Advanced Configuration in docs

* Drop implied behavior

* Tweak working to match other descriptions
2018-10-08 12:48:15 -04:00
Ben Brandt
183efedb42 Remove unused require for getCacheIdentifier after ejecting (#5317) 2018-10-05 13:01:52 -04:00
Joe Haddad
f166144557 Disable inline 3 option (#5281) 2018-10-03 15:43:37 -04:00
Joe Haddad
736561fa8b Add .mjs support back to webpack (#5258)
* Add `.mjs` support back to webpack, because webpack was not the problem

* Continue toggling `.mjs` to `javascript/auto` mode

* Be more inline with the specification

* Bump old Node to 6
2018-10-03 00:03:51 -04:00
Crux
d624f25df3 Fix GENERATE_SOURCEMAP env not working for css (#5246) 2018-10-02 10:37:42 -04:00
Maël Nison
9e074bbf08 Plug'n'Play support (#5136)
* Adds the PnP plugin for Webpack to find dependencies when working under PnP

* Adds configuration for jest

* Adds an e2e test for when using PnP

* Avoids cra from crashing at the engine check

* Avoids cra from crashing when initializing react-scripts

* Makes the ownPath portable

* Fixes linting

* Bumps to pnp-webpack-plugin@1.1.0, removes symlinks: false

* Adds a --use-pnp option

* Pin version
2018-10-01 15:53:07 +01:00
Dan Abramov
4a96247bf0 Treat .css and .sass/.scss as side effectful (#5197) 2018-10-01 15:07:09 +01:00
Dan Abramov
53e4c0ac0e Format SVG React snapshots as <svg> tag with props (#5196)
* Format SVG React snapshots as <svg> tag with props

* Keep output simpler
2018-10-01 14:50:23 +01:00
Joe Haddad
70b3110a75 Use Workbox CDN as default (#5180) 2018-09-30 17:58:40 -04:00
Joe Haddad
7b1a32be6e Polish webpack message output (#5174)
* Only install react-scripts in CI mode

* Link locally

* Re-enable all output tests

* 💄 Polish webpack output

* Test sass support message

* Add more tests, but disabled

* Format missing default export error

* Format aliased import

* Why was node-sass required? Odd

* Format webpack rejection error

* Re-enable unknown package test

* Format file not found error and catch module scope plugin error

* Re-disable case sensitive paths

* Intercept and format case sensitive path errors

* Test out of scope message formatting

* Run behavior on macOS

* Run behavior on Node 8 and 10, only Node 8 for macOS

* Add some debugging

* Update matcher

* Only check stderr

* Remove old snapshot

* More debug

* Remove debug

* Add new debug

* Disable test on linux

* Add comment for future
2018-09-30 17:44:49 -04:00
Joe Haddad
5abff641a9 Remove thread-loader (#5170)
* Remove thread-loader
After the cache is warm, it is possible for thread-loader to hurt speed

* Disable babel output formatting
2018-09-29 18:30:28 -04:00
Joe Haddad
232e892754 Drop comment 2018-09-28 23:05:53 -04:00
Joe Haddad
42026a01f7 Correctly lookup assets when using a relative build directory (#5163)
* Correctly lookup assets when using a relative build directory

* Hah, var ...

* Add e2e test for relative paths

* Format svg
2018-09-28 23:03:48 -04:00
Maël Nison
97c7131d12 Forwards args through thread-loader (#5157)
* Forwards args through thread-loader

* Comments & dev
2018-09-28 16:21:58 +01:00
Joe Haddad
3ae3cf3678 Toggle mjs files to javascript/auto type (#5151) 2018-09-28 08:34:06 -04:00
Ian Sutherland
39c73ce5e3 Switch back to babel-loader (#5143)
* Switch back to babel-loader

* Preserve existing caller options. Use Object.assign instead of object spread.

* Updated filename in package.json

* Update comment about cache identifier

* Update macro check to use a regex

* Move macro check regex out of function
2018-09-27 19:17:21 -04:00
Joe Haddad
27ac52ac2f Remove runtime alias hack (#5142)
* Remove runtime alias hack

* Pass absolute path to preset

* Change comment

* Give a relative path to absolute runtime

* Clean up config

* Tweak again

* Make absolute runtime the default

* Remove runtime package from error overlay
2018-09-27 16:52:43 -04:00
Joe Haddad
ce5a2e4e14 Adjust regex fed to RegExp
https://github.com/facebook/create-react-app/pull/4169#issuecomment-425145384
2018-09-27 11:56:42 -04:00
David Moodie
3b71621552 Workbox service worker (#4169)
* Add workbox service worker functionality

* Remove debug

* Set workboxConfig for when there isn't a cra config file

* Remove workbox configuration options as c-r-a isn't planning on supporting optional configuration

* Remove c-r-a config path from paths

* Add workbox service worker functionality

* Remove c-r-a config path from paths

* Inline the webpack workbox config

* Use settings reccommended by @jeffposnick

https://github.com/facebook/create-react-app/pull/4169/#issuecomment-422963072

* Fallback to public url index.html, not root

* Add one comment

* Update comment

* Correct regex
2018-09-27 11:51:42 -04:00
Joe Haddad
fed41009b6 Output CSS sourcemaps in separate file (#5131)
* Output CSS sourcemaps in separate file

* explain options
2018-09-27 09:13:27 -04:00
Marco Fugaro
1b57f0157b Remove highlightCode:true because it's now the default (#5085) 2018-09-27 00:20:42 -04:00
XiaoYan Li
46b18d9f36 Prevent Babel config overridden (#5109) 2018-09-26 17:03:31 -04:00
Joe Haddad
deffd04130 Fix babel runtime exclude rule 2018-09-26 01:31:50 -04:00
Joe Haddad
969fb37ea9 Disable source maps for node_modules (#5096) 2018-09-25 21:24:48 -04:00
Joe Haddad
adfb20c403 Turn on Babel helpers (#5093)
* Turn on helpers and test importing something with async/await works

* Compiling babel runtime breaks itself

* Add helpers option to babel plugin with defaults

* Make helpers off by default and on in our configuration

* Hit eject and e2e

* meh

* copy'n'paste

* change again

* Turn off helpers by default in /prod, /dev, /test

* oops

* Spread undefined

* Use object assign not object spread

* Put preset in template since it's needed

* Fix e2e tests
2018-09-25 18:59:06 -04:00
Joe Haddad
5599eff861 Drop IE 11 support by default (#5090)
* Drop ie 11 support and move polyfills to a new package

* More useful directions for what entry point to use
https://github.com/facebook/create-react-app/pull/5090#discussion_r220313783

* Clear up what file this polyfill goes in
https://github.com/facebook/create-react-app/pull/5090#discussion_r220313980

* Polyfill `window`, not `global`

* Remove proxy polyfill file
2018-09-25 16:08:29 -04:00
Joe Haddad
5f381e7646 Allow stage 3 css transforms (#5091)
* Switch to stage 3 css

* Tweak default browsers, too
2018-09-25 15:21:55 -04:00
Grady Kuhnline
fb6e6f70a3 Add postcss-preset-env, remove autoprefixer (#4716)
* add postcss-preset-env, remove autoprefixer

* limit to stage 4
2018-09-25 10:33:23 -04:00
Joe Haddad
11737bc786 Prevent the cache of files using Babel Macros (#5078)
* Add new overrides option

* Add file to package.json

* Create our own loader

* Remove overrides

* We have to use a real babel option

* Add comments
2018-09-24 20:10:11 -04:00
Joe Haddad
03a709195f Revert "Add loader for .graphql files (#3909)" (#5076) 2018-09-24 12:48:58 -04:00
Joe Haddad
2ee4fa8152 Add user defined proxy via middleware (#5073)
* Add user defined proxy via middleware

* Pass app, instead
2018-09-24 11:24:02 -04:00
Joe Haddad
2150693d6f Upgrade svgr to v2 and disable Prettier/SVGO (#5062) 2018-09-21 16:00:28 -04:00