Skip to content

Commit 76823d6

Browse files
Merge pull request #1070 from NordicSemiconductor/add_electron_versions
Add electron versions
2 parents 4b11e5b + 8b0ffd4 commit 76823d6

File tree

6 files changed

+73
-2
lines changed

6 files changed

+73
-2
lines changed

.github/workflows/test-shared.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ jobs:
1616
cache: 'npm'
1717
- run: npm ci
1818
- run: npm run check
19+
- run: npx tsx scripts/check-versions.ts
1920
- run: npm test
2021
- run: npm pack

Changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ This project does _not_ adhere to
77
[Semantic Versioning](https://semver.org/spec/v2.0.0.html) but contrary to it
88
every new version is a new major version.
99

10+
## 233.0.0 - 2025-10-10
11+
12+
### Changed
13+
14+
- Use correct Chrome version when building for the renderer process.
15+
1016
## 232.0.0 - 2025-10-10
1117

1218
### Changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nordicsemiconductor/pc-nrfconnect-shared",
3-
"version": "232.0.0",
3+
"version": "233.0.0",
44
"description": "Shared commodities for developing pc-nrfconnect-* packages",
55
"repository": {
66
"type": "git",

scripts/check-versions.ts

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/usr/bin/env tsx
2+
3+
/*
4+
* Copyright (c) 2025 Nordic Semiconductor ASA
5+
*
6+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
7+
*/
8+
9+
import { execSync } from 'child_process';
10+
11+
import * as versions from './versions';
12+
13+
const main = async () => {
14+
const npmLsElectronResult = execSync('npm ls electron --json', {
15+
encoding: 'utf8',
16+
});
17+
const installedElectronVersion =
18+
JSON.parse(npmLsElectronResult).dependencies.electron.version;
19+
20+
const electronReleases = await (
21+
await fetch('https://releases.electronjs.org/releases.json')
22+
).json();
23+
const currentElectronRelease = electronReleases.find(
24+
(release: { version: string }) =>
25+
release.version === installedElectronVersion,
26+
);
27+
28+
if (
29+
currentElectronRelease.version !== versions.electron ||
30+
currentElectronRelease.chrome !== versions.chrome ||
31+
currentElectronRelease.node !== versions.node
32+
) {
33+
console.error(
34+
`Version mismatch! scripts/versions.ts contains the following versions:
35+
36+
- electron: ${versions.electron}
37+
- chrome: ${versions.chrome}
38+
- node: ${versions.node}
39+
40+
but it should contain these:
41+
42+
- electron: ${currentElectronRelease.version}
43+
- chrome: ${currentElectronRelease.chrome}
44+
- node: ${currentElectronRelease.node}
45+
`,
46+
);
47+
process.exit(1);
48+
}
49+
};
50+
51+
main();

scripts/esbuild-renderer.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import * as module from 'node:module';
1414
import * as path from 'node:path';
1515
import tailwindcss from 'tailwindcss';
1616

17+
import { chromeWithoutBuild } from './versions';
18+
1719
const packageJson = JSON.parse(fs.readFileSync('package.json', 'utf8'));
1820

1921
const projectSpecificTailwindConfigPath = path.join(
@@ -42,7 +44,7 @@ const options = (
4244
({
4345
format: 'iife',
4446
...outfileOrDir(additionalOptions),
45-
target: 'chrome89',
47+
target: `chrome${chromeWithoutBuild}`,
4648
sourcemap: true,
4749
metafile: false,
4850
minify: process.argv.includes('--prod'),

scripts/versions.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
5+
*/
6+
7+
export const electron = '32.1.2';
8+
export const chrome = '128.0.6613.162';
9+
export const node = '20.17.0';
10+
11+
export const chromeWithoutBuild = chrome.replace(/^(\d+\.\d+\.\d+).*$/, '$1');

0 commit comments

Comments
 (0)