Skip to content

Commit fc75472

Browse files
Merge pull request #2285 from Scavanger/ESM-Modules
ESM modules & More
2 parents 5422e56 + 04075ba commit fc75472

File tree

306 files changed

+8594
-101670
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

306 files changed

+8594
-101670
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515

1616
jobs:
1717
build-linux:
18-
runs-on: ubuntu-latest
18+
runs-on: ubuntu-24.04
1919
steps:
2020
- uses: actions/checkout@v4
2121
- name: Setup environment
@@ -37,23 +37,20 @@ jobs:
3737
echo "BUILD_NAME=inav-configurator_linux_x64_${VERSION}_${BUILD_SUFFIX}" >> $GITHUB_ENV
3838
- uses: actions/setup-node@v4
3939
with:
40-
node-version: 20
40+
node-version: 22
4141
#check-latest: true
42-
#cache: 'npm'
4342
- name: Install dependencies
4443
run: sudo apt-get update && sudo apt-get -y install dpkg fakeroot rpm build-essential libudev-dev
4544
- name: Install deps
4645
uses: nick-fields/retry@v3
4746
with:
4847
max_attempts: 3
4948
retry_on: error
50-
command: npm install --foreground-scripts
49+
command: yarn install
5150
timeout_minutes: 10
5251
on_retry_command: rm -rfv node_modules
53-
- name: Remove other SITL binary
54-
run: rm -v resources/sitl/linux/arm64/inav_SITL
5552
- name: Build Linux
56-
run: npm run make
53+
run: yarn run make
5754
- name: Upload Linux deb
5855
uses: actions/upload-artifact@v4
5956
with:
@@ -71,7 +68,7 @@ jobs:
7168
path: ./out/make/zip/linux/x64/*.zip
7269

7370
build-linux-aarch64:
74-
runs-on: ubuntu-24.04-arm
71+
runs-on: ubuntu-24.04
7572
steps:
7673
- uses: actions/checkout@v4
7774
- name: Setup environment
@@ -93,25 +90,20 @@ jobs:
9390
echo "BUILD_NAME=inav-configurator_linux_aarch64_${VERSION}_${BUILD_SUFFIX}" >> $GITHUB_ENV
9491
- uses: actions/setup-node@v4
9592
with:
96-
node-version: 20
93+
node-version: 22
9794
#check-latest: true
98-
#cache: 'npm'
9995
- name: Install dependencies
10096
run: sudo apt-get update && sudo apt-get -y install dpkg fakeroot rpm build-essential libudev-dev
10197
- name: Install deps
10298
uses: nick-fields/retry@v3
10399
with:
104100
max_attempts: 3
105101
retry_on: error
106-
command: npm install --foreground-scripts
102+
command: yarn install
107103
timeout_minutes: 10
108104
on_retry_command: rm -rfv node_modules
109-
- name: Remove other SITL binary
110-
run: |
111-
mv -fv resources/sitl/linux/arm64/inav_SITL resources/sitl/linux/inav_SITL
112-
rmdir -v resources/sitl/linux/arm64
113105
- name: Build Linux
114-
run: npm run make
106+
run: yarn run make -- --arch="arm64"
115107
- name: Upload Linux deb
116108
uses: actions/upload-artifact@v4
117109
with:
@@ -150,9 +142,8 @@ jobs:
150142
echo "BUILD_NAMEarm64=inav-configurator_MacOS_arm64_${VERSION}_${BUILD_SUFFIX}" >> $GITHUB_ENV
151143
- uses: actions/setup-node@v4
152144
with:
153-
node-version: 20
145+
node-version: 22
154146
#check-latest: true
155-
#cache: 'npm'
156147
# Workaround due to a bug in node-gyp: https://github.com/electron/rebuild/issues/1116
157148
- name: Install Setuptools
158149
run: python3 -m pip install --break-system-packages setuptools
@@ -161,11 +152,11 @@ jobs:
161152
with:
162153
max_attempts: 3
163154
retry_on: error
164-
command: npm install --foreground-scripts
155+
command: yarn install --foreground-scripts
165156
timeout_minutes: 10
166157
on_retry_command: rm -rfv node_modules
167158
- name: Build MacOS arm64
168-
run: npm run make -- --arch="arm64"
159+
run: yarn run make -- --arch="arm64"
169160
- name: Upload MacOS arm64 zip
170161
uses: actions/upload-artifact@v4
171162
with:
@@ -199,9 +190,8 @@ jobs:
199190
echo "BUILD_NAMEx64=inav-configurator_MacOS_x64_${VERSION}_${BUILD_SUFFIX}" >> $GITHUB_ENV
200191
- uses: actions/setup-node@v4
201192
with:
202-
node-version: 20
193+
node-version: 22
203194
#check-latest: true
204-
#cache: 'npm'
205195
# Workaround due to a bug in node-gyp: https://github.com/electron/rebuild/issues/1116
206196
- name: Install Setuptools
207197
run: python3 -m pip install --break-system-packages setuptools
@@ -210,11 +200,11 @@ jobs:
210200
with:
211201
max_attempts: 3
212202
retry_on: error
213-
command: npm install --foreground-scripts
203+
command: yarn install --foreground-scripts
214204
timeout_minutes: 10
215205
on_retry_command: rm -rfv node_modules
216206
- name: Build MacOS x64
217-
run: npm run make -- --arch="x64"
207+
run: yarn run make -- --arch="x64"
218208
- name: Upload MacOS x64 zip
219209
uses: actions/upload-artifact@v4
220210
with:
@@ -252,8 +242,7 @@ jobs:
252242
shell: bash
253243
- uses: actions/setup-node@v4
254244
with:
255-
node-version: 20
256-
#cache: 'npm'
245+
node-version: 22
257246
- uses: engineerd/[email protected]
258247
with:
259248
name: "Wix Toolset 3.1.4"
@@ -264,11 +253,11 @@ jobs:
264253
with:
265254
max_attempts: 3
266255
retry_on: error
267-
command: npm install --foreground-scripts
256+
command: yarn install --foreground-scripts
268257
timeout_minutes: 10
269258
on_retry_command: rm -rfv node_modules
270259
- name: Build Win x64
271-
run: npm run make -- --arch="x64"
260+
run: yarn run make -- --arch="x64"
272261
- name: Upload Windows x64 zip
273262
uses: actions/upload-artifact@v4
274263
with:
@@ -306,8 +295,7 @@ jobs:
306295
shell: bash
307296
- uses: actions/setup-node@v4
308297
with:
309-
node-version: 20
310-
#cache: 'npm'
298+
node-version: 22
311299
- uses: engineerd/[email protected]
312300
with:
313301
name: "Wix Toolset 3.1.4"
@@ -318,11 +306,11 @@ jobs:
318306
with:
319307
max_attempts: 3
320308
retry_on: error
321-
command: npm install --foreground-scripts
309+
command: yarn install --foreground-scripts
322310
timeout_minutes: 10
323311
on_retry_command: rm -rfv node_modules
324312
- name: Build Win32
325-
run: npm run make -- --arch="ia32"
313+
run: yarn run make -- --arch="ia32"
326314
- name: Upload Windows ia32 zip
327315
uses: actions/upload-artifact@v4
328316
with:

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ npm-debug.log
66
npm-debug.log
77
inav-configurator.iml
88
/out
9+
/.vite
910
.eslintrc.json
1011
/.project
1112
/cache/
@@ -16,4 +17,3 @@ inav-configurator.iml
1617
*.swp
1718
*.bak
1819
eeprom.bin
19-
yarn.lock

.vscode/launch.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"args": ["--inspect", "--no-sandbox"],
1313
"env": {
1414
"NODE_ENV": "development",
15-
"NODE_PATH": "${workspaceFolder}/js/"
15+
"NODE_PATH": "${workspaceFolder}/js/",
16+
"DEV_TOOLS_MODE": "undocked" // left, right, bottom, undocked, detach
1617
},
1718
"cwd": "${workspaceFolder}",
1819
"console": "integratedTerminal"

.vscode/tasks.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
"type": "npm",
66
"script": "start",
77
"problemMatcher": [],
8-
"label": "npm: start",
9-
"detail": "node node_modules/gulp/bin/gulp.js build && node node_modules/nw/bin/nw .",
8+
"label": "yarn: start",
109
"group": {
1110
"kind": "build",
1211
"isDefault": true

README.md

Lines changed: 7 additions & 5 deletions

forge.config.js

Lines changed: 40 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,47 @@
1-
const path = require('path');
2-
const fs = require('fs');
1+
import path from 'node:path';
2+
import fs from 'node:fs';
3+
import { fileURLToPath } from 'node:url';
34

4-
module.exports = {
5+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
6+
7+
export default {
58
packagerConfig: {
69
executableName: "inav-configurator",
710
asar: false,
811
icon: 'images/inav',
9-
ignore: [
10-
"^(\/\.vscode$)",
11-
"^(\/support$)",
12-
".gitattributes",
13-
".gitignore",
14-
".github",
15-
".git",
16-
"3D_model_creation.md",
17-
"LICENSE",
18-
"MAPPROXY.md",
19-
"package-lock.json",
20-
"README.md",
21-
"inav_icon_128.psd",
22-
]
2312
},
13+
rebuildConfig: {},
14+
plugins: [
15+
{
16+
name: '@electron-forge/plugin-vite',
17+
config: {
18+
build: [
19+
{
20+
entry: 'js/main/main.js',
21+
config: 'vite.main.config.js',
22+
},
23+
{
24+
entry: 'js/main/preload.js',
25+
config: 'vite.preload.config.js',
26+
},
27+
{
28+
entry: 'js/libraries/bluetooth-device-chooser/bt-device-chooser-preload.js',
29+
config: 'vite.preload.config.js',
30+
},
31+
],
32+
renderer: [
33+
{
34+
name: 'bt_device_chooser',
35+
config: 'vite.bt-dc-renderer.config.js',
36+
},
37+
{
38+
name: 'main_window',
39+
config: 'vite.main-renderer.config.js',
40+
},
41+
],
42+
},
43+
},
44+
],
2445
hooks: {
2546
// Uniform artifact file names
2647
postMake: async (config, makeResults) => {
@@ -36,9 +57,8 @@ module.exports = {
3657
console.log('Artifact: ' + newPath);
3758
});
3859
});
39-
}
60+
},
4061
},
41-
rebuildConfig: {},
4262
makers: [
4363
{
4464
name: '@electron-forge/maker-wix',
@@ -53,7 +73,7 @@ module.exports = {
5373
appUserModelId: "com.inav.configurator",
5474
icon: path.join(__dirname, "./assets/windows/inav_installer_icon.ico"),
5575
upgradeCode: "13606ff3-b0bc-4dde-8fac-805bc8aed2f8",
56-
ui : {
76+
ui: {
5777
enabled: false,
5878
chooseDirectory: true,
5979
images: {
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)