Skip to content

Commit 62d21a5

Browse files
chore(agents): Ensure that coding agents use pnpm rather than npm (#8930)
Co-authored-by: Alexander Eichhorn <alex@eichhorn.dev>
1 parent eb15a4e commit 62d21a5

3 files changed

Lines changed: 37 additions & 1 deletion

File tree

.github/AGENTS.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Agent Instructions
2+
3+
## Package Management
4+
5+
This project uses **pnpm** exclusively for package management in the frontend (`invokeai/frontend/web/`).
6+
7+
- ✅ Use `pnpm` commands (e.g., `pnpm install`, `pnpm run`)
8+
- ❌ Never use `npm` or `yarn` commands
9+
- ❌ Never suggest creating or using `package-lock.json` or `yarn.lock`
10+
- ✅ The lock file is `pnpm-lock.yaml`
11+
12+
Use the following pnpm commands for typical operations:
13+
14+
- pnpm -C invokeai/frontend/web install
15+
- pnpm -C invokeai/frontend/web build
16+
- pnpm -C invokeai/frontend/web lint:tsc
17+
- pnpm -C invokeai/frontend/web lint:dpdm
18+
- pnpm -C invokeai/frontend/web lint:eslint
19+
- pnpm -C invokeai/frontend/web lint:prettier
20+
21+
## Project Structure
22+
23+
- Backend: Python in `invokeai/`
24+
- Frontend: TypeScript/React in `invokeai/frontend/web/` (uses pnpm)

.github/workflows/frontend-checks.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,17 @@ jobs:
4141
steps:
4242
- uses: actions/checkout@v4
4343

44+
- name: Fail if package-lock.json is added/modified (pnpm only)
45+
shell: bash
46+
working-directory: .
47+
run: |
48+
set -euo pipefail
49+
git fetch --no-tags --prune --depth=1 origin "${{ github.base_ref }}"
50+
if git diff --name-only "origin/${{ github.base_ref }}...HEAD" | grep -E '(^|/)package-lock\.json$'; then
51+
echo "::error::package-lock.json was added or modified. This repo uses pnpm only."
52+
exit 1
53+
fi
54+
4455
- name: check for changed frontend files
4556
if: ${{ inputs.always_run != true }}
4657
id: changed-files
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"type": "module"
2+
"type": "module",
3+
"packageManager": "pnpm@10.12.4"
34
}

0 commit comments

Comments
 (0)