From 66e5feb28ca5129f5fb8186b9c7df49dd3600357 Mon Sep 17 00:00:00 2001 From: Christian Linne Date: Tue, 15 May 2018 08:09:55 +0200 Subject: [PATCH 1/6] Update migration instructions for 2.16.0 Closes https://github.com/wmonk/create-react-app-typescript/issues/322 --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index ebaaa7917..2300fc11d 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,10 @@ npm start In general, most upgrades won't require any migration steps to work, but if you experience problems after an upgrade, please file an issue, and we'll add it to the list of migration steps below. +### From `<2.16.0` to `>=2.16.0` + +Since `2.16.0`, the template uses different `tsconfig` files for both development and production mode. For the latter, unfortunately, the path resolver is not smart enough to fall back to the basic `tsconfig.json` in case the expected `tsconfig.prod.json` is not present, so you have to create this file manually like shown [here](https://github.com/wmonk/create-react-app-typescript/blob/master/packages/react-scripts/template/tsconfig.prod.json). + ### From `<2.13.0` to `>=2.13.0` Since `2.13.0`, `typescript` is listed as a peer dependency of `react-scripts-ts`. For projects generated with at least this version, the init script takes care of properly installing it as dev dependency to the generated projects. Older projects require manual installation, in case you have not already done that. From 7d6e77c169395bda3227f4d71ddc7f016cfb2631 Mon Sep 17 00:00:00 2001 From: DorianGrey Date: Wed, 2 May 2018 10:49:18 +0200 Subject: [PATCH 2/6] Travis build/e2e-kitchensink: Outstanding behavior fixes... --- tasks/e2e-kitchensink.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tasks/e2e-kitchensink.sh b/tasks/e2e-kitchensink.sh index 1aa55a907..9a3f895a5 100755 --- a/tasks/e2e-kitchensink.sh +++ b/tasks/e2e-kitchensink.sh @@ -160,7 +160,10 @@ E2E_FILE=./build/index.html \ # ****************************************************************************** # Eject... -echo yes | npm run eject +echo yes | yarn eject + +# Ensure all packages are installed properly. +yarn # Link to test module npm link "$temp_module_path/node_modules/test-integrity" From 29c8b001615e579a07248e6f6df9d0e9b02d08a8 Mon Sep 17 00:00:00 2001 From: Alexandru-Dan Pop Date: Tue, 12 Jun 2018 11:55:19 +0300 Subject: [PATCH 3/6] exclude coverage from tslint.json --- packages/react-scripts/template/tslint.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/react-scripts/template/tslint.json b/packages/react-scripts/template/tslint.json index 67823d8e1..bfdc862cf 100644 --- a/packages/react-scripts/template/tslint.json +++ b/packages/react-scripts/template/tslint.json @@ -3,7 +3,8 @@ "linterOptions": { "exclude": [ "config/**/*.js", - "node_modules/**/*.ts" + "node_modules/**/*.ts", + "coverage/lcov-report/*.js" ] } } From c27879b6f810d370450a1530ef9e46948e936d07 Mon Sep 17 00:00:00 2001 From: DorianGrey Date: Tue, 15 May 2018 12:30:11 +0200 Subject: [PATCH 4/6] Use correct tsconfig file for TsconfigPathsPlugin --- packages/react-scripts/config/webpack.config.prod.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/react-scripts/config/webpack.config.prod.js b/packages/react-scripts/config/webpack.config.prod.js index c267bf011..7cb33afd0 100644 --- a/packages/react-scripts/config/webpack.config.prod.js +++ b/packages/react-scripts/config/webpack.config.prod.js @@ -131,7 +131,7 @@ module.exports = { // please link the files into your node_modules/ and let module-resolution kick in. // Make sure your source files are compiled, as they will not be processed in any way. new ModuleScopePlugin(paths.appSrc, [paths.appPackageJson]), - new TsconfigPathsPlugin({ configFile: paths.appTsConfig }), + new TsconfigPathsPlugin({ configFile: paths.appTsProdConfig }), ], }, module: { @@ -183,7 +183,7 @@ module.exports = { options: { // disable type checker - we will use it in fork plugin transpileOnly: true, - configFile: paths.appTsProdConfig + configFile: paths.appTsProdConfig, }, }, ], @@ -333,7 +333,7 @@ module.exports = { // Enable file caching cache: true, sourceMap: shouldUseSourceMap, - }), // Note: this won't work without ExtractTextPlugin.extract(..) in `loaders`. + }), // Note: this won't work without ExtractTextPlugin.extract(..) in `loaders`. new ExtractTextPlugin({ filename: cssFilename, }), From 6edb4ffd490cbc5b8c1167fb0a4824c27bad2df8 Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 25 Jun 2018 16:25:50 -0700 Subject: [PATCH 5/6] Resolve merge conflict --- packages/react-scripts/template/README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/react-scripts/template/README.md b/packages/react-scripts/template/README.md index c773d2435..d5b4fc98a 100644 --- a/packages/react-scripts/template/README.md +++ b/packages/react-scripts/template/README.md @@ -2217,9 +2217,6 @@ GitHub Pages doesn’t support routers that use the HTML5 `pushState` history AP * You could switch from using HTML5 history API to routing with hashes. If you use React Router, you can switch to `hashHistory` for this effect, but the URL will be longer and more verbose (for example, `http://user.github.io/todomvc/#/todos/42?_k=yknaj`). [Read more](https://reacttraining.com/react-router/web/api/Router) about different history implementations in React Router. * Alternatively, you can use a trick to teach GitHub Pages to handle 404 by redirecting to your `index.html` page with a special redirect parameter. You would need to add a `404.html` file with the redirection code to the `build` folder before deploying your project, and you’ll need to add code handling the redirect parameter to `index.html`. You can find a detailed explanation of this technique [in this guide](https://github.com/rafrex/spa-github-pages). -<<<<<<< HEAD -### Heroku -======= #### Troubleshooting ##### "/dev/tty: No such a device or address" @@ -2231,7 +2228,6 @@ If, when deploying, you get `/dev/tty: No such a device or address` or a similar 3. Try `npm run deploy again` ### [Heroku](https://www.heroku.com/) ->>>>>>> dfbc71ce2ae07547a8544cce14a1a23fac99e071 Use the [Heroku Buildpack for Create React App](https://github.com/mars/create-react-app-buildpack).
You can find instructions in [Deploying React with Zero Configuration](https://blog.heroku.com/deploying-react-with-zero-configuration). From 26e43db88161ae51b1d630cbb795abeb67698535 Mon Sep 17 00:00:00 2001 From: Aurelien Giraud Date: Thu, 28 Jun 2018 13:53:17 +0200 Subject: [PATCH 6/6] fix: do not add ESLint config to ejected app Otherwise we get: `Error while running ESLint: Cannot find module 'eslint-config-react-app'` --- packages/react-scripts/scripts/eject.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/packages/react-scripts/scripts/eject.js b/packages/react-scripts/scripts/eject.js index 59f385a7f..d4339eb16 100644 --- a/packages/react-scripts/scripts/eject.js +++ b/packages/react-scripts/scripts/eject.js @@ -208,12 +208,6 @@ inquirer presets: ['react-app'], }; - // Add ESlint config - console.log(` Adding ${cyan('ESLint')} configuration`); - appPackage.eslintConfig = { - extends: 'react-app', - }; - fs.writeFileSync( path.join(appPath, 'package.json'), JSON.stringify(appPackage, null, 2) + '\n'