Commit Graph

176 Commits

Author SHA1 Message Date
Joe Haddad
6b010b09a9 Fix TypeScript file detection 2018-10-22 08:36:41 -04:00
Joe Haddad
b5f156efec Print friendly message on first time use 2018-10-22 08:32:48 -04:00
Joe Haddad
fa535304d1 Hoist compiler options 2018-10-22 08:26:52 -04:00
Joe Haddad
e0939b6262 Automatically create a tsconfig.json when entrypoint is TypeScript 2018-10-22 08:24:48 -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
7ba343c187 Check for TypeScript install in preflight (#5516)
* Check for TypeScript install in preflight

* Remove unused import
2018-10-21 19:25:04 -04:00
Bruno Lemos
88aef1100f TypeScript syntax support (#4837) 2018-10-21 12:03:26 -04:00
Kit Thompson
302daeffff Fix typo
explictly seems like a typo for explicitly
2018-10-18 10:31:43 -04:00
Dan Abramov
56fed47976 Tweak preflight check message 2018-10-02 00:40:46 +01:00
Dan Abramov
bce2bfca6d Support globalSetup and globalTeardown Jest options (#5218) 2018-10-02 00:33:26 +01:00
Joe Haddad
316da53a32 Check for more packages which may cause problems (#5217) 2018-10-01 18:20:42 -04:00
Dan Abramov
45e621748c Fix absolute paths on eject (#5214) 2018-10-01 22:48:01 +01:00
Dan Abramov
b10337697e Don't crash npm test when hg/git are missing (#5212) 2018-10-01 22:08:14 +01: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
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
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
88a3de96af Set browsers automatically if not an interactive terminal 2018-09-24 11:46:07 -04:00
Joe Haddad
62b0942be6 Change default test environment to jsdom (#5074) 2018-09-24 11:30:04 -04:00
Joe Haddad
b8da58499a Optimize webpack rebuild speed (#5065)
Derived from https://github.com/facebook/create-react-app/issues/4492#issuecomment-421959548
2018-09-22 13:44:58 -04:00
Joe Haddad
7be14b914f Tweak init.js after merge 2018-09-21 08:19:14 -04:00
Aaron Reisman
2aaf71eed0 Add eslintConfig to new projects automatically (#1457) 2018-09-21 08:18:18 -04:00
Joe Haddad
e2dc3fc5a4 Lessen significance of browserslist
Adjust the default browsers to be a single list and remove it from the build output; it only affects CSS now
2018-09-20 16:48:45 -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
Joe Haddad
cc328d6287 Revert "Use yarn when running inside yarn workspace. (#3997)"
This reverts commit 2c34d5b66e.
2018-09-18 14:31:19 -04:00
Joshua Comeau
7c85938458 Create a --stats flag for react-scripts build. Update README.
To analyze Webpack bundles, a "stats" JSON is required.

This PR allows that file to be created and saved to the `build`
directory, so that users can use it with Webpack-specific insight
tools like `webpack-bundle-analyzer` without ejecting their
application.

Updated the README to include details for how to do this.
2018-05-31 07:23:13 -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
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