Skip to content

Commit 4a51faa

Browse files
authored
Merge pull request #184 from wpengine/pnpm
refactor: move to pnpm
2 parents c420aad + fbe8237 commit 4a51faa

File tree

10 files changed

+12069
-15417
lines changed

10 files changed

+12069
-15417
lines changed

.github/actions/cache-restore/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ inputs:
55
node-version:
66
description: "Node version to use, default to LTS"
77
required: true
8-
default: 20
8+
default: 22
99
outputs:
1010
cache-hit:
1111
description: "Forward actions/cache cache-hit output"
@@ -27,4 +27,4 @@ runs:
2727
path: |
2828
**/node_modules
2929
~/.cache
30-
key: ${{ runner.os }}-npm-${{ inputs.node-version }}-${{ hashFiles('package-lock.json') }}
30+
key: ${{ runner.os }}-pnpm-${{ inputs.node-version }}-${{ hashFiles('pnpm-lock.yaml') }}

.github/workflows/validate_pr.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
strategy:
1616
matrix:
17-
node-version: [20]
17+
node-version: [22]
1818

1919
steps:
2020
- uses: actions/checkout@v4
@@ -30,7 +30,7 @@ jobs:
3030

3131
- name: Install dependencies
3232
if: steps.cache-node-modules.outputs.cache-hit != 'true'
33-
run: npm ci
33+
run: pnpm install --frozen-lockfile
3434

3535
check_format:
3636
name: Validate formating with Prettier
@@ -47,7 +47,7 @@ jobs:
4747
run: corepack enable
4848

4949
- name: Format source code
50-
run: npm run test:format
50+
run: pnpm run test:format
5151

5252
check_lint:
5353
name: Validate linting with ES Lint
@@ -64,7 +64,7 @@ jobs:
6464
run: corepack enable
6565

6666
- name: Check Linting
67-
run: npm run test:lint
67+
run: pnpm run test:lint
6868

6969
# run-tests:
7070
# name: Run package tests on (Node.js v${{ matrix.node }})
@@ -88,7 +88,7 @@ jobs:
8888
# run: corepack enable
8989

9090
# - name: Build packages
91-
# run: npm build
91+
# run: pnpm build
9292

9393
# - name: Set up S3 Server
9494
# uses: ./.github/actions/s3-test-server

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
engine-strict=true

.vscode/settings.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"cSpell.words": [
33
"combobox",
4+
"faustjs",
45
"faustwp",
56
"heroicons",
67
"Kevinbatdorf",
@@ -29,5 +30,14 @@
2930
},
3031
"[json]": {
3132
"editor.defaultFormatter": "esbenp.prettier-vscode"
32-
}
33+
},
34+
"cSpell.ignorePaths": [
35+
"package-lock.json",
36+
"node_modules",
37+
"vscode-extension",
38+
".git/objects",
39+
".vscode",
40+
".vscode-insiders",
41+
"pnpm-lock.yaml"
42+
]
3343
}

README.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,40 @@
22

33
Frontend for the [faustjs.org](https://faustjs.org/) website.
44

5+
# Prerequisites
6+
7+
- [`nvm` (Node Version Manager)](https://github.com/nvm-sh/nvm?tab=readme-ov-file#installing-and-updating)
8+
- Cloned repository
9+
10+
## Getting started
11+
12+
```bash
13+
$ nvm install # Install the correct version of node
14+
$ corepack enable # Enable Corepack
15+
$ corepack install # Install `pnpm` via Corepack
16+
$ pnpm install # Install project dependencies via `pnpm`
17+
$ pnpm dev # Start dev server; See `scripts` in `package.json` for more
18+
```
19+
20+
## PNPM Package Manager
21+
22+
```bash
23+
corepack enable
24+
corepack install
25+
```
26+
27+
This project users [pnpm](https://pnpm.io/). While not significantly different than `npm` here are some basic differences and I'd recommend you checkout the [`pnpm` docs](https://pnpm.io/) for more info.
28+
29+
- `npm run dev` => `pnpm dev` or `pnpm run dev` :: commands can be shortened, or use your muscle memory
30+
- `npx` => `pnpx` or `pnpm dlx` :: either way it still works
31+
- `pnpm update` :: a whole suite of [native tools](https://pnpm.io/cli/update) to manage dependencies. No need for 3rd party tools to update dependencies.
32+
533
## Linting and Formatting
634

735
Linting - checks for potential errors and code style. i.e. eslint
8-
Formatting - checks for spaces, line length, etc. i.e prittier
36+
Formatting - checks for spaces, line length, etc. i.e prettier
937

10-
Both are run against staged files on commit. If it's failing for a good reaason and you need to bypass you can use the `--no-verify` or `-n` flag. `git commit -nm "my message"`
38+
Both are run against staged files on commit. If it's failing for a good reason and you need to bypass you can use the `--no-verify` or `-n` flag. `git commit -nm "my message"`
1139

1240
## Documentation Docs
1341

eslint.config.mjs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const config = [
4040
rules: {
4141
"arrow-body-style": "off",
4242
"react/prop-types": "off",
43-
...unicorn.configs["flat/recommended"].rules, // neno disables a lot of unicorn rules so this reenables defaults
43+
...unicorn.configs["flat/recommended"].rules, // neon disables a lot of unicorn rules so this reenables defaults
4444
"react/no-danger": "warn",
4545
"react/jsx-sort-props": "off",
4646
"unicorn/prevent-abbreviations": [
@@ -79,12 +79,12 @@ const config = [
7979
"unicorn/prefer-module": "off",
8080
},
8181
},
82-
// {
83-
// files: ["src/pages/**/*.{js,jsx}"],
84-
// rules: {
85-
// "unicorn/filename-case": ["off"],
86-
// },
87-
// },
82+
{
83+
files: ["src/pages/**/*.{js,jsx}"],
84+
rules: {
85+
"react-refresh/only-export-components": ["off"],
86+
},
87+
},
8888
{
8989
...mdx.flat,
9090
processor: mdx.createRemarkProcessor({

0 commit comments

Comments
 (0)