Commit Graph

147 Commits

Author SHA1 Message Date
Dan Abramov
3b102fe1b9 Work around Jest environment resolving bug (#4247) 2018-04-03 18:44:59 +01: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
Pete Nykänen
779dad5546 Add loader for .graphql files (#3909)
* Add graphql loader to webpack config

Signed-off-by: petetnt <pete.a.nykanen@gmail.com>

* Update README.md

Signed-off-by: petetnt <pete.a.nykanen@gmail.com>

* Update react-scripts README.md

Signed-off-by: petetnt <pete.a.nykanen@gmail.com>

* Add graphql jest transform

Signed-off-by: petetnt <pete.a.nykanen@gmail.com>

* Add integration tests, pin versions in package.json

Signed-off-by: petetnt <pete.a.nykanen@gmail.com>

* Tests expect regexp matchers

Signed-off-by: petetnt <pete.a.nykanen@gmail.com>

* Use strict equal test instead

Signed-off-by: petetnt <pete.a.nykanen@gmail.com>

* Escaping is hard

Signed-off-by: petetnt <pete.a.nykanen@gmail.com>

* Add comment for signifying a different file

* Update docs

* Fix jest config

* Remove node_modules exclusion

* Update README.md

* Inline graphql jest transform

Signed-off-by: petetnt <pete.a.nykanen@gmail.com>

* Update copyright header

Signed-off-by: petetnt <pete.a.nykanen@gmail.com>

* Use .graphql extension only

Signed-off-by: petetnt <pete.a.nykanen@gmail.com>
2018-02-03 15:51:55 +00:00
bradfordlemley
b43ad04b88 Add support for yarn and lerna monorepos. (#3741)
* Support for multiple source paths via package.json srcPaths entry.

Initial support for yarn workspace.

Support lerna workspace, fix for when to use template files.

Remove support for specifying srcPaths in package.json.

Re-enable transpilation caching.

* Clean up, use file matching (similar to original) in webpack configs instead of matching function.

* Remove package lock files.

* Fix for eject.
Note: monorepos won't work after eject.
Can be fixed easily with JEST 22.0.?+ which has file pattern matches against realpaths.

* Filter tests to run only tests in monorepo components included by the app.
(Not sure this is desireable, might be cool to be able to easily run all tests in monorepo from one app.)

* Fix conditions for when to use template.

* Fix eject.

* Remove code that is not needed w/ Jest 22.

* Include all cra-comp tests in monorepo instead of trying to include only tests that are dependencies of app.
(tests can be easily filtered via jest cli if desired, e.g. 'npm test -- myapp comp1')

* Pin find-pkg version.

* Hopefully fix jest test file matching on windows by removing first slash.

* E2E tests for monorepo.

* Run monorepo tests in CI.

* Fix and test post-eject build.

* Fix e2e test.

* Fix test suite names in appveyor.

* Include individual package dirs as srcPaths instead of top-level monorepo root.
Fixes build/start after eject.

* Fix running tests after eject.

* Clean up test workspace, add some verifcations.

* Cleanup.

* Try to fix hang when running test on appveyor.

* Don't write babel or lint config to package.json when ejecting.

* Incorporate review comments.
* Simply monorepo pkg finder
* Only include monorepo pkgs if app itself is included in monorepo
* Check for specific tests in e2e

* Fixes for windows.

* Fix for kitchensink mocha tests compiling.

* Add lerna monorepo test.

* Fix lerna bootstrap on windows.

* Incorporate more review comments:
* remove support for lerna w/o yarn workspace
* add react and react-dom as devDeps to comp1 and comp2

* Add monorepo info to user guide.
2018-02-01 20:58:18 +00:00
Michaël De Boey
25184c4e91 Fix links to package (#3898) 2018-01-22 22:16:22 +00:00
Dan Abramov
d49ffde4e6 Fix the E2E script (#3888)
* Fix the E2E script

* Delete .git if committing failed
2018-01-21 23:31:03 +00:00
Dan Abramov
b3527d7783 Fix git init race condition (#3877) 2018-01-20 18:32:41 +00:00
Maurice de Beijer
247e5c90a0 Create git repository with initial commit (#1288)
* Create git repo with initial commit

* Fixe commit message

* Added the git repo to the docs

* Bail if we are in a mercurial repository

* Removed Chore from commit mesage

* Create repo after installing react and react-dom

* Removed docs

* Commit changes when ejecting

* Update after review

* git add -A instead of git add . after code review
2018-01-19 13:12:34 +00: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
Ro Savage
fc7c9915b0 Add support for CSS Modules with explicit filename (#2285)
* Add css modules with [name].modules.css file convention

* Add e2e for CSS Modules

* Updated based on feedback

* Change css modules class name to be deterministic and fix licences

* Update css modules class naming convention
2018-01-17 10:20:57 -05:00
Jack Franklin
7969b48cd0 Enhance Jest config error for setupTestFrameworkScriptFile (#3512)
* Enhance Jest config error for `setupTestFrameworkScriptFile`

I wasn't aware of the fact that users of c-r-a could just define
`src/setupTests.js` and it would be configured with Jest - I nearly
ejected before I found a GitHub issue that confirmed this functionality.

I thought it might be a nice idea to add it to the error about Jest
config overrides to stop others ejecting when they don't need to.

* Change the order of Jest config errors.

* Show different error for `setupTestFrameworkScriptFile`

* Tweak the message
2018-01-17 13:26:22 +00:00
Dan Abramov
72c3d4ebb5 Try to fix CI (#3806)
* Try to fix CI

* Bump Jest elsewhere

* Bump Babel elsewhere

* Fix CI on Windows by writing .cmd file back
2018-01-16 18:24:14 +00:00
Dan Abramov
19e0bb1881 Support Jest --watchAll flag (#3804)
* Support Jest --watchAll flag

* Use clearer condition

* Add comma
2018-01-15 17:49:57 +00:00
Gary Meehan
f5708c67cd Add feature #3116 extended Jest config (#3802) 2018-01-15 17:03:14 +00: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
Joe Haddad
aa67a4f78e Loosen Babel preset to use browserslist (#3770)
* Provide better defaults

* Let babel determine features to compile

* meh

* Remove setting of BABEL_ENV

* Revert "Remove setting of BABEL_ENV"

This reverts commit ee2db707faa8b9ada3e7a668e8a94944f5955a1e.

* Set browsers to ie9
2018-01-15 00:08:14 -05:00
aisensiy
776d2d6036 Update jest to 22 and support watchPathIgnorePatterns configuration (#3124)
* update jest to 21.0.2 to support watchPathIgnorePatterns configuration

* update jest to 21.1.0

* Try bumping Jest

* Bump babel-jest

* Try to debug weird CI failure

* Remove debug code

* Bump other Jest packages

* ffs

* temp

* Revert "temp"

This reverts commit 62aec9ac1ae70a995a89548feb7ac7870e5324c0.
2018-01-15 00:06:24 -05:00
Andrey Sitnik
0a331710aa Move browsers to cross-tool config (#3644) 2018-01-15 00:06:24 -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
Joe Lim
4bec877178 Improve eject message (#3416)
* improve eject message

* cross os implementation
2017-11-07 13:37:40 -05:00
Joe Haddad
5c8000f300 Add .mjs support (#3239) 2017-10-28 21:48:42 +01:00
Sophie Alpert
2e82ebb337 BSD+Patents -> MIT (#3189)
* File headers BSD+Patents -> MIT

* BSD+Patents -> MIT
2017-09-26 10:30:05 +01:00
Ade Viankakrisna Fadlil
44cfbccfda Rerun prettier and pin version (#3058)
* rerun prettier for all files

* pin prettier to 1.6.1
2017-09-10 01:12:38 -04:00
Stéphane Goetz
badfc2a8d9 Make formatWebpackMessages return all messages (#2834)
* Move the reduction of the messages to a single place in the place it is used.

* Fix variable name
2017-08-08 21:37:04 -04:00
Ade Viankakrisna Fadlil
b643f5710a Format UglifyJs error (#2650)
* format UglifyJs error

* move formatBuildError to react-dev-utils

* fix readme

* use regex for plucking the path from stack

* make path human readable and fallback to show error if regex not matched

* rename to printBuildError and add link to the docs

* fix link indentation

* improve readibility + shorten link
2017-08-01 21:57:50 -04:00
Mostafa Hajizadeh
16f0d4a56c Add "node" to Jest's moduleFileExtensions (#2738)
Jest's default value for this option is ["js", "json", "jsx", "node"].
CRA's current value is ["web.js", "js", "json", "web.jsx", "jsx"], which
is missing one of default ones: "node". This change fixes that.

This "node" extension is used in packages that use native code.
2017-07-07 11:37:32 +01:00
Dan Abramov
a171d93064 Reformat source code with Prettier 1.5.2 2017-06-28 16:23:16 +01:00
Evan Jones
6ab0ec0075 Better React Native Web support (#2511)
* Better React Native Web support

* Adding better react-native-web support for jest testing
2017-06-28 15:29:58 +01:00
Dan Abramov
9559ba486e Put react-scripts in dependencies, not devDependencies (#2657)
* Put react-scripts in dependencies, not devDependencies

* Sort dependencies on eject

* Remove CI check
2017-06-28 14:04:26 +01:00
Dan Abramov
7cf4de71fa Warn about large bundle sizes (#2648) 2017-06-28 00:00:49 +01:00
Dan Abramov
3747144f9a Set npm loglevel to 'error' (#2635) 2017-06-27 15:39:42 +01:00
Dan Abramov
bed875c83d Don't run yarn after ejecting (#2634) 2017-06-27 15:09:46 +01:00
Paweł Jędrzejczyk
0644e80d36 add check to filter out custom scripts in eject command (#2562) 2017-06-27 14:11:14 +01:00
Joe Haddad
31a4d14b33 Fix a potential issue (#2569) 2017-06-19 13:27:02 -04:00
varnav
5b38c5439d Check if CI variable is set to 'false' (#2501)
* Fix incorrect check if CI variable is set to true

Originally build would fail on warnings with any value of CI environment variable. Now it will correctly check if it's true.

Discussed here: https://github.com/facebookincubator/create-react-app/issues/2453

* Check for "not false" instead of "not true"

After discussion we decided that this will be closer to current functionality and not break anything.
2017-06-19 12:36:28 -04:00
Dan Abramov
2069e8ac43 Consistently set environment variables (#2382) 2017-05-27 12:37:07 +01:00
Jin Zheng
b60f55c6bf Print file sizes with correct build folder path. (#2361)
* Print file sizes with correct build folder path.

* Just use the print the basename.
2017-05-25 16:18:29 +01:00
Dan Abramov
25f81f2bea Files in public/ folder should not be requested through proxy (#2326) 2017-05-22 17:04:17 +01:00
Pavol Madar
0d1521aabf Remove connect-history-api-fallback and cross-spawn dependencies from react-scripts (#751) (#2320) 2017-05-22 12:46:51 +01:00
pmadar
a1749f9154 Remove unnecessary dependencies(#751) (#2283)
* Remove unnecessary dependencies(#751)

* Sort alphabetically
2017-05-20 19:08:58 +01:00
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