Skip to content

Commit

Permalink
build(*): replace yarn with pnpm (#2759)
Browse files Browse the repository at this point in the history
Get rid of `yarn` in favor of `pnpm`.
  • Loading branch information
garrappachc authored Dec 27, 2023
1 parent fef717b commit 94a75a7
Show file tree
Hide file tree
Showing 9 changed files with 9,090 additions and 13,142 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,19 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
cache: yarn
cache: pnpm

- name: Install dependencies
run: yarn install --immutable
run: pnpm install

- name: Lint
run: yarn lint
run: pnpm lint
44 changes: 32 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,22 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: yarn
cache: pnpm

- name: Install dependencies
run: yarn install --immutable
run: pnpm install

- name: Run unit test
run: yarn test:ci
run: pnpm test:ci

- name: Upload test coverage info
uses: codecov/codecov-action@v3
Expand Down Expand Up @@ -118,14 +123,19 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: yarn
cache: pnpm

- name: Install dependencies
run: yarn install --immutable
run: pnpm install

- name: Setup mongodb-tools
run: |
Expand All @@ -152,7 +162,7 @@ jobs:
LOG_RELAY_PORT: '9871'
GAME_SERVER_SECRET: 'xxxxxx'
LOGS_TF_API_KEY: 'FAKE_LOGS_TF_API_KEY'
run: yarn test:e2e ${{ matrix.test-name }}
run: pnpm test:e2e ${{ matrix.test-name }}

- name: Upload test coverage info
uses: codecov/codecov-action@v3
Expand Down Expand Up @@ -188,14 +198,19 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: yarn
cache: pnpm

- name: Install dependencies
run: yarn install --immutable
run: pnpm install

- name: Run fresh instance
env:
Expand All @@ -213,7 +228,7 @@ jobs:
LOG_RELAY_PORT: '9871'
GAME_SERVER_SECRET: 'xxxxxx'
LOGS_TF_API_KEY: 'FAKE_LOGS_TF_API_KEY'
run: timeout 3m yarn dev || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi
run: timeout 3m pnpm dev || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi

build:
name: build
Expand All @@ -228,14 +243,19 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: yarn
cache: pnpm

- name: Install dependencies
run: yarn install --immutable
run: pnpm install

- name: Build
run: yarn build
run: pnpm build
893 changes: 0 additions & 893 deletions .yarn/releases/yarn-4.0.2.cjs

This file was deleted.

5 changes: 0 additions & 5 deletions .yarnrc.yml

This file was deleted.

13 changes: 5 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
FROM node:lts-alpine AS build
WORKDIR /tf2pickup.pl

COPY package.json yarn.lock .yarnrc.yml ./
COPY .yarn/releases .yarn/releases
RUN yarn install --immutable
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile

COPY . .
RUN yarn build
RUN pnpm build


FROM node:lts-alpine AS package-install
WORKDIR /tf2pickup.pl

COPY package.json yarn.lock .yarnrc.yml ./
COPY .yarn/releases .yarn/releases

RUN yarn workspaces focus --production
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --prod


FROM node:lts-alpine
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"prod": "node dist/src/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\"",
"test": "jest --watch",
"test:ci": "NODE_ENV=test node --max-old-space-size=4096 --trace-warnings node_modules/.bin/jest --ci --runInBand --forceExit",
"test:ci": "NODE_ENV=test jest --ci --runInBand --forceExit",
"test:e2e": "NODE_ENV=test jest --config e2e.jest.config.ts --runInBand --forceExit",
"release": "release-it"
},
Expand Down Expand Up @@ -57,6 +57,7 @@
"mongoose": "8.0.3",
"multer": "^1.4.5-lts.1",
"nestjs-real-ip": "3.0.1",
"openapi3-ts": "^4.2.1",
"passport": "0.7.0",
"passport-headerapikey": "1.2.2",
"passport-jwt": "4.0.1",
Expand All @@ -66,6 +67,7 @@
"reflect-metadata": "0.2.1",
"rimraf": "5.0.5",
"rxjs": "7.8.1",
"socket.io": "^4.7.2",
"steamid": "2.0.0",
"zod": "^3.20.2"
},
Expand All @@ -78,11 +80,9 @@
"@types/cache-manager-redis-store": "2.0.4",
"@types/cookie": "0.6.0",
"@types/cookie-parser": "1.4.6",
"@types/csv-parse": "^1.2.2",
"@types/express": "4.17.21",
"@types/helmet": "0.0.48",
"@types/jest": "29.5.11",
"@types/jsonschema": "1.1.1",
"@types/jsonwebtoken": "9.0.5",
"@types/lodash": "4.14.202",
"@types/mongodb-uri": "0.9.4",
Expand Down
Loading

0 comments on commit 94a75a7

Please sign in to comment.