Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to pnpm #270

Closed
wants to merge 2 commits into from
Closed
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
69 changes: 45 additions & 24 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,26 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "npm"
cache: "pnpm"
- name: Setup Emscripten
uses: mymindstorm/setup-emsdk@v14
- name: Install Node.js dependencies
run: npm ci
run: pnpm i
env:
ASCOPE_NO_FFMPEG: true
- name: Check formatting
run: npm run check-format
run: pnpm run check-format
- name: Compile WebAssembly
run: mkdir bundles; npm run wasm:compile
run: mkdir bundles; pnpm run wasm:compile
- name: Compile bundles (FRC 6328)
run: npm run compile
run: pnpm run compile
- name: Upload bundles (FRC 6328)
uses: actions/upload-artifact@v4
with:
Expand All @@ -43,7 +46,7 @@ jobs:
bundles/*.js
bundles/*.wasm
- name: Compile bundles (WPILib)
run: npm run compile
run: pnpm run compile
env:
ASCOPE_DISTRIBUTOR: WPILIB
- name: Upload bundles (WPILib)
Expand All @@ -67,20 +70,23 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "npm"
cache: "pnpm"
- name: Install Node.js dependencies
run: npm ci
run: pnpm i
- name: Download bundles
uses: actions/download-artifact@v4
with:
name: bundles
path: bundles
- name: Build documentation
run: npm run docs:build-embed
run: pnpm run docs:build-embed
- name: Build app
run: npx electron-builder build --${{ matrix.arch }} --publish never
env:
Expand Down Expand Up @@ -124,13 +130,16 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "npm"
cache: "pnpm"
- name: Install Node.js dependencies
run: npm ci
run: pnpm i
- name: Load macOS certificate
if: github.event_name != 'pull_request'
run: |
Expand All @@ -148,7 +157,7 @@ jobs:
name: bundles
path: bundles
- name: Build documentation
run: npm run docs:build-embed
run: pnpm run docs:build-embed
- name: Build app
run: npx electron-builder build --${{ matrix.arch }} --publish never
env:
Expand Down Expand Up @@ -201,13 +210,16 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "npm"
cache: "pnpm"
- name: Install Node.js dependencies
run: npm ci
run: pnpm i
- name: Install Linux packages
run: |
sudo apt-get update; sudo apt-get install --no-install-recommends -y libarchive-tools snapd
Expand All @@ -225,7 +237,7 @@ jobs:
name: bundles
path: bundles
- name: Build documentation
run: npm run docs:build-embed
run: pnpm run docs:build-embed
- name: Build app
run: npx electron-builder build --${{ matrix.arch.electronArch }} -l ${{ matrix.format }} --publish never
env:
Expand Down Expand Up @@ -269,20 +281,23 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "npm"
cache: "pnpm"
- name: Install Node.js dependencies
run: npm ci
run: pnpm i
- name: Download bundles
uses: actions/download-artifact@v4
with:
name: bundles-wpilib
path: bundles
- name: Build documentation
run: npm run docs:build-embed
run: pnpm run docs:build-embed
- name: Build app
run: npx electron-builder build --publish never --${{ matrix.arch }} -w dir
env:
Expand Down Expand Up @@ -330,13 +345,16 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "npm"
cache: "pnpm"
- name: Install Node.js dependencies
run: npm ci
run: pnpm i
- name: Load macOS certificate
if: github.event_name != 'pull_request'
run: |
Expand All @@ -354,7 +372,7 @@ jobs:
name: bundles-wpilib
path: bundles
- name: Build documentation
run: npm run docs:build-embed
run: pnpm run docs:build-embed
- name: Build app
run: npx electron-builder build --publish never --${{ matrix.arch }} -m dir
env:
Expand Down Expand Up @@ -404,20 +422,23 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "npm"
cache: "pnpm"
- name: Install Node.js dependencies
run: npm ci
run: pnpm i
- name: Download bundles
uses: actions/download-artifact@v4
with:
name: bundles-wpilib
path: bundles
- name: Build documentation
run: npm run docs:build-embed
run: pnpm run docs:build-embed
- name: Build app
run: npx electron-builder build --publish never --${{ matrix.arch }} -l dir
env:
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node-linker=hoisted
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,21 @@ Feedback, feature requests, and bug reports are welcome on the [issues page](htt
To install Node.js dependencies, run:

```bash
npm install
pnpm install
```

[Emscripten](https://emscripten.org) also needs to be installed (instructions [here](https://emscripten.org/docs/getting_started/downloads.html)).

To build for the current platform, run:

```bash
npm run build
pnpm run build
```

To build for another platform, run:

```bash
npm run build -- --win --x64 # For full list of options, run "npx electron-builder help"
pnpm run build --win --x64 # For full list of options, run "npx electron-builder help"
```

To build the WPILib version, set the environment variable `ASCOPE_DISTRIBUTOR` to `WPILIB` before building:
Expand All @@ -60,8 +60,8 @@ export ASCOPE_DISTRIBUTOR=WPILIB
For development, run:

```bash
npm run watch
npm start
pnpm run watch
pnpm start
```

## Assets
Expand Down
Loading