Skip to content

Commit 2b6116e

Browse files
committed
Migrate eagle-api to Yarn 4.12.0 and update dependencies
- Migrate from npm to yarn@4.12.0 for consistency with eagle-public and eagle-admin - Add .yarnrc.yml and .yarn/ directory with Yarn binary - Generate yarn.lock (361KB, 9930 lines) - Remove package-lock.json - Update Dockerfile to use yarn with corepack - Update GitHub workflows (deploy-to-dev, pr.yaml) to use yarn - Remove deprecated run-test-suite.yml workflow - Update vulnerable dependencies: - axios: 0.19.0 → 0.28.0 (fixes CVE-2021-3749, CVE-2025-27152, CVE-2026-25639) - body-parser: 1.18.3 → 1.20.3 (fixes CVE-2024-45590) - jsonwebtoken: 8.4.0 → 9.0.2 (fixes CVE-2022-23539) - All three Eagle repos now use consistent yarn@4.12.0
1 parent 222cfe8 commit 2b6116e

File tree

8 files changed

+116
-20237
lines changed

8 files changed

+116
-20237
lines changed

.github/workflows/deploy-to-dev.yaml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,15 @@ jobs:
5454
- name: Checkout
5555
uses: actions/checkout@v4
5656

57+
- name: Enable Corepack
58+
run: corepack enable
59+
5760
- name: Setup node
5861
uses: actions/setup-node@v4
5962
with:
6063
node-version: ${{ matrix.node-version }}
61-
cache: "npm"
62-
- run: npm ci
64+
cache: "yarn"
65+
- run: yarn install --immutable
6366
- name: Lint (stubbed)
6467
run: |
6568
echo "Linting skipped - not configured for eagle-api"
@@ -76,13 +79,16 @@ jobs:
7679
- name: Checkout
7780
uses: actions/checkout@v4
7881

82+
- name: Enable Corepack
83+
run: corepack enable
84+
7985
- name: Setup node
8086
uses: actions/setup-node@v4
8187
with:
8288
node-version: ${{ matrix.node-version }}
83-
cache: "npm"
84-
- run: npm ci
85-
- run: npm test
89+
cache: "yarn"
90+
- run: yarn install --immutable
91+
- run: yarn test
8692

8793
build:
8894
name: Build

.github/workflows/pr.yaml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: PR Checks
2+
3+
on: [pull_request]
4+
5+
permissions:
6+
contents: read
7+
pull-requests: write
8+
9+
jobs:
10+
install:
11+
name: Install
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
node-version: [16.x]
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Enable Corepack
21+
run: corepack enable
22+
23+
- name: Setup node
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
cache: "yarn"
28+
- run: yarn install --immutable
29+
30+
lint:
31+
name: Lint
32+
runs-on: ubuntu-latest
33+
needs: install
34+
strategy:
35+
matrix:
36+
node-version: [16.x]
37+
steps:
38+
- name: Checkout
39+
uses: actions/checkout@v4
40+
41+
- name: Enable Corepack
42+
run: corepack enable
43+
44+
- name: Setup node
45+
uses: actions/setup-node@v4
46+
with:
47+
node-version: ${{ matrix.node-version }}
48+
cache: "yarn"
49+
- run: yarn install --immutable
50+
- run: echo "Linting step - configure linter when ready"
51+
52+
test:
53+
name: Test
54+
runs-on: ubuntu-latest
55+
needs: install
56+
strategy:
57+
matrix:
58+
node-version: [16.x]
59+
steps:
60+
- name: Checkout
61+
uses: actions/checkout@v4
62+
63+
- name: Enable Corepack
64+
run: corepack enable
65+
66+
- name: Setup node
67+
uses: actions/setup-node@v4
68+
with:
69+
node-version: ${{ matrix.node-version }}
70+
cache: "yarn"
71+
- run: yarn install --immutable
72+
- run: yarn test
73+
74+
build:
75+
name: Build
76+
runs-on: ubuntu-latest
77+
needs: install
78+
strategy:
79+
matrix:
80+
node-version: [16.x]
81+
steps:
82+
- name: Checkout
83+
uses: actions/checkout@v4
84+
85+
- name: Enable Corepack
86+
run: corepack enable
87+
88+
- name: Setup node
89+
uses: actions/setup-node@v4
90+
with:
91+
node-version: ${{ matrix.node-version }}
92+
cache: "yarn"
93+
- run: yarn install --immutable
94+
- run: echo "Build step - API doesn't require compilation, dependencies installed successfully"

.github/workflows/run-test-suite.yml

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

.yarn/install-state.gz

764 KB
Binary file not shown.

.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: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,14 @@ FROM node:16-alpine AS base
1414

1515
WORKDIR /app
1616

17+
# Enable Corepack for Yarn
18+
RUN corepack enable
19+
1720
# Copy package files
18-
COPY package*.json ./
21+
COPY package.json yarn.lock .yarnrc.yml ./
1922

2023
# Install production dependencies only
21-
RUN npm ci --only=production
24+
RUN yarn install --immutable --immutable-cache
2225

2326
# -----------------------------------------------------------------------------
2427
# Stage 2: Production Runtime

0 commit comments

Comments
 (0)