Skip to content

Commit 0835fbc

Browse files
authored
chore: updating pnpm and setting minimumReleaseAge to 1 week (electron-userland#9300)
1 parent eb1ecce commit 0835fbc

File tree

11 files changed

+96
-63
lines changed

11 files changed

+96
-63
lines changed

.changeset/neat-rivers-itch.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"app-builder-lib": patch
3+
---
4+
5+
chore: updating pnpm and setting minimumReleaseAge to 1 week

.github/actions/pnpm/action.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
name: 'pnpm installation'
2-
description: 'Install and audit dependencies via pnpm'
3-
inputs:
4-
version: # id of input
5-
description: 'The pnpm version to use'
6-
required: false
7-
default: 9.4.0
2+
description: 'Enable via corepack and install dependencies'
83

94
runs:
105
using: 'composite'
116
steps:
12-
- name: Setup pnpm
13-
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
14-
with:
15-
version: ${{ inputs.version }}
7+
- name: Enable Corepack for pnpm
8+
run: corepack enable
9+
shell: bash
1610

1711
- name: Setup node
1812
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
@@ -25,7 +19,5 @@ runs:
2519
shell: bash
2620

2721
## Usage
28-
# - name: install and audit
29-
# uses: ./.github/actions/pnpm
30-
# with:
31-
# version: ${{ env.PNPM_VERSION }}
22+
# - name: corepack and install dependencies
23+
# uses: ./.github/actions/pnpm

.github/actions/pretest/action.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
11
name: 'Setup Tests'
2-
description: 'Set up pnpm, node w/ pnpm cache, install and audit deps, compile, and restore electron cache'
2+
description: 'Set up pnpm, node w/ pnpm cache, install deps, compile, and restore electron cache'
33
inputs:
44
cache-key:
55
description: 'The key to the electron cache'
66
required: true
77
cache-path:
88
description: 'The path to the electron cache'
99
required: true
10-
version:
11-
description: 'The pnpm version to use'
12-
required: false
13-
default: 9.4.0
1410

1511
runs:
1612
using: 'composite'
1713
steps:
18-
- name: Setup pnpm
19-
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
20-
with:
21-
version: ${{ inputs.version }}
14+
- name: Enable Corepack for pnpm
15+
run: corepack enable
16+
shell: bash
2217

2318
- name: Setup python
2419
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5

.github/workflows/test.yaml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ jobs:
114114
# Need to separate from other tests because logic is specific to when TOKEN env vars are set
115115
test-updater:
116116
runs-on: ubuntu-22.04
117-
timeout-minutes: 30
117+
timeout-minutes: 20
118118
needs: [check-if-docker-build, run-docker-build]
119119
# Wonky if-conditional to allow this step to run AFTER docker images are rebuilt OR if the build stage skipped and we want to use dockerhub registry for images
120120
if: |
@@ -160,13 +160,27 @@ jobs:
160160
FORCE_COLOR: 1
161161
TEST_RUNNER_IMAGE_TAG: electronuserland/builder:${{ env.TEST_IMAGE_NODE_MAJOR_VERSION }}-wine-mono
162162

163-
- name: Test Linux Updater
164-
run: |
165-
sh test/src/updater/test-specific-platforms.sh
163+
# must be it's own build node due to docker library/images size limit on github hosted runners
164+
test-e2e:
165+
runs-on: ubuntu-22.04
166+
timeout-minutes: 30
167+
steps:
168+
- name: Checkout code repository
169+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
170+
171+
- name: Setup Tests
172+
uses: ./.github/actions/pretest
173+
with:
174+
cache-path: ~/.cache/electron
175+
cache-key: v-23.3.10-update-electron
166176

167177
- name: Verify Docs Generation
168178
run: pnpm generate-all
169179

180+
- name: e2e Linux Updater tests (install, auto-update, uninstall)
181+
run: |
182+
sh test/src/updater/test-specific-platforms.sh
183+
170184
test-windows:
171185
runs-on: windows-2022
172186
timeout-minutes: 20

CONTRIBUTING.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@ This repository has a mono-repo structure consisting of multiple packages. Try t
77

88
## Prerequisites
99

10-
> All prerequisites could be installed via script at the end of the chapter
10+
- [pnpm](https://pnpm.js.org) is required.
1111

12-
- [pnpm](https://pnpm.js.org) is required because NPM is not reliable and Yarn 2 is not as good as PNPM.
12+
Use `corepack` to activate the correct version of pnpm for this project.
1313

14-
Currently we use the following version of PNPM in the Github CI's action config, please use the same version to ensure that lockfiles are compatible.
15-
https://github.com/electron-userland/electron-builder/blob/master/.github/actions/pnpm/action.yml
14+
For local development:
15+
### New dev route
16+
https://pnpm.io/cli/link
1617

17-
- For local development, you can use [yalc](https://github.com/whitecolor/yalc) in order to apply changes made to
18+
### Legacy dev Route
19+
20+
You can use [yalc](https://github.com/whitecolor/yalc) in order to apply changes made to
1821
electron-builder for your other projects to leverage and test with.
1922

2023
```

docker/node/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ RUN curl -L https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64
88
unlink /usr/local/CHANGELOG.md && unlink /usr/local/LICENSE && unlink /usr/local/README.md && \
99
# https://github.com/npm/npm/issues/4531
1010
echo "unsafe-perm true" > .npmrc
11-
RUN npm i -g pnpm@9.4.0
11+
RUN npm i -g pnpm@10.18.0

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
"@babel/plugin-transform-modules-commonjs": "7.24.8",
5151
"@changesets/changelog-github": "0.4.7",
5252
"@changesets/cli": "2.29.7",
53+
"@eslint/eslintrc": "^3.3.1",
54+
"@eslint/js": "^9.37.0",
5355
"@stylistic/eslint-plugin": "^2.8.0",
5456
"@types/node": "^22.7.4",
5557
"@typescript-eslint/eslint-plugin": "8.17.0",
@@ -74,9 +76,9 @@
7476
},
7577
"engines": {
7678
"node": ">=14.14",
77-
"pnpm": ">=9"
79+
"pnpm": ">=10"
7880
},
79-
"packageManager": "pnpm@9.4.0",
81+
"packageManager": "pnpm@10.18.0+sha512.e804f889f1cecc40d572db084eec3e4881739f8dec69c0ff10d2d1beff9a4e309383ba27b5b750059d7f4c149535b6cd0d2cb1ed3aeb739239a4284a68f40cfa",
8082
"pnpm": {
8183
"patchedDependencies": {
8284
"@changesets/[email protected]": "patches/@[email protected]",

packages/app-builder-lib/src/node-module-collector/packageManager.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,13 @@ export function detectPackageManagerByLockfile(cwd: string): PM | null {
9191
}
9292

9393
export function detectYarnBerry() {
94-
// yarn --version
95-
const version = execSync("yarn --version").toString().trim()
96-
if (parseInt(version.split(".")[0]) > 1) return PM.YARN_BERRY
94+
try {
95+
const version = execSync("yarn --version").toString().trim()
96+
if (parseInt(version.split(".")[0]) > 1) {
97+
return PM.YARN_BERRY
98+
}
99+
} catch (_e) {
100+
// If `yarn` is not found or another error occurs, fallback to the regular Yarn
101+
}
97102
return PM.YARN
98103
}

pnpm-lock.yaml

Lines changed: 36 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)