Skip to content

Commit 42ae87e

Browse files
authored
chore: migrate from npm to pnpm (#120)
* replace package-lock.json with pnpm-lock.yaml * update ci to use pnpm * update renovate config to use pnpm * update contributing.md
1 parent e8564e9 commit 42ae87e

9 files changed

Lines changed: 5889 additions & 8883 deletions

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,20 @@ jobs:
2424
with:
2525
persist-credentials: false
2626

27+
- name: Set up pnpm
28+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
29+
2730
- name: Set up Node.js
2831
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
2932
with:
3033
node-version: 24.16.0
31-
cache: npm
34+
cache: pnpm
3235

3336
- name: Install dependencies
34-
run: npm ci
37+
run: pnpm install --frozen-lockfile
3538

3639
- name: Build site
37-
run: npm run build:ci
40+
run: pnpm run build:ci
3841

3942
doc_tests:
4043
name: Test and update notebooks
@@ -58,14 +61,17 @@ jobs:
5861
- name: Install Python deps
5962
run: uv sync --all-extras
6063

64+
- name: Set up pnpm
65+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
66+
6167
- name: Set up Node.js
6268
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
6369
with:
6470
node-version: "24.16.0"
65-
cache: "npm"
71+
cache: "pnpm"
6672

6773
- name: Install Node deps
68-
run: npm ci
74+
run: pnpm install --frozen-lockfile
6975

7076
- name: Run notebook tests
7177
env:

.pre-commit-config.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,7 @@ repos:
3131
\.secrets\.baseline$|
3232
\.python-version$|
3333
venv\.lock$|
34-
version\.json$
34+
version\.json$|
35+
pnpm-lock\.yaml$|
36+
package-lock\.json$
3537
)$

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ pre-commit-install: ## Setup pre-commit hooks
55
.PHONY: pre-commit-install
66

77
install: ## Install project dependencies
8-
uv sync --all-extras && npm install
8+
uv sync --all-extras && pnpm install
99
.PHONY: setup
1010

1111

1212
dev: ## Start development server
13-
npm run dev
13+
pnpm dev
1414
.PHONY: dev
1515

1616
test-docs-nb: ## Run notebook E2E tests (overwrites outputs by default; set OVERWRITE_NB=0 to skip)

README.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,21 @@ Documentation site built with [Astro](https://astro.build) + [Starlight](https:/
55
## Requirements
66

77
- Node.js 18+
8-
- Python 3 + `black` (optional — only needed for `npm run format`)
8+
- [pnpm](https://pnpm.io/) (auto-managed via the `packageManager` field in `package.json`; enable with `corepack enable`)
9+
- Python 3 + `black` (optional, only needed for `pnpm run format`)
910

1011
## Commands
1112

12-
| Command | Description |
13-
| :---------------------- | :-------------------------------------------------------------------- |
14-
| `npm install` | Install dependencies |
15-
| `npm run dev` | Start local dev server at `localhost:4321` (converts notebooks first) |
16-
| `npm run build` | Format, convert notebooks, and build production site to `dist/` |
17-
| `npm run build:ci` | Convert notebooks and build without formatting use this in CI |
18-
| `npm run preview` | Preview the production build locally |
19-
| `npm run format` | Run Prettier + black on all `.md`/`.mdx` files |
20-
| `npm run format:prose` | Run Prettier only |
21-
| `npm run format:code` | Run black on Python code blocks only |
13+
| Command | Description |
14+
| :--------------------- | :-------------------------------------------------------------------- |
15+
| `pnpm install` | Install dependencies |
16+
| `pnpm dev` | Start local dev server at `localhost:4321` (converts notebooks first) |
17+
| `pnpm build` | Format, convert notebooks, and build production site to `dist/` |
18+
| `pnpm build:ci` | Convert notebooks and build without formatting (use this in CI) |
19+
| `pnpm preview` | Preview the production build locally |
20+
| `pnpm format` | Run Prettier + black on all `.md`/`.mdx` files |
21+
| `pnpm format:prose` | Run Prettier only |
22+
| `pnpm format:code` | Run black on Python code blocks only |
2223

2324
## Project structure
2425

@@ -44,7 +45,7 @@ Documentation site built with [Astro](https://astro.build) + [Starlight](https:/
4445
## Adding content
4546

4647
- **Markdown/MDX pages**: drop `.md` or `.mdx` files into `src/content/docs/`. The URL mirrors the file path.
47-
- **Jupyter notebooks**: add `.ipynb` files alongside other content. Running `npm run dev` or `npm run build:ci` converts them to `.mdx` automatically. The generated `.mdx` files are git-ignored — do not commit them.
48+
- **Jupyter notebooks**: add `.ipynb` files alongside other content. Running `pnpm dev` or `pnpm build:ci` converts them to `.mdx` automatically. The generated `.mdx` files are git-ignored — do not commit them.
4849
- **Sidebar ordering**: controlled by `_meta.yaml` files in each content directory (via `starlight-auto-sidebar`).
4950

5051
## Notebook conventions

0 commit comments

Comments
 (0)