Commit Graph

157 Commits

Author SHA1 Message Date
Ian Schmitz
1a66971f9e Bump dependencies (#8024) 2019-11-24 15:48:15 -08:00
Ian Schmitz
82009f570d Bump webpack-dev-server (#7988) 2019-11-24 14:18:33 -08:00
Ali Waseem
4b4f3f2cf7 added e2e test for checking typescript template with unsupported node (#7844) 2019-11-18 16:06:44 -07:00
Ian Schmitz
211694a8a2 Fix CI (#7951) 2019-11-08 18:54:16 -08:00
Kent C. Dodds
2de57fe15a Add @testing-library to the default templates (#7881) 2019-10-29 14:36:55 -07:00
Brody McKee
4c0c81953d Add template support (#7716)
* Add template support

* Update templates version check

* Update TypeScript template README
2019-10-24 15:17:41 -07:00
Ian Schmitz
1f46136d96 Fix build (#7662) 2019-09-08 18:20:51 -07:00
Alex Guerra
45e0703121 Fix CI issue on windows (#7385)
* Attempt at fixing CI issue on windows

* Try to debug why verdaccio isn't in the ps output

* Just remove the kill call alltogether
2019-07-18 14:46:04 -06:00
Min ho Kim
7c0dfef237 Fix various typos (#7355) 2019-07-15 17:12:35 +03:00
Ian Schmitz
7b196fa4d6 Add Azure DevOps build pipeline (#7096) 2019-05-28 19:12:22 -07:00
Ian Sutherland
657ae2f7be Upgrade to Lerna v3 (#6829)
* Upgrade Lerna to 3.13.2

* Remove independent argument to Lerna

* Update publish command
2019-04-17 09:59:06 -06:00
Robert van Steen
e7a2d6168a Set baseUrl from jsconfig.json/tsconfig.json (#6656)
* Set baseUrl from jsconfig.json/tsconfig.json

* Resolve the path for loading modules

* Add tests for jsconfig.json

* Add jsconfig.json

* Update packages/react-scripts/scripts/start.js

* Move baseUrl test to config folder

* Remove alias test

* Use chalk from react-dev-utils

* Add lost absolute file for typescript baseUrl test

* Update packages/react-scripts/config/modules.js

* Update other references of useTypeScript to hasTsConfig

* Fix casing of TypeScript

* Keep respecting NODE_PATH for now to support multiple module paths.

* Add test for NODE_PATH

* Add fallback if NODE_PATH is not set.

* Fix node path behavior tests

* Remove debugging code from behavior test suite

* Remove more debugging code

* Show NODE_PATH deprecation warning during build


Co-authored-by: Ian Sutherland <ian@iansutherland.ca>
Co-authored-by: Brody McKee <mrmckeb@users.noreply.github.com>
Co-authored-by: Jack Zhao <jzhao@fb.com>
2019-04-16 15:08:24 -06:00
Ian Sutherland
f1523a603a Add temporary workaround for Babel dependency issues in kitchensink-eject test suite (#6762) 2019-04-05 00:03:45 -06:00
Ian Sutherland
bf7d1c4b3e Add temporary workaround for Babel dependency issues in installs test suite (#6757)
This is a temporary fix to get our test suites passing so we can finish work on the 3.0 release. We still need to find and fix the root cause of this issue: #6679. This workaround should be removed once that's fixed.
2019-04-04 13:34:49 -06:00
Ian Schmitz
76fea02277 Cleanup Jest config (#6654)
General cleanup after the [Jest 24 PR](#6278). 

This also includes `jsdom@14` via https://www.npmjs.com/package/jest-environment-jsdom-fourteen. Since we have a node >= 8.10 requirement, we are able to use the latest version of `jsdom` which includes additional implementations of browser APIs such as `MutationObserver` (which we had an issue filed for over at #6617).

/cc @SimenB. Is there more you recommend we do to cleanup our [Jest config](b0cbf2caa1/packages/react-scripts/scripts/utils/createJestConfig.js) for TypeScript?

Co-authored-by: Ian Sutherland <ian@iansutherland.ca>
2019-04-04 11:00:00 -06:00
Santosh Yadav
5acb28645e Kill verdaccio in CI tasks cleanup (#6700)
Fixes #6663
2019-03-25 17:59:09 -07:00
Lorenzo Rapetti
3be3576304 Update to Jest 24 (#6278)
* Update to jest 24

* Add notice about pnpResolver.js

* Formatting

* Fix linting

* Update to jest 24.1.0

* Update jest-pnp-resolver

* Swap create-react-app params in e2e scripts

* Add extraGlobals to supportedKeys

* Bump jest to 24.3.1

* Bump jest to 24.4.0

* Bumb jest to 24.5.0

* Update template dependencies jest to 24.5.0

* Debug failing test

* Remove jest-pnp-resolver

* Remove console.log

* Revert yarn.lock.cached
2019-03-15 12:02:59 -06:00
Salvador Hernandez
dc133a351f Stage files for commit after ejecting (#5960)
* add command to add files to staging after eject

* update console.log message

* wrap git add in a try/catch block

* return true & update log message

* add test to check if files were staged

* Fix check for staged files
2019-03-11 22:06:37 -06:00
gottfired
1648ce8106 Fix order of args in tasks/cra test (#6342) 2019-02-05 09:45:57 +02:00
James K Nelson
3efcdbf328 Fix e2e:docker test failure (#6050)
* fix e2e:docker issue

* fix e2e tests
2019-01-21 20:24:34 -07:00
Dallon Feldner
132ac3523f Update local-test.sh to return test exit code (#6179)
The `e2e:docker` command can run tests in a Docker container, but it always returns exit code 0 even if the tests failed. This PR resolves that and returns the exit code from the test command.
2019-01-11 18:35:13 -05:00
Nima Shahri
337541b452 add tests for named-asset-imports plugin (#5575)
* add tests for named-asset-imports plugin

* add ticketFormats store/saga

* change import to require on test file to avoid using babel when running tests

* remove all babel dependencies as not needed more for running tests

* update tests and rename file to index.test.js

* remove npmignore as it is whitelisted in package.json

* add babel-plugin-named-asset-import tests to e2e
2018-10-31 14:33:02 -06: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
Joe Haddad
57cccb3332 Compile lock file on publish 2018-10-28 16:24:36 -04:00
Joe Haddad
0379c3898c Check for CI in publish 2018-10-26 11:54:39 -07:00
Joe Haddad
bf0b5e221d Prompt for 2fa auth code 2018-10-25 00:44:38 -07:00
Joe Haddad
ef499e5764 Always publish with npm 2018-10-25 00:41:01 -07:00
Joe Haddad
b50590f7f4 Add TypeScript app creation (#5550)
* Add TypeScript app creation

* Actually specify new extension

* Check for ts and tsx

* Fix types in default service worker file

* Mirror changes in JS version of SW

* Separate templates

* Use separate template directory

* Remove unused function

* Add a tsconfig file to the template

* Test install of typescript

* Add e2e for TypeScript

* Check for index.tsx to make sure we're not in the JS template

* Ensure TypeScript doesn't leak into normal installs

* Ignore some files

* Print version of CRA

* Fix script

* Add new template

* Move test to correct location

* Use `verifyTypeScriptSetup` routine to populate files

* Ensure tsconfig is created
2018-10-24 16:28:36 -04:00
Joe Haddad
5fecfee237 Clean up the behavior tests (#5365)
* Speed up installs with pnp

* Move to a better relative path test

* Continue work on new test organization

* Move mjs test to new enhanced tests

* Move over last legacy test

* Update behavior e2e script

* Add first iteration of instructions to test readme

* Add some more bad instructions

* Split test command into multiple lines

* Use two workers (do not run in band)

* Bump install timeout

* No global pollution

* Fix PnP support via standard run mechanism

* Prevent circular serve command

* Silent yarn execs

* Fix common commands by using a shell

* Run with npx instead of Yarn

* Remove unused scripts

* Wait for localhost and fix script booting with PnP

* Don't pnp locally because links will cause module resolution to whine

* lint-staged is annoying

* Strip Yarn out of execa runs

* Set default license if none specified

* Don't impose worker limit

* Disable pnp for webpack messages

* Add missing dependency

* Disable timeout and rely on Jest

* Only use 2 jest workers

* Add missing dependency
2018-10-10 11:05:15 -04:00
Maël Nison
201079dca2 Caches the Yarn resolution for faster installs (#5270)
* Caches the Yarn resolution for faster installs

* Adds the yarn.lock.cached file to the publish list

* Removes the copied lockfile when the install fails

* Updates the release checklist
2018-10-03 20:00:07 +01:00
Joe Haddad
b41e69662a Add browser test for graphql (#5263) 2018-10-03 01:05:06 -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
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
2a7346e085 Run behavioral smoke tests with Jest, add output tests (#5150)
* Run smoke tests with Jest

* Get a unique port for smoke test

* Upgrade verdaccio across the board

* Drop unneeded step

* Try latest instead

* Boot registry in home directory

* Correct config path

* Add mutex

* Test webpack message formatting

* Strip color

* Add browserslist to default

* Disable another broken feature
2018-09-28 06:19:29 -04:00
Joe Haddad
af61071a85 Add behavior e2e tests (#5146)
* Add new behavior e2e test script

* Add output for transparency
2018-09-27 17:42:59 -04:00
Jack Zhao
63398bd5e4 Remove babelrc dependency for kitchensink test (#5098)
* add kitchensink-eject to local-test

* add jest transform

Closes https://github.com/facebook/create-react-app/issues/5095
2018-09-26 00:58:06 -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
Jack Zhao
d0ed84507b Convert test suite to Jest (#4550)
* convert mocha tests to jest

* jest 23

* add jest configs

* use material css

* fix windows

* forceExit jest test

* force exit eject

* test

* test

* retrigger test

* remove appveyor comment

* try to remove pretendToBeVisual option

* use jsdom env

* test environment

* no cache

* test no close

* bring back raf

* test revert all broken changes

* add back jsdom

* remove jsdom

* node test environment

* use latest change

* runInBand

* runInBand

* comment test run

* try different jest option

* standardize jest test options

* increase heap size

* remove heap size config

* support scoped packages for cra --scripts-version option

* upgrade jest version

* fix windows

* fix windows again

* jest 23.4.1

* babel-jest

* babel-jest

* split out kitchhensink

* travis node 6

* travis node 6 config

* node 6 travis eject

* cache yarn

* only cache yarn

* remove unrelated changes

* typo
2018-09-21 05:17:45 -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
Ian Sutherland
92d9c5ada4 Add Node 10 to CI config and remove Node 6 (#4383)
* Add Node 10 to Travis config. Remove Node 6.

* Add Node 10 to Appveyor config. Remove Node 6.

* Remove node 9 from travis config.

* Increase mocha timeout.

* Update minimum Node version to 8.

* Update yarn to latest on Travis.

* Update old-node test to use Node 4.

* Increase mocha timeout in kitchensink-eject tests.

* Update yarn to latest on Appveyor.
2018-07-15 22:26:42 -06:00
Jack Zhao
366e5d3475 [internal] Separate out kitchensink test into two (#4767)
* support scoped packages for cra --scripts-version option

* seperate out kitchensink test

* add eject to node 6 testing

* travis node 6 eject

* fix CI warnings
2018-07-15 12:21:32 -06:00
Jack Zhao
e1ee8032a8 Fix node 10 npm login issue (#4626)
* node10

* token

* rerun tests
2018-06-18 13:00:55 -04:00
Jack Zhao
c1b0175253 Merge pull request #3929 from maciej-ka/remove-trailing-spaces-from-copyright
Remove trailing spaces from copyright
2018-05-30 21:46:43 -07:00
Jack Zhao
d1454febd1 Webpack4 (#4490)
* - [x] Upgrade to webpack 4.8.X
- [x] Utilize webpack 4 development and production modes
- [x] Upgrade webpack dev server
- [x] Webpack 4 compatible release of thread-loader
- [x] Webpack 4 compatible release of HtmlWebpackPlugin
- [x] Webpack 4 compatible release of SwPrecacheWebpackPlugin
- [x] Webpack 4 compatible release of WebpackManifestPlugin
- [x] Update README
- [x] Update WebpackDevServerUtils
- [x] Update InterpolateHtmlPlugin
- [x] Update ModuleScopePlugin
- [x] Update WatchMissingNodeModulesPlugin
- [x] Move UglifyJS options to webpack 4 optimize
- [x] Move InterpolateHtmlPlugin to make it tapable on HtmlWebpackPlugin
- [x] vendor splitting via splitChunks.splitChunks (https://twitter.com/wSokra/status/969633336732905474)
- [x] long term caching via splitChunks.runtimeChunk (https://twitter.com/wSokra/status/969679223278505985)
- [x] Make sure process.env.NODE_ENV is proxied correctly to `react-error-overlay`
- [x] Implicit webpack.NamedModulesPlugin in dev config as its default in webpack 4
- [x] Disable webpack performance hints as we have our own filesize reporter
- [x] Replace ExtractTextPlugin with MiniCssExtractPlugin
- [x] Switch to css whole file minification via OptimizeCSSAssetsPlugin rather than per module css minification to gain performance

* disable module concatenation

* fix cleanup

* fix optimization

* restore tmp removal

* preserve

* fix css tests

* fix test run

* fix svg test

* revert tmp dir

* fix import

* fix import

* help debugging

* fix tests

* fix sass test

* restore cleanup
2018-05-20 18:25:57 +01:00
Jack Zhao
c2aa1632e6 Fix e2e:docker script (#4454)
* verdaccio configs

* verdaccio configs

* fix typo

* revert e2e-installs

* move config to tasks
2018-05-14 01:05:16 +01:00
Mikhail Osher
da4a87f638 Support package distribution tags (#4350)
* Support package distribution tags (#4348)

* Remove redundand variable check in `getInstallPackage`

* Simplify react-scripts version using `--scripts-version=@tagname` notation

* Add dist-tag tests to e2e-installs
2018-04-27 08:45:18 -04:00
Brian Muenzenmeyer
cf6caf46ef Fix typo in e2e-simple.sh comment (#4323) 2018-04-19 14:39:32 -04:00
Ro Savage
b2fd8db8bd Minor fixes to CI (#4193) 2018-03-21 14:55:35 -04: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
maciej-ka
476fe85164 Remove trailing spaces from copyright 2018-01-28 23:36:23 +01:00