Skip to content

Commit 7090720

Browse files
committed
node: Update the examples
1 parent 14c3fe4 commit 7090720

File tree

6 files changed

+950
-854
lines changed

6 files changed

+950
-854
lines changed

node/vanilla-quick-start/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ Showcases building a Flatpak of the Electron 18 version of
55

66
To create generated-sources.json run:
77

8-
```
9-
flatpak-node-generator.py npm /path/to/electron-quick-start/package-lock.json
8+
```sh
9+
flatpak-node-generator npm /path/to/electron-quick-start/package-lock.json
1010
```
1111

1212
(Make sure your local clone of electron-quick-start is at the same commit as used in the manifest

node/vanilla-quick-start/generated-sources.json

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

node/vanilla-quick-start/org.electronjs.ElectronQuickStart.yaml

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
app-id: org.electronjs.ElectronQuickStart
2-
branch: stable
32
runtime: org.freedesktop.Platform
4-
runtime-version: '22.08'
3+
runtime-version: '24.08'
54
sdk: org.freedesktop.Sdk
65
# Use the Electron 2 BaseApp, which adds several common libraries we'll need.
76
base: org.electronjs.Electron2.BaseApp
8-
base-version: '22.08'
9-
# Add the Node 16 SDK extension.
7+
base-version: '24.08'
8+
separate-locales: false
9+
# Add the Node SDK extension.
1010
sdk-extensions:
11-
- org.freedesktop.Sdk.Extension.node18
11+
- org.freedesktop.Sdk.Extension.node24
1212
command: start-electron-quick-start
1313
finish-args:
1414
# These three lines add the permissions needed for graphics.
1515
- --device=dri
1616
- --share=ipc
1717
- --socket=x11
1818
# Sound access.
19-
- --socket=pulseaudio
19+
# - --socket=pulseaudio
2020
# Network access.
21-
- --share=network
21+
# - --share=network
2222
# If you need to access the filesystem, also add:
2323
# - --filesystem=home
2424
modules:
@@ -30,23 +30,21 @@ modules:
3030
- name: node
3131
buildsystem: simple
3232
build-commands:
33-
- /usr/lib/sdk/node18/install-sdk.sh
33+
- /usr/lib/sdk/node24/install-sdk.sh
3434

3535
# Now is the quickstart module.
3636
- name: electron-quick-start
3737
buildsystem: simple
3838
build-options:
3939
# Add the node bin directory.
40-
append-path: /usr/lib/sdk/node18/bin
40+
append-path: /usr/lib/sdk/node24/bin
4141
env:
4242
# Set the cache directory, used to find Electron and some other helper
4343
# tools.
4444
# (The directory format is: /run/build/MODULE_NAME/flatpak-node/cache)
4545
XDG_CACHE_HOME: /run/build/electron-quick-start/flatpak-node/cache
4646
# Set the npm cache directory, used by npm to find its package metadata.
4747
npm_config_cache: /run/build/electron-quick-start/flatpak-node/npm-cache
48-
# Sets the directory where Node is located so that npm won't download the headers.
49-
npm_config_nodedir: /usr/lib/sdk/node18
5048
build-commands:
5149
# Install the packages from our offline cache.
5250
# --prefix= is the path to our subdirectory (see the electron-quick-start source below).
@@ -60,15 +58,11 @@ modules:
6058
- cp -r electron-quick-start /app
6159
# Install the wrapper script to start it.
6260
- install -Dm 755 start-electron-quick-start.sh /app/bin/start-electron-quick-start
63-
64-
# To allow separate locales
65-
- setup-separate-locales ${FLATPAK_DEST}/electron-quick-start
6661
sources:
6762
- type: git
6863
url: https://github.com/electron/electron-quick-start
69-
# Use the Electron 22 version.
70-
commit: 7f1b2bc2906a672084af9b930ccb2f333593b55c
71-
branch: 22-x-y
64+
# branch: 33-x-y
65+
commit: 27ba774d361875442c0ac6877996700434c156bd
7266
# Checkout into a subdirectory so we can copy the whole thing to /app.
7367
dest: electron-quick-start
7468
# Add the flatpak-node-generator generated sources.

node/webpack-quick-start/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ https://github.com/electron-userland/electron-webpack-quick-start/).
55

66
To create generated-sources.json run:
77

8-
```
9-
flatapk-node-generator.py yarn /path/to/electron-webpack-quick-start/yarn.lock
8+
```sh
9+
flatpak-node-generator yarn /path/to/electron-webpack-quick-start/yarn.lock
1010
```
1111

1212
(Make sure your local clone of electron-webpack-quick-start is at the same commit as used in the

node/webpack-quick-start/build.electron.webpack.ElectronWebpackQuickStart.yaml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
app-id: build.electron.webpack.ElectronWebpackQuickStart
2-
branch: stable
32
runtime: org.freedesktop.Platform
4-
runtime-version: '21.08'
3+
runtime-version: '24.08'
54
sdk: org.freedesktop.Sdk
65
# Use the Electron 2 BaseApp, which adds several common libraries we'll need.
76
base: org.electronjs.Electron2.BaseApp
8-
base-version: '21.08'
9-
# Add the Node 12 SDK extension.
7+
base-version: '24.08'
8+
separate-locales: false
9+
# Add the Node SDK extension.
1010
sdk-extensions:
11-
- org.freedesktop.Sdk.Extension.node12
11+
- org.freedesktop.Sdk.Extension.node24
1212
command: start-electron-webpack-quick-start
1313
finish-args:
1414
# These three lines add the permissions needed for graphics.
1515
- --device=dri
1616
- --share=ipc
1717
- --socket=x11
1818
# Sound access.
19-
- --socket=pulseaudio
19+
# --socket=pulseaudio
2020
# Network access.
21-
- --share=network
21+
# - --share=network
2222
# If you need to access the filesystem, also add:
2323
# - --filesystem=home
2424
modules:
@@ -30,14 +30,14 @@ modules:
3030
buildsystem: simple
3131
build-options:
3232
# Add the node bin directory.
33-
append-path: /usr/lib/sdk/node12/bin
33+
append-path: /usr/lib/sdk/node24/bin
3434
env:
3535
# Set the cache directory, used to find Electron and some other helper
3636
# tools.
3737
# (The directory format is: /run/build/MODULE_NAME/flatpak-node/cache)
3838
XDG_CACHE_HOME: /run/build/electron-webpack-quick-start/flatpak-node/cache
39-
# Sets the directory where Node is located so that npm won't download the headers.
40-
npm_config_nodedir: /usr/lib/sdk/node12
39+
# ⚠️ ONLY used as the webpack example project is outdated ⚠️
40+
NODE_OPTIONS: "--openssl-legacy-provider"
4141
build-commands:
4242
# Have Yarn use the offline mirror.
4343
- HOME=$PWD yarn config --offline set yarn-offline-mirror $FLATPAK_BUILDER_BUILDDIR/flatpak-node/yarn-mirror
@@ -58,9 +58,6 @@ modules:
5858
# - 'install -Dm 755 flatpak-node/libffmpeg.so -t /app/electron-webpack-quick-start'
5959
# Install the wrapper script to start it.
6060
- install -Dm 755 start-electron-webpack-quick-start.sh /app/bin/start-electron-webpack-quick-start
61-
62-
# To allow separate locales
63-
- setup-separate-locales ${FLATPAK_DEST}/electron-webpack-quick-start
6461
sources:
6562
- type: git
6663
url: https://github.com/electron-userland/electron-webpack-quick-start

0 commit comments

Comments
 (0)