From 8f54521eeee775ea363bf028ffb38bbcc491a051 Mon Sep 17 00:00:00 2001 From: Eric Guo Date: Tue, 11 Jun 2024 09:27:38 +0800 Subject: [PATCH] Upgrade to shakapacker v8 --- Gemfile | 2 +- Gemfile.lock | 4 ++-- config/webpack/webpack.config.js | 12 +++++++++--- node_modules/.yarn-integrity | 5 ++--- package.json | 5 +++-- yarn.lock | 11 +++++------ 6 files changed, 22 insertions(+), 17 deletions(-) diff --git a/Gemfile b/Gemfile index a40765b..360fcfa 100644 --- a/Gemfile +++ b/Gemfile @@ -14,7 +14,7 @@ gem "sqlite3", "~> 1.4" # Use the Puma web server [https://github.com/puma/puma] gem "puma" -gem "shakapacker" +gem "shakapacker", "~> 8.0" gem "jbuilder" diff --git a/Gemfile.lock b/Gemfile.lock index db0d502..1206de9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -297,7 +297,7 @@ GEM rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) semantic_range (3.0.0) - shakapacker (7.2.3) + shakapacker (8.0.0) activesupport (>= 5.2) package_json rack-proxy (>= 0.6.1) @@ -383,7 +383,7 @@ DEPENDENCIES rails (~> 7.1.2) ruby-lsp selenium-webdriver (>= 4.11.0) - shakapacker + shakapacker (~> 8.0) sqlite3 (~> 1.4) standard tzinfo-data diff --git a/config/webpack/webpack.config.js b/config/webpack/webpack.config.js index 968517e..bf9f249 100644 --- a/config/webpack/webpack.config.js +++ b/config/webpack/webpack.config.js @@ -1,10 +1,16 @@ -const { globalMutableWebpackConfig: webpackConfig, merge } = require('shakapacker') +const { generateWebpackConfig, merge } = require('shakapacker'); + +const webpackConfig = generateWebpackConfig(); + +if (!webpackConfig) { + throw new Error('generateWebpackConfig did not return a valid configuration. Check your Shakapacker setup.'); +} // See the shakacode/shakapacker README and docs directory for advice on customizing your webpackConfig. const customConfig = { resolve: { extensions: ['.scss'] } -} +}; -module.exports = merge(webpackConfig, customConfig) +module.exports = merge(webpackConfig, customConfig); diff --git a/node_modules/.yarn-integrity b/node_modules/.yarn-integrity index 896aac4..1a4fd30 100644 --- a/node_modules/.yarn-integrity +++ b/node_modules/.yarn-integrity @@ -32,7 +32,7 @@ "sass-loader@^13.2.0", "sass@^1.57.1", "semver@^7.5.3", - "shakapacker@=7.2.3", + "shakapacker@=8.0.0", "simplebar@^6.2.0", "style-loader@^3.3.1", "terser-webpack-plugin@5", @@ -424,7 +424,6 @@ "glob-parent@~5.1.2": "https://registry.npmmirror.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4", "glob-to-regexp@^0.4.1": "https://registry.npmmirror.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e", "glob@^7.1.3": "https://registry.npmmirror.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b", - "glob@^7.2.0": "https://registry.npmmirror.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b", "globals@^11.1.0": "https://registry.npmmirror.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e", "gopd@^1.0.1": "https://registry.npmmirror.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c", "graceful-fs@^4.1.11": "https://registry.npmmirror.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3", @@ -687,7 +686,7 @@ "set-function-length@^1.2.1": "https://registry.npmmirror.com/set-function-length/-/set-function-length-1.2.2.tgz#aac72314198eaed975cf77b2c3b6b880695e5449", "setprototypeof@1.1.0": "https://registry.npmmirror.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656", "setprototypeof@1.2.0": "https://registry.npmmirror.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424", - "shakapacker@=7.2.3": "https://registry.npmmirror.com/shakapacker/-/shakapacker-7.2.3.tgz#12613e8ca3139e47d42003f8d01846dea28f6c40", + "shakapacker@=8.0.0": "https://registry.npmmirror.com/shakapacker/-/shakapacker-8.0.0.tgz#f29537c19078af7318758c92e7a1bca4cee96bdd", "shallow-clone@^3.0.0": "https://registry.npmmirror.com/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3", "shebang-command@^1.2.0": "https://registry.npmmirror.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea", "shebang-command@^2.0.0": "https://registry.npmmirror.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea", diff --git a/package.json b/package.json index 5ae1663..5721ad5 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "sass": "^1.57.1", "sass-loader": "^13.2.0", "semver": "^7.5.3", - "shakapacker": "=7.2.3", + "shakapacker": "=8.0.0", "simplebar": "^6.2.0", "style-loader": "^3.3.1", "terser-webpack-plugin": "5", @@ -57,5 +57,6 @@ }, "browserslist": [ "defaults" - ] + ], + "packageManager": "yarn@1.22.22" } diff --git a/yarn.lock b/yarn.lock index 5a42ff0..723dfe2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2477,7 +2477,7 @@ glob-to-regexp@^0.4.1: resolved "https://registry.npmmirror.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== -glob@^7.1.3, glob@^7.2.0: +glob@^7.1.3: version "7.2.3" resolved "https://registry.npmmirror.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== @@ -3856,12 +3856,11 @@ setprototypeof@1.2.0: resolved "https://registry.npmmirror.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== -shakapacker@=7.2.3: - version "7.2.3" - resolved "https://registry.npmmirror.com/shakapacker/-/shakapacker-7.2.3.tgz#12613e8ca3139e47d42003f8d01846dea28f6c40" - integrity sha512-+qF74Y6+hEARqtsmJmBtdc2L0q6eXO21PlPsvtw6aqoxtqhM2VpCCDt51/5Cqnj/5IyEOEICZqStRCSO/q38hg== +shakapacker@=8.0.0: + version "8.0.0" + resolved "https://registry.npmmirror.com/shakapacker/-/shakapacker-8.0.0.tgz#f29537c19078af7318758c92e7a1bca4cee96bdd" + integrity sha512-HCdpITzIKXzGEyUWQhKzPbpwwOsgTamaPH+0kXdhM59VQxZ3NWnT5cL3DlJdAT3sGsWCJskEl3eMkQlnh9DjhA== dependencies: - glob "^7.2.0" js-yaml "^4.1.0" path-complete-extname "^1.0.0"