Skip to content

Commit 1e96792

Browse files
feat(mbe, ebe): move from yarn to npm for better tooling
BREAKING CHAGE: Remove Yarn and Use npm Ticket: WP-5314
1 parent d2f3077 commit 1e96792

File tree

8 files changed

+41236
-14802
lines changed

8 files changed

+41236
-14802
lines changed

.github/workflows/build-and-test.yaml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,20 @@ jobs:
2323
uses: actions/setup-node@v4
2424
with:
2525
node-version: ${{ inputs.node-version }}
26-
cache: 'yarn'
26+
cache: 'npm'
2727

2828
- name: Cache dependencies
2929
uses: actions/cache@v3
3030
id: node-modules-cache
3131
with:
3232
path: '**/node_modules'
33-
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
33+
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
3434
restore-keys: |
3535
${{ runner.os }}-modules-
3636
3737
- name: Install dependencies
3838
if: steps.node-modules-cache.outputs.cache-hit != 'true'
39-
run: yarn install
39+
run: npm ci
4040

4141
- name: Validate PR commits with commitlint
4242
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
@@ -52,23 +52,23 @@ jobs:
5252
uses: actions/setup-node@v4
5353
with:
5454
node-version: ${{ inputs.node-version }}
55-
cache: 'yarn'
55+
cache: 'npm'
5656

5757
- name: Cache dependencies
5858
uses: actions/cache@v3
5959
id: node-modules-cache
6060
with:
6161
path: '**/node_modules'
62-
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
62+
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
6363
restore-keys: |
6464
${{ runner.os }}-modules-
6565
6666
- name: Install dependencies
6767
if: steps.node-modules-cache.outputs.cache-hit != 'true'
68-
run: yarn install
68+
run: npm ci
6969

7070
- name: Build
71-
run: yarn build
71+
run: npm run build
7272

7373
lint:
7474
name: Run lint
@@ -81,23 +81,23 @@ jobs:
8181
uses: actions/setup-node@v4
8282
with:
8383
node-version: ${{ inputs.node-version }}
84-
cache: 'yarn'
84+
cache: 'npm'
8585

8686
- name: Cache dependencies
8787
uses: actions/cache@v3
8888
id: node-modules-cache
8989
with:
9090
path: '**/node_modules'
91-
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
91+
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
9292
restore-keys: |
9393
${{ runner.os }}-modules-
9494
9595
- name: Install dependencies
9696
if: steps.node-modules-cache.outputs.cache-hit != 'true'
97-
run: yarn install
97+
run: npm ci
9898

9999
- name: Lint
100-
run: yarn lint
100+
run: npm run lint
101101

102102
test:
103103
name: Test
@@ -110,26 +110,26 @@ jobs:
110110
uses: actions/setup-node@v4
111111
with:
112112
node-version: ${{ inputs.node-version }}
113-
cache: 'yarn'
113+
cache: 'npm'
114114

115115
- name: Cache dependencies
116116
uses: actions/cache@v3
117117
id: node-modules-cache
118118
with:
119119
path: '**/node_modules'
120-
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
120+
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
121121
restore-keys: |
122122
${{ runner.os }}-modules-
123123
124124
- name: Install dependencies
125125
if: steps.node-modules-cache.outputs.cache-hit != 'true'
126-
run: yarn install
126+
run: npm ci
127127

128128
- name: Generate test SSL certificates
129-
run: yarn generate-test-ssl
129+
run: npm run generate-test-ssl
130130

131131
- name: Test
132-
run: yarn test
132+
run: npm test
133133
env:
134134
NODE_OPTIONS: '--max-old-space-size=4096'
135135
MASTER_BITGO_EXPRESS_KEYPATH: ./test-ssl-key.pem

.github/workflows/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ jobs:
2828
lint-node-version: '22.x'
2929
test-node-versions: '["22.x"]'
3030
release-node-version: '22.x'
31-
build-command: 'yarn build'
32-
test-command: 'yarn test'
31+
build-command: 'npm run build'
32+
test-command: 'npm test'
3333
allow-postinstall-scripts: false

CLAUDE.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
55
## Commands
66

77
### Development
8-
- `yarn start` - Start the application in development mode using nodemon for auto-reloading
9-
- `yarn build` - Build the TypeScript code (creates /dist folder)
10-
- `yarn lint` - Run ESLint to check for code issues
11-
- `yarn lint:fix` - Run ESLint and automatically fix issues when possible
8+
- `npm start` - Start the application in development mode using nodemon for auto-reloading
9+
- `npm run build` - Build the TypeScript code (creates /dist folder)
10+
- `npm run lint` - Run ESLint to check for code issues
11+
- `npm run lint:fix` - Run ESLint and automatically fix issues when possible
1212

1313
### Testing
14-
- `yarn test` - Run all tests
15-
- `yarn test:watch` - Run tests in watch mode
16-
- `yarn test:coverage` - Run tests with coverage report
17-
- `yarn generate-test-ssl` - Generate self-signed SSL certificates for testing
14+
- `npm test` - Run all tests
15+
- `npm run test:watch` - Run tests in watch mode
16+
- `npm run test:coverage` - Run tests with coverage report
17+
- `npm run generate-test-ssl` - Generate self-signed SSL certificates for testing
1818

1919
### Container
20-
- `yarn container:build` - Build the container image using Podman (optionally use --build-arg PORT=3080)
20+
- `npm run container:build` - Build the container image using Podman (optionally use --build-arg PORT=3080)
2121

2222
## Architecture Overview
2323

Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,19 @@ RUN --mount=type=cache,target=/var/cache/apk \
3636
linux-headers
3737

3838
# Copy dependency files
39-
COPY package.json yarn.lock ./
39+
COPY package.json package-lock.json ./
4040

4141
# Install dependencies with cache mount
42-
RUN --mount=type=cache,target=/usr/src/app/.yarn-cache \
43-
yarn install --frozen-lockfile --production=false --cache-folder /usr/src/app/.yarn-cache && \
44-
yarn cache clean && \
45-
rm -rf /usr/src/app/.yarn-cache/*
42+
RUN --mount=type=cache,target=/usr/src/app/.npm-cache \
43+
npm ci --cache /usr/src/app/.npm-cache && \
44+
npm cache clean --force && \
45+
rm -rf /usr/src/app/.npm-cache/*
4646

4747
# Copy source code
4848
COPY . .
4949

5050
# Build TypeScript code with deterministic output
51-
RUN yarn build
51+
RUN npm run build
5252

5353
FROM node:22.1.0-alpine@sha256:487dc5d5122d578e13f2231aa4ac0f63068becd921099c4c677c850df93bede8 AS production
5454

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ TLS_KEY_PATH=./server.key \
101101
TLS_CERT_PATH=./server.crt \
102102
MTLS_REQUEST_CERT=true \
103103
ALLOW_SELF_SIGNED=true \
104-
yarn start
104+
npm run start
105105
```
106106

107107
### 3. Start Master Express
@@ -117,7 +117,7 @@ ENCLAVED_EXPRESS_URL=https://localhost:3080 \
117117
ENCLAVED_EXPRESS_CERT=./server.crt \
118118
MTLS_REQUEST_CERT=false \
119119
ALLOW_SELF_SIGNED=true \
120-
yarn start
120+
npm run start
121121
```
122122

123123
### 4. Test the Connection
@@ -151,7 +151,7 @@ TLS_CERT_PATH=/secure/path/enclaved.crt \
151151
MTLS_REQUEST_CERT=true \
152152
ALLOW_SELF_SIGNED=false \
153153
MTLS_ALLOWED_CLIENT_FINGERPRINTS=ABC123...,DEF456... \
154-
yarn start
154+
npm run start
155155
```
156156

157157
#### Master Express (Production)
@@ -165,7 +165,7 @@ ENCLAVED_EXPRESS_URL=https://enclaved.internal.example.com:3080 \
165165
ENCLAVED_EXPRESS_CERT=/secure/path/enclaved.crt \
166166
MTLS_REQUEST_CERT=true \
167167
ALLOW_SELF_SIGNED=false \
168-
yarn start
168+
npm run start
169169
```
170170

171171
## Container Deployment with Podman
@@ -174,10 +174,10 @@ First, build the container image:
174174

175175
```bash
176176
# For Master Express (default port 3081)
177-
yarn container:build
177+
npm run container:build
178178

179179
# For Enclaved Express (port 3080)
180-
yarn container:build --build-arg PORT=3080
180+
npm run container:build --build-arg PORT=3080
181181
```
182182

183183
For local development, you'll need to run both the Enclaved Express and Master Express containers:
@@ -290,7 +290,7 @@ env | grep -E "(APP_MODE|KMS_URL|ENCLAVED_EXPRESS|TLS_)"
290290
Enable debug logging for detailed troubleshooting:
291291

292292
```bash
293-
DEBUG_NAMESPACE=enclaved:*,master:* yarn start
293+
DEBUG_NAMESPACE=enclaved:*,master:* npm run start
294294
```
295295

296296
## License

0 commit comments

Comments
 (0)