Skip to content

Commit 0b62710

Browse files
authored
chore: update dependencies and improve package configurations (#203)
* chore: update dependencies and improve package configurations - Updated various package dependencies to their latest versions, including `@biomejs/biome`, `@types/node`, `@typescript-eslint/parser`, and `eslint` packages. - Enhanced `pnpm` configurations for better dependency management. - Adjusted `package.json` files across multiple projects to ensure consistency in dependency versions and improve overall project stability. - Reformatted `package.json` files for better readability by aligning array elements and improving structure. * chore: update Node.js version in .nvmrc - Changed the Node.js version in the .nvmrc file from v24 to 24 for consistency with project requirements. * chore: update Node.js version requirement in package.json - Changed the Node.js version requirement from ">=18 || >=20" to ">=20" to align with the project's updated compatibility standards. * chore: update TypeScript and Vite dependencies in package.json - Updated TypeScript version from "^5.0.0" to "^5.9.3" for improved features and performance. - Downgraded Vite version from "^8.0.0" to "^7.3.1" to maintain compatibility with existing project configurations. * chore: standardize Node.js version requirement across packages - Updated the Node.js version requirement in multiple package.json files from ">=18 || >=20" to ">=20" to ensure consistency and align with the project's compatibility standards. * chore: update lockfile * test(electron): update function declaration assertion in executeCdp tests - Modified the function declaration in the `executeCdp.spec.ts` to use `expect.stringMatching` for improved assertion accuracy, ensuring the function format is correctly validated during tests. * chore: update Node.js version requirement in package.json files - Changed the Node.js version requirement from ">=20" to "^20.19.0 || >=22.12.0" in multiple package.json files to ensure compatibility with newer Node.js versions and maintain consistency across the project. * chore: update package dependencies and versions - Reintroduced `tsx` dependency in `bundler` and `tauri-plugin` with updated version. - Downgraded `vitest` version to `^4.0.18` across multiple packages for compatibility. - Replaced `@puppeteer/browsers` with `@electron/packager` in `electron-service` and updated its version. - Added new dependencies `deepmerge-ts` and `find-versions` in `electron-service`. - Removed unnecessary dependencies and ensured consistency in package configurations across various modules. * chore: replace `find-up` with `find-up-simple` in package dependencies - Updated `find-up` to `find-up-simple` in `bundler` and `native-utils` package.json files to reflect the new dependency structure. - Adjusted import statements in relevant TypeScript files to use `find-up-simple` for consistency across the codebase. - Added `@electron/packager` dependency in `native-utils` with the specified version. * refactor: move electron-specific `native-utils` functionality into the electron service * feat(electron-service): export additional utility functions for app build info and binary paths * test: update imports to use `@wdio/electron-service` for electron utilities * test: update import for `isOk` utility from `@wdio/native-utils` in electron config * chore: remove unused dependencies from native-utils - Deleted `deepmerge-ts` and `find-versions` from `native-utils` package.json and updated the pnpm-lock.yaml accordingly to reflect these changes. * fix: add electron external to electron-vite configs to prevent bundling This fixes the 'Electron failed to install correctly' error that occurs when electron-vite bundles the electron shim code instead of keeping it as an external import. The bundled code includes a getElectronPath() function that looks for path.txt at runtime, which doesn't exist in the packaged app.
1 parent 770d890 commit 0b62710

58 files changed

Lines changed: 1826 additions & 1730 deletions

Some content is hidden

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

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v24
1+
24

docs/package-structure.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ All packages use the `@wdio/` scope:
9999
}
100100
},
101101
"engines": {
102-
"node": "^18.12.0 || ^20.0.0"
102+
"node": "^20.19.0 || >=22.12.0"
103103
},
104104
"scripts": {
105105
"build": "pnpm build:esm && pnpm build:cjs",

e2e/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@
6060
"@crabnebula/test-runner-backend": "^0.2.6",
6161
"@electron-forge/cli": "^7.11.1",
6262
"@types/mocha": "^10.0.10",
63-
"@types/node": "^25.3.0",
64-
"@vitest/spy": "^4.0.18",
63+
"@types/node": "^25.5.0",
64+
"@vitest/spy": "^4.1.0",
6565
"@wdio/native-types": "workspace:*",
6666
"@wdio/types": "catalog:",
6767
"cross-env": "^10.1.0",

e2e/test/electron/standalone/api.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import fs from 'node:fs';
22
import path from 'node:path';
3+
import { getElectronVersion } from '@wdio/electron-service';
34
import type { NormalizedPackageJson } from '@wdio/native-types';
4-
import { getElectronVersion } from '@wdio/native-utils';
55
import type * as Electron from 'electron';
66
import { setupStandaloneTest } from './helpers/setup.js';
77

e2e/wdio.electron.conf.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ async function getElectronConfigContext(): Promise<ElectronConfigContext> {
7979

8080
try {
8181
// Import async utilities and resolve binary path directly
82-
const { getBinaryPath, getAppBuildInfo, getElectronVersion, isOk } = await import('@wdio/native-utils');
82+
const { getBinaryPath, getAppBuildInfo, getElectronVersion } = await import('@wdio/electron-service');
83+
const { isOk } = await import('@wdio/native-utils');
8384

8485
const pkg = { packageJson, path: packageJsonPath };
8586
const electronVersion = await getElectronVersion(pkg);

fixtures/e2e-apps/electron-builder/electron.vite.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export default defineConfig({
99
output: {
1010
format: 'es',
1111
},
12+
external: ['electron'],
1213
},
1314
},
1415
},
@@ -20,6 +21,7 @@ export default defineConfig({
2021
format: 'cjs',
2122
entryFileNames: '[name].cjs',
2223
},
24+
external: ['electron'],
2325
},
2426
},
2527
},

fixtures/e2e-apps/electron-builder/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
"clean:dist": "pnpm dlx shx rm -rf ./dist ./dist-electron && pnpm dlx shx mkdir -p ./dist"
1616
},
1717
"devDependencies": {
18-
"@types/node": "^25.3.0",
18+
"@types/node": "^25.5.0",
1919
"@wdio/cli": "catalog:default",
2020
"@wdio/globals": "catalog:default",
2121
"@wdio/local-runner": "catalog:default",
2222
"@wdio/mocha-framework": "catalog:default",
2323
"electron": "catalog:default",
24-
"electron-builder": "26.8.0",
24+
"electron-builder": "26.8.1",
2525
"electron-vite": "^5.0.0",
2626
"typescript": "^5.9.3",
2727
"webdriverio": "catalog:default"

fixtures/e2e-apps/electron-forge/electron.vite.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export default defineConfig({
99
output: {
1010
format: 'es',
1111
},
12+
external: ['electron'],
1213
},
1314
},
1415
},
@@ -20,6 +21,7 @@ export default defineConfig({
2021
format: 'cjs',
2122
entryFileNames: '[name].cjs',
2223
},
24+
external: ['electron'],
2325
},
2426
},
2527
},

fixtures/e2e-apps/electron-forge/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
},
1717
"devDependencies": {
1818
"@electron-forge/cli": "^7.11.1",
19-
"@types/node": "^25.3.0",
19+
"@types/node": "^25.5.0",
2020
"@wdio/cli": "catalog:default",
2121
"@wdio/globals": "catalog:default",
2222
"@wdio/local-runner": "catalog:default",

fixtures/e2e-apps/electron-script/electron.vite.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export default defineConfig({
99
output: {
1010
format: 'es',
1111
},
12+
external: ['electron'],
1213
},
1314
},
1415
},
@@ -20,6 +21,7 @@ export default defineConfig({
2021
format: 'cjs',
2122
entryFileNames: '[name].cjs',
2223
},
24+
external: ['electron'],
2325
},
2426
},
2527
},

0 commit comments

Comments
 (0)