Skip to content

Commit 84d2c40

Browse files
authored
Use npm instead of yarn (#14265)
1 parent 974e9db commit 84d2c40

19 files changed

Lines changed: 19244 additions & 12135 deletions

.ackrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
--ignore-file=match:.*\.log
55
--ignore-file=is:webpack-assets.json
6-
--ignore-file=is:yarn.lock
6+
--ignore-file=is:package-lock.json
77

88
--ignore-dir=.tox
99
--ignore-dir=coverage

.circleci/config.yml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -29,35 +29,35 @@ references:
2929

3030
restore_build_cache: &restore_build_cache
3131
restore_cache:
32-
name: restore yarn package cache
32+
name: restore npm package cache
3333
keys:
34-
- yarn-packages-v16-{{ checksum "yarn.lock" }}
34+
- npm-packages-v16-{{ checksum "package-lock.json" }}
3535

36-
run_yarn_install: &run_yarn_install
36+
run_npm_install: &run_npm_install
3737
run:
3838
name: install dependencies
3939
# See: https://github.com/mozilla/addons-frontend/issues/3034
40-
command: yarn install --pure-lockfile
40+
command: npm ci
4141

4242
save_build_cache: &save_build_cache
4343
save_cache:
44-
name: save yarn package cache
45-
key: yarn-packages-v16-{{ checksum "yarn.lock" }}
44+
name: save npm package cache
45+
key: npm-packages-v16-{{ checksum "package-lock.json" }}
4646
paths:
47-
- ~/.cache/yarn
47+
- ~/.npm
4848

4949
restore_next_build_cache: &restore_next_build_cache
5050
restore_cache:
51-
name: restore yarn package cache
51+
name: restore npm package cache
5252
keys:
53-
- next-yarn-packages-v18-{{ checksum "yarn.lock" }}
53+
- next-npm-packages-v18-{{ checksum "package-lock.json" }}
5454

5555
save_next_build_cache: &save_next_build_cache
5656
save_cache:
57-
name: save yarn package cache
58-
key: next-yarn-packages-v18-{{ checksum "yarn.lock" }}
57+
name: save npm package cache
58+
key: next-npm-packages-v18-{{ checksum "package-lock.json" }}
5959
paths:
60-
- ~/.cache/yarn
60+
- ~/.npm
6161

6262
commands:
6363
better_checkout:
@@ -139,9 +139,9 @@ jobs:
139139
steps:
140140
- checkout
141141
- *restore_build_cache
142-
- *run_yarn_install
142+
- *run_npm_install
143143
- *save_build_cache
144-
- run: yarn build-ci
144+
- run: npm run build-ci
145145

146146
build-docker-image:
147147
<<: *defaults-release
@@ -156,9 +156,9 @@ jobs:
156156
steps:
157157
- checkout
158158
- *restore_build_cache
159-
- *run_yarn_install
159+
- *run_npm_install
160160
- *save_build_cache
161-
- run: yarn build:blog-utils-prod
161+
- run: npm run build:blog-utils-prod
162162
# Set up a workspace to share data between this job and the
163163
# `release-blog-utils` one when we want to publish a new npm version.
164164
- persist_to_workspace:
@@ -171,9 +171,9 @@ jobs:
171171
steps:
172172
- better_checkout
173173
- *restore_build_cache
174-
- *run_yarn_install
174+
- *run_npm_install
175175
- *save_build_cache
176-
- run: yarn test-ci
176+
- run: npm run test-ci
177177
- codecov/upload
178178

179179
check:
@@ -183,29 +183,29 @@ jobs:
183183
steps:
184184
- better_checkout
185185
- *restore_build_cache
186-
- *run_yarn_install
186+
- *run_npm_install
187187
- *save_build_cache
188-
- run: yarn lint
189-
- run: yarn prettier-ci
190-
- run: pip install 'fonttools<4.44.1' brotli && yarn check-fonts
188+
- run: npm run lint
189+
- run: npm run prettier-ci
190+
- run: pip install 'fonttools<4.44.1' brotli && npm run check-fonts
191191

192192
# build-next:
193193
# <<: *defaults-next
194194
# steps:
195195
# - checkout
196196
# - *restore_next_build_cache
197-
# - *run_yarn_install
197+
# - *run_npm_install
198198
# - *save_next_build_cache
199-
# - run: yarn build
199+
# - run: npm run build
200200

201201
# test-next:
202202
# <<: *defaults-next
203203
# steps:
204204
# - better_checkout
205205
# - *restore_next_build_cache
206-
# - *run_yarn_install
206+
# - *run_npm_install
207207
# - *save_next_build_cache
208-
# - run: yarn test-ci-next
208+
# - run: npm run test-ci-next
209209

210210
dennis-lint:
211211
<<: *defaults-release
@@ -264,7 +264,7 @@ jobs:
264264
- run:
265265
name: Build the app and check bundlesize from container
266266
command: |
267-
docker run --rm addons-frontend yarn build-ci
267+
docker run --rm addons-frontend npm run build-ci
268268
- run:
269269
name: Write the sha256 sum to an artifact for verification
270270
command: |
@@ -277,7 +277,7 @@ jobs:
277277
- run:
278278
name: Check image works
279279
command: |
280-
docker run --rm -p 4000:4000 -d -e NODE_ENV=production -e NODE_CONFIG_ENV=prod addons-frontend sh -c "yarn build && yarn start"
280+
docker run --rm -p 4000:4000 -d -e NODE_ENV=production -e NODE_CONFIG_ENV=prod addons-frontend sh -c "npm run build && npm start"
281281
sleep 60
282282
curl --retry 3 --retry-delay 2 http://127.0.0.1:4000/__frontend_lbheartbeat__
283283
- run:
@@ -319,7 +319,7 @@ jobs:
319319
- run:
320320
name: Build the app and check bundlesize from container
321321
command: |
322-
docker run --rm addons-frontend yarn build-ci
322+
docker run --rm addons-frontend npm run build-ci
323323
- run:
324324
name: Write the sha256 sum to an artifact for verification
325325
command: |
@@ -332,7 +332,7 @@ jobs:
332332
- run:
333333
name: Check image works
334334
command: |
335-
docker run --rm -p 4000:4000 -d -e NODE_ENV=production -e NODE_CONFIG_ENV=prod addons-frontend sh -c "yarn build && yarn start"
335+
docker run --rm -p 4000:4000 -d -e NODE_ENV=production -e NODE_CONFIG_ENV=prod addons-frontend sh -c "npm run build && npm start"
336336
sleep 60
337337
curl --retry 3 --retry-delay 2 http://127.0.0.1:4000/__frontend_lbheartbeat__
338338
- run:

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ jobs:
4343
- name: Install gettext
4444
run: sudo apt-get install gettext
4545

46-
- name: Yarn install
47-
run: yarn install --frozen-lockfile --prefer-offline
46+
- name: Install dependencies
47+
run: npm ci --prefer-offline
4848

4949
- name: Extract locales
50-
run: yarn extract-locales
50+
run: npm run extract-locales
5151

5252
- name: Push Locales
5353
env:

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ node_modules
3434
# Optional npm cache directory
3535
.npm
3636

37-
# yarn cache directory
38-
.yarn
39-
4037
# Optional REPL history
4138
.node_repl_history
4239

.ignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
# More info: https://github.com/BurntSushi/ripgrep
44

55
locale
6-
yarn.lock
6+
package-lock.json

.yarnrc

Lines changed: 0 additions & 6 deletions
This file was deleted.

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
FROM node:22.22.2-slim AS builder
55

66
WORKDIR /srv/node
7-
COPY package.json yarn.lock /srv/node/
7+
COPY package.json package-lock.json /srv/node/
88

9-
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates git && rm -rf /var/lib/apt/lists/
10-
RUN yarn install --pure-lockfile
9+
RUN apt-get update && apt-get install -y --no-install-recommends python3 build-essential ca-certificates git && rm -rf /var/lib/apt/lists/
10+
RUN npm ci
1111

1212
#
1313
# Install
@@ -37,4 +37,4 @@ COPY --from=builder --chown=${app_uid}:${app_uid} /srv/node/node_modules ${app_d
3737
ENV SERVER_HOST 0.0.0.0
3838
ENV SERVER_PORT 4000
3939

40-
CMD yarn start
40+
CMD npm start

0 commit comments

Comments
 (0)