From b0b5c3c236abb67ec4027da324fa121c57dc7ef1 Mon Sep 17 00:00:00 2001 From: Julien Lengrand-Lambert Date: Thu, 8 Oct 2020 23:58:45 +0200 Subject: [PATCH 01/15] feat: update chalk to 4.1.0 closes #322 closes #322 --- package.json | 2 +- scripts/utils/formatElmCompilerErrors.js | 8 ++++---- tests/elm-app.eject.spec.js | 11 ++++++----- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 1d0fda30..a8027ff4 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "babel-loader": "8.1.0", "babel-runtime": "6.26.0", "case-sensitive-paths-webpack-plugin": "2.3.0", - "chalk": "2.4.2", + "chalk": "4.1.0", "cli-table": "0.3.1", "connect-history-api-fallback": "1.6.0", "copy-webpack-plugin": "5.1.2", diff --git a/scripts/utils/formatElmCompilerErrors.js b/scripts/utils/formatElmCompilerErrors.js index f936975a..6eb7db5e 100644 --- a/scripts/utils/formatElmCompilerErrors.js +++ b/scripts/utils/formatElmCompilerErrors.js @@ -1,7 +1,7 @@ 'use strict'; var chalk = require('chalk'); -var ctx = new chalk.constructor({ enabled: true }); +var ctx = new chalk.Instance({ enabled: true }); var error = ctx.bold.red; var filename = ctx.cyan; var isBrowser = typeof window === 'object'; @@ -28,7 +28,7 @@ module.exports = function formatElmCompilerErrors(messages) { return errors.length > 0 ? { errors: errors - .map(x => + .map((x) => x .replace(/(--\s[A-Z\s]+-+\s.*\.elm\r?\n)/g, filename('$1')) .replace(/(\n\s*)(\^+)/g, '$1' + error('$2')) @@ -36,8 +36,8 @@ module.exports = function formatElmCompilerErrors(messages) { ) .map(stripRedundantInfo) // drop errors that only contain whitespace - .filter(err => err.trim()), - warnings: warnings + .filter((err) => err.trim()), + warnings: warnings, } : messages; }; diff --git a/tests/elm-app.eject.spec.js b/tests/elm-app.eject.spec.js index 8da6ecac..89f98d0a 100644 --- a/tests/elm-app.eject.spec.js +++ b/tests/elm-app.eject.spec.js @@ -12,10 +12,10 @@ const testAppDir = path.join(rootDir, testAppName); const createElmAppCmd = path.join(rootDir, 'bin/create-elm-app-cli.js'); const elmAppCmd = path.join(rootDir, 'bin/elm-app-cli.js'); -describe('Ejecting Elm application. (Please wait...)', function() { +describe('Ejecting Elm application. (Please wait...)', function () { this.timeout(60000); - before(done => { + before((done) => { const { status } = spawn.sync('node', [createElmAppCmd, testAppName]); if (status === 0) { process.chdir(testAppDir); @@ -33,7 +33,7 @@ describe('Ejecting Elm application. (Please wait...)', function() { it(`'elm-app eject' should succeed in '${testAppName}'`, () => { const { status, output } = spawn.sync('node', [elmAppCmd, 'eject']); const outputString = output - .map(out => (out !== null ? out.toString() : '')) + .map((out) => (out !== null ? out.toString() : '')) .join(''); expect(status, 'to be', 0); @@ -50,7 +50,7 @@ describe('Ejecting Elm application. (Please wait...)', function() { start: 'node scripts/start.js', make: 'elm make', repl: 'elm repl', - reactor: 'elm reactor' + reactor: 'elm reactor', }); }); @@ -77,9 +77,10 @@ describe('Ejecting Elm application. (Please wait...)', function() { it('It should be possible to build ejected application, using npm scripts', () => { const { status, output } = spawn.sync('npm', ['run', 'build']); const outputString = output - .map(out => (out !== null ? out.toString() : '')) + .map((out) => (out !== null ? out.toString() : '')) .join(''); + console.log(outputString); expect(status, 'to be', 0); expect(outputString, 'to contain', 'Compiled successfully'); }).timeout(5 * 60 * 1000); From b7debd14b436f3d4cdd7721085730179943310bd Mon Sep 17 00:00:00 2001 From: Julien Lengrand-Lambert Date: Fri, 9 Oct 2020 00:13:49 +0200 Subject: [PATCH 02/15] feat: update cosmiconfig to 7.0.0 --- CONTRIBUTING.md | 9 +++++++++ config/paths.js | 14 +++++++------- package.json | 2 +- tests/elm-app.eject.spec.js | 1 - 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9121ea4a..0265fd0d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,6 +16,15 @@ Following these guidelines helps to communicate that you respect the time of the 3. Run `npm link` in the root `create-elm-app` folder to install local module globally. +## Running tests + +You can run tests by running `$npm run test`. + +If you run into failures while ugrading dependencies, running `$npm run app:build` will allow you to check the build faster. + +_NOTE: Functional tests may take a while to run because they interact with your system_. + + ## Submitting a Pull Request When you have a local copy of the project up and running, create a new branch with a name, such as `patch-1` diff --git a/config/paths.js b/config/paths.js index d1a0508f..a8c14c0d 100644 --- a/config/paths.js +++ b/config/paths.js @@ -3,19 +3,19 @@ const path = require('path'); const fs = require('fs'); const url = require('url'); -const cosmiconfig = require('cosmiconfig'); +const { cosmiconfigSync } = require('cosmiconfig'); // Make sure any symlinks in the project folder are resolved: // https://github.com/facebookincubator/create-react-app/issues/637 const appDirectory = fs.realpathSync(process.cwd()); -const resolveApp = relativePath => path.resolve(appDirectory, relativePath); +const resolveApp = (relativePath) => path.resolve(appDirectory, relativePath); // We look for configration in files supported by cosmiconfig by default: // https://github.com/davidtheclark/cosmiconfig -const explorer = cosmiconfig('elmapp'); -const result = explorer.searchSync(appDirectory); +const explorerSync = cosmiconfigSync('elmapp'); +const result = explorerSync.search(appDirectory); const config = result ? result.config : loadElmJson(); -const id = x => x; +const id = (x) => x; const configureWebpack = typeof config.configureWebpack === 'function' ? config.configureWebpack : id; @@ -46,7 +46,7 @@ function ensureSlash(path, needsSlash) { return path; } -const getPublicUrl = appConfig => { +const getPublicUrl = (appConfig) => { if (envPublicUrl) { return envPublicUrl; } @@ -81,5 +81,5 @@ module.exports = { servedPath: getServedPath(config), proxy: config.proxy, setupProxy: config.setupProxy, - configureWebpack + configureWebpack, }; diff --git a/package.json b/package.json index a8027ff4..3b1c605c 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "cli-table": "0.3.1", "connect-history-api-fallback": "1.6.0", "copy-webpack-plugin": "5.1.2", - "cosmiconfig": "5.2.1", + "cosmiconfig": "7.0.0", "cross-spawn": "7.0.3", "css-loader": "4.3.0", "dotenv": "8.2.0", diff --git a/tests/elm-app.eject.spec.js b/tests/elm-app.eject.spec.js index 89f98d0a..611d2c63 100644 --- a/tests/elm-app.eject.spec.js +++ b/tests/elm-app.eject.spec.js @@ -80,7 +80,6 @@ describe('Ejecting Elm application. (Please wait...)', function () { .map((out) => (out !== null ? out.toString() : '')) .join(''); - console.log(outputString); expect(status, 'to be', 0); expect(outputString, 'to contain', 'Compiled successfully'); }).timeout(5 * 60 * 1000); From a507cc45de12b781e1a68fefc236945bafb3d251 Mon Sep 17 00:00:00 2001 From: Julien Lengrand-Lambert Date: Fri, 9 Oct 2020 00:23:42 +0200 Subject: [PATCH 03/15] feat: update uglifyjs-webpack-plugin to 2.2.0 closes #454 --- config/webpack.config.prod.js | 5 +---- package.json | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index 1c57250e..8c7da74a 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -61,13 +61,13 @@ module.exports = { minimizer: [ new UglifyJsPlugin({ uglifyOptions: { + warnings: false, // ES5 is required in the minified code if you want compatibility with IE11, // otherwise you can bump it up to ES8 ecma: 5, // Compression settings mostly based on compress: { passes: 2, - warnings: false, // Disabled because of an issue with Uglify breaking seemingly valid code: // https://github.com/facebook/create-react-app/issues/2376 // Pending further investigation: @@ -96,9 +96,6 @@ module.exports = { 'F9', ], }, - mangle: { - safari10: true, - }, output: { comments: false, // Turned on because emoji and regex is not minified properly using default diff --git a/package.json b/package.json index 3b1c605c..799d9ecd 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "string-replace-loader": "2.3.0", "strip-ansi": "6.0.0", "style-loader": "1.2.1", - "uglifyjs-webpack-plugin": "1.3.0", + "uglifyjs-webpack-plugin": "2.2.0", "url-loader": "4.1.0", "webpack": "4.44.2", "webpack-dev-server": "3.11.0", From 6aaac1713a62b39528dd84dbd59e53b7dd03c795 Mon Sep 17 00:00:00 2001 From: Julien Lengrand-Lambert Date: Fri, 9 Oct 2020 00:35:13 +0200 Subject: [PATCH 04/15] feat: upgrade copy-webpack-plugin to 6.2.0 --- config/webpack.config.prod.js | 4 +++- package.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index 1e34401b..35c19e38 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -342,7 +342,9 @@ module.exports = { publicPath: publicPath, }), // Copies the public folder to the build folder - new CopyPlugin([{ from: './public/', to: './' }]), + new CopyPlugin({ + patterns: [{ from: './public/', to: './' }], + }), // Generate a service worker script that will precache, and keep up to date, // the HTML & assets that are part of the Webpack build. new workboxPlugin.GenerateSW({ diff --git a/package.json b/package.json index 675ec3f2..da978775 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "chalk": "4.1.0", "cli-table": "0.3.1", "connect-history-api-fallback": "1.6.0", - "copy-webpack-plugin": "5.1.2", + "copy-webpack-plugin": "6.2.0", "cosmiconfig": "7.0.0", "cross-spawn": "7.0.3", "css-loader": "4.3.0", From db22f69765a25fc5b8ccd95e142ff6f422764d26 Mon Sep 17 00:00:00 2001 From: Julien Lengrand-Lambert Date: Fri, 9 Oct 2020 00:43:15 +0200 Subject: [PATCH 05/15] feat: upgrade elm-webpack-loader to 7.0.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index da978775..4a8e8a01 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "elm-asset-webpack-loader": "1.1.2", "elm-hot-webpack-loader": "1.1.7", "elm-test": "latest-0.19.1", - "elm-webpack-loader": "6.0.1", + "elm-webpack-loader": "7.0.1", "file-loader": "6.1.0", "fs-extra": "6.0.1", "html-webpack-plugin": "4.5.0", From f19d286f48f8f9faa8a5be4e81291c0d949f09f8 Mon Sep 17 00:00:00 2001 From: Julien Lengrand-Lambert Date: Fri, 9 Oct 2020 00:46:58 +0200 Subject: [PATCH 06/15] feat: upgrade socks-client to 1.5.0 closes #507 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4a8e8a01..a360ec57 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "prompt": "1.0.0", "react-dev-utils": "6.1.1", "react-error-overlay": "4.0.1", - "sockjs-client": "1.4.0", + "sockjs-client": "1.5.0", "string-replace-loader": "2.3.0", "strip-ansi": "6.0.0", "style-loader": "1.2.1", From fd96c212b42615669c94c5ea48a954729d550416 Mon Sep 17 00:00:00 2001 From: Julien Lengrand-Lambert Date: Fri, 9 Oct 2020 00:47:59 +0200 Subject: [PATCH 07/15] feat: upgrade optimize-css-assets-webpack-plugin to 5.0.4 closes #506 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a360ec57..8018a1c0 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "mini-css-extract-plugin": "0.12.0", "minimist": "1.2.5", "object-assign": "4.1.1", - "optimize-css-assets-webpack-plugin": "5.0.3", + "optimize-css-assets-webpack-plugin": "5.0.4", "postcss-flexbugs-fixes": "4.2.1", "postcss-loader": "4.0.3", "postcss-safe-parser": "5.0.2", From 8d69e2988c17df92a9e1b5f55e899cdd274e2ceb Mon Sep 17 00:00:00 2001 From: Julien Lengrand-Lambert Date: Fri, 9 Oct 2020 00:49:33 +0200 Subject: [PATCH 08/15] feat: upgrade assets-webpack-plugin to 5.1.2 closes #473 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8018a1c0..955eb8a2 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "@babel/plugin-transform-runtime": "7.11.5", "@babel/preset-env": "7.11.5", "@babel/runtime": "7.11.2", - "assets-webpack-plugin": "3.9.12", + "assets-webpack-plugin": "5.1.2", "autoprefixer": "10.0.1", "babel-loader": "8.1.0", "babel-runtime": "6.26.0", From 62ae8109581686d6d238dba2a9246e2a125af817 Mon Sep 17 00:00:00 2001 From: Julien Lengrand-Lambert Date: Fri, 9 Oct 2020 00:50:41 +0200 Subject: [PATCH 09/15] feat: upgrade workbox-webpack-plugin to 5.1.4 closes #457 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 955eb8a2..3c35854e 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "webpack-dev-server": "3.11.0", "webpack-manifest-plugin": "2.2.0", "whatwg-fetch": "3.4.1", - "workbox-webpack-plugin": "4.3.1" + "workbox-webpack-plugin": "5.1.4" }, "devDependencies": { "@commitlint/cli": "11.0.0", From 93a3318e85ef787635beefe8e9660e6779dcb0eb Mon Sep 17 00:00:00 2001 From: Julien Lengrand-Lambert Date: Fri, 9 Oct 2020 00:51:53 +0200 Subject: [PATCH 10/15] feat: upgrades react-error-overlay to 6.0.7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3c35854e..ff30e856 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "promise": "8.1.0", "prompt": "1.0.0", "react-dev-utils": "6.1.1", - "react-error-overlay": "4.0.1", + "react-error-overlay": "6.0.7", "sockjs-client": "1.5.0", "string-replace-loader": "2.3.0", "strip-ansi": "6.0.0", From 874e425839e1d0b7bbdfbdb7a31e0d4c627f596c Mon Sep 17 00:00:00 2001 From: Julien Lengrand-Lambert Date: Fri, 9 Oct 2020 00:53:00 +0200 Subject: [PATCH 11/15] feat: upgrades http-proxy-middleware to 1.0.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ff30e856..0bb628a9 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "file-loader": "6.1.0", "fs-extra": "6.0.1", "html-webpack-plugin": "4.5.0", - "http-proxy-middleware": "0.21.0", + "http-proxy-middleware": "1.0.5", "mini-css-extract-plugin": "0.12.0", "minimist": "1.2.5", "object-assign": "4.1.1", From 52578bb47f4e84d3b697d450da514fbcca215f76 Mon Sep 17 00:00:00 2001 From: Julien Lengrand-Lambert Date: Fri, 9 Oct 2020 00:53:56 +0200 Subject: [PATCH 12/15] feat: upgrades fs-extra to 9.0.1 Closes #421 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0bb628a9..524b98c9 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "elm-test": "latest-0.19.1", "elm-webpack-loader": "7.0.1", "file-loader": "6.1.0", - "fs-extra": "6.0.1", + "fs-extra": "9.0.1", "html-webpack-plugin": "4.5.0", "http-proxy-middleware": "1.0.5", "mini-css-extract-plugin": "0.12.0", From 2812c64ad51b5f0f6733f9ea89ef6fcc1398d0a3 Mon Sep 17 00:00:00 2001 From: Julien Lengrand-Lambert Date: Fri, 9 Oct 2020 00:54:53 +0200 Subject: [PATCH 13/15] feat: upgrades react-dev-utils to 10.2.1 closes #404 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 524b98c9..cf53e4d1 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "postcss-safe-parser": "5.0.2", "promise": "8.1.0", "prompt": "1.0.0", - "react-dev-utils": "6.1.1", + "react-dev-utils": "10.2.1", "react-error-overlay": "6.0.7", "sockjs-client": "1.5.0", "string-replace-loader": "2.3.0", From f7dcae2a983bd42c5bb2ffeeb1cb9bf520c7e8bf Mon Sep 17 00:00:00 2001 From: Julien Lengrand-Lambert Date: Fri, 9 Oct 2020 01:05:26 +0200 Subject: [PATCH 14/15] ci: just trigger CI again --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index cf53e4d1..67684c54 100644 --- a/package.json +++ b/package.json @@ -141,3 +141,4 @@ } } } + From 86634e4bcde07ed5232116729e594a3e382bf5a5 Mon Sep 17 00:00:00 2001 From: Julien Lengrand-Lambert Date: Tue, 27 Oct 2020 09:16:05 +0100 Subject: [PATCH 15/15] chore: revert react-dev-utils --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 85508297..1a2b1376 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "postcss-safe-parser": "5.0.2", "promise": "8.1.0", "prompt": "1.0.0", - "react-dev-utils": "10.2.1", + "react-dev-utils": "6.1.1", "react-error-overlay": "6.0.7", "sockjs-client": "1.5.0", "string-replace-loader": "2.3.0",