Skip to content

Commit 7ec7c53

Browse files
committed
chore: migrate from Yarn to pnpm for package management
1 parent cd129fb commit 7ec7c53

File tree

7 files changed

+11632
-9320
lines changed

7 files changed

+11632
-9320
lines changed

.github/workflows/test.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,17 @@ jobs:
1515

1616
strategy:
1717
matrix:
18-
node-version: [22.10.0]
18+
node-version: [22.18.0]
1919

2020
steps:
2121
- uses: actions/checkout@v3
2222
- name: Use Node.js ${{ matrix.node-version }}
2323
uses: actions/setup-node@v3
2424
with:
2525
node-version: ${{ matrix.node-version }}
26-
- run: yarn
27-
- run: yarn test
26+
- name: Setup pnpm
27+
uses: pnpm/action-setup@v2
28+
with:
29+
version: 10.14.0
30+
- run: pnpm install
31+
- run: pnpm test

CONTRIBUTING.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Contributing to Real Dev Squad API
22

33
- [Getting Started](#getting-started)
4-
- [Yarn Command Reference](#yarn-command-reference)
4+
- [pnpm Command Reference](#pnpm-command-reference)
55
- [Project Structure](#project-structure)
66
- [Generating Authentication Token](#generating-authentication-token)
77
- [Testing Guidelines](#testing-guidelines)
@@ -12,26 +12,26 @@
1212

1313
Instructions for initial setup can be found in the [README](README.md).
1414

15-
## Yarn Command Reference
15+
## pnpm Command Reference
1616

17-
##### `yarn`
17+
##### `pnpm install`
1818

1919
Installs all `dependencies` listed in the root `package.json`.
2020

21-
##### `yarn run test`
21+
##### `pnpm test`
2222

23-
The script associated with `yarn run test` will run all tests that ensures that your commit does not break anything in the
23+
The script associated with `pnpm test` will run all tests that ensures that your commit does not break anything in the
2424
repository. This will run the lint, integration and unit tests.
2525

26-
##### `yarn run lint`
26+
##### `pnpm lint`
2727

2828
Runs the lint checks in the project.
2929

30-
##### `yarn run generate-api-schema`
30+
##### `pnpm generate-api-schema`
3131

3232
Generates the API schema in the file `public/apiSchema.json`.
3333

34-
##### `yarn run validate-setup`
34+
##### `pnpm validate-setup`
3535

3636
Runs the test for checking local development setup is working properly or not.
3737

@@ -146,8 +146,8 @@ export FIRESTORE_EMULATOR_HOST="localhost:<Firebase emulator PORT>"
146146
## Running test scripts on Windows
147147
148148
- Git Bash is recommended for running test scripts on Windows.
149-
- Run `yarn run test-integration` for running integration tests.
150-
- Run `yarn run test-unit` for running unit tests.
149+
- Run `pnpm test-integration` for running integration tests.
150+
- Run `pnpm test-unit` for running unit tests.
151151
- Make sure the server is not running.
152152
- Make sure to close the emulator window after running the tests in order to avoid the blocking of the port for the next tests to run.
153153
- For e.g - After running the integration tests, close the emulator window and then run the command for unit tests.
@@ -163,7 +163,7 @@ export FIRESTORE_EMULATOR_HOST="localhost:<Firebase emulator PORT>"
163163
## Certain issues you may face while running the tests:
164164
165165
- Java version is not above 11
166-
- When we run yarn test, it runs both the unit and integration tests (in this order). So after the unit tests are done, the java process is not killed automatically and when our integration test run it gives error.
166+
- When we run pnpm test, it runs both the unit and integration tests (in this order). So after the unit tests are done, the java process is not killed automatically and when our integration test run it gives error.
167167
- Error: connect ECONNREFUSED ::1:8081
168168
169169
## Possible solutions for above issues (in particular order):

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ This Project serves the backend APIs required for [Real Dev Squad](https://reald
2828

2929
## Starting Local Development
3030

31-
Please install `yarn` and `volta`
31+
Please install `pnpm` and `volta`
3232

3333
[Why Volta?](https://docs.volta.sh/guide/#why-volta)
3434

@@ -39,12 +39,12 @@ To install Volta, please follow the [process](https://docs.volta.sh/guide/gettin
3939
Install all the packages using the following command:
4040

4141
```shell
42-
yarn
42+
pnpm install
4343
```
44-
Now if one runs yarn install. The yarn.lock will be unexpectedly updated with an unknown future version of a dependency, potentially breaking the build in the future. To ensure that the yarn.lock file is not update, you will need to use the --frozen-lockfile flag.
44+
Now if one runs pnpm install. The pnpm-lock.yaml will be unexpectedly updated with an unknown future version of a dependency, potentially breaking the build in the future. To ensure that the pnpm-lock.yaml file is not update, you will need to use the --frozen-lockfile flag.
4545

4646
```shell
47-
yarn install --frozen-lockfile
47+
pnpm install --frozen-lockfile
4848
```
4949

5050
#### Confirm correct configuration setup
@@ -53,7 +53,7 @@ This command should be successful, before moving to development.
5353

5454

5555
```shell
56-
yarn validate-setup
56+
pnpm validate-setup
5757
```
5858

5959
#### TDD Local Development
@@ -65,27 +65,27 @@ Head over to [TDD Tests Files List](scripts/tests/tdd-files-list.txt), and add t
6565
Run TDD in watch mode. Exiting this command will print the coverage report. Try to achieve 100% coverage.
6666

6767
```shell
68-
yarn tdd:watch
68+
pnpm tdd:watch
6969
```
7070

7171
#### Running a server in Dev mode
7272

7373
```shell
74-
yarn dev
74+
pnpm dev
7575
```
7676

7777
## What happens in production:
7878

7979
- Install packages
8080

8181
```
82-
yarn
82+
pnpm install
8383
```
8484

8585
- Run tests
8686

8787
```
88-
yarn run test
88+
pnpm test
8989
```
9090

9191
- Prune dev dependencies
@@ -97,7 +97,7 @@ npm prune --production
9797
- Run start command (with port information)
9898

9999
```
100-
yarn start
100+
pnpm start
101101
```
102102

103103
Note: These are handled automatically behind the scene when pushing to [Heroku](https://devcenter.heroku.com/)

package.json

Lines changed: 45 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -5,86 +5,89 @@
55
"scripts": {
66
"start": "node ./dist/server.js",
77
"tsc": "tsc",
8-
"postinstall": "yarn run tsc",
8+
"postinstall": "pnpm run tsc",
99
"dev": "cross-env NODE_ENV=development ts-node-dev server.js",
1010
"lint": "eslint .",
1111
"lint-fix": "eslint . --fix",
1212
"validate-setup": "node scripts/validateSetup.js",
1313
"test-integration": "sh scripts/tests/testIntegration.sh",
1414
"test-unit": "sh scripts/tests/testUnit.sh",
15-
"test": "yarn lint && yarn test-unit && yarn test-integration",
15+
"test": "pnpm lint && pnpm test-unit && pnpm test-integration",
1616
"tdd:watch": "sh scripts/tests/tdd.sh"
1717
},
1818
"dependencies": {
19-
"@aws-sdk/client-identitystore": "^3.665.0",
20-
"@types/nodemailer": "^6.4.15",
21-
"axios": "1.7.4",
22-
"cloudinary": "2.0.3",
23-
"config": "3.3.7",
24-
"cookie-parser": "1.4.6",
19+
"@aws-sdk/client-identitystore": "^3.864.0",
20+
"@types/nodemailer": "^7.0.0",
21+
"axios": "^1.11.0",
22+
"cloudinary": "^2.7.0",
23+
"config": "4.1.1",
24+
"cookie-parser": "^1.4.7",
2525
"cors": "2.8.5",
2626
"datauri": "4.1.0",
27-
"debug": "4.3.5",
28-
"express": "~4.18.3",
27+
"debug": "^4.4.1",
28+
"express": "~5.1.0",
2929
"express-boom": "3.0.0",
30-
"firebase-admin": "12.1.1",
31-
"helmet": "7.1.0",
30+
"firebase-admin": "13.4.0",
31+
"helmet": "8.1.0",
3232
"http-errors": "~2.0.0",
33-
"joi": "17.12.2",
34-
"jsdoc": "4.0.2",
33+
"joi": "18.0.0",
34+
"jsdoc": "4.0.4",
3535
"jsonwebtoken": "^8.5.1",
36-
"morgan": "1.10.0",
37-
"multer": "1.4.5-lts.1",
38-
"newrelic": "11.19.0",
39-
"nodemailer": "^6.9.15",
36+
"morgan": "^1.10.1",
37+
"multer": "2.0.2",
38+
"newrelic": "13.1.0",
39+
"nodemailer": "^7.0.5",
4040
"nodemailer-mock": "^2.0.6",
4141
"passport": "0.7.0",
4242
"passport-github2": "0.1.12",
4343
"passport-google-oauth20": "^2.0.0",
44-
"rate-limiter-flexible": "5.0.3",
45-
"winston": "3.13.0"
44+
"rate-limiter-flexible": "7.2.0",
45+
"winston": "3.17.0"
4646
},
4747
"devDependencies": {
48-
"@types/chai": "4.3.16",
49-
"@types/config": "3.3.4",
50-
"@types/express": "4.17.21",
51-
"@types/jest": "29.5.12",
52-
"@types/mocha": "10.0.6",
53-
"@types/node": "20.11.24",
54-
"@types/sinon": "17.0.3",
55-
"@typescript-eslint/parser": "^7.1.1",
56-
"chai": "4.4.1",
48+
"@types/chai": "4.3.20",
49+
"@types/config": "3.3.5",
50+
"@types/express": "5.0.3",
51+
"@types/jest": "30.0.0",
52+
"@types/lodash": "^4.17.20",
53+
"@types/mocha": "10.0.10",
54+
"@types/node": "24.3.0",
55+
"@types/sinon": "17.0.4",
56+
"@typescript-eslint/parser": "^8.39.1",
57+
"chai": "4.5.0",
5758
"chai-http": "4.4.0",
58-
"cross-env": "7.0.3",
59+
"cross-env": "10.0.0",
5960
"eslint": "^8.57.0",
6061
"eslint-config-prettier": "^9.1.0",
6162
"eslint-config-standard": "^16.0.3",
6263
"eslint-plugin-import": "^2.22.1",
6364
"eslint-plugin-mocha": "^10.0.0",
6465
"eslint-plugin-node": "^11.1.0",
65-
"eslint-plugin-prettier": "^4.2.1",
66+
"eslint-plugin-prettier": "^5.5.4",
6667
"eslint-plugin-promise": "^6.0.0",
6768
"eslint-plugin-security": "^1.7.1",
68-
"firebase-tools": "13.4.0",
69-
"mocha": "10.3.0",
70-
"nock": "13.2.9",
71-
"nodemon": "3.1.3",
72-
"nyc": "15.1.0",
69+
"firebase-tools": "14.12.1",
70+
"lodash": "^4.17.21",
71+
"mocha": "11.7.1",
72+
"nock": "14.0.10",
73+
"nodemon": "3.1.10",
74+
"nyc": "17.1.0",
7375
"pre-commit": "1.2.2",
74-
"prettier": "^2.5.1",
75-
"sinon": "18.0.0",
76+
"prettier": "^2.8.8",
77+
"sinon": "21.0.0",
7678
"ts-node": "10.9.2",
7779
"ts-node-dev": "2.0.0",
78-
"typescript": "5.3.3"
80+
"typescript": "5.9.2"
7981
},
8082
"engines": {
81-
"node": "22.10.0"
83+
"node": "22.18.0",
84+
"pnpm": "10.14.0"
8285
},
8386
"pre-commit": [
8487
"lint"
8588
],
8689
"volta": {
87-
"node": "22.10.0",
88-
"yarn": "1.22.21"
90+
"node": "22.18.0",
91+
"pnpm": "10.14.0"
8992
}
9093
}

0 commit comments

Comments
 (0)