Skip to content

Commit 7c34801

Browse files
authored
chore: harden pnpm supply chain settings (#6044)
1 parent fc1219c commit 7c34801

11 files changed

Lines changed: 62 additions & 34 deletions

File tree

.circleci/config.yml

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,20 @@ jobs:
77
steps:
88
- checkout
99
- run:
10-
name: Install pnpm
11-
command: npm i --prefix=$HOME/.local -g pnpm@9.14.4
10+
name: Enable pnpm
11+
command: |
12+
mkdir -p $HOME/.local/bin
13+
corepack enable --install-directory $HOME/.local/bin
14+
corepack prepare pnpm@10.33.4 --activate
1215
- restore_cache:
1316
keys:
14-
- deps-v10-{{ checksum "pnpm-lock.yaml" }}
15-
- deps-v10-{{ .Branch }}
17+
- deps-pnpm-10-33-4-{{ checksum "pnpm-lock.yaml" }}
18+
- deps-pnpm-10-33-4-{{ .Branch }}
1619
- run:
1720
name: Install dependencies
1821
command: pnpm install
1922
- save_cache:
20-
key: deps-v10-{{ checksum "pnpm-lock.yaml" }}
23+
key: deps-pnpm-10-33-4-{{ checksum "pnpm-lock.yaml" }}
2124
paths:
2225
- ./node_modules
2326
- ./packages/eslint-config/node_modules
@@ -35,8 +38,8 @@ jobs:
3538
- checkout
3639
- restore_cache:
3740
keys:
38-
- deps-v10-{{ checksum "pnpm-lock.yaml" }}
39-
- deps-v10-{{ .Branch }}
41+
- deps-pnpm-10-33-4-{{ checksum "pnpm-lock.yaml" }}
42+
- deps-pnpm-10-33-4-{{ .Branch }}
4043
- run:
4144
name: Test
4245
command: |
@@ -56,8 +59,8 @@ jobs:
5659
- checkout
5760
- restore_cache:
5861
keys:
59-
- deps-v10-{{ checksum "pnpm-lock.yaml" }}
60-
- deps-v10-{{ .Branch }}
62+
- deps-pnpm-10-33-4-{{ checksum "pnpm-lock.yaml" }}
63+
- deps-pnpm-10-33-4-{{ .Branch }}
6164
- run:
6265
name: Test
6366
command: |
@@ -77,8 +80,8 @@ jobs:
7780
- checkout
7881
- restore_cache:
7982
keys:
80-
- deps-v10-{{ checksum "pnpm-lock.yaml" }}
81-
- deps-v10-{{ .Branch }}
83+
- deps-pnpm-10-33-4-{{ checksum "pnpm-lock.yaml" }}
84+
- deps-pnpm-10-33-4-{{ .Branch }}
8285
- run:
8386
name: Lint
8487
command: npm run pretest
@@ -91,8 +94,8 @@ jobs:
9194
- checkout
9295
- restore_cache:
9396
keys:
94-
- deps-v10-{{ checksum "pnpm-lock.yaml" }}
95-
- deps-v10-{{ .Branch }}
97+
- deps-pnpm-10-33-4-{{ checksum "pnpm-lock.yaml" }}
98+
- deps-pnpm-10-33-4-{{ .Branch }}
9699
- run:
97100
name: Fetch base branch
98101
command: git fetch origin main
@@ -107,8 +110,8 @@ jobs:
107110
- checkout
108111
- restore_cache:
109112
keys:
110-
- deps-v10-{{ checksum "pnpm-lock.yaml" }}
111-
- deps-v10-{{ .Branch }}
113+
- deps-pnpm-10-33-4-{{ checksum "pnpm-lock.yaml" }}
114+
- deps-pnpm-10-33-4-{{ .Branch }}
112115
- run:
113116
name: Test
114117
command: |
@@ -126,12 +129,15 @@ jobs:
126129
steps:
127130
- checkout
128131
- run:
129-
name: Install pnpm
130-
command: npm i --prefix=$HOME/.local -g pnpm@9.14.4
132+
name: Enable pnpm
133+
command: |
134+
mkdir -p $HOME/.local/bin
135+
corepack enable --install-directory $HOME/.local/bin
136+
corepack prepare pnpm@10.33.4 --activate
131137
- restore_cache:
132138
keys:
133-
- deps-v10-{{ checksum "pnpm-lock.yaml" }}
134-
- deps-v10-{{ .Branch }}
139+
- deps-pnpm-10-33-4-{{ checksum "pnpm-lock.yaml" }}
140+
- deps-pnpm-10-33-4-{{ .Branch }}
135141
- run:
136142
name: Install dependencies
137143
command: pnpm install

.github/workflows/e2e-tests.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
required: true
1212
type: string
1313

14+
permissions:
15+
contents: read
16+
1417
jobs:
1518
e2e-tests:
1619
if: >-
@@ -32,7 +35,7 @@ jobs:
3235
- name: Install pnpm
3336
uses: pnpm/action-setup@v4
3437
with:
35-
version: 9.14.4
38+
version: 10.33.4
3639

3740
- name: Get pnpm store directory
3841
shell: bash
@@ -43,9 +46,9 @@ jobs:
4346
uses: actions/cache@v4
4447
with:
4548
path: ${{ env.STORE_PATH }}
46-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
49+
key: ${{ runner.os }}-pnpm-10.33.4-store-${{ hashFiles('**/pnpm-lock.yaml') }}
4750
restore-keys: |
48-
${{ runner.os }}-pnpm-store-
51+
${{ runner.os }}-pnpm-10.33.4-store-
4952
5053
- name: Install dependencies
5154
run: pnpm install --frozen-lockfile

.gitpod.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ tasks:
3636
nvm install
3737
nvm use
3838
init: |
39-
npm i -g pnpm@9.14.4
39+
corepack enable
40+
corepack prepare pnpm@10.33.4 --activate
4041
pnpm install
4142
command: |
4243
cd packages/webapp

AGENTS.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ This is a pnpm monorepo containing the daily.dev application suite:
4141
## Technology Stack
4242

4343
- **Node.js v24.14** (see `package.json` `volta` and `packageManager` properties, also `.nvmrc`)
44-
- **pnpm 9.14.4** for package management (see `package.json` `packageManager` property)
44+
- **pnpm 10.33.4** for package management (see `package.json` `packageManager` property)
4545
- **TypeScript** across all packages
4646
- **React 18.3.1** with Next.js 15 for webapp (Pages Router, NOT App Router/Server Components)
4747
- **TanStack Query v5** for server state and data fetching
@@ -171,7 +171,8 @@ This ensures type safety, reduces duplication, and keeps types automatically in
171171
```bash
172172
# Setup
173173
nvm use # Use correct Node version from .nvmrc
174-
npm i -g pnpm@9.14.4
174+
corepack enable
175+
corepack prepare pnpm@10.33.4 --activate
175176
pnpm install
176177

177178
# Development

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ RUN \
2222
apk --no-cache add \
2323
libc6-compat
2424

25-
RUN npm i -g pnpm
25+
RUN corepack enable && corepack prepare pnpm@10.33.4 --activate
2626
RUN pnpm install
2727

2828
COPY packages ./packages

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The decision was made to allow faster iterations and to keep features parity in
2626
## Technologies
2727

2828
- Node v24.14 (a `.nvmrc` is presented for [nvm](https://github.com/nvm-sh/nvm) users).
29-
- [pnpm](https://pnpm.io/workspaces) for managing the monorepo and dependencies.
29+
- [pnpm](https://pnpm.io/workspaces) 10.33.4 for managing the monorepo and dependencies.
3030

3131
## Projects
3232

@@ -87,10 +87,18 @@ We would appreciate if you dedicate the time and read them carefully:
8787
After cloning the project, please make sure to run the following commands to bootstrap the project:
8888

8989
```bash
90-
npm i -g pnpm@9.14.4
90+
nvm use
91+
corepack enable
92+
corepack prepare pnpm@10.33.4 --activate
9193
pnpm install
9294
```
9395

96+
## Dependency Supply-Chain Hardening
97+
98+
This repo delays newly published package versions for seven days via `minimumReleaseAge: 10080` in `pnpm-workspace.yaml`. Keep using the pinned pnpm version from `package.json`; older pnpm versions do not enforce this setting.
99+
100+
Keep `pnpm-lock.yaml` committed, use frozen-lockfile installs in CI, and avoid adding git or tarball dependencies unless they are reviewed explicitly. If an urgent dependency update must bypass the cooldown, add a temporary `minimumReleaseAgeExclude` entry in `pnpm-workspace.yaml`, review the package contents/provenance first, and remove the exception after the release ages out.
101+
94102
### Run Extension Locally
95103

96104
Example for Chrome:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"test:e2e:headed": "pnpm --filter playwright test:headed",
1616
"test:e2e:ui": "pnpm --filter playwright test:ui"
1717
},
18-
"packageManager": "pnpm@9.14.4",
18+
"packageManager": "pnpm@10.33.4",
1919
"pnpm": {
2020
"patchedDependencies": {
2121
"graphql-request@3.7.0": "patches/graphql-request@3.7.0.patch"

packages/webapp/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "webapp",
33
"version": "0.0.0",
4+
"packageManager": "pnpm@10.33.4",
45
"scripts": {
56
"dev": "next dev -p 5002 --experimental-https --experimental-https-key ./certificates/adhoc-server.key --experimental-https-cert ./certificates/adhoc-server.crt --experimental-https-ca ./certificates/root_ca.crt",
67
"dev:turbo": "next dev --turbopack -p 5002 --experimental-https --experimental-https-key ./certificates/adhoc-server.key --experimental-https-cert ./certificates/adhoc-server.crt --experimental-https-ca ./certificates/root_ca.crt",

packages/webapp/vercel.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"installCommand": "if [ -f pnpm-workspace.yaml ]; then corepack pnpm@10.33.4 install; elif [ -f ../../pnpm-workspace.yaml ]; then corepack pnpm@10.33.4 --dir ../.. install; else corepack pnpm@10.33.4 install; fi",
23
"github": {
34
"silent": true
45
}

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)