Skip to content

Commit d82f880

Browse files
committed
Upgrade Yarn to v4
Following the deprecation of Yarn 1.xx and 2.xx, we have upgraded Whitehall's base image to use Yarn v4. Consequently, flags like `--production` `--frozen-lockfile` have been removed. Associated PR: alphagov/govuk-docker#908 Flags: https://yarnpkg.com/cli/install JIRA: https://gov-uk.atlassian.net/browse/WHIT-1954
1 parent f10bf6a commit d82f880

File tree

11 files changed

+4948
-4613
lines changed

11 files changed

+4948
-4613
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151

5252
test-javascript:
5353
name: Test JavaScript
54-
uses: alphagov/govuk-infrastructure/.github/workflows/jasmine.yml@main
54+
uses: alphagov/govuk-infrastructure/.github/workflows/jasmine.yml@corepack
5555
with:
5656
useWithRails: true
5757

.github/workflows/cucumber.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
bundler-cache: true
3030

3131
- name: Setup Node
32-
uses: alphagov/govuk-infrastructure/.github/actions/setup-node@main
32+
uses: alphagov/govuk-infrastructure/.github/actions/setup-node@corepack
3333

3434
- name: Cache Playwright Chromium browser
3535
id: playwright-cache

.github/workflows/lintjs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
uses: actions/checkout@v5
1212

1313
- name: Setup Node
14-
uses: alphagov/govuk-infrastructure/.github/actions/setup-node@main
14+
uses: alphagov/govuk-infrastructure/.github/actions/setup-node@corepack
1515

1616
- name: Run lint:js
1717
run: yarn run lint:js

.github/workflows/lintprettier.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
uses: actions/checkout@v5
1212

1313
- name: Setup Node
14-
uses: alphagov/govuk-infrastructure/.github/actions/setup-node@main
14+
uses: alphagov/govuk-infrastructure/.github/actions/setup-node@corepack
1515

1616
- name: Run lint:prettier
1717
run: yarn run lint:prettier

.github/workflows/lintscss.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
uses: actions/checkout@v5
1212

1313
- name: Setup Node
14-
uses: alphagov/govuk-infrastructure/.github/actions/setup-node@main
14+
uses: alphagov/govuk-infrastructure/.github/actions/setup-node@corepack
1515

1616
- name: Run lint:scss
1717
run: yarn run lint:scss

.github/workflows/minitest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
bundler-cache: true
5151

5252
- name: Setup Node
53-
uses: alphagov/govuk-infrastructure/.github/actions/setup-node@main
53+
uses: alphagov/govuk-infrastructure/.github/actions/setup-node@corepack
5454

5555
- name: Precompile assets
5656
uses: alphagov/govuk-infrastructure/.github/actions/precompile-rails-assets@main

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
/failures
2929
/node_modules
3030
/yarn-error.log
31+
.yarn/
32+
.pnp.*
3133
.cache/
3234
.DS_Store
3335
/app/assets/builds/*

.yarnrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ ENV JWT_AUTH_SECRET=unused_yet_required
1010
WORKDIR $APP_HOME
1111
COPY Gemfile* .ruby-version ./
1212
RUN bundle install
13-
COPY package.json yarn.lock ./
14-
RUN yarn install --production --frozen-lockfile --non-interactive --link-duplicates
13+
COPY package.json yarn.lock ./
14+
RUN corepack enable
15+
RUN yarn install --immutable
1516
COPY . .
1617
RUN bootsnap precompile --gemfile .
1718
RUN rails assets:precompile && rm -fr log

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"private": true,
55
"author": "Government Digital Service",
66
"license": "MIT",
7+
"packageManager": "[email protected]",
78
"scripts": {
89
"lint": "yarn run lint:js && yarn run lint:scss && yarn run lint:prettier",
910
"lint:js": "eslint --cache --cache-location .cache/eslint --color --ignore-path .gitignore -- \"**/*.js\"",

0 commit comments

Comments
 (0)