Skip to content

Commit 153a05c

Browse files
committed
Upgrade webpacker to fix security dependency
- Also update github actions file inline with the comment on the GithubActions for Yarn: https://github.com/marketplace/actions/github-action-for-yarn ``` Please keep in mind that this Action was originally written for GitHub Actions beta (when Docker was the only way of doing things). Consider using actions/setup-node to work with Yarn. This repository will be mostly supporting the existing flows. ```
1 parent 0955ef7 commit 153a05c

File tree

8 files changed

+685
-521
lines changed

8 files changed

+685
-521
lines changed

.github/workflows/build.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ jobs:
2020
with:
2121
postgresql version: '11'
2222

23-
- name: Install Yarn
24-
uses: borales/actions-yarn@v2.0.0
23+
- name: Install Node
24+
uses: actions/setup-node@v2
2525
with:
26-
cmd: install
26+
node-version: '14'
27+
- run: yarn install
2728

2829
- name: Install file previewing tools
2930
run: |

Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ gem "pg", ">= 0.18", "< 2.0"
2525
gem "puma", "~> 4.1"
2626
gem "rails", "~> 6.1.3"
2727
gem "rswag-ui"
28-
gem "webpacker", "~> 4.0"
28+
gem "webpacker", "~> 5.2", ">= 5.2.1"
2929

3030
group :development, :test do
3131
gem "brakeman", require: false

Gemfile.lock

+6-4
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ GEM
322322
selenium-webdriver (3.142.7)
323323
childprocess (>= 0.5, < 4.0)
324324
rubyzip (>= 1.2.2)
325+
semantic_range (3.0.0)
325326
simplecov (0.21.2)
326327
docile (~> 1.1)
327328
simplecov-html (~> 0.11)
@@ -350,10 +351,11 @@ GEM
350351
addressable (>= 2.3.6)
351352
crack (>= 0.3.2)
352353
hashdiff (>= 0.4.0, < 2.0.0)
353-
webpacker (4.3.0)
354-
activesupport (>= 4.2)
354+
webpacker (5.2.1)
355+
activesupport (>= 5.2)
355356
rack-proxy (>= 0.6.1)
356-
railties (>= 4.2)
357+
railties (>= 5.2)
358+
semantic_range (>= 2.3.0)
357359
websocket-driver (0.7.3)
358360
websocket-extensions (>= 0.1.0)
359361
websocket-extensions (0.1.5)
@@ -405,7 +407,7 @@ DEPENDENCIES
405407
simplecov
406408
web-console (>= 3.3.0)
407409
webmock
408-
webpacker (~> 4.0)
410+
webpacker (~> 5.2, >= 5.2.1)
409411

410412
BUNDLED WITH
411413
2.2.7

babel.config.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ module.exports = function(api) {
5656
[
5757
'@babel/plugin-transform-runtime',
5858
{
59-
helpers: false,
60-
regenerator: true,
61-
corejs: false
59+
helpers: false
6260
}
6361
],
6462
[

config/webpack/environment.js

-16
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
11
const { environment } = require('@rails/webpacker')
2-
const { merge } = require('webpack-merge')
3-
4-
const sassLoader = environment.loaders.get('sass')
5-
const cssLoader = environment.loaders.get('css')
6-
7-
sassLoader.use.map(function(loader) {
8-
if (loader.options) {
9-
loader.options = merge(loader.options, { sourceMap: false })
10-
}
11-
});
12-
13-
cssLoader.use.map(function(loader) {
14-
if (loader.options) {
15-
loader.options = merge(loader.options, { sourceMap: false })
16-
}
17-
});
182

193
module.exports = environment

config/webpacker.yml

+1-6
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ default: &default
66
public_root_path: public
77
public_output_path: packs
88
cache_path: tmp/cache/webpacker
9-
check_yarn_integrity: false
109
webpack_compile_output: true
1110

1211
# Additional paths webpack should lookup modules
1312
# ['app/assets', 'engine/foo/app/assets']
14-
resolved_paths: []
13+
additional_paths: []
1514

1615
# Reload manifest.json on all requests so we reload latest compiled packs
1716
cache_manifest: false
@@ -51,10 +50,6 @@ default: &default
5150
development:
5251
<<: *default
5352
compile: true
54-
extract_css: true
55-
56-
# Verifies that correct packages and versions are installed by inspecting package.json, yarn.lock, and node_modules
57-
check_yarn_integrity: false
5853

5954
# Reference: https://webpack.js.org/configuration/dev-server/
6055
dev_server:

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
"dependencies": {
55
"@rails/activestorage": "^6.0.0",
66
"@rails/ujs": "^6.0.0",
7-
"@rails/webpacker": "^4.2.2",
7+
"@rails/webpacker": "5.2.1",
88
"govuk-frontend": "^3.6.0",
99
"stimulus": "^1.1.1",
1010
"toastr": "^2.1.4",
11+
"webpack": "^4.0.0",
1112
"webpack-merge": "^5.4.0"
1213
},
1314
"version": "0.1.0",
1415
"devDependencies": {
15-
"webpack-dev-server": "^3.10.3"
16+
"webpack-dev-server": "^3.11.2"
1617
}
1718
}

0 commit comments

Comments
 (0)