Commit Graph

28 Commits

Author SHA1 Message Date
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
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
03a709195f Revert "Add loader for .graphql files (#3909)" (#5076) 2018-09-24 12:48:58 -04:00
Joe Haddad
62b0942be6 Change default test environment to jsdom (#5074) 2018-09-24 11:30:04 -04:00
Joe Haddad
9bbc1775bb Remove mjs support (#5027)
* Revert Lerna dependency, there's too many bugs in v3

* Remove `mjs` support
2018-09-18 17:09:27 -04:00
Joe Haddad
50b4857ff8 Revert "Add support for yarn and lerna monorepos. (#3741)"
This reverts commit b43ad04b88.
2018-09-18 14:31:19 -04:00
Craig Mulligan
0e0f260e35 .mjs should not resolve before .js files (#4085) (#4318)
Support for .mjs files added in #3239 did not account for npm libraries which ship native mjs files alongside js files. This accounts for this by ensuring .js files resolve before their accompanying .mjs file. Note that this is not an ideal end state since selecting a .mjs over a .js extension should be the result of whether `import` was used instead of `require()` in a node environment with native ESM support (currently via `--experimental-modules`). Instead, this change just *always* selects a .js extension before the .mjs extension if it exists.

This unbreaks support for using GraphQL (relay, apollo, etc) within create-react-app projects.
2018-05-20 20:27:31 +01:00
Mike Kusold
493a379c21 Map (css|sass|scss) modules to identity-obj-proxy in jest (#4419) 2018-05-15 21:03:22 -04: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
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
Gary Meehan
f5708c67cd Add feature #3116 extended Jest config (#3802) 2018-01-15 17:03:14 +00: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
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
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
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
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
Jeremy Morrell
94149c77a8 Ignore the yarn cache directory (#2063) 2017-05-08 15:05:49 +01: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
Dan Abramov
e5bf5af296 Extract some utilities into a separate package (#723)
* Extract some utilities into a separate package

* Add utils dir to `files` in package.json

* Do not create an empty `utils` dir on eject
2016-09-23 20:53:08 +01:00
Dan Abramov
ba34b0b79b Eject .babelrc instead of separate configs (#705)
Fixes #410, #674
2016-09-23 00:33:14 +01:00
Ville Immonen
26464096d5 Set up a monorepo with Lerna 2016-09-19 10:52:19 +03:00