Skip to content

Commit

Permalink
chore: Update pnpm to 9.4.0 and edit some docs (#8304)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaietta authored Jul 10, 2024
1 parent cfbd106 commit 1ac86c9
Show file tree
Hide file tree
Showing 10 changed files with 7,330 additions and 5,456 deletions.
16 changes: 16 additions & 0 deletions .changeset/clean-boxes-do.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
"app-builder-lib": patch
"builder-util": patch
"builder-util-runtime": patch
"dmg-builder": patch
"electron-builder": patch
"electron-builder-squirrel-windows": patch
"electron-forge-maker-appimage": patch
"electron-forge-maker-nsis": patch
"electron-forge-maker-nsis-web": patch
"electron-forge-maker-snap": patch
"electron-publish": patch
"electron-updater": patch
---

chore: update pnpm to 9.4.0
2 changes: 1 addition & 1 deletion .github/actions/pnpm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ inputs:
version: # id of input
description: 'The pnpm version to use'
required: false
default: 8.9.0
default: 9.4.0

runs:
using: 'composite'
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/pretest/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ inputs:
version:
description: 'The pnpm version to use'
required: false
default: 8.9.0
default: 9.4.0

runs:
using: 'composite'
Expand Down
8 changes: 6 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ This repository has a mono-repo structure consisting of multiple packages. Try t

> All prerequisites could be installed via script at the end of the chapter
- [pnpm](https://pnpm.js.org) is required because NPM is not reliable and Yarn 2 is not as good as PNPM. Currently we use the latest version 7.x of PNPM, please use the same version to ensure that lockfiles are compatible.
- [pnpm](https://pnpm.js.org) is required because NPM is not reliable and Yarn 2 is not as good as PNPM.

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.
https://github.com/electron-userland/electron-builder/blob/master/.github/actions/pnpm/action.yml

- For local development, you can use [yalc](https://github.com/whitecolor/yalc) in order to apply changes made to
electron-builder for your other projects to leverage and test with.

```
npm i -g pnpm@latest-8
npm i -g pnpm
pnpm i yalc -g
```

Expand Down
2 changes: 1 addition & 1 deletion docker/node/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ RUN curl -L https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64
unlink /usr/local/CHANGELOG.md && unlink /usr/local/LICENSE && unlink /usr/local/README.md && \
# https://github.com/npm/npm/issues/4531
echo "unsafe-perm true" > .npmrc
RUN npm i -g pnpm@8.9.0
RUN npm i -g pnpm@9.4.0
33 changes: 24 additions & 9 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Building:
--ia32 Build for ia32 [boolean]
--armv7l Build for armv7l [boolean]
--arm64 Build for arm64 [boolean]
--universal Build for universal (mac only) [boolean]
--dir Build unpacked dir. Useful to test. [boolean]
--prepackaged, --pd The path to prepackaged app (to pack in a
distributable format)
Expand All @@ -40,24 +41,24 @@ Other:

For other commands please see help using `--help` arg, e.g. `./node_modules/.bin/electron-builder install-app-deps --help`

!!! tip
!!! tip
Since Node.js 8 [npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) is bundled, so, you can simply use `npx electron-builder`.


Prepend `npx` to sample commands below if you run it from Terminal and not from `package.json` scripts.

!!! example "build for macOS, Windows and Linux"
`electron-builder -mwl`

!!! example "build deb and tar.xz for Linux"
`electron-builder --linux deb tar.xz`

!!! example "build NSIS 32-bit installer for Windows"
`electron-builder --windows nsis:ia32`

!!! example "set package.json property `foo` to `bar`"
`electron-builder -c.extraMetadata.foo=bar`

!!! example "configure unicode options for NSIS"
`electron-builder -c.nsis.unicode=false`

Expand All @@ -71,7 +72,7 @@ Without target configuration, electron-builder builds Electron app for current p
- if you build on Windows or macOS: [Snap](configuration/snap.md) and [AppImage](configuration/appimage.md) for x64.
- if you build on Linux: [Snap](configuration/snap.md) and [AppImage](configuration/appimage.md) for current architecture.

Platforms and archs can be configured or using [CLI args](https://github.com/electron-userland/electron-builder#cli-usage), or in the configuration.
Platforms and archs can be configured or using [CLI args](https://github.com/electron-userland/electron-builder#cli-usage), or in the configuration.

For example, if you don't want to pass `--ia32` and `--x64` flags each time, but instead build by default NSIS target for all archs for Windows:

Expand All @@ -90,6 +91,16 @@ For example, if you don't want to pass `--ia32` and `--x64` flags each time, but
]
}
]
},
"mac": {
"target": [
{
"target": "dmg",
"arch": [
"universal"
]
}
]
}
}
```
Expand All @@ -102,6 +113,10 @@ For example, if you don't want to pass `--ia32` and `--x64` flags each time, but
arch:
- x64
- ia32
mac:
target:
- target: dmg
arch: universal
```

and use
Expand All @@ -111,4 +126,4 @@ build -wl

### TargetConfiguration
* **<code id="TargetConfiguration-target">target</code>** String - The target name. e.g. `snap`.
* <code id="TargetConfiguration-arch">arch</code> "x64" | "ia32" | "armv7l" | "arm64" - The arch or list of archs.
* <code id="TargetConfiguration-arch">arch</code> "x64" | "ia32" | "armv7l" | "arm64" | "universal" - The arch or list of archs.
10 changes: 3 additions & 7 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ will declare to use node-modules instead of PnP.
To ensure your native dependencies always matched the electron version, simply add script `"postinstall": "electron-builder install-app-deps"` to your `package.json`.

5. If you have native addons of your own that are part of the application (not as a dependency), set [nodeGypRebuild](/configuration/configuration#Configuration-nodeGypRebuild) to `true`.

Please note that everything is packaged into an asar archive [by default](configuration/configuration.md#Configuration-asar).

For an app that will be shipped to production, you should sign your application. See [Where to buy code signing certificates](code-signing.md#where-to-buy-code-signing-certificate).
Expand Down Expand Up @@ -130,7 +130,7 @@ builder.build({

## Pack Only in a Distributable Format

You can use electron-builder only to pack your electron app in a AppImage, Snaps, Debian package, NSIS, macOS installer component package (`pkg`)
You can use electron-builder only to pack your electron app in a AppImage, Snaps, Debian package, NSIS, macOS installer component package (`pkg`)
and other distributable formats.

```
Expand All @@ -153,13 +153,9 @@ DEBUG=electron-builder
```bash
set DEBUG=electron-builder
```

!!! tip "PowerShell"
PowerShell uses different syntax to set environment variables.
```bash
$env:DEBUG=electron-builder
```

## Community

[electron-builder](https://electron-builder.zulipchat.com/) on Zulip.
2 changes: 1 addition & 1 deletion netlify-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pip3 install pipenv
pipenv install
echo "Installing pnpm"
npm i -g pnpm@latest-8
npm i -g pnpm@9.4.0
pnpm install --store=./node_modules/.pnpm-store
echo "Building site docs"
mkdocs build
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
},
"engines": {
"node": ">=14.14",
"pnpm": ">=8.0.0"
"pnpm": ">=8"
},
"pnpm": {
"patchedDependencies": {
Expand Down
Loading

0 comments on commit 1ac86c9

Please sign in to comment.