Skip to content

Commit 309d6a3

Browse files
saihajbenface
andauthored
chore: use pnpm (graphprotocol#295)
* chore: use pnpm * install in docker * use overrides * Update .github/workflows/website-integrity.yml Co-authored-by: Benoît Rouleau <[email protected]> --------- Co-authored-by: Benoît Rouleau <[email protected]>
1 parent b62fbf7 commit 309d6a3

File tree

8 files changed

+8317
-7711
lines changed

8 files changed

+8317
-7711
lines changed

.github/workflows/website-integrity.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ jobs:
1818
uses: the-guild-org/shared-config/setup@main
1919
with:
2020
nodeVersion: 18
21-
packageManager: yarn
21+
packageManager: pnpm
2222

2323
- name: Build Site
24-
run: yarn build
24+
run: pnpm build
2525

2626
- name: Compare
2727
run: git diff origin/${{ github.base_ref }}.. -- route-lockfile.txt

.husky/pre-commit

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
yarn pre-commit
4+
pnpm pre-commit

.husky/pre-push

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
yarn pre-push
4+
pnpm pre-push

Dockerfile

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
FROM node:16.13.1-alpine3.14 as builder
22

33
RUN apk add --no-cache git
4+
RUN npm install -g pnpm
45

56
WORKDIR /app
67

78
# copy package and lock files first for better caching
89
COPY ./package.json /app/package.json
9-
COPY ./yarn.lock /app/yarn.lock
10+
COPY ./pnpm-lock.yaml /app/pnpm-lock.yaml
1011

1112
# install the packages
12-
RUN yarn install --frozen-lockfile --ignore-scripts
13+
RUN pnpm install --frozen-lockfile --ignore-scripts
1314

1415
# copy the rest
1516
COPY . .
1617

17-
RUN yarn build
18-
RUN yarn export
18+
RUN pnpm build
19+
RUN pnpm export
1920

2021
## production environment
2122
FROM nginx:1.16.0-alpine

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Please read [`CONTRIBUTING.md`](https://github.com/graphprotocol/docs/blob/main/
88

99
## Local Setup
1010

11-
This project is built on [Next.js](https://nextjs.org/). You can run it on your machine, provided you have [Node 16+](https://nodejs.org/en/) and [Yarn](https://yarnpkg.com) installed.
11+
This project is built on [Next.js](https://nextjs.org/). You can run it on your machine, provided you have [Node 16+](https://nodejs.org/en/) and [`pnpm`](https://pnpm.io) installed.
1212

1313
First, clone the repo:
1414

@@ -25,13 +25,13 @@ cd docs
2525
Install the dependencies:
2626

2727
```bash
28-
yarn
28+
pnpm install
2929
```
3030

3131
Then, run the project:
3232

3333
```bash
34-
yarn dev
34+
pnpm dev
3535
```
3636

3737
That’s it! Go to http://localhost:3000 to see it in action. Any change you make to a file in `pages` should be refreshed automatically in your browser.

package.json

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
{
22
"name": "@graphprotocol/docs",
33
"version": "1.0.0",
4+
"packageManager": "[email protected]",
45
"private": true,
56
"scripts": {
67
"dev": "next dev",
78
"build": "rm -rf .next && next build",
89
"postbuild": "next-sitemap --config next-sitemap.config.cjs && node scripts/sitemap-ci.mjs",
910
"start": "next start",
1011
"export": "rm -rf out && next export -o out/docs",
11-
"lint": "eslint . --ext .js,.jsx,.ts,.tsx,.mjs && yarn prettier:check && yarn typecheck",
12-
"lint:fix": "eslint . --fix --ext .js,.jsx,.ts,.tsx,.mjs && yarn prettier && yarn typecheck",
12+
"lint": "eslint . --ext .js,.jsx,.ts,.tsx,.mjs && pnpm prettier:check && pnpm typecheck",
13+
"lint:fix": "eslint . --fix --ext .js,.jsx,.ts,.tsx,.mjs && pnpm prettier && pnpm typecheck",
1314
"prettier": "prettier . --write",
1415
"prettier:check": "prettier . --check",
1516
"typecheck": "tsc --noEmit",
@@ -18,7 +19,7 @@
1819
"docker:clean": "docker builder prune",
1920
"prepare": "husky install && chmod +x .husky/*",
2021
"pre-commit": "lint-staged --concurrent false",
21-
"pre-push": "yarn build"
22+
"pre-push": "pnpm build"
2223
},
2324
"dependencies": {
2425
"@docsearch/react": "^3.3.3",
@@ -68,8 +69,10 @@
6869
"unist-util-visit": "^4.1.2",
6970
"url": "^0.11.0"
7071
},
71-
"resolutions": {
72-
"@types/react": "^17.0.52"
72+
"pnpm": {
73+
"overrides": {
74+
"@types/react": "^17.0.52"
75+
}
7376
},
7477
"lint-staged": {
7578
"**/*.{js,jsx,ts,tsx,mjs}": "eslint --fix",

0 commit comments

Comments
 (0)