diff --git a/.changeset/angry-pens-occur.md b/.changeset/angry-pens-occur.md new file mode 100644 index 0000000..ea0d22c --- /dev/null +++ b/.changeset/angry-pens-occur.md @@ -0,0 +1,10 @@ +--- +"@krakenjs/babel-config-grumbler": patch +"@krakenjs/eslint-config-grumbler": patch +"@krakenjs/grumbler-scripts": patch +"@krakenjs/karma-config-grumbler": patch +"@krakenjs/webpack-config-grumbler": patch +"@krakenjs/typescript-config-grumbler": patch +--- + +Consist filenames for babel configs. All files are `babelrc-*` diff --git a/.changeset/forty-chefs-draw.md b/.changeset/forty-chefs-draw.md new file mode 100644 index 0000000..d3eed6c --- /dev/null +++ b/.changeset/forty-chefs-draw.md @@ -0,0 +1,10 @@ +--- +"@krakenjs/babel-config-grumbler": patch +"@krakenjs/eslint-config-grumbler": patch +"@krakenjs/grumbler-scripts": patch +"@krakenjs/karma-config-grumbler": patch +"@krakenjs/webpack-config-grumbler": patch +"@krakenjs/typescript-config-grumbler": patch +--- + +Update webpack dependencies to remove flow-bin and include webpack-dev-middleware diff --git a/.changeset/yellow-eyes-pump.md b/.changeset/yellow-eyes-pump.md new file mode 100644 index 0000000..78cfa7a --- /dev/null +++ b/.changeset/yellow-eyes-pump.md @@ -0,0 +1,10 @@ +--- +"@krakenjs/babel-config-grumbler": patch +"@krakenjs/eslint-config-grumbler": patch +"@krakenjs/grumbler-scripts": patch +"@krakenjs/karma-config-grumbler": patch +"@krakenjs/webpack-config-grumbler": patch +"@krakenjs/typescript-config-grumbler": patch +--- + +Ensure webpack loaders are required from @krakenjs/webpack-config-grumbler as they will not be guaranteed to be hoisted in complex projects diff --git a/package-lock.json b/package-lock.json index 292186b..ac9ed48 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7746,17 +7746,6 @@ "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==" }, - "node_modules/flow-bin": { - "version": "0.164.0", - "resolved": "https://registry.npmjs.org/flow-bin/-/flow-bin-0.164.0.tgz", - "integrity": "sha512-cSAA0LLa1SlQ1YmNCYpJ19ES39WYrqjfxX8Oqhbvn6+DET8Cs+EnVkJWHVSkfK8zUupbxvSt7pDoFXePYbcJRA==", - "bin": { - "flow": "cli.js" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/flush-write-stream": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", @@ -17168,7 +17157,6 @@ "cache-loader": "^4.1.0", "circular-dependency-plugin": "^5.2.2", "css-loader": "^5.2.7", - "flow-bin": "0.164.0", "hard-source-webpack-plugin": "^0.13.1", "imports": "^1.0.0", "isomorphic-style-loader": "^5.3.2", @@ -17185,6 +17173,7 @@ "webpack": "^4.44.1", "webpack-bundle-analyzer": "^4.7.0", "webpack-cli": "^4.10.0", + "webpack-dev-middleware": "^3.7.2", "webpack-dev-server": "^4.11.1" } }, @@ -17199,6 +17188,17 @@ "node": ">=10" } }, + "packages/webpack-config-grumbler/node_modules/mime": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", + "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4.0.0" + } + }, "packages/webpack-config-grumbler/node_modules/semver": { "version": "7.3.8", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", @@ -17213,6 +17213,24 @@ "node": ">=10" } }, + "packages/webpack-config-grumbler/node_modules/webpack-dev-middleware": { + "version": "3.7.3", + "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-3.7.3.tgz", + "integrity": "sha512-djelc/zGiz9nZj/U7PTBi2ViorGJXEWo/3ltkPbDyxCXhhEXkW0ce99falaok4TPj+AsxLiXJR0EBOb0zh9fKQ==", + "dependencies": { + "memory-fs": "^0.4.1", + "mime": "^2.4.4", + "mkdirp": "^0.5.1", + "range-parser": "^1.2.1", + "webpack-log": "^2.0.0" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "webpack": "^4.0.0 || ^5.0.0" + } + }, "packages/webpack-config-grumbler/node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", @@ -19101,7 +19119,6 @@ "cache-loader": "^4.1.0", "circular-dependency-plugin": "^5.2.2", "css-loader": "^5.2.7", - "flow-bin": "0.164.0", "hard-source-webpack-plugin": "^0.13.1", "imports": "^1.0.0", "isomorphic-style-loader": "^5.3.2", @@ -19118,6 +19135,7 @@ "webpack": "^4.44.1", "webpack-bundle-analyzer": "^4.7.0", "webpack-cli": "^4.10.0", + "webpack-dev-middleware": "^3.7.2", "webpack-dev-server": "^4.11.1" }, "dependencies": { @@ -19129,6 +19147,11 @@ "yallist": "^4.0.0" } }, + "mime": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", + "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==" + }, "semver": { "version": "7.3.8", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", @@ -19137,6 +19160,18 @@ "lru-cache": "^6.0.0" } }, + "webpack-dev-middleware": { + "version": "3.7.3", + "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-3.7.3.tgz", + "integrity": "sha512-djelc/zGiz9nZj/U7PTBi2ViorGJXEWo/3ltkPbDyxCXhhEXkW0ce99falaok4TPj+AsxLiXJR0EBOb0zh9fKQ==", + "requires": { + "memory-fs": "^0.4.1", + "mime": "^2.4.4", + "mkdirp": "^0.5.1", + "range-parser": "^1.2.1", + "webpack-log": "^2.0.0" + } + }, "yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", @@ -23263,11 +23298,6 @@ "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==" }, - "flow-bin": { - "version": "0.164.0", - "resolved": "https://registry.npmjs.org/flow-bin/-/flow-bin-0.164.0.tgz", - "integrity": "sha512-cSAA0LLa1SlQ1YmNCYpJ19ES39WYrqjfxX8Oqhbvn6+DET8Cs+EnVkJWHVSkfK8zUupbxvSt7pDoFXePYbcJRA==" - }, "flush-write-stream": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", diff --git a/packages/babel-config-grumbler/README.md b/packages/babel-config-grumbler/README.md index 820d0d9..1818b86 100644 --- a/packages/babel-config-grumbler/README.md +++ b/packages/babel-config-grumbler/README.md @@ -16,7 +16,7 @@ npm install -D @krakenjs/babel-config-grumbler ```json { - "extends": "@krakenjs/babel-config-grumbler/babel-node" + "extends": "@krakenjs/babel-config-grumbler/babelrc-node" } ``` @@ -24,7 +24,7 @@ npm install -D @krakenjs/babel-config-grumbler ```json { - "extends": "@krakenjs/babel-config-grumbler/babel-browser" + "extends": "@krakenjs/babel-config-grumbler/babelrc-browser" } ``` diff --git a/packages/babel-config-grumbler/babel-browser.js b/packages/babel-config-grumbler/babelrc-browser.js similarity index 100% rename from packages/babel-config-grumbler/babel-browser.js rename to packages/babel-config-grumbler/babelrc-browser.js diff --git a/packages/babel-config-grumbler/babel-node.js b/packages/babel-config-grumbler/babelrc-node.js similarity index 100% rename from packages/babel-config-grumbler/babel-node.js rename to packages/babel-config-grumbler/babelrc-node.js diff --git a/packages/babel-config-grumbler/package.json b/packages/babel-config-grumbler/package.json index 0ba2e05..00e280c 100644 --- a/packages/babel-config-grumbler/package.json +++ b/packages/babel-config-grumbler/package.json @@ -2,7 +2,7 @@ "name": "@krakenjs/babel-config-grumbler", "version": "8.0.3", "description": "Babel scripts for grumbler modules", - "main": "babel-browser.js", + "main": "babelrc-browser.js", "scripts": { "lint": "eslint ." }, diff --git a/packages/eslint-config-grumbler/.babelrc b/packages/eslint-config-grumbler/.babelrc index 79c0e93..5f06501 100644 --- a/packages/eslint-config-grumbler/.babelrc +++ b/packages/eslint-config-grumbler/.babelrc @@ -1,3 +1,3 @@ { - "extends": "@krakenjs/babel-config-grumbler/babel-browser" + "extends": "@krakenjs/babel-config-grumbler/babelrc-browser" } diff --git a/packages/grumbler-scripts/.babelrc b/packages/grumbler-scripts/.babelrc index 79c0e93..5f06501 100644 --- a/packages/grumbler-scripts/.babelrc +++ b/packages/grumbler-scripts/.babelrc @@ -1,3 +1,3 @@ { - "extends": "@krakenjs/babel-config-grumbler/babel-browser" + "extends": "@krakenjs/babel-config-grumbler/babelrc-browser" } diff --git a/packages/grumbler-scripts/config/.babelrc-browser b/packages/grumbler-scripts/config/.babelrc-browser index c96c548..d779ed1 100644 --- a/packages/grumbler-scripts/config/.babelrc-browser +++ b/packages/grumbler-scripts/config/.babelrc-browser @@ -1 +1 @@ -{ "extends": "@krakenjs/babel-config-grumbler/babel-browser" } \ No newline at end of file +{ "extends": "@krakenjs/babel-config-grumbler/babelrc-browser" } diff --git a/packages/grumbler-scripts/config/.babelrc-node b/packages/grumbler-scripts/config/.babelrc-node index b7aa573..7918d30 100644 --- a/packages/grumbler-scripts/config/.babelrc-node +++ b/packages/grumbler-scripts/config/.babelrc-node @@ -1 +1 @@ -{ "extends": "@krakenjs/babel-config-grumbler/babel-node" } \ No newline at end of file +{ "extends": "@krakenjs/babel-config-grumbler/babelrc-node" } diff --git a/packages/karma-config-grumbler/.babelrc b/packages/karma-config-grumbler/.babelrc index 8e13035..5227cd7 100644 --- a/packages/karma-config-grumbler/.babelrc +++ b/packages/karma-config-grumbler/.babelrc @@ -1,3 +1,3 @@ { - "extends": "@krakenjs/babel-config-grumbler/babel-node" + "extends": "@krakenjs/babel-config-grumbler/babelrc-node" } diff --git a/packages/webpack-config-grumbler/.babelrc b/packages/webpack-config-grumbler/.babelrc index 8e13035..5227cd7 100644 --- a/packages/webpack-config-grumbler/.babelrc +++ b/packages/webpack-config-grumbler/.babelrc @@ -1,3 +1,3 @@ { - "extends": "@krakenjs/babel-config-grumbler/babel-node" + "extends": "@krakenjs/babel-config-grumbler/babelrc-node" } diff --git a/packages/webpack-config-grumbler/index.js b/packages/webpack-config-grumbler/index.js index 9a5a2a2..1e5f8ef 100644 --- a/packages/webpack-config-grumbler/index.js +++ b/packages/webpack-config-grumbler/index.js @@ -256,7 +256,7 @@ export function getWebpackConfig({ analyze = false, dynamic = false, optimize = env !== "local", - babelConfig = "@krakenjs/babel-config-grumbler/babel-browser", + babelConfig = "@krakenjs/babel-config-grumbler/babelrc-browser", publicPath, } = {}) { const enableSourceMap = sourcemaps && web && !test; @@ -383,15 +383,15 @@ export function getWebpackConfig({ rules.push({ test: /\.scss$/i, use: [ - "isomorphic-style-loader", + require.resolve("isomorphic-style-loader"), { - loader: "css-loader", + loader: require.resolve("css-loader"), options: { importLoaders: 1, }, }, - "scoped-css-loader", - "sass-loader", + require.resolve("scoped-css-loader"), + require.resolve("sass-loader"), ], }); } @@ -399,7 +399,7 @@ export function getWebpackConfig({ if (enableCaching) { rules.push({ test: /\.m?(j|t)sx?$/, - loader: "cache-loader", + loader: require.resolve("cache-loader"), options: { cacheDirectory: cacheDirs.cacheLoader, }, @@ -409,7 +409,7 @@ export function getWebpackConfig({ rules.push({ test: /\.m?(j|t)sx?$/, exclude: /(dist)/, - loader: "babel-loader", + loader: require.resolve("babel-loader"), options: { cacheDirectory: enableCaching && cacheDirs.babel, extends: babelConfig, @@ -418,7 +418,7 @@ export function getWebpackConfig({ rules.push({ test: /\.(html?|css|json|svg)$/, - loader: "raw-loader", + loader: require.resolve("raw-loader"), }); const output = { diff --git a/packages/webpack-config-grumbler/package.json b/packages/webpack-config-grumbler/package.json index d6e061b..c9cf921 100644 --- a/packages/webpack-config-grumbler/package.json +++ b/packages/webpack-config-grumbler/package.json @@ -36,7 +36,6 @@ "cache-loader": "^4.1.0", "circular-dependency-plugin": "^5.2.2", "css-loader": "^5.2.7", - "flow-bin": "0.164.0", "hard-source-webpack-plugin": "^0.13.1", "imports": "^1.0.0", "isomorphic-style-loader": "^5.3.2", @@ -53,6 +52,7 @@ "webpack": "^4.44.1", "webpack-bundle-analyzer": "^4.7.0", "webpack-cli": "^4.10.0", + "webpack-dev-middleware": "^3.7.2", "webpack-dev-server": "^4.11.1" } }