From 09fe592714d774e6ecf9407d93b178c76dffc5e8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 May 2024 03:18:24 +0000 Subject: [PATCH] Migrate shakapacker from 7.2.3 to 8.0.0 Bumps [shakapacker](https://github.com/shakacode/shakapacker) from 7.2.3 to 8.0.0. - [Changelog](https://github.com/shakacode/shakapacker/blob/main/CHANGELOG.md) - [Commits](https://github.com/shakacode/shakapacker/compare/v7.2.3...v8.0.0) --- updated-dependencies: - dependency-name: shakapacker dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 4 +- config/webpack/webpack.config.js | 16 +++-- package.json | 2 +- yarn.lock | 105 ++++--------------------------- 5 files changed, 27 insertions(+), 102 deletions(-) diff --git a/Gemfile b/Gemfile index db86ce0a..8bd5b4f5 100644 --- a/Gemfile +++ b/Gemfile @@ -45,7 +45,7 @@ gem 'ransack' gem 'rubytree' gem 'rubyzip' gem 'sassc-rails' -gem 'shakapacker', '7.2.3' +gem 'shakapacker', '8.0.0' gem 'slim-rails' gem 'sorcery' gem 'sprockets-rails' diff --git a/Gemfile.lock b/Gemfile.lock index da1bb59c..571b7b55 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -475,7 +475,7 @@ GEM bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) set (1.1.0) - shakapacker (7.2.3) + shakapacker (8.0.0) activesupport (>= 5.2) package_json rack-proxy (>= 0.6.1) @@ -639,7 +639,7 @@ DEPENDENCIES selenium-webdriver sentry-rails sentry-ruby - shakapacker (= 7.2.3) + shakapacker (= 8.0.0) shoulda-matchers simplecov slim-rails diff --git a/config/webpack/webpack.config.js b/config/webpack/webpack.config.js index d8a3d04e..85859053 100644 --- a/config/webpack/webpack.config.js +++ b/config/webpack/webpack.config.js @@ -1,6 +1,6 @@ // See the shakacode/shakapacker README and docs directory for advice on customizing your webpackConfig. -const { globalMutableWebpackConfig, generateWebpackConfig, config, merge } = require('shakapacker') +const { generateWebpackConfig, config, merge } = require('shakapacker') const webpackConfig = generateWebpackConfig() const CompressionPlugin = require("compression-webpack-plugin"); @@ -88,8 +88,14 @@ const envConfig = module.exports = { stats: 'minimal', } -// Use the two lines below to remove the original WebpackAssetsManifest and replace it with our custom config. -const filteredPlugins = webpackConfig.plugins.filter((plugin) => !(plugin instanceof WebpackAssetsManifest)) -globalMutableWebpackConfig.plugins = filteredPlugins; -module.exports = merge(globalMutableWebpackConfig, envConfig) +// Use the following lines below to remove original plugins and replace them with our custom config. +// This is especially needed for the `WebpackAssetsManifest` plugin, which would otherwise run twice. +const customPlugins = envConfig.plugins.map((plugin) => plugin.constructor.name); +const filteredDefaultPlugins = webpackConfig.plugins.filter((plugin) => { + return !customPlugins.includes(plugin.constructor.name); +}); +webpackConfig.plugins = filteredDefaultPlugins; + +// Create the resulting config by merging the (modified) default config and our custom setup +module.exports = merge(webpackConfig, envConfig) diff --git a/package.json b/package.json index 4f028b26..d8669956 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "rails-erb-loader": "usabilityhub/rails-erb-loader#master", "sass": "^1.77.2", "sass-loader": "^14.2.1", - "shakapacker": "7.2.3", + "shakapacker": "8.0.0", "sortablejs": "^1.15.2", "sorttable": "^1.0.2", "style-loader": "^4.0.0", diff --git a/yarn.lock b/yarn.lock index 5b7a6d1f..738c9ce5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2804,16 +2804,6 @@ __metadata: languageName: node linkType: hard -"brace-expansion@npm:^1.1.7": - version: 1.1.11 - resolution: "brace-expansion@npm:1.1.11" - dependencies: - balanced-match: "npm:^1.0.0" - concat-map: "npm:0.0.1" - checksum: 10c0/695a56cd058096a7cb71fb09d9d6a7070113c7be516699ed361317aca2ec169f618e28b8af352e02ab4233fb54eb0168460a40dc320bab0034b36ab59aaad668 - languageName: node - linkType: hard - "brace-expansion@npm:^2.0.1": version: 2.0.1 resolution: "brace-expansion@npm:2.0.1" @@ -3117,7 +3107,7 @@ __metadata: rails-erb-loader: "usabilityhub/rails-erb-loader#master" sass: "npm:^1.77.2" sass-loader: "npm:^14.2.1" - shakapacker: "npm:7.2.3" + shakapacker: "npm:8.0.0" sortablejs: "npm:^1.15.2" sorttable: "npm:^1.0.2" style-loader: "npm:^4.0.0" @@ -3255,13 +3245,6 @@ __metadata: languageName: node linkType: hard -"concat-map@npm:0.0.1": - version: 0.0.1 - resolution: "concat-map@npm:0.0.1" - checksum: 10c0/c996b1cfdf95b6c90fee4dae37e332c8b6eb7d106430c17d538034c0ad9a1630cb194d2ab37293b1bdd4d779494beee7786d586a50bd9376fd6f7bcc2bd4c98f - languageName: node - linkType: hard - "connect-history-api-fallback@npm:^2.0.0": version: 2.0.0 resolution: "connect-history-api-fallback@npm:2.0.0" @@ -4456,13 +4439,6 @@ __metadata: languageName: node linkType: hard -"fs.realpath@npm:^1.0.0": - version: 1.0.0 - resolution: "fs.realpath@npm:1.0.0" - checksum: 10c0/444cf1291d997165dfd4c0d58b69f0e4782bfd9149fd72faa4fe299e68e0e93d6db941660b37dd29153bf7186672ececa3b50b7e7249477b03fdf850f287c948 - languageName: node - linkType: hard - "fsevents@npm:~2.3.2": version: 2.3.3 resolution: "fsevents@npm:2.3.3" @@ -4546,20 +4522,6 @@ __metadata: languageName: node linkType: hard -"glob@npm:^7.2.0": - version: 7.2.3 - resolution: "glob@npm:7.2.3" - dependencies: - fs.realpath: "npm:^1.0.0" - inflight: "npm:^1.0.4" - inherits: "npm:2" - minimatch: "npm:^3.1.1" - once: "npm:^1.3.0" - path-is-absolute: "npm:^1.0.0" - checksum: 10c0/65676153e2b0c9095100fe7f25a778bf45608eeb32c6048cf307f579649bcc30353277b3b898a3792602c65764e5baa4f643714dfbdfd64ea271d210c7a425fe - languageName: node - linkType: hard - "globals@npm:^11.1.0": version: 11.12.0 resolution: "globals@npm:11.12.0" @@ -4849,23 +4811,6 @@ __metadata: languageName: node linkType: hard -"inflight@npm:^1.0.4": - version: 1.0.6 - resolution: "inflight@npm:1.0.6" - dependencies: - once: "npm:^1.3.0" - wrappy: "npm:1" - checksum: 10c0/7faca22584600a9dc5b9fca2cd5feb7135ac8c935449837b315676b4c90aa4f391ec4f42240178244b5a34e8bede1948627fda392ca3191522fc46b34e985ab2 - languageName: node - linkType: hard - -"inherits@npm:2, inherits@npm:2.0.4, inherits@npm:^2.0.1, inherits@npm:^2.0.3, inherits@npm:~2.0.3": - version: 2.0.4 - resolution: "inherits@npm:2.0.4" - checksum: 10c0/4e531f648b29039fb7426fb94075e6545faa1eb9fe83c29f0b6d9e7263aceb4289d2d4557db0d428188eeb449cc7c5e77b0a0b2c4e248ff2a65933a0dee49ef2 - languageName: node - linkType: hard - "inherits@npm:2.0.3": version: 2.0.3 resolution: "inherits@npm:2.0.3" @@ -4873,6 +4818,13 @@ __metadata: languageName: node linkType: hard +"inherits@npm:2.0.4, inherits@npm:^2.0.1, inherits@npm:^2.0.3, inherits@npm:~2.0.3": + version: 2.0.4 + resolution: "inherits@npm:2.0.4" + checksum: 10c0/4e531f648b29039fb7426fb94075e6545faa1eb9fe83c29f0b6d9e7263aceb4289d2d4557db0d428188eeb449cc7c5e77b0a0b2c4e248ff2a65933a0dee49ef2 + languageName: node + linkType: hard + "internmap@npm:1 - 2": version: 2.0.3 resolution: "internmap@npm:2.0.3" @@ -5533,15 +5485,6 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^3.1.1": - version: 3.1.2 - resolution: "minimatch@npm:3.1.2" - dependencies: - brace-expansion: "npm:^1.1.7" - checksum: 10c0/0262810a8fc2e72cca45d6fd86bd349eee435eb95ac6aa45c9ea2180e7ee875ef44c32b55b5973ceabe95ea12682f6e3725cbb63d7a2d1da3ae1163c8b210311 - languageName: node - linkType: hard - "minimatch@npm:^9.0.1": version: 9.0.3 resolution: "minimatch@npm:9.0.3" @@ -5814,15 +5757,6 @@ __metadata: languageName: node linkType: hard -"once@npm:^1.3.0": - version: 1.4.0 - resolution: "once@npm:1.4.0" - dependencies: - wrappy: "npm:1" - checksum: 10c0/5d48aca287dfefabd756621c5dfce5c91a549a93e9fdb7b8246bc4c4790aa2ec17b34a260530474635147aeb631a2dcc8b32c613df0675f96041cbb8244517d0 - languageName: node - linkType: hard - "onetime@npm:^5.1.2": version: 5.1.2 resolution: "onetime@npm:5.1.2" @@ -5949,13 +5883,6 @@ __metadata: languageName: node linkType: hard -"path-is-absolute@npm:^1.0.0": - version: 1.0.1 - resolution: "path-is-absolute@npm:1.0.1" - checksum: 10c0/127da03c82172a2a50099cddbf02510c1791fc2cc5f7713ddb613a56838db1e8168b121a920079d052e0936c23005562059756d653b7c544c53185efe53be078 - languageName: node - linkType: hard - "path-key@npm:^3.0.0, path-key@npm:^3.1.0": version: 3.1.1 resolution: "path-key@npm:3.1.1" @@ -7029,11 +6956,10 @@ __metadata: languageName: node linkType: hard -"shakapacker@npm:7.2.3": - version: 7.2.3 - resolution: "shakapacker@npm:7.2.3" +"shakapacker@npm:8.0.0": + version: 8.0.0 + resolution: "shakapacker@npm:8.0.0" dependencies: - glob: "npm:^7.2.0" js-yaml: "npm:^4.1.0" path-complete-extname: "npm:^1.0.0" peerDependencies: @@ -7056,7 +6982,7 @@ __metadata: optional: true "@types/webpack": optional: true - checksum: 10c0/77c277339e5c8acac0abea0b5161802bd8ba718d2ff0e8e12b861f2dc35b0bec6a933fd64ab4b75462a1cc672c26e5ada5c6876a53eaa5ad0cb12d739fa72a95 + checksum: 10c0/4de846a4f2fc76eb7b39dbe9f394d301777d391b7fa12014926502021e78a51fcec93856cd0b7ec1d3b80f7eb5b4f6ea0eeee6ccfb9fd4d9d04b42ee950fb3f1 languageName: node linkType: hard @@ -7951,13 +7877,6 @@ __metadata: languageName: node linkType: hard -"wrappy@npm:1": - version: 1.0.2 - resolution: "wrappy@npm:1.0.2" - checksum: 10c0/56fece1a4018c6a6c8e28fbc88c87e0fbf4ea8fd64fc6c63b18f4acc4bd13e0ad2515189786dd2c30d3eec9663d70f4ecf699330002f8ccb547e4a18231fc9f0 - languageName: node - linkType: hard - "ws@npm:^8.16.0": version: 8.16.0 resolution: "ws@npm:8.16.0"