Skip to content

Commit ad64bfe

Browse files
authored
Switch to pnpm (and update some dependencies) (#2032)
1 parent ffd4d1f commit ad64bfe

File tree

14 files changed

+3786
-8458
lines changed

14 files changed

+3786
-8458
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,20 @@ jobs:
2626
runs-on: ubuntu-22.04
2727
steps:
2828
- uses: actions/checkout@v4
29+
- name: Install pnpm
30+
uses: pnpm/action-setup@v4
31+
with:
32+
version: 10
2933
- name: Setup Node.js
3034
uses: actions/setup-node@v4
3135
with:
3236
node-version: 22
37+
cache: pnpm
38+
cache-dependency-path: photon-client/pnpm-lock.yaml
3339
- name: Install Dependencies
34-
run: npm ci
40+
run: pnpm i --frozen-lockfile
3541
- name: Build Production Client
36-
run: npm run build
42+
run: pnpm run build
3743
- uses: actions/upload-artifact@v4
3844
with:
3945
name: built-client

.github/workflows/lint-format.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,22 @@ jobs:
6767
runs-on: ubuntu-22.04
6868
steps:
6969
- uses: actions/checkout@v4
70+
- name: Install pnpm
71+
uses: pnpm/action-setup@v4
72+
with:
73+
version: 10
7074
- name: Setup Node.js
7175
uses: actions/setup-node@v4
7276
with:
7377
node-version: 22
78+
cache: pnpm
79+
cache-dependency-path: photon-client/pnpm-lock.yaml
7480
- name: Install Dependencies
75-
run: npm ci
81+
run: pnpm i --frozen-lockfile
7682
- name: Check Linting
77-
run: npm run lint-ci
83+
run: pnpm run lint-ci
7884
- name: Check Formatting
79-
run: npm run format-ci
85+
run: pnpm run format-ci
8086
server-index:
8187
name: "Check server index.html not changed"
8288
runs-on: ubuntu-22.04

.github/workflows/photon-api-docs.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,20 @@ jobs:
3030
runs-on: ubuntu-22.04
3131
steps:
3232
- uses: actions/checkout@v4
33+
- name: Install pnpm
34+
uses: pnpm/action-setup@v4
35+
with:
36+
version: 10
3337
- name: Setup Node.js
3438
uses: actions/setup-node@v4
3539
with:
3640
node-version: 22
41+
cache: pnpm
42+
cache-dependency-path: photon-client/pnpm-lock.yaml
3743
- name: Install Dependencies
38-
run: npm ci
44+
run: pnpm i --frozen-lockfile
3945
- name: Build Production Client
40-
run: npm run build-demo
46+
run: pnpm run build-demo
4147
- uses: actions/upload-artifact@v4
4248
with:
4349
name: built-demo

.github/workflows/website.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,21 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v4
13+
- name: Install pnpm
14+
uses: pnpm/action-setup@v4
15+
with:
16+
version: 10
1317
- name: Setup Node
1418
uses: actions/setup-node@v4
19+
with:
20+
node-version: 22
21+
cache: pnpm
22+
cache-dependency-path: website/pnpm-lock.yaml
1523
- name: Install packages
16-
run: npm ci
24+
run: pnpm i --frozen-lockfile
1725
working-directory: website
1826
- name: Build project
19-
run: npm run build
27+
run: pnpm run build
2028
working-directory: website
2129
- uses: up9cloud/[email protected]
2230
if: github.ref == 'refs/heads/main'
@@ -32,11 +40,19 @@ jobs:
3240
runs-on: ubuntu-latest
3341
steps:
3442
- uses: actions/checkout@v4
43+
- name: Install pnpm
44+
uses: pnpm/action-setup@v4
45+
with:
46+
version: 10
3547
- name: Setup Node
3648
uses: actions/setup-node@v4
49+
with:
50+
node-version: 22
51+
cache: pnpm
52+
cache-dependency-path: website/pnpm-lock.yaml
3753
- name: Install Packages
38-
run: npm ci
54+
run: pnpm i --frozen-lockfile
3955
working-directory: website
4056
- name: Run Formatting Check
41-
run: npx prettier -c .
57+
run: pnpm prettier -c .
4258
working-directory: website

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ If you are interested in contributing code or documentation to the project, plea
2323

2424
## Building
2525

26-
Gradle is used for all C++ and Java code, and NPM is used for the web UI. Instructions to compile PhotonVision yourself can be found [in our docs](https://docs.photonvision.org/en/latest/docs/contributing/building-photon.html#compiling-instructions).
26+
Gradle is used for all C++ and Java code, and pnpm is used for the web UI. Instructions to compile PhotonVision yourself can be found [in our docs](https://docs.photonvision.org/en/latest/docs/contributing/building-photon.html#compiling-instructions).
2727

2828
You can run one of the many built in examples straight from the command line, too! They contain a fully featured robot project, and some include simulation support. The projects can be found inside the [`photonlib-java-examples`](photonlib-java-examples) and [`photonlib-cpp-examples`](photonlib-cpp-examples) subdirectories, respectively. Instructions for running these examples directly from the repo are found [in the docs](https://docs.photonvision.org/en/latest/docs/contributing/building-photon.html#running-examples).
2929

docs/source/docs/contributing/building-photon.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ or alternatively download the source code from GitHub and extract the zip:
3636
In the photon-client directory:
3737

3838
```bash
39-
npm install
39+
pnpm install
4040
```
4141

4242
### Build and Copy UI to Java Source
@@ -64,7 +64,7 @@ In the root directory:
6464
In the photon-client directory:
6565

6666
```bash
67-
npm run dev
67+
pnpm run dev
6868
```
6969

7070
This allows you to make UI changes quickly without having to spend time rebuilding the jar. Hot reload is enabled, so changes that you make and save are reflected in the UI immediately. Running this command will give you the URL for accessing the UI, which is on a different port than normal. You must use the printed URL to use hot reload.

photon-client/.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
src/assets/fonts/PromptRegular.ts
2+
pnpm-lock.yaml

0 commit comments

Comments
 (0)