Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
npx --no-install commitlint --edit "$1"
pnpm exec commitlint --edit "$1"
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
npx lint-staged
pnpm exec lint-staged
18 changes: 13 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,22 @@ python scripts/seed_problems.py # load problems from YAML
python app.py
```

One-time, from the repo root, install the Git hook tooling (requires Node 18+):
One-time, from the repo root, install the JavaScript tooling. This repo uses
[pnpm](https://pnpm.io/) (a pnpm workspace covers the root tooling and the
`frontend/` app). Enable it via Corepack, which ships with Node 18+:

```bash
npm install # sets up Husky pre-commit + commit-msg hooks
corepack enable # makes the pinned pnpm version available
pnpm install # installs frontend deps + sets up Git hooks
```

This activates auto-formatting and commit-message validation on every commit
(see [Git hooks](#git-hooks) and [Commit messages](#commit-messages) below).
`pnpm install` also activates auto-formatting and commit-message validation on
every commit (see [Git hooks](#git-hooks) and [Commit messages](#commit-messages)
below). The pnpm version is pinned via the `packageManager` field in the root
`package.json`.

The frontend can then be run from the repo root: `pnpm dev` (or `pnpm build` /
`pnpm lint`), which proxy to the `frontend` workspace.

### Running tests

Expand Down Expand Up @@ -127,7 +135,7 @@ sure both pass locally first.

### Git hooks

After `npm install` (repo root), [Husky](https://typicode.github.io/husky/)
After `pnpm install` (repo root), [Husky](https://typicode.github.io/husky/)
installs two hooks that run automatically:

- **`pre-commit`** — runs [lint-staged](https://github.com/lint-staged/lint-staged)
Expand Down
12 changes: 6 additions & 6 deletions frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-

## Getting Started

First, run the development server:
This app is part of a [pnpm workspace](https://pnpm.io/workspaces). Install
dependencies once from the **repo root** (`pnpm install`), then run the dev
server either from the root or from this directory:

```bash
npm run dev
# or
yarn dev
pnpm dev # from the repo root (proxies to this workspace)
# or
pnpm --filter frontend dev
# or, from inside frontend/
pnpm dev
# or
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
Expand Down
Loading
Loading