Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Electron Forge for example-cjs #243

Merged
merged 7 commits into from
Oct 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,7 @@ wdio-logs
.DS_Store

# VS Code local configuration
.vscode
.vscode

# Electron Forge output
out
3 changes: 3 additions & 0 deletions example-cjs/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Electron Forge doesn't tolerate PNPM symlinks
# can be removed when https://github.com/electron/forge/pull/3351 is merged
node-linker=hoisted
32 changes: 32 additions & 0 deletions example-cjs/forge.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import path from 'node:path';

import MakerSquirrel from '@electron-forge/maker-squirrel';
import MakerDMG from '@electron-forge/maker-dmg';
import MakerZIP from '@electron-forge/maker-zip';
import type { ForgeConfig } from '@electron-forge/shared-types';

const icon = path.join(__dirname, 'src', 'assets', 'icon', 'webdriverio');

const config: ForgeConfig = {
packagerConfig: {
asar: true,
icon,
},
rebuildConfig: {},
makers: [
new MakerZIP({}, ['darwin']),
new MakerDMG({ icon }, ['darwin']),
new MakerSquirrel(
{
name: 'WDIO Electron Service CJS Example',
owners: 'WebdriverIO',
authors: 'WebdriverIO',
copyright: 'WebdriverIO',
},
['win32'],
),
],
plugins: [],
};

export default config;
44 changes: 17 additions & 27 deletions example-cjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,48 +5,38 @@
"scripts": {
"build": "pnpm build:bundle && pnpm build:package",
"build:bundle": "tsc && rollup -c rollup.config.mjs",
"build:package": "cp ./src/index.html ./dist && electron-builder -p never",
"build:package": "cp ./src/index.html ./dist && electron-forge package",
"ci": "pnpm i && pnpm build && pnpm test",
"clean": "pnpm clean:dist && rm -rf ./node_modules pnpm-lock.yaml ./all-logs",
"clean:dist": "pnpx rimraf ./dist && mkdir -p ./dist",
"test": "wdio run ./wdio.conf.ts"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^25.0.4",
"@electron-forge/cli": "^6.4.2",
"@electron-forge/core": "^6.4.2",
"@electron-forge/core-utils": "^6.4.2",
"@electron-forge/maker-dmg": "^6.4.2",
"@electron-forge/maker-squirrel": "^6.4.2",
"@electron-forge/maker-zip": "^6.4.2",
"@electron-forge/shared-types": "^6.4.2",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.1",
"@types/node": "^20.8.4",
"@wdio/cli": "^8.17.0",
"@wdio/globals": "^8.17.0",
"@wdio/local-runner": "^8.17.0",
"@wdio/mocha-framework": "^8.17.0",
"electron": "^27.0.0",
"electron-builder": "^24.6.4",
"@types/node": "^20.8.9",
"@wdio/cli": "^8.20.5",
"@wdio/globals": "^8.20.5",
"@wdio/local-runner": "^8.20.5",
"@wdio/mocha-framework": "^8.20.3",
"electron": "^27.0.2",
"global-jsdom": "^9.1.0",
"jsdom": "^22.1.0",
"rollup": "^4.0.2",
"rollup": "^4.1.5",
"ts-loader": "^9.4.4",
"ts-node": "^10.9.1",
"typescript": "^5.2.2",
"wdio-electron-service": "file:../",
"webdriverio": "^8.17.0"
"webdriverio": "^8.20.4"
},
"peerDependencies": {
"typescript": "5.2.2"
},
"build": {
"asar": true,
"appId": "com.wdio-electron-service-example-cjs.demo",
"copyright": "goosewobbler",
"productName": "wdio-electron-service-example-cjs",
"files": [
"./dist/*"
],
"linux": {
"executableName": "wdio-electron-service-example-cjs",
"category": "Utility",
"target": [
"AppImage"
]
}
}
}
Loading