From 7280900965fd622c09537e9add39982694412be6 Mon Sep 17 00:00:00 2001 From: Christian Wesselhoeft Date: Thu, 10 May 2018 13:54:04 -0600 Subject: [PATCH 01/42] Update for Elm 0.19 --- .editorconfig | 2 +- README.md | 4 +- config/paths.js | 8 +- config/webpack.config.dev.js | 3 +- config/webpack.config.prod.js | 2 +- package.json | 4 +- scripts/build.js | 2 +- scripts/eject.js | 9 +- scripts/start.js | 2 +- template/elm-package.json | 15 -- template/elm.json | 18 +++ tests/elm-app.eject.spec.js | 9 +- yarn.lock | 272 +++++++++++++++++++++++++++++----- 13 files changed, 271 insertions(+), 79 deletions(-) delete mode 100644 template/elm-package.json create mode 100644 template/elm.json diff --git a/.editorconfig b/.editorconfig index b4ac983e..b21a5918 100644 --- a/.editorconfig +++ b/.editorconfig @@ -12,7 +12,7 @@ trim_trailing_whitespace = true [*.html] indent_size = 4 -[elm-package.json] +[elm.json] indent_size = 4 [*.md] diff --git a/README.md b/README.md index 5e51ebc1..11a625fa 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ Create a new `my-app` folder with files for your future project. my-app/ ├── .gitignore ├── README.md -├── elm-package.json +├── elm.json ├── elm-stuff ├── public │ ├── favicon.ico @@ -65,7 +65,7 @@ my-app/ │ └── registerServiceWorker.js └── tests ├── Tests.elm - └── elm-package.json + └── elm.json ``` You are ready to employ the full power of Create Elm App! diff --git a/config/paths.js b/config/paths.js index 83c8ba63..c8962f85 100644 --- a/config/paths.js +++ b/config/paths.js @@ -46,8 +46,8 @@ module.exports = { dotenv: resolveApp('./.env'), entry: resolveApp('./src/index.js'), appBuild: resolveApp('./build'), - elmPackageJson: resolveApp('./elm-package.json'), - elmMake: require('elm/platform').executablePaths['elm-make'], - publicUrl: getPublicUrl(resolveApp('elm-package.json')), - servedPath: getServedPath(resolveApp('elm-package.json')) + elmPackageJson: resolveApp('./elm.json'), + elm: '/usr/local/bin/elm', + publicUrl: getPublicUrl(resolveApp('elm.json')), + servedPath: getServedPath(resolveApp('elm.json')) }; diff --git a/config/webpack.config.dev.js b/config/webpack.config.dev.js index 81751808..f6e9be64 100644 --- a/config/webpack.config.dev.js +++ b/config/webpack.config.dev.js @@ -130,11 +130,10 @@ module.exports = { loader: require.resolve('elm-webpack-loader'), options: { verbose: true, - warn: true, // If ELM_DEBUGGER was set to "false", disable it. Otherwise // for invalid values, "true" and as a default, enable it debug: process.env.ELM_DEBUGGER === 'false' ? false : true, - pathToMake: paths.elmMake, + pathToElm: paths.elm, forceWatch: true } } diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index 7ba710e4..10fd8b5c 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -153,7 +153,7 @@ module.exports = { // If ELM_DEBUGGER was set to "true", enable it. Otherwise // for invalid values, "false" and as a default, disable it debug: process.env.ELM_DEBUGGER === 'true' ? true : false, - pathToMake: paths.elmMake + pathToElm: paths.elm } } ] diff --git a/package.json b/package.json index d7529d2e..c4e8d1e0 100644 --- a/package.json +++ b/package.json @@ -34,8 +34,8 @@ "dotenv": "^5.0.0", "elm": "^0.18.0", "elm-hot-loader": "0.5.4", - "elm-test": "^0.18.12", - "elm-webpack-loader": "^4.4.0", + "elm-test": "^0.19.0-beta4", + "elm-webpack-loader": "https://github.com/xtian/elm-webpack-loader.git#0.19", "extract-text-webpack-plugin": "^3.0.2", "file-loader": "^1.1.6", "fs-extra": "^5.0.0", diff --git a/scripts/build.js b/scripts/build.js index 99aca4bb..fe248c83 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -28,7 +28,7 @@ const measureFileSizesBeforeBuild = FileSizeReporter.measureFileSizesBeforeBuild; const printFileSizesAfterBuild = FileSizeReporter.printFileSizesAfterBuild; -if (fs.existsSync('elm-package.json') === false) { +if (fs.existsSync('elm.json') === false) { console.log('Please, run the build script from project root directory'); process.exit(1); } diff --git a/scripts/eject.js b/scripts/eject.js index 2613d7ad..e5a9d94b 100644 --- a/scripts/eject.js +++ b/scripts/eject.js @@ -99,14 +99,13 @@ const devDependencies = extendOmittingProps( const scripts = { build: 'node scripts/build.js', start: 'node scripts/start.js', - package: 'elm-package', - make: 'elm-make', - repl: 'elm-repl', - reactor: 'elm-reactor', + make: 'elm make', + repl: 'elm repl', + reactor: 'elm reactor', test: 'elm-test' }; -if (fs.existsSync('elm-package.json') === false) { +if (fs.existsSync('elm.json') === false) { console.log('Please, run the eject script from project root directory'); process.exit(1); } diff --git a/scripts/start.js b/scripts/start.js index 321de433..49b52ab3 100644 --- a/scripts/start.js +++ b/scripts/start.js @@ -32,7 +32,7 @@ const createDevServerConfig = require('../config/webpackDevServer.config'); const formatElmCompilerErrors = require('./utils/formatElmCompilerErrors'); const paths = require('../config/paths'); -if (fs.existsSync('elm-package.json') === false) { +if (fs.existsSync('elm.json') === false) { console.log('Please, run the build script from project root directory'); process.exit(0); } diff --git a/template/elm-package.json b/template/elm-package.json deleted file mode 100644 index 2467e86c..00000000 --- a/template/elm-package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "version": "1.0.0", - "summary": "helpful summary of your project, less than 80 characters", - "repository": "https://github.com/user/project.git", - "license": "BSD3", - "source-directories": [ - "src" - ], - "exposed-modules": [], - "dependencies": { - "elm-lang/core": "5.0.0 <= v < 6.0.0", - "elm-lang/html": "2.0.0 <= v < 3.0.0" - }, - "elm-version": "0.18.0 <= v < 0.19.0" -} diff --git a/template/elm.json b/template/elm.json new file mode 100644 index 00000000..9417b878 --- /dev/null +++ b/template/elm.json @@ -0,0 +1,18 @@ +{ + "type": "application", + "source-directories": [ + "src" + ], + "elm-version": "0.19.0", + "dependencies": { + "elm-lang/core": "6.0.0", + "elm-lang/html": "3.0.0" + }, + "test-dependencies": {}, + "do-not-edit-this-by-hand": { + "transitive-dependencies": { + "elm-lang/json": "1.0.0", + "elm-lang/virtual-dom": "3.0.0" + } + } +} diff --git a/tests/elm-app.eject.spec.js b/tests/elm-app.eject.spec.js index 5b40fb1f..496ca92a 100644 --- a/tests/elm-app.eject.spec.js +++ b/tests/elm-app.eject.spec.js @@ -47,10 +47,9 @@ describe('Ejecting Elm application. (Please wait...)', () => { expect(pkgScripts, 'to satisfy', { build: 'node scripts/build.js', start: 'node scripts/start.js', - package: 'elm-package', - make: 'elm-make', - repl: 'elm-repl', - reactor: 'elm-reactor' + make: 'elm make', + repl: 'elm repl', + reactor: 'elm reactor' }); }); @@ -74,7 +73,7 @@ describe('Ejecting Elm application. (Please wait...)', () => { expect(same, 'to be', true); }); - it('It should be possible to build ejected applitaction, using npm scripts', () => { + 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() : '')) diff --git a/yarn.lock b/yarn.lock index cd4ffadc..84e02972 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1072,6 +1072,13 @@ binary-extensions@^1.0.0: version "1.8.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.8.0.tgz#48ec8d16df4377eae5fa5884682480af4d95c774" +binary@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/binary/-/binary-0.3.0.tgz#9f60553bc5ce8c3386f3b553cff47462adecaa79" + dependencies: + buffers "~0.1.1" + chainsaw "~0.1.0" + binstall@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/binstall/-/binstall-1.2.0.tgz#6b2c0f580b9e3c607f50ef7a22a54ce9fdc8d933" @@ -1079,6 +1086,16 @@ binstall@1.2.0: request "2.79.0" tar "2.2.1" +binwrap@^0.2.0-rc2: + version "0.2.0-rc2" + resolved "https://registry.yarnpkg.com/binwrap/-/binwrap-0.2.0-rc2.tgz#0b8c3ffee4dea1dbebe26dd6730735d414c9e877" + dependencies: + mustache "^2.3.0" + request "^2.81.0" + request-promise "^4.2.0" + tar "^2.2.1" + unzip-stream "^0.3.0" + bl@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/bl/-/bl-1.1.2.tgz#fdca871a99713aa00d19e3bbba41c44787a65398" @@ -1099,6 +1116,10 @@ bluebird@^3.4.7: version "3.5.0" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.0.tgz#791420d7f551eea2897453a8a77653f96606d67c" +bluebird@^3.5.0: + version "3.5.1" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9" + bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: version "4.11.7" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.7.tgz#ddb048e50d9482790094c13eb3fcfc833ce7ab46" @@ -1285,6 +1306,10 @@ buffer@^4.3.0: ieee754 "^1.1.4" isarray "^1.0.0" +buffers@~0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/buffers/-/buffers-0.1.1.tgz#b24579c3bed4d6d396aeee6d9a8ae7f5482ab7bb" + builtin-modules@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" @@ -1408,6 +1433,12 @@ center-align@^0.1.1: align-text "^0.1.3" lazy-cache "^1.0.3" +chainsaw@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/chainsaw/-/chainsaw-0.1.0.tgz#5eab50b28afe58074d0d58291388828b5e5fbc98" + dependencies: + traverse ">=0.3.0 <0.4" + chalk@1.1.3, chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" @@ -1465,8 +1496,8 @@ chokidar@^1.6.1, chokidar@^1.7.0: fsevents "^1.0.0" chokidar@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.0.2.tgz#4dc65139eeb2714977735b6a35d06e97b494dfd7" + version "2.0.4" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.0.4.tgz#356ff4e2b0e8e43e322d18a372460bbcf3accd26" dependencies: anymatch "^2.0.0" async-each "^1.0.0" @@ -1475,12 +1506,17 @@ chokidar@^2.0.0: inherits "^2.0.1" is-binary-path "^1.0.0" is-glob "^4.0.0" + lodash.debounce "^4.0.8" normalize-path "^2.1.1" path-is-absolute "^1.0.0" readdirp "^2.0.0" - upath "^1.0.0" + upath "^1.0.5" optionalDependencies: - fsevents "^1.0.0" + fsevents "^1.2.2" + +chownr@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.0.1.tgz#e2a75042a9551908bebd25b8523d5f9769d79181" ci-info@^1.0.0: version "1.0.0" @@ -2096,7 +2132,7 @@ debug@2.6.8, debug@^2.2.0, debug@^2.6.0, debug@^2.6.6, debug@^2.6.8: dependencies: ms "2.0.0" -debug@2.6.9, debug@^2.1.3, debug@^2.3.3: +debug@2.6.9, debug@^2.1.2, debug@^2.1.3, debug@^2.3.3: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" dependencies: @@ -2134,6 +2170,10 @@ deep-equal@~0.2.1: version "0.2.2" resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-0.2.2.tgz#84b745896f34c684e98f2ce0e42abaf43bba017d" +deep-extend@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + deep-extend@~0.4.0: version "0.4.2" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.2.tgz#48b699c27e334bf89f10892be432f6e4c7d34a7f" @@ -2248,6 +2288,10 @@ detect-indent@4.0.0, detect-indent@^4.0.0: dependencies: repeating "^2.0.0" +detect-libc@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + detect-node@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.0.3.tgz#a2033c09cc8e158d37748fbde7507832bd6ce127" @@ -2439,14 +2483,15 @@ elm-hot-loader@0.5.4: dependencies: loader-utils "^0.2.12" -elm-test@^0.18.12: - version "0.18.12" - resolved "https://registry.yarnpkg.com/elm-test/-/elm-test-0.18.12.tgz#8586a056980eb383fd35ad2ef2b74a6ee4c410f7" +elm-test@^0.19.0-beta4: + version "0.19.0-beta4" + resolved "https://registry.yarnpkg.com/elm-test/-/elm-test-0.19.0-beta4.tgz#37eb3db57372ff6bd5949e911146ec5a6d1a52c9" dependencies: binstall "1.2.0" chalk "2.1.0" chokidar "1.6.0" cross-spawn "4.0.0" + elmi-to-json "0.19.0-rc3" find-parent-dir "^0.3.0" firstline "1.2.1" fs-extra "0.30.0" @@ -2454,21 +2499,21 @@ elm-test@^0.18.12: lodash "4.13.1" minimist "^1.2.0" murmur-hash-js "1.0.0" - node-elm-compiler "4.3.3" + node-elm-compiler "5.0.0-alpha1" split "^1.0.1" supports-color "4.2.0" xmlbuilder "^8.2.2" optionalDependencies: fsevents "1.1.2" -elm-webpack-loader@^4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/elm-webpack-loader/-/elm-webpack-loader-4.4.0.tgz#dd7a3b628b7abc4fac38e3045d3ab6e57187e9b6" +"elm-webpack-loader@https://github.com/xtian/elm-webpack-loader.git#0.19": + version "4.3.1" + resolved "https://github.com/xtian/elm-webpack-loader.git#f116fec3c7519c44a38b01c1368925d04df9fe8b" dependencies: elm "^0.18.0" glob "^7.1.1" loader-utils "^1.0.2" - node-elm-compiler "^4.2.1" + node-elm-compiler "^5.0.0-alpha1" yargs "^6.5.0" elm@^0.18.0: @@ -2480,6 +2525,12 @@ elm@^0.18.0: request "2.74.0" tar "2.2.1" +elmi-to-json@0.19.0-rc3: + version "0.19.0-rc3" + resolved "https://registry.yarnpkg.com/elmi-to-json/-/elmi-to-json-0.19.0-rc3.tgz#bd69161dd38db6002c01cf2f230050ae75df48b3" + dependencies: + binwrap "^0.2.0-rc2" + emojis-list@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" @@ -3203,6 +3254,12 @@ fs-extra@^5.0.0: jsonfile "^4.0.0" universalify "^0.1.0" +fs-minipass@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" + dependencies: + minipass "^2.2.1" + fs-readdir-recursive@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.0.0.tgz#8cd1745c8b4f8a29c8caec392476921ba195f560" @@ -3218,6 +3275,13 @@ fsevents@1.1.2, fsevents@^1.0.0: nan "^2.3.0" node-pre-gyp "^0.6.36" +fsevents@^1.2.2: + version "1.2.4" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.4.tgz#f41dcb1af2582af3692da36fc55cbd8e1041c426" + dependencies: + nan "^2.9.2" + node-pre-gyp "^0.10.0" + fstream-ignore@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/fstream-ignore/-/fstream-ignore-1.0.5.tgz#9c31dae34767018fe1d249b24dada67d092da105" @@ -3746,6 +3810,12 @@ iconv-lite@^0.4.17: version "0.4.18" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.18.tgz#23d8656b16aae6742ac29732ea8f0336a4789cf2" +iconv-lite@^0.4.4: + version "0.4.23" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" + dependencies: + safer-buffer ">= 2.1.2 < 3" + icss-replace-symbols@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/icss-replace-symbols/-/icss-replace-symbols-1.1.0.tgz#06ea6f83679a7749e386cfe1fe812ae5db223ded" @@ -3760,6 +3830,12 @@ ieee754@^1.1.4: version "1.1.8" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4" +ignore-walk@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" + dependencies: + minimatch "^3.0.4" + ignore@^3.3.3: version "3.3.3" resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.3.tgz#432352e57accd87ab3110e82d3fea0e47812156d" @@ -4531,14 +4607,14 @@ lodash.camelcase@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" +lodash.debounce@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" + lodash.defaults@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-4.2.0.tgz#d09178716ffea4dde9e5fb7b37f6f0802274580c" -lodash.endswith@^4.2.1: - version "4.2.1" - resolved "https://registry.yarnpkg.com/lodash.endswith/-/lodash.endswith-4.2.1.tgz#fed59ac1738ed3e236edd7064ec456448b37bc09" - lodash.isarguments@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" @@ -4547,10 +4623,6 @@ lodash.isarray@^3.0.0: version "3.0.4" resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55" -lodash.isfunction@^3.0.8: - version "3.0.9" - resolved "https://registry.yarnpkg.com/lodash.isfunction/-/lodash.isfunction-3.0.9.tgz#06de25df4db327ac931981d1bdb067e5af68d051" - lodash.isplainobject@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-3.2.0.tgz#9a8238ae16b200432960cd7346512d0123fbf4c5" @@ -4559,10 +4631,6 @@ lodash.isplainobject@^3.0.0: lodash.isarguments "^3.0.0" lodash.keysin "^3.0.0" -lodash.isstring@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451" - lodash.istypedarray@^3.0.0: version "3.0.6" resolved "https://registry.yarnpkg.com/lodash.istypedarray/-/lodash.istypedarray-3.0.6.tgz#c9a477498607501d8e8494d283b87c39281cef62" @@ -4610,10 +4678,6 @@ lodash.restparam@^3.0.0: version "3.6.1" resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805" -lodash.startswith@^4.2.1: - version "4.2.1" - resolved "https://registry.yarnpkg.com/lodash.startswith/-/lodash.startswith-4.2.1.tgz#c598c4adce188a27e53145731cdc6c0e7177600c" - lodash.template@^4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.4.0.tgz#e73a0385c8355591746e020b99679c690e68fba0" @@ -4662,6 +4726,10 @@ lodash@^4, lodash@^4.0.0, lodash@^4.14.0, lodash@^4.17.2, lodash@^4.17.3, lodash version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" +lodash@^4.13.1: + version "4.17.10" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" + loglevel@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.4.1.tgz#95b383f91a3c2756fd4ab093667e4309161f2bcd" @@ -4905,6 +4973,19 @@ minimist@1.2.0, minimist@^1.1.0, minimist@^1.1.3, minimist@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" +minipass@^2.2.1, minipass@^2.3.3: + version "2.3.4" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.4.tgz#4768d7605ed6194d6d576169b9e12ef71e9d9957" + dependencies: + safe-buffer "^5.1.2" + yallist "^3.0.0" + +minizlib@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.1.0.tgz#11e13658ce46bc3a70a267aac58359d1e0c29ceb" + dependencies: + minipass "^2.2.1" + minstache@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minstache/-/minstache-1.2.0.tgz#ff1cc403ac2844f68dbf18c662129be7eb0efc41" @@ -4972,6 +5053,10 @@ murmur-hash-js@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/murmur-hash-js/-/murmur-hash-js-1.0.0.tgz#5041049269c96633c866386960b2f4289e75e5b0" +mustache@^2.3.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/mustache/-/mustache-2.3.1.tgz#ef5db3c0d11f1640e9baa47f4e65ba0c3fcd82b9" + mute-stream@0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.6.tgz#48962b19e169fd1dfc240b3f1e7317627bbc47db" @@ -4984,6 +5069,10 @@ nan@^2.3.0: version "2.6.2" resolved "https://registry.yarnpkg.com/nan/-/nan-2.6.2.tgz#e4ff34e6c95fdfb5aecc08de6596f43605a7db45" +nan@^2.9.2: + version "2.10.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f" + nanomatch@^1.2.9: version "1.2.9" resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.9.tgz#879f7150cb2dab7a471259066c104eee6e0fa7c2" @@ -5015,6 +5104,14 @@ ncp@1.0.x: version "1.0.1" resolved "https://registry.yarnpkg.com/ncp/-/ncp-1.0.1.tgz#d15367e5cb87432ba117d2bf80fdf45aecfb4246" +needle@^2.2.1: + version "2.2.2" + resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.2.tgz#1120ca4c41f2fcc6976fd28a8968afe239929418" + dependencies: + debug "^2.1.2" + iconv-lite "^0.4.4" + sax "^1.2.4" + negotiator@0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" @@ -5051,9 +5148,9 @@ no-case@^2.2.0: dependencies: lower-case "^1.1.1" -node-elm-compiler@4.3.3, node-elm-compiler@^4.2.1: - version "4.3.3" - resolved "https://registry.yarnpkg.com/node-elm-compiler/-/node-elm-compiler-4.3.3.tgz#44e48e8679876bf2f5bd8820dd15734ff3a28caf" +node-elm-compiler@5.0.0-alpha1, node-elm-compiler@^5.0.0-alpha1: + version "5.0.0-alpha1" + resolved "https://registry.yarnpkg.com/node-elm-compiler/-/node-elm-compiler-5.0.0-alpha1.tgz#ddfd35788595e5c127039975b50096188d1ae4f6" dependencies: cross-spawn "4.0.0" find-elm-dependencies "1.0.2" @@ -5098,6 +5195,21 @@ node-libs-browser@^2.0.0: util "^0.10.3" vm-browserify "0.0.4" +node-pre-gyp@^0.10.0: + version "0.10.3" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc" + dependencies: + detect-libc "^1.0.2" + mkdirp "^0.5.1" + needle "^2.2.1" + nopt "^4.0.1" + npm-packlist "^1.1.6" + npmlog "^4.0.2" + rc "^1.2.7" + rimraf "^2.6.1" + semver "^5.3.0" + tar "^4" + node-pre-gyp@^0.6.36: version "0.6.36" resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.36.tgz#db604112cb74e0d477554e9b505b17abddfab786" @@ -5159,6 +5271,10 @@ normalize-url@^1.4.0: query-string "^4.1.0" sort-keys "^1.0.0" +npm-bundled@^1.0.1: + version "1.0.5" + resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.5.tgz#3c1732b7ba936b3a10325aef616467c0ccbcc979" + npm-conf@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/npm-conf/-/npm-conf-1.1.3.tgz#256cc47bd0e218c259c4e9550bf413bc2192aff9" @@ -5175,6 +5291,13 @@ npm-conf@^1.1.3: semver "^5.1.0" validate-npm-package-name "^3.0.0" +npm-packlist@^1.1.6: + version "1.1.11" + resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.1.11.tgz#84e8c683cbe7867d34b1d357d893ce29e28a02de" + dependencies: + ignore-walk "^3.0.1" + npm-bundled "^1.0.1" + npm-registry-client@^8.5.0: version "8.5.0" resolved "https://registry.yarnpkg.com/npm-registry-client/-/npm-registry-client-8.5.0.tgz#4878fb6fa1f18a5dc08ae83acf94d0d0112d7ed0" @@ -5998,6 +6121,10 @@ pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" +psl@^1.1.24: + version "1.1.29" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.29.tgz#60f580d360170bb722a797cc704411e6da850c67" + public-encrypt@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.0.tgz#39f699f3a46560dd5ebacbca693caf7c65c18cc6" @@ -6094,6 +6221,15 @@ rc@^1.0.1, rc@^1.1.2, rc@^1.1.6, rc@^1.1.7: minimist "^1.2.0" strip-json-comments "~2.0.1" +rc@^1.2.7: + version "1.2.8" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" + dependencies: + deep-extend "^0.6.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" + react-dev-utils@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/react-dev-utils/-/react-dev-utils-5.0.0.tgz#425ac7c9c40c2603bc4f7ab8836c1406e96bb473" @@ -6378,6 +6514,21 @@ repeating@^2.0.0: dependencies: is-finite "^1.0.0" +request-promise-core@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.1.tgz#3eee00b2c5aa83239cfb04c5700da36f81cd08b6" + dependencies: + lodash "^4.13.1" + +request-promise@^4.2.0: + version "4.2.2" + resolved "https://registry.yarnpkg.com/request-promise/-/request-promise-4.2.2.tgz#d1ea46d654a6ee4f8ee6a4fea1018c22911904b4" + dependencies: + bluebird "^3.5.0" + request-promise-core "1.1.1" + stealthy-require "^1.1.0" + tough-cookie ">=2.3.3" + request@2.74.0: version "2.74.0" resolved "https://registry.yarnpkg.com/request/-/request-2.74.0.tgz#7693ca768bbb0ea5c8ce08c084a45efa05b892ab" @@ -6598,7 +6749,15 @@ safe-buffer@5.1.1, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@~5.1.0, s version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" -sax@~1.2.1: +safe-buffer@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + +"safer-buffer@>= 2.1.2 < 3": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + +sax@^1.2.4, sax@~1.2.1: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" @@ -7024,6 +7183,10 @@ static-extend@^0.1.1: version "1.3.1" resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e" +stealthy-require@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" + stream-browserify@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.1.tgz#66266ee5f9bdb9940a4e4514cafb43bb71e5c9db" @@ -7252,6 +7415,18 @@ tar@2.2.1, tar@^2.2.1: fstream "^1.0.2" inherits "2" +tar@^4: + version "4.4.6" + resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.6.tgz#63110f09c00b4e60ac8bcfe1bf3c8660235fbc9b" + dependencies: + chownr "^1.0.1" + fs-minipass "^1.2.5" + minipass "^2.3.3" + minizlib "^1.1.0" + mkdirp "^0.5.0" + safe-buffer "^5.1.2" + yallist "^3.0.2" + temp@^0.8.3: version "0.8.3" resolved "https://registry.yarnpkg.com/temp/-/temp-0.8.3.tgz#e0c6bc4d26b903124410e4fed81103014dfc1f59" @@ -7356,12 +7531,23 @@ toposort@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/toposort/-/toposort-1.0.3.tgz#f02cd8a74bd8be2fc0e98611c3bacb95a171869c" +tough-cookie@>=2.3.3: + version "2.4.3" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" + dependencies: + psl "^1.1.24" + punycode "^1.4.1" + tough-cookie@~2.3.0: version "2.3.2" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.2.tgz#f081f76e4c85720e6c37a5faced737150d84072a" dependencies: punycode "^1.4.1" +"traverse@>=0.3.0 <0.4": + version "0.3.9" + resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.3.9.tgz#717b8f220cc0bb7b44e40514c22b2e8bbc70d8b9" + traverse@~0.6.6: version "0.6.6" resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.6.6.tgz#cbdf560fd7b9af632502fed40f918c157ea97137" @@ -7509,14 +7695,16 @@ unzip-response@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-1.0.2.tgz#b984f0877fc0a89c2c773cc1ef7b5b232b5b06fe" -upath@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/upath/-/upath-1.0.2.tgz#80aaae5395abc5fd402933ae2f58694f0860204c" +unzip-stream@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/unzip-stream/-/unzip-stream-0.3.0.tgz#c30c054cd6b0d64b13a23cd3ece911eb0b2b52d8" dependencies: - lodash.endswith "^4.2.1" - lodash.isfunction "^3.0.8" - lodash.isstring "^4.0.1" - lodash.startswith "^4.2.1" + binary "^0.3.0" + mkdirp "^0.5.1" + +upath@^1.0.5: + version "1.1.0" + resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.0.tgz#35256597e46a581db4793d0ce47fa9aebfc9fabd" update-notifier@^1.0.3: version "1.0.3" @@ -7897,6 +8085,10 @@ yallist@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" +yallist@^3.0.0, yallist@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.2.tgz#8452b4bb7e83c7c188d8041c1a837c773d6d8bb9" + yargs-parser@^4.2.0: version "4.2.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-4.2.1.tgz#29cceac0dc4f03c6c87b4a9f217dd18c9f74871c" From f31fa03915d1d6a9b3bccc660b018fc0573910e3 Mon Sep 17 00:00:00 2001 From: Christian Wesselhoeft Date: Tue, 21 Aug 2018 10:06:18 -0600 Subject: [PATCH 02/42] Use Elm 0.19 from NPM --- config/paths.js | 2 +- package.json | 2 +- yarn.lock | 89 ++++++++++++++++++++++++++++++++++++++++++++----- 3 files changed, 82 insertions(+), 11 deletions(-) diff --git a/config/paths.js b/config/paths.js index c8962f85..4ac78311 100644 --- a/config/paths.js +++ b/config/paths.js @@ -47,7 +47,7 @@ module.exports = { entry: resolveApp('./src/index.js'), appBuild: resolveApp('./build'), elmPackageJson: resolveApp('./elm.json'), - elm: '/usr/local/bin/elm', + elm: require('elm/platform').executablePaths['elm'], publicUrl: getPublicUrl(resolveApp('elm.json')), servedPath: getServedPath(resolveApp('elm.json')) }; diff --git a/package.json b/package.json index c4e8d1e0..b94d7891 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "cross-spawn": "^6.0.4", "css-loader": "^0.28.9", "dotenv": "^5.0.0", - "elm": "^0.18.0", + "elm": "^0.19.0", "elm-hot-loader": "0.5.4", "elm-test": "^0.19.0-beta4", "elm-webpack-loader": "https://github.com/xtian/elm-webpack-loader.git#0.19", diff --git a/yarn.lock b/yarn.lock index 84e02972..48fc1b5f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1072,7 +1072,7 @@ binary-extensions@^1.0.0: version "1.8.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.8.0.tgz#48ec8d16df4377eae5fa5884682480af4d95c774" -binary@^0.3.0: +"binary@>= 0.3.0 < 1", binary@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/binary/-/binary-0.3.0.tgz#9f60553bc5ce8c3386f3b553cff47462adecaa79" dependencies: @@ -1086,6 +1086,15 @@ binstall@1.2.0: request "2.79.0" tar "2.2.1" +binwrap@0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/binwrap/-/binwrap-0.1.4.tgz#ca1f7870302212518fa24b07726f9c50a15c7559" + dependencies: + request "^2.81.0" + request-promise "^4.2.0" + tar "^2.2.1" + unzip "^0.1.11" + binwrap@^0.2.0-rc2: version "0.2.0-rc2" resolved "https://registry.yarnpkg.com/binwrap/-/binwrap-0.2.0-rc2.tgz#0b8c3ffee4dea1dbebe26dd6730735d414c9e877" @@ -2525,6 +2534,12 @@ elm@^0.18.0: request "2.74.0" tar "2.2.1" +elm@^0.19.0: + version "0.19.0" + resolved "https://registry.yarnpkg.com/elm/-/elm-0.19.0.tgz#c6ad86afea9e971424ebe75e36c9d03412a787fa" + dependencies: + binwrap "0.1.4" + elmi-to-json@0.19.0-rc3: version "0.19.0-rc3" resolved "https://registry.yarnpkg.com/elmi-to-json/-/elmi-to-json-0.19.0-rc3.tgz#bd69161dd38db6002c01cf2f230050ae75df48b3" @@ -3290,6 +3305,15 @@ fstream-ignore@^1.0.5: inherits "2" minimatch "^3.0.0" +"fstream@>= 0.1.30 < 1": + version "0.1.31" + resolved "https://registry.yarnpkg.com/fstream/-/fstream-0.1.31.tgz#7337f058fbbbbefa8c9f561a28cab0849202c988" + dependencies: + graceful-fs "~3.0.2" + inherits "~2.0.0" + mkdirp "0.5" + rimraf "2" + fstream@^1.0.0, fstream@^1.0.10, fstream@^1.0.2: version "1.0.11" resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171" @@ -3524,6 +3548,12 @@ graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.4, graceful-fs@^4.1.6, version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" +graceful-fs@~3.0.2: + version "3.0.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-3.0.11.tgz#7613c778a1afea62f25c630a086d7f3acbbdd818" + dependencies: + natives "^1.1.0" + "graceful-readlink@>= 1.0.0": version "1.0.1" resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" @@ -4812,6 +4842,13 @@ marked@^0.3.9: version "0.3.15" resolved "https://registry.yarnpkg.com/marked/-/marked-0.3.15.tgz#de96982e54c880962f5093a2fa93d0866bf73668" +"match-stream@>= 0.0.2 < 1": + version "0.0.2" + resolved "https://registry.yarnpkg.com/match-stream/-/match-stream-0.0.2.tgz#99eb050093b34dffade421b9ac0b410a9cfa17cf" + dependencies: + buffers "~0.1.1" + readable-stream "~1.0.0" + math-expression-evaluator@^1.2.14: version "1.2.17" resolved "https://registry.yarnpkg.com/math-expression-evaluator/-/math-expression-evaluator-1.2.17.tgz#de819fdbcd84dccd8fae59c6aeb79615b9d266ac" @@ -4999,15 +5036,15 @@ mixin-deep@^1.2.0: for-in "^1.0.2" is-extendable "^1.0.1" -mkdirp@0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.0.tgz#1d73076a6df986cd9344e15e71fcc05a4c9abf12" +mkdirp@0.5, mkdirp@0.5.1, mkdirp@0.5.x, mkdirp@0.x.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: minimist "0.0.8" -mkdirp@0.5.1, mkdirp@0.5.x, mkdirp@0.x.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" +mkdirp@0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.0.tgz#1d73076a6df986cd9344e15e71fcc05a4c9abf12" dependencies: minimist "0.0.8" @@ -5090,6 +5127,10 @@ nanomatch@^1.2.9: snapdragon "^0.8.1" to-regex "^3.0.1" +natives@^1.1.0: + version "1.1.4" + resolved "https://registry.yarnpkg.com/natives/-/natives-1.1.4.tgz#2f0f224fc9a7dd53407c7667c84cf8dbe773de58" + natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" @@ -5504,6 +5545,10 @@ output-file-sync@^1.1.2: mkdirp "^0.5.1" object-assign "^4.1.0" +"over@>= 0.0.5 < 1": + version "0.0.5" + resolved "https://registry.yarnpkg.com/over/-/over-0.0.5.tgz#f29852e70fd7e25f360e013a8ec44c82aedb5708" + p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" @@ -6135,6 +6180,15 @@ public-encrypt@^4.0.0: parse-asn1 "^5.0.0" randombytes "^2.0.1" +"pullstream@>= 0.4.1 < 1": + version "0.4.1" + resolved "https://registry.yarnpkg.com/pullstream/-/pullstream-0.4.1.tgz#d6fb3bf5aed697e831150eb1002c25a3f8ae1314" + dependencies: + over ">= 0.0.5 < 1" + readable-stream "~1.0.31" + setimmediate ">= 1.0.2 < 2" + slice-stream ">= 1.0.0 < 2" + punycode@1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" @@ -6315,7 +6369,7 @@ read@1.0.x: dependencies: mute-stream "~0.0.4" -readable-stream@1.0: +readable-stream@1.0, readable-stream@~1.0.0, readable-stream@~1.0.31: version "1.0.34" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" dependencies: @@ -6898,7 +6952,7 @@ set-value@^2.0.0: is-plain-object "^2.0.3" split-string "^3.0.1" -setimmediate@^1.0.4: +"setimmediate@>= 1.0.1 < 2", "setimmediate@>= 1.0.2 < 2", setimmediate@^1.0.4: version "1.0.5" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" @@ -6961,6 +7015,12 @@ slice-ansi@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" +"slice-stream@>= 1.0.0 < 2": + version "1.0.0" + resolved "https://registry.yarnpkg.com/slice-stream/-/slice-stream-1.0.0.tgz#5b33bd66f013b1a7f86460b03d463dec39ad3ea0" + dependencies: + readable-stream "~1.0.31" + sliced@0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/sliced/-/sliced-0.0.5.tgz#5edc044ca4eb6f7816d50ba2fc63e25d8fe4707f" @@ -7702,6 +7762,17 @@ unzip-stream@^0.3.0: binary "^0.3.0" mkdirp "^0.5.1" +unzip@^0.1.11: + version "0.1.11" + resolved "https://registry.yarnpkg.com/unzip/-/unzip-0.1.11.tgz#89749c63b058d7d90d619f86b98aa1535d3b97f0" + dependencies: + binary ">= 0.3.0 < 1" + fstream ">= 0.1.30 < 1" + match-stream ">= 0.0.2 < 1" + pullstream ">= 0.4.1 < 1" + readable-stream "~1.0.31" + setimmediate ">= 1.0.1 < 2" + upath@^1.0.5: version "1.1.0" resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.0.tgz#35256597e46a581db4793d0ce47fa9aebfc9fabd" From 0744dce56f46ae2750b01b3840a4d3d2c2b5bae3 Mon Sep 17 00:00:00 2001 From: Christian Wesselhoeft Date: Tue, 21 Aug 2018 13:05:57 -0600 Subject: [PATCH 03/42] Update template/elm.json --- template/elm.json | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/template/elm.json b/template/elm.json index 9417b878..fbfc4f8b 100644 --- a/template/elm.json +++ b/template/elm.json @@ -5,14 +5,20 @@ ], "elm-version": "0.19.0", "dependencies": { - "elm-lang/core": "6.0.0", - "elm-lang/html": "3.0.0" - }, - "test-dependencies": {}, - "do-not-edit-this-by-hand": { - "transitive-dependencies": { - "elm-lang/json": "1.0.0", - "elm-lang/virtual-dom": "3.0.0" + "direct": { + "elm/browser": "1.0.0", + "elm/core": "1.0.0", + "elm/html": "1.0.0" + }, + "indirect": { + "elm/json": "1.0.0", + "elm/time": "1.0.0", + "elm/url": "1.0.0", + "elm/virtual-dom": "1.0.0" } + }, + "test-dependencies": { + "direct": {}, + "indirect": {} } } From ec4246a2543fa11c35b6eab156c5cead567a1bc6 Mon Sep 17 00:00:00 2001 From: Christian Wesselhoeft Date: Sun, 26 Aug 2018 07:38:15 -0700 Subject: [PATCH 04/42] Update deps --- package.json | 2 +- yarn.lock | 126 ++++++++++++++------------------------------------- 2 files changed, 36 insertions(+), 92 deletions(-) diff --git a/package.json b/package.json index b94d7891..f15e71b2 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "cross-spawn": "^6.0.4", "css-loader": "^0.28.9", "dotenv": "^5.0.0", - "elm": "^0.19.0", + "elm": "0.19.0-bugfix2", "elm-hot-loader": "0.5.4", "elm-test": "^0.19.0-beta4", "elm-webpack-loader": "https://github.com/xtian/elm-webpack-loader.git#0.19", diff --git a/yarn.lock b/yarn.lock index 48fc1b5f..bfc7d928 100644 --- a/yarn.lock +++ b/yarn.lock @@ -406,10 +406,6 @@ arrify@^1.0.0, arrify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" -asap@~2.0.3: - version "2.0.6" - resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" - asn1.js@^4.0.0: version "4.9.1" resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.9.1.tgz#48ba240b45a9280e94748990ba597d216617fd40" @@ -458,7 +454,7 @@ async@^1.4.0, async@^1.5.2: version "1.5.2" resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" -async@^2.0.1, async@^2.1.2, async@^2.4.1: +async@^2.1.2, async@^2.4.1: version "2.5.0" resolved "https://registry.yarnpkg.com/async/-/async-2.5.0.tgz#843190fd6b7357a0b9e1c956edddd5ec8462b54d" dependencies: @@ -1105,12 +1101,6 @@ binwrap@^0.2.0-rc2: tar "^2.2.1" unzip-stream "^0.3.0" -bl@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/bl/-/bl-1.1.2.tgz#fdca871a99713aa00d19e3bbba41c44787a65398" - dependencies: - readable-stream "~2.0.5" - block-stream@*: version "0.0.9" resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a" @@ -2517,22 +2507,19 @@ elm-test@^0.19.0-beta4: "elm-webpack-loader@https://github.com/xtian/elm-webpack-loader.git#0.19": version "4.3.1" - resolved "https://github.com/xtian/elm-webpack-loader.git#f116fec3c7519c44a38b01c1368925d04df9fe8b" + resolved "https://github.com/xtian/elm-webpack-loader.git#eef2c36865cd10784f7c3aa66970c7c1534a61e9" dependencies: - elm "^0.18.0" + elm "^0.19.0" glob "^7.1.1" loader-utils "^1.0.2" - node-elm-compiler "^5.0.0-alpha1" + node-elm-compiler rtfeldman/node-elm-compiler#0.19 yargs "^6.5.0" -elm@^0.18.0: - version "0.18.0" - resolved "https://registry.yarnpkg.com/elm/-/elm-0.18.0.tgz#919b8309cd939dfe2ff9d252d961b6c89509b970" +elm@0.19.0-bugfix2: + version "0.19.0-bugfix2" + resolved "https://registry.yarnpkg.com/elm/-/elm-0.19.0-bugfix2.tgz#b2b7ad4dbeb89edf997759330b3694f419f9f1b3" dependencies: - mkdirp "0.5.1" - promise "7.1.1" - request "2.74.0" - tar "2.2.1" + binwrap "0.1.4" elm@^0.19.0: version "0.19.0" @@ -3126,6 +3113,13 @@ find-elm-dependencies@1.0.2: firstline "1.2.0" lodash "4.14.2" +find-elm-dependencies@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/find-elm-dependencies/-/find-elm-dependencies-1.0.3.tgz#68554b23332c87ed1078828d9dd5b652ca63bfac" + dependencies: + firstline "1.2.0" + lodash "4.17.10" + find-node-modules@1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/find-node-modules/-/find-node-modules-1.0.4.tgz#b6deb3cccb699c87037677bcede2c5f5862b2550" @@ -3202,14 +3196,6 @@ forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" -form-data@~1.0.0-rc4: - version "1.0.1" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-1.0.1.tgz#ae315db9a4907fa065502304a66d7733475ee37c" - dependencies: - async "^2.0.1" - combined-stream "^1.0.5" - mime-types "^2.1.11" - form-data@~2.1.1: version "2.1.4" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.4.tgz#33c183acf193276ecaa98143a69e94bfee1750d1" @@ -4748,6 +4734,10 @@ lodash@4.14.2: version "4.14.2" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.14.2.tgz#bbccce6373a400fbfd0a8c67ca42f6d1ef416432" +lodash@4.17.10, lodash@^4.13.1: + version "4.17.10" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" + lodash@4.17.2: version "4.17.2" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.2.tgz#34a3055babe04ce42467b607d700072c7ff6bf42" @@ -4756,10 +4746,6 @@ lodash@^4, lodash@^4.0.0, lodash@^4.14.0, lodash@^4.17.2, lodash@^4.17.3, lodash version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" -lodash@^4.13.1: - version "4.17.10" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" - loglevel@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.4.1.tgz#95b383f91a3c2756fd4ab093667e4309161f2bcd" @@ -4948,18 +4934,18 @@ mime-db@~1.30.0: version "1.30.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.30.0.tgz#74c643da2dd9d6a45399963465b26d5ca7d71f01" -mime-types@^2.1.11, mime-types@~2.1.11, mime-types@~2.1.15, mime-types@~2.1.7: - version "2.1.15" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.15.tgz#a4ebf5064094569237b8cf70046776d09fc92aed" - dependencies: - mime-db "~1.27.0" - mime-types@^2.1.12, mime-types@~2.1.16: version "2.1.17" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.17.tgz#09d7a393f03e995a79f8af857b70a9e0ab16557a" dependencies: mime-db "~1.30.0" +mime-types@~2.1.11, mime-types@~2.1.15, mime-types@~2.1.7: + version "2.1.15" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.15.tgz#a4ebf5064094569237b8cf70046776d09fc92aed" + dependencies: + mime-db "~1.27.0" + mime@1.4.1, mime@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6" @@ -5189,7 +5175,7 @@ no-case@^2.2.0: dependencies: lower-case "^1.1.1" -node-elm-compiler@5.0.0-alpha1, node-elm-compiler@^5.0.0-alpha1: +node-elm-compiler@5.0.0-alpha1: version "5.0.0-alpha1" resolved "https://registry.yarnpkg.com/node-elm-compiler/-/node-elm-compiler-5.0.0-alpha1.tgz#ddfd35788595e5c127039975b50096188d1ae4f6" dependencies: @@ -5198,6 +5184,15 @@ node-elm-compiler@5.0.0-alpha1, node-elm-compiler@^5.0.0-alpha1: lodash "4.14.2" temp "^0.8.3" +node-elm-compiler@rtfeldman/node-elm-compiler#0.19: + version "5.0.0-alpha1" + resolved "https://codeload.github.com/rtfeldman/node-elm-compiler/tar.gz/7449d9da76558a0393dd7e9dc9190ca6d6f61f85" + dependencies: + cross-spawn "4.0.0" + find-elm-dependencies "1.0.3" + lodash "4.17.10" + temp "^0.8.3" + node-emoji@^1.4.1: version "1.8.1" resolved "https://registry.yarnpkg.com/node-emoji/-/node-emoji-1.8.1.tgz#6eec6bfb07421e2148c75c6bba72421f8530a826" @@ -5269,10 +5264,6 @@ node-status-codes@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/node-status-codes/-/node-status-codes-1.0.0.tgz#5ae5541d024645d32a58fcddc9ceecea7ae3ac2f" -node-uuid@~1.4.7: - version "1.4.8" - resolved "https://registry.yarnpkg.com/node-uuid/-/node-uuid-1.4.8.tgz#b040eb0923968afabf8d32fb1f17f1167fdab907" - nopt@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" @@ -6126,12 +6117,6 @@ progress@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f" -promise@7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/promise/-/promise-7.1.1.tgz#489654c692616b8aa55b0724fa809bb7db49c5bf" - dependencies: - asap "~2.0.3" - prompt@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/prompt/-/prompt-1.0.0.tgz#8e57123c396ab988897fb327fd3aedc3e735e4fe" @@ -6205,10 +6190,6 @@ qs@6.5.1: version "6.5.1" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8" -qs@~6.2.0: - version "6.2.3" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.2.3.tgz#1cfcb25c10a9b2b483053ff39f5dfc9233908cfe" - qs@~6.3.0: version "6.3.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.2.tgz#e75bd5f6e268122a2a0e0bda630b2550c166502c" @@ -6399,17 +6380,6 @@ readable-stream@~1.1.9: isarray "0.0.1" string_decoder "~0.10.x" -readable-stream@~2.0.5: - version "2.0.6" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "~1.0.0" - process-nextick-args "~1.0.6" - string_decoder "~0.10.x" - util-deprecate "~1.0.1" - readdirp@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.1.0.tgz#4ed0ad060df3073300c48440373f72d1cc642d78" @@ -6583,32 +6553,6 @@ request-promise@^4.2.0: stealthy-require "^1.1.0" tough-cookie ">=2.3.3" -request@2.74.0: - version "2.74.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.74.0.tgz#7693ca768bbb0ea5c8ce08c084a45efa05b892ab" - dependencies: - aws-sign2 "~0.6.0" - aws4 "^1.2.1" - bl "~1.1.2" - caseless "~0.11.0" - combined-stream "~1.0.5" - extend "~3.0.0" - forever-agent "~0.6.1" - form-data "~1.0.0-rc4" - har-validator "~2.0.6" - hawk "~3.1.3" - http-signature "~1.1.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.7" - node-uuid "~1.4.7" - oauth-sign "~0.8.1" - qs "~6.2.0" - stringstream "~0.0.4" - tough-cookie "~2.3.0" - tunnel-agent "~0.4.1" - request@2.79.0: version "2.79.0" resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de" From be86924740caf474698c517e6b2cad0e0da2bdb7 Mon Sep 17 00:00:00 2001 From: Christian Wesselhoeft Date: Sun, 26 Aug 2018 07:46:46 -0700 Subject: [PATCH 05/42] config/paths.js: elmPackageJson -> elmJson --- config/paths.js | 2 +- scripts/start.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/paths.js b/config/paths.js index 4ac78311..19f14173 100644 --- a/config/paths.js +++ b/config/paths.js @@ -46,7 +46,7 @@ module.exports = { dotenv: resolveApp('./.env'), entry: resolveApp('./src/index.js'), appBuild: resolveApp('./build'), - elmPackageJson: resolveApp('./elm.json'), + elmJson: resolveApp('./elm.json'), elm: require('elm/platform').executablePaths['elm'], publicUrl: getPublicUrl(resolveApp('elm.json')), servedPath: getServedPath(resolveApp('elm.json')) diff --git a/scripts/start.js b/scripts/start.js index 49b52ab3..1ee31b0d 100644 --- a/scripts/start.js +++ b/scripts/start.js @@ -154,12 +154,12 @@ choosePort(HOST, DEFAULT_PORT) return; } const protocol = process.env.HTTPS === 'true' ? 'https' : 'http'; - const appName = path.basename(path.dirname(paths.elmPackageJson)); + const appName = path.basename(path.dirname(paths.elmJson)); const urls = prepareUrls(protocol, HOST, port); // Create a webpack compiler that is configured with custom messages. const compiler = createCompiler(webpack, config, appName, urls); // Load proxy config - const proxySetting = require(paths.elmPackageJson).proxy; + const proxySetting = require(paths.elmJson).proxy; const proxyConfig = prepareProxy(proxySetting, '/'); // Serve webpack assets generated by the compiler over a web sever. const serverConfig = createDevServerConfig( From f8a65d79b809f16f8fdbba08d547fa54311e72b7 Mon Sep 17 00:00:00 2001 From: Christian Wesselhoeft Date: Sun, 26 Aug 2018 08:12:20 -0700 Subject: [PATCH 06/42] Remove elm/platform references --- bin/create-elm-app-cli.js | 4 ++-- bin/elm-app-cli.js | 17 +++++++---------- config/paths.js | 2 +- scripts/create.js | 7 +++---- 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/bin/create-elm-app-cli.js b/bin/create-elm-app-cli.js index ed4592c3..c698190f 100755 --- a/bin/create-elm-app-cli.js +++ b/bin/create-elm-app-cli.js @@ -6,7 +6,7 @@ const path = require('path'); const spawn = require('cross-spawn'); const argv = require('minimist')(process.argv.slice(2)); const version = require('../package.json').version; -const elmPlatformVersion = require('elm/package.json').version; +const elmVersion = require('elm/package.json').version; const commands = argv._; if (commands.length === 0) { @@ -14,7 +14,7 @@ if (commands.length === 0) { console.log( 'where is the name of the directory with your future project' ); - console.log('\nElm Platform ' + elmPlatformVersion + '\n'); + console.log('\nElm Platform ' + elmVersion + '\n'); console.log( 'create-elm-app@' + version + ' ' + path.resolve(__dirname, '..') ); diff --git a/bin/elm-app-cli.js b/bin/elm-app-cli.js index 0356dabf..400c7064 100755 --- a/bin/elm-app-cli.js +++ b/bin/elm-app-cli.js @@ -5,9 +5,9 @@ const path = require('path'); const spawn = require('cross-spawn'); const argv = require('minimist')(process.argv.slice(2)); -const executablePaths = require('elm/platform').executablePaths; +const elmExecutable = path.resolve(__dirname, '../node_modules/.bin/elm') const version = require('../package.json').version; -const elmPlatformVersion = require('elm/package.json').version; +const elmVersion = require('elm/package.json').version; const commands = argv._; @@ -37,7 +37,7 @@ switch (script) { args = args.concat([ '--compiler', - path.normalize(executablePaths['elm-make']) + elmExecutable ]); const cp = spawn.sync(require.resolve('elm-test/bin/elm-test'), args, { @@ -51,18 +51,15 @@ switch (script) { break; } case 'install': { - const executable = executablePaths['elm-package']; - spawn.sync(path.normalize(executable), process.argv.slice(2), { + spawn.sync(elmExecutable, process.argv.slice(2), { stdio: 'inherit' }); break; } default: // Proxy elm-platform cli commands. - if (['package', 'reactor', 'make', 'repl'].indexOf(script) !== -1) { - const executable = executablePaths['elm-' + script]; - - spawn.sync(path.normalize(executable), process.argv.slice(3), { + if (['reactor', 'make', 'repl'].indexOf(script) !== -1) { + spawn.sync(elmExecutable, process.argv.slice(2), { stdio: 'inherit' }); break; @@ -84,7 +81,7 @@ function help(version) { console.log( ' create, build, start, install, test, eject, package, reactor, make, repl\n' ); - console.log('\nElm ' + elmPlatformVersion + '\n'); + console.log('\nElm ' + elmVersion + '\n'); console.log( 'create-elm-app@' + version + ' ' + path.resolve(__dirname, '..') ); diff --git a/config/paths.js b/config/paths.js index 19f14173..4fb4a412 100644 --- a/config/paths.js +++ b/config/paths.js @@ -47,7 +47,7 @@ module.exports = { entry: resolveApp('./src/index.js'), appBuild: resolveApp('./build'), elmJson: resolveApp('./elm.json'), - elm: require('elm/platform').executablePaths['elm'], + elm: path.resolve(__dirname, '../node_modules/.bin/elm'), publicUrl: getPublicUrl(resolveApp('elm.json')), servedPath: getServedPath(resolveApp('elm.json')) }; diff --git a/scripts/create.js b/scripts/create.js index 28891763..47a23324 100644 --- a/scripts/create.js +++ b/scripts/create.js @@ -7,7 +7,6 @@ const chalk = require('chalk'); const spawnSync = require('child_process').spawnSync; const argv = require('minimist')(process.argv.slice(2)); const commands = argv._; -const executablePaths = require('elm/platform').executablePaths; if (commands.length === 0 || commands[0] === '') { console.error('\nUsage: elm-app create '); @@ -40,10 +39,10 @@ function createElmApp(name) { process.chdir(root); - // Run initial `elm-package install -y` + // Run initial `elm make` const spawnElmPkgResult = spawnSync( - executablePaths['elm-package'], - ['install', '-y'], + path.resolve(__dirname, '../node_modules/.bin/elm'), + ['make', 'src/Main.elm'], { stdio: 'inherit' } ); From ce0840be01c887ded428bffa16d835ebf4cc29e0 Mon Sep 17 00:00:00 2001 From: Christian Wesselhoeft Date: Sun, 26 Aug 2018 08:17:52 -0700 Subject: [PATCH 07/42] create-elm-app.spec.js: elm-package.json -> elm.json --- tests/create-elm-app.spec.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/create-elm-app.spec.js b/tests/create-elm-app.spec.js index abc5a050..8339fa5c 100644 --- a/tests/create-elm-app.spec.js +++ b/tests/create-elm-app.spec.js @@ -21,9 +21,9 @@ describe('Create Elm application with `create-elm-app` command', () => { expect(status, 'to be', 0); }).timeout(60 * 1000); - it(`'${testAppName}' should have elm-package.json file`, () => { + it(`'${testAppName}' should have elm.json file`, () => { expect( - fs.existsSync(path.join(testAppDir, 'elm-package.json')), + fs.existsSync(path.join(testAppDir, 'elm.json')), 'to be', true ); @@ -36,7 +36,7 @@ describe('Create Elm application with `create-elm-app` command', () => { it(`'${testAppName}' should have the same file structure as template`, () => { const templateDir = path.join(rootDir, 'template'); const options = { - excludeFilter: 'elm-stuff, elm-package.json, gitignore, .gitignore' + excludeFilter: 'elm-stuff, elm.json, gitignore, .gitignore' }; const { same } = dircompare.compareSync(templateDir, testAppDir, options); expect(same, 'to be', true); From 008caf1707cecec618ef22a0684e2502e1413c04 Mon Sep 17 00:00:00 2001 From: Christian Wesselhoeft Date: Sun, 26 Aug 2018 08:21:23 -0700 Subject: [PATCH 08/42] Update template --- README.md | 3 +-- template/README.md | 21 ++++++++------------- template/elm.json | 12 +++++++----- template/tests/elm-package.json | 17 ----------------- 4 files changed, 16 insertions(+), 37 deletions(-) delete mode 100644 template/tests/elm-package.json diff --git a/README.md b/README.md index 11a625fa..547d0cda 100644 --- a/README.md +++ b/README.md @@ -64,8 +64,7 @@ my-app/ │ ├── main.css │ └── registerServiceWorker.js └── tests - ├── Tests.elm - └── elm.json + └── Tests.elm ``` You are ready to employ the full power of Create Elm App! diff --git a/template/README.md b/template/README.md index e4a8eb1c..b11cd296 100644 --- a/template/README.md +++ b/template/README.md @@ -86,7 +86,7 @@ const db = new PouchDB('mydb'); my-app/ ├── .gitignore ├── README.md -├── elm-package.json +├── elm.json ├── elm-stuff ├── public │ ├── favicon.ico @@ -99,8 +99,7 @@ my-app/ │ ├── main.css │ └── registerServiceWorker.js └── tests - ├── Tests.elm - └── elm-package.json + └── Tests.elm ``` For the project to build, these files must exist with exact filenames: @@ -136,7 +135,9 @@ You may change the listening port number by using the `PORT` environment variabl ### `elm-app install` -An alias for [`elm-app package install`](#package) +Alias for [`elm install`](http://guide.elm-lang.org/get_started.html#elm-install) + +Use it for installing Elm packages from [package.elm-lang.org](http://package.elm-lang.org/) ### `elm-app test` @@ -162,23 +163,17 @@ You don’t have to use 'eject' The curated feature set is suitable for small an Create Elm App does not rely on the global installation of Elm Platform, but you still can use its local Elm Platform to access default command line tools: -#### `package` - -Alias for [elm-package](http://guide.elm-lang.org/get_started.html#elm-package) - -Use it for installing Elm packages from [package.elm-lang.org](http://package.elm-lang.org/) - #### `repl` -Alias for [elm-repl](http://guide.elm-lang.org/get_started.html#elm-repl) +Alias for [`elm repl`](http://guide.elm-lang.org/get_started.html#elm-repl) #### `make` -Alias for [elm-make](http://guide.elm-lang.org/get_started.html#elm-make) +Alias for [`elm make`](http://guide.elm-lang.org/get_started.html#elm-make) #### `reactor` -Alias for [elm-reactor](http://guide.elm-lang.org/get_started.html#elm-reactor) +Alias for [`elm reactor`](http://guide.elm-lang.org/get_started.html#elm-reactor) ## Turning on/off Elm Debugger diff --git a/template/elm.json b/template/elm.json index fbfc4f8b..7e5f4f65 100644 --- a/template/elm.json +++ b/template/elm.json @@ -1,8 +1,6 @@ { "type": "application", - "source-directories": [ - "src" - ], + "source-directories": ["src"], "elm-version": "0.19.0", "dependencies": { "direct": { @@ -18,7 +16,11 @@ } }, "test-dependencies": { - "direct": {}, - "indirect": {} + "direct": { + "elm-explorations/test": "1.0.0" + }, + "indirect": { + "elm/random": "1.0.0" + } } } diff --git a/template/tests/elm-package.json b/template/tests/elm-package.json deleted file mode 100644 index 1e47e760..00000000 --- a/template/tests/elm-package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "version": "1.0.0", - "summary": "Test Suites", - "repository": "https://github.com/user/project.git", - "license": "BSD3", - "source-directories": [ - ".", - "../src" - ], - "exposed-modules": [], - "dependencies": { - "elm-lang/core": "5.0.0 <= v < 6.0.0", - "elm-community/elm-test": "4.0.0 <= v < 5.0.0", - "elm-lang/html": "2.0.0 <= v < 3.0.0" - }, - "elm-version": "0.18.0 <= v < 0.19.0" -} From 16042e56389f15156ff2485a13486f64c43a0867 Mon Sep 17 00:00:00 2001 From: Christian Wesselhoeft Date: Sun, 26 Aug 2018 08:25:30 -0700 Subject: [PATCH 09/42] Remove `elm-app package` test --- tests/cliAccessibility.js | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/tests/cliAccessibility.js b/tests/cliAccessibility.js index 0e6fd5de..b16a5c6a 100644 --- a/tests/cliAccessibility.js +++ b/tests/cliAccessibility.js @@ -20,22 +20,12 @@ describe('Test command line interface functionality', () => { expect(output.toString(), 'to contain', 'Usage: elm-app '); }); - it('`elm-app package` command should be available', () => { - const { output, status } = spawn.sync('elm-app', ['package']); - expect( - output.toString(), - 'to contain', - 'install and publish elm packages' - ); - expect(status, 'to be', 0); - }); - it('`elm-app install` command should be available', () => { const { output, status } = spawn.sync('elm-app', ['install', '--help']); expect( output.toString(), 'to contain', - 'Install packages to use locally' + 'The `install` command fetches packages' ); expect(status, 'to be', 0); }); From c0222d2e02b46e7738e6890fb38c72fdb95c5254 Mon Sep 17 00:00:00 2001 From: Christian Wesselhoeft Date: Sun, 26 Aug 2018 08:27:55 -0700 Subject: [PATCH 10/42] webpack.config.prod.js: Use --optimize flag --- config/webpack.config.prod.js | 1 + 1 file changed, 1 insertion(+) diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index 10fd8b5c..ee30de69 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -153,6 +153,7 @@ module.exports = { // If ELM_DEBUGGER was set to "true", enable it. Otherwise // for invalid values, "false" and as a default, disable it debug: process.env.ELM_DEBUGGER === 'true' ? true : false, + optimize: true, pathToElm: paths.elm } } From 748e5c1076a044ca2fee56e9bf7b64415a7620a3 Mon Sep 17 00:00:00 2001 From: Christian Wesselhoeft Date: Sun, 26 Aug 2018 08:42:20 -0700 Subject: [PATCH 11/42] scripts/build.js: Write errors to stderr --- scripts/build.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/build.js b/scripts/build.js index fe248c83..9a6d90ca 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -74,8 +74,8 @@ measureFileSizesBeforeBuild(paths.appBuild) console.log(); }, err => { - console.log(chalk.red('Failed to compile.\n')); - console.log((err.message || err) + '\n'); + console.error(chalk.red('Failed to compile.\n')); + console.error((err.message || err) + '\n'); process.exit(1); } ); From 7095de04c4a85456689848b8872280beb1230d30 Mon Sep 17 00:00:00 2001 From: Christian Wesselhoeft Date: Wed, 29 Aug 2018 12:53:29 -0700 Subject: [PATCH 12/42] Update elm-webpack-loader --- package.json | 2 +- yarn.lock | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index f15e71b2..7776e35c 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "elm": "0.19.0-bugfix2", "elm-hot-loader": "0.5.4", "elm-test": "^0.19.0-beta4", - "elm-webpack-loader": "https://github.com/xtian/elm-webpack-loader.git#0.19", + "elm-webpack-loader": "^5.0.0", "extract-text-webpack-plugin": "^3.0.2", "file-loader": "^1.1.6", "fs-extra": "^5.0.0", diff --git a/yarn.lock b/yarn.lock index bfc7d928..a2ca1968 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2505,14 +2505,14 @@ elm-test@^0.19.0-beta4: optionalDependencies: fsevents "1.1.2" -"elm-webpack-loader@https://github.com/xtian/elm-webpack-loader.git#0.19": - version "4.3.1" - resolved "https://github.com/xtian/elm-webpack-loader.git#eef2c36865cd10784f7c3aa66970c7c1534a61e9" +elm-webpack-loader@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/elm-webpack-loader/-/elm-webpack-loader-5.0.0.tgz#bcbd3334f232f61412390f7a9373264068cf7aa2" dependencies: elm "^0.19.0" glob "^7.1.1" loader-utils "^1.0.2" - node-elm-compiler rtfeldman/node-elm-compiler#0.19 + node-elm-compiler "^5.0.0" yargs "^6.5.0" elm@0.19.0-bugfix2: @@ -3113,9 +3113,9 @@ find-elm-dependencies@1.0.2: firstline "1.2.0" lodash "4.14.2" -find-elm-dependencies@1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/find-elm-dependencies/-/find-elm-dependencies-1.0.3.tgz#68554b23332c87ed1078828d9dd5b652ca63bfac" +find-elm-dependencies@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/find-elm-dependencies/-/find-elm-dependencies-2.0.0.tgz#435aa05a6544a0ecf54c5d1ac85cc1ca1044e4e4" dependencies: firstline "1.2.0" lodash "4.17.10" @@ -5184,12 +5184,12 @@ node-elm-compiler@5.0.0-alpha1: lodash "4.14.2" temp "^0.8.3" -node-elm-compiler@rtfeldman/node-elm-compiler#0.19: - version "5.0.0-alpha1" - resolved "https://codeload.github.com/rtfeldman/node-elm-compiler/tar.gz/7449d9da76558a0393dd7e9dc9190ca6d6f61f85" +node-elm-compiler@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/node-elm-compiler/-/node-elm-compiler-5.0.1.tgz#d62094ee72d6aad616ebaa71397b6cfac90381f6" dependencies: cross-spawn "4.0.0" - find-elm-dependencies "1.0.3" + find-elm-dependencies "2.0.0" lodash "4.17.10" temp "^0.8.3" From 638e6f0450663020c8e0016aba9995e895dfde26 Mon Sep 17 00:00:00 2001 From: Eduard Kyvenko Date: Wed, 29 Aug 2018 23:36:40 +0200 Subject: [PATCH 13/42] chore(tests/*): Move eslint configuration for tests into a separate file. --- tests/build.spec.js | 3 --- tests/cliAccessibility.js | 1 - tests/create-elm-app.spec.js | 1 - tests/elm-app.build.spec.js | 1 - tests/elm-app.eject.spec.js | 1 - tests/elm-app.test.spec.js | 1 - 6 files changed, 8 deletions(-) diff --git a/tests/build.spec.js b/tests/build.spec.js index d9cf99e0..22c85e2d 100644 --- a/tests/build.spec.js +++ b/tests/build.spec.js @@ -1,6 +1,3 @@ -/* eslint-disable */ -/* eslint-env mocha */ -const fs = require('fs'); const path = require('path'); const spawn = require('cross-spawn'); const rimraf = require('rimraf'); diff --git a/tests/cliAccessibility.js b/tests/cliAccessibility.js index b16a5c6a..c5f587fa 100644 --- a/tests/cliAccessibility.js +++ b/tests/cliAccessibility.js @@ -1,4 +1,3 @@ -/* eslint-env mocha */ const expect = require('unexpected'); const spawn = require('cross-spawn'); diff --git a/tests/create-elm-app.spec.js b/tests/create-elm-app.spec.js index 8339fa5c..87a34039 100644 --- a/tests/create-elm-app.spec.js +++ b/tests/create-elm-app.spec.js @@ -1,4 +1,3 @@ -/* eslint-env mocha */ const path = require('path'); const expect = require('unexpected'); const spawn = require('cross-spawn'); diff --git a/tests/elm-app.build.spec.js b/tests/elm-app.build.spec.js index 2ca72373..1931f1cd 100644 --- a/tests/elm-app.build.spec.js +++ b/tests/elm-app.build.spec.js @@ -1,4 +1,3 @@ -/* eslint-env mocha */ const fs = require('fs'); const path = require('path'); const spawn = require('cross-spawn'); diff --git a/tests/elm-app.eject.spec.js b/tests/elm-app.eject.spec.js index 496ca92a..ec4ec158 100644 --- a/tests/elm-app.eject.spec.js +++ b/tests/elm-app.eject.spec.js @@ -1,4 +1,3 @@ -/* eslint-env mocha */ const fs = require('fs'); const path = require('path'); const expect = require('unexpected'); diff --git a/tests/elm-app.test.spec.js b/tests/elm-app.test.spec.js index 29c61150..f203e544 100644 --- a/tests/elm-app.test.spec.js +++ b/tests/elm-app.test.spec.js @@ -1,4 +1,3 @@ -/* eslint-env mocha */ const path = require('path'); const spawn = require('cross-spawn'); const rimraf = require('rimraf'); From 8ddfd0da337b442f559a0905399b0bd70c5b0d60 Mon Sep 17 00:00:00 2001 From: Eduard Kyvenko Date: Wed, 29 Aug 2018 23:38:03 +0200 Subject: [PATCH 14/42] fix(webpack.config.dev.js): Use elm-hot-webpack-loader instead of deprecated elm-hot-loader. --- config/webpack.config.dev.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/webpack.config.dev.js b/config/webpack.config.dev.js index f6e9be64..851503ed 100644 --- a/config/webpack.config.dev.js +++ b/config/webpack.config.dev.js @@ -112,7 +112,7 @@ module.exports = { exclude: [/elm-stuff/, /node_modules/], use: [ { - loader: require.resolve('elm-hot-loader') + loader: require.resolve('elm-hot-webpack-loader') }, // string-replace-loader works as InterpolateHtmlPlugin for Elm, // it replaces all of the %PUBLIC_URL% with the URL of your diff --git a/package.json b/package.json index 7776e35c..e97e1a41 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "css-loader": "^0.28.9", "dotenv": "^5.0.0", "elm": "0.19.0-bugfix2", - "elm-hot-loader": "0.5.4", + "elm-hot-webpack-loader": "^1.0.0", "elm-test": "^0.19.0-beta4", "elm-webpack-loader": "^5.0.0", "extract-text-webpack-plugin": "^3.0.2", From 44d778217b29964a0c2503fcfa7abdcaf61906e1 Mon Sep 17 00:00:00 2001 From: Eduard Kyvenko Date: Wed, 29 Aug 2018 23:38:55 +0200 Subject: [PATCH 15/42] fix(template/*): Upgrade the code of the tempalte to 0.19 Use Browser instead of Html.App --- template/src/Main.elm | 7 ++++--- template/src/index.js | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/template/src/Main.elm b/template/src/Main.elm index c23c23b8..c3ab4830 100644 --- a/template/src/Main.elm +++ b/template/src/Main.elm @@ -1,5 +1,6 @@ module Main exposing (..) +import Browser import Html exposing (Html, text, div, h1, img) import Html.Attributes exposing (src) @@ -45,11 +46,11 @@ view model = ---- PROGRAM ---- -main : Program Never Model Msg +main : Program () Model Msg main = - Html.program + Browser.element { view = view - , init = init + , init = \_ -> init , update = update , subscriptions = always Sub.none } diff --git a/template/src/index.js b/template/src/index.js index 3f79cf93..1942e644 100644 --- a/template/src/index.js +++ b/template/src/index.js @@ -1,7 +1,9 @@ import './main.css'; -import { Main } from './Main.elm'; +import { Elm } from './Main.elm'; import registerServiceWorker from './registerServiceWorker'; -Main.embed(document.getElementById('root')); +Elm.Main.init({ + node: document.getElementById('root') +}); registerServiceWorker(); From 4da4587c791f6c72147f526db326e13515cf016a Mon Sep 17 00:00:00 2001 From: Eduard Kyvenko Date: Wed, 29 Aug 2018 23:39:42 +0200 Subject: [PATCH 16/42] chore(package.json): Add scripts for running elm-app scripts in the template --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index e97e1a41..87c3a64f 100644 --- a/package.json +++ b/package.json @@ -96,7 +96,8 @@ "test": "npm run test:cli && npm run test:functional", "test:cli": "mocha tests/cliAccessibility.js --reporter spec --timeout 15000", "test:functional": "mocha tests/*.spec.js --reporter spec --timeout 15000", - "build": "cd template && node ../bin/elm-app-cli.js build", - "start": "cd template && node ../bin/elm-app-cli.js start" + "app:build": "cd template && node ../bin/elm-app-cli.js build", + "app:start": "cd template && node ../bin/elm-app-cli.js start", + "app:test": "cd template && node ../bin/elm-app-cli.js test" } } From dd68f93efe711888921b0f9be905f4ae385668e1 Mon Sep 17 00:00:00 2001 From: Eduard Kyvenko Date: Wed, 29 Aug 2018 23:41:31 +0200 Subject: [PATCH 17/42] fix: Fix the create-elm-app test by disabling the output of the initial elm-make run --- scripts/create.js | 2 +- tests/create-elm-app.spec.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/create.js b/scripts/create.js index 47a23324..fa49e7ce 100644 --- a/scripts/create.js +++ b/scripts/create.js @@ -42,7 +42,7 @@ function createElmApp(name) { // Run initial `elm make` const spawnElmPkgResult = spawnSync( path.resolve(__dirname, '../node_modules/.bin/elm'), - ['make', 'src/Main.elm'], + ['make', 'src/Main.elm', '--output=/dev/null'], { stdio: 'inherit' } ); diff --git a/tests/create-elm-app.spec.js b/tests/create-elm-app.spec.js index 87a34039..96249eb4 100644 --- a/tests/create-elm-app.spec.js +++ b/tests/create-elm-app.spec.js @@ -35,7 +35,7 @@ describe('Create Elm application with `create-elm-app` command', () => { it(`'${testAppName}' should have the same file structure as template`, () => { const templateDir = path.join(rootDir, 'template'); const options = { - excludeFilter: 'elm-stuff, elm.json, gitignore, .gitignore' + excludeFilter: 'elm-stuff, elm.json, gitignore, .gitignore, build' }; const { same } = dircompare.compareSync(templateDir, testAppDir, options); expect(same, 'to be', true); From 0dacc3f4842d3a6e739f7fb5357c9ff900ec5e72 Mon Sep 17 00:00:00 2001 From: Eduard Kyvenko Date: Thu, 30 Aug 2018 23:13:28 +0200 Subject: [PATCH 18/42] ci: Disable timeouts for before hook --- tests/build.spec.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/build.spec.js b/tests/build.spec.js index 22c85e2d..05c597c9 100644 --- a/tests/build.spec.js +++ b/tests/build.spec.js @@ -11,9 +11,10 @@ const createElmAppCmd = path.join(rootDir, 'bin/create-elm-app-cli.js'); const elmAppCmd = path.join(rootDir, 'bin/elm-app-cli.js'); describe('Creating and making a build of Elm application', function() { - this.timeout(30000); + this.timeout(60000); - before(done => { + before(function(done) { + this.enableTimeouts(false); process.env.PUBLIC_URL = './'; spawn('node', [createElmAppCmd, testAppName]).on('close', status => { if (status === 0) { From 2349bfc8cf78076b85056a592424332755a07f6e Mon Sep 17 00:00:00 2001 From: Eduard Kyvenko Date: Thu, 30 Aug 2018 23:41:39 +0200 Subject: [PATCH 19/42] ci: Enable timouts after the first test. --- tests/build.spec.js | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/build.spec.js b/tests/build.spec.js index 05c597c9..801bb25a 100644 --- a/tests/build.spec.js +++ b/tests/build.spec.js @@ -33,6 +33,7 @@ describe('Creating and making a build of Elm application', function() { after(() => { rimraf.sync(testAppDir); + this.enableTimeouts(true); }); it('compiled correctly and renders "Your Elm App is working!" text', done => { From ac1396b3f714437b3b964b21adf3d8d4569f4d03 Mon Sep 17 00:00:00 2001 From: Eduard Kyvenko Date: Mon, 6 Aug 2018 18:08:20 +0200 Subject: [PATCH 20/42] feat(package.json, webpack.config.dev.js, webpack.config.prod.js): Upgrade Babel setup and enable transpilation of third-party code More context in: https://github.com/facebook/create-react-app/pull/3776 BREAKING CHANGE: Now we compile third-party JavaScript code with Babel. fix #217 --- config/webpack.config.dev.js | 55 +++++++++++++++++++++++++---------- config/webpack.config.prod.js | 52 +++++++++++++++++++++++---------- package.json | 10 +++---- 3 files changed, 81 insertions(+), 36 deletions(-) diff --git a/config/webpack.config.dev.js b/config/webpack.config.dev.js index 851503ed..d2c2df17 100644 --- a/config/webpack.config.dev.js +++ b/config/webpack.config.dev.js @@ -72,44 +72,67 @@ module.exports = { rules: [ { test: /\.js$/, - exclude: [/elm-stuff/, /node_modules/], + exclude: [/[/\\\\]elm-stuff[/\\\\]/, /[/\\\\]node_modules[/\\\\]/], + include: paths.appSrc, loader: require.resolve('babel-loader'), query: { - // Latest stable ECMAScript features presets: [ [ - require.resolve('babel-preset-env'), + require.resolve('@babel/preset-env'), { - targets: { - // React parses on ie 9, so we should too - ie: 9, - // We currently minify with uglify - // Remove after https://github.com/mishoo/UglifyJS2/issues/448 - uglify: true - }, - // Disable polyfill transforms - useBuiltIns: false, + // `entry` transforms `@babel/polyfill` into individual requires for + // the targeted browsers. This is safer than `usage` which performs + // static code analysis to determine what's required. + // This is probably a fine default to help trim down bundles when + // end-users inevitably import '@babel/polyfill'. + useBuiltIns: 'entry', // Do not transform modules to CJS modules: false } ] ], plugins: [ + // Polyfills the runtime needed for async/await and generators [ - require.resolve('babel-plugin-transform-runtime'), + require('@babel/plugin-transform-runtime').default, { helpers: false, - polyfill: false, regenerator: true } ] ] } }, - + // Process any JS outside of the app with Babel. + // Unlike the application JS, we only compile the standard ES features. + { + test: /\.js$/, + use: [ + { + loader: require.resolve('babel-loader'), + options: { + babelrc: false, + compact: false, + presets: [ + [ + // Latest stable ECMAScript features + require('@babel/preset-env').default, + { + // Do not transform modules to CJS + modules: false + } + ] + ], + cacheDirectory: true, + highlightCode: true + } + } + ] + }, { test: /\.elm$/, - exclude: [/elm-stuff/, /node_modules/], + include: paths.appSrc, + exclude: [/[/\\\\]elm-stuff[/\\\\]/, /[/\\\\]node_modules[/\\\\]/], use: [ { loader: require.resolve('elm-hot-webpack-loader') diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index ee30de69..4211eac4 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -95,44 +95,66 @@ module.exports = { rules: [ { test: /\.js$/, - exclude: [/elm-stuff/, /node_modules/], + exclude: [/[/\\\\]elm-stuff[/\\\\]/, /[/\\\\]node_modules[/\\\\]/], loader: require.resolve('babel-loader'), query: { // Latest stable ECMAScript features presets: [ [ - require.resolve('babel-preset-env'), + require.resolve('@babel/preset-env'), { - targets: { - // React parses on ie 9, so we should too - ie: 9, - // We currently minify with uglify - // Remove after https://github.com/mishoo/UglifyJS2/issues/448 - uglify: true - }, - // Disable polyfill transforms - useBuiltIns: false, + // `entry` transforms `@babel/polyfill` into individual requires for + // the targeted browsers. This is safer than `usage` which performs + // static code analysis to determine what's required. + // This is probably a fine default to help trim down bundles when + // end-users inevitably import '@babel/polyfill'. + useBuiltIns: 'entry', // Do not transform modules to CJS modules: false } ] ], plugins: [ + // Polyfills the runtime needed for async/await and generators [ - require.resolve('babel-plugin-transform-runtime'), + require('@babel/plugin-transform-runtime').default, { helpers: false, - polyfill: false, regenerator: true } ] ] } }, - + // Process any JS outside of the app with Babel. + // Unlike the application JS, we only compile the standard ES features. + { + test: /\.js$/, + use: [ + { + loader: require.resolve('babel-loader'), + options: { + babelrc: false, + compact: false, + presets: [ + [ + // Latest stable ECMAScript features + require('@babel/preset-env').default, + { + // Do not transform modules to CJS + modules: false + } + ] + ], + cacheDirectory: true, + highlightCode: true + } + } + ] + }, { test: /\.elm$/, - exclude: [/elm-stuff/, /node_modules/], + exclude: [/[/\\\\]elm-stuff[/\\\\]/, /[/\\\\]node_modules[/\\\\]/], use: [ // string-replace-loader works as InterpolateHtmlPlugin for Elm, // it replaces all of the %PUBLIC_URL% with the URL of your diff --git a/package.json b/package.json index 87c3a64f..a10b801a 100644 --- a/package.json +++ b/package.json @@ -17,13 +17,13 @@ } }, "dependencies": { + "@babel/cli": "7.0.0-beta.56", + "@babel/core": "7.0.0-beta.56", + "@babel/plugin-transform-runtime": "7.0.0-beta.56", + "@babel/preset-env": "7.0.0-beta.56", "assets-webpack-plugin": "^3.5.1", "autoprefixer": "^8.0.0", - "babel-cli": "^6.26.0", - "babel-core": "^6.26.0", - "babel-loader": "^7.1.2", - "babel-plugin-transform-runtime": "^6.23.0", - "babel-preset-env": "^1.6.1", + "babel-loader": "8.0.0-beta.4", "babel-runtime": "^6.26.0", "chalk": "^2.3.1", "clean-webpack-plugin": "^0.1.18", From 4f012f57d6abb37b76c0b8f23f943548bfaab4a6 Mon Sep 17 00:00:00 2001 From: Eduard Kyvenko Date: Tue, 20 Mar 2018 19:45:15 +0100 Subject: [PATCH 21/42] chore(package.json): Extract the configuration for prettier to the external file --- .prettierrc | 3 +++ package.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 .prettierrc diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..db1bca68 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,3 @@ +{ + singleQuote: true +} diff --git a/package.json b/package.json index a10b801a..832bc18e 100644 --- a/package.json +++ b/package.json @@ -91,7 +91,7 @@ "scripts": { "cz": "git-cz", "eslint": "eslint .", - "prettier": "prettier --write --single-quote '{bin,config,scripts,template/src,tests}/**/*.js'", + "format": "prettier --write '{bin,config,scripts,template/src,tests}/**/*.js'", "semantic-release": "semantic-release", "test": "npm run test:cli && npm run test:functional", "test:cli": "mocha tests/cliAccessibility.js --reporter spec --timeout 15000", From 7ab2c10fad3d0dbdad5bccc5193f26811f2a5dea Mon Sep 17 00:00:00 2001 From: Eduard Kyvenko Date: Tue, 20 Mar 2018 19:47:55 +0100 Subject: [PATCH 22/42] chore(Added lint-staged to the devDependencies and the setup for running it on precommit): --- package.json | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 832bc18e..aa3205ee 100644 --- a/package.json +++ b/package.json @@ -61,6 +61,7 @@ "eslint": "^4.18.0", "eslint-plugin-prettier": "^2.6.0", "husky": "^0.14.3", + "lint-staged": "^7.0.0", "mocha": "^5.0.1", "nightmare": "^2.10.0", "prettier": "^1.10.2", @@ -98,6 +99,16 @@ "test:functional": "mocha tests/*.spec.js --reporter spec --timeout 15000", "app:build": "cd template && node ../bin/elm-app-cli.js build", "app:start": "cd template && node ../bin/elm-app-cli.js start", - "app:test": "cd template && node ../bin/elm-app-cli.js test" + "app:test": "cd template && node ../bin/elm-app-cli.js test", + "precommit": "lint-staged" + }, + "lint-staged": { + "*.js": [ + "prettier --write", + "git add" + ], + "package-lock.json": [ + "git rm --cached" + ] } } From bee9f93b299b6f086a3fb0d485c202829315d189 Mon Sep 17 00:00:00 2001 From: Eduard Kyvenko Date: Tue, 20 Mar 2018 21:46:35 +0100 Subject: [PATCH 23/42] build(dev config): Added `case-sensitive-paths-webpack-plugin` for extra security --- config/webpack.config.dev.js | 94 ++++++++++++++++++++++++------------ package.json | 1 + 2 files changed, 65 insertions(+), 30 deletions(-) diff --git a/config/webpack.config.dev.js b/config/webpack.config.dev.js index d2c2df17..0ce1dc6b 100644 --- a/config/webpack.config.dev.js +++ b/config/webpack.config.dev.js @@ -1,10 +1,9 @@ 'use strict'; -const path = require('path'); const autoprefixer = require('autoprefixer'); -const HotModuleReplacementPlugin = require('webpack/lib/HotModuleReplacementPlugin'); -const DefinePlugin = require('webpack/lib/DefinePlugin'); -const NamedModulesPlugin = require('webpack/lib/NamedModulesPlugin'); +const path = require('path'); +const webpack = require('webpack'); +const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin'); const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const getClientEnvironment = require('./env'); @@ -20,9 +19,32 @@ const publicUrl = ''; // Get environment variables to inject into our app. const env = getClientEnvironment(publicUrl); +// Options for PostCSS as we reference these options twice +// Adds vendor prefixing based on your specified browser support in +// package.json +const postCSSLoaderOptions = { + // Necessary for external CSS imports to work + // https://github.com/facebook/create-react-app/issues/2677 + ident: 'postcss', + plugins: () => [ + require('postcss-flexbugs-fixes'), + autoprefixer({ + flexbox: 'no-2009' + }) + ] +}; + +// This is the development configuration. +// It is focused on developer experience and fast rebuilds. +// The production configuration is different and lives in a separate file. module.exports = { + mode: 'development', + // You may want 'eval' instead if you prefer to see the compiled output in DevTools. + // See the discussion in https://github.com/facebook/create-react-app/issues/343. devtool: 'cheap-module-source-map', - + // These are the "entry points" to our application. + // This means they will be the "root" imports that are included in JS bundle. + // The first two entry points enable "hot" CSS and auto-refreshes for JS. entry: [ // Include an alternative client for WebpackDevServer. A client's job is to // connect to WebpackDevServer by a socket and get notified about changes. @@ -44,6 +66,7 @@ module.exports = { ], output: { + // Add /* filename */ comments to generated require()s in the output. pathinfo: true, // The build folder. @@ -53,22 +76,33 @@ module.exports = { // served by WebpackDevServer in development. This is the JS bundle // containing code from all our entry points, and the Webpack runtime. filename: 'static/js/bundle.js', - + // There are also additional JS chunk files if you use code splitting. + chunkFilename: 'static/js/[name].chunk.js', + // This is the URL that app is served from. We use "/" in development. publicPath: publicPath, // Point sourcemap entries to original disk location (format as URL on Windows) devtoolModuleFilenameTemplate: info => path.resolve(info.absoluteResourcePath).replace(/\\/g, '/') }, - + optimization: { + // Automatically split vendor and commons + // https://twitter.com/wSokra/status/969633336732905474 + splitChunks: { + chunks: 'all' + }, + // Keep the runtime chunk seperated to enable long term caching + // https://twitter.com/wSokra/status/969679223278505985 + runtimeChunk: true + }, resolve: { modules: ['node_modules'], extensions: ['.js', '.elm'] }, - module: { noParse: /\.elm$/, + strictExportPresence: true, rules: [ { test: /\.js$/, @@ -168,8 +202,10 @@ module.exports = { // "style" loader turns CSS into JS modules that inject