Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
goosewobbler committed Oct 15, 2024
1 parent bc7cdc1 commit 74bbe8f
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 71 deletions.
45 changes: 6 additions & 39 deletions apps/example-reducers/electron-builder.json
Original file line number Diff line number Diff line change
@@ -1,45 +1,12 @@
{
"appId": "com.electron.app",
"productName": "zutron-example-reducers",
"directories": {
"buildResources": "../../resources/build"
},
"files": [
"!**/.vscode/*",
"!src/*",
"!electron.vite.config.{js,ts,mjs,cjs}",
"!{dev-app-update.yml,README.md}",
"!{.env,.env.*,.npmrc,pnpm-lock.yaml}",
"!{tsconfig.json,tsconfig.node.json,tsconfig.web.json}"
],
"asar": true,
"win": {
"executableName": "zutron-example-reducers"
},
"nsis": {
"artifactName": "${name}-${version}-setup.${ext}",
"shortcutName": "${productName}",
"uninstallDisplayName": "${productName}",
"createDesktopShortcut": "always"
},
"mac": {
"entitlementsInherit": "build/entitlements.mac.plist",
"notarize": false
},
"dmg": {
"artifactName": "${name}-${version}.${ext}"
},
"appId": "com.zutron-example-reducers.demo",
"copyright": "goosewobbler",
"productName": "zutron-example-reducers",
"files": ["./out/**/*"],
"linux": {
"executableName": "zutron-example-reducers",
"target": ["AppImage"],
"category": "Utility"
},
"appImage": {
"artifactName": "${name}-${version}.${ext}"
},
"npmRebuild": false,
"publish": {
"provider": "generic",
"url": "https://example.com/auto-updates"
"category": "Utility",
"target": ["AppImage"]
}
}
3 changes: 2 additions & 1 deletion apps/example-reducers/src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { store } from './store.js';
import { tray } from './tray/index.js';

const icon = path.join(__dirname, '..', '..', 'resources', 'images', 'icon.png');
const isTest = process.env.TEST === 'true';

const windowOptions: BrowserWindowConstructorOptions = {
show: false,
Expand All @@ -19,7 +20,7 @@ const windowOptions: BrowserWindowConstructorOptions = {
webPreferences: {
contextIsolation: true,
scrollBounce: true,
sandbox: true,
sandbox: !isTest,
nodeIntegration: false,
preload: path.join(__dirname, '..', 'preload', 'index.cjs'),
},
Expand Down
3 changes: 2 additions & 1 deletion apps/example-separate-handlers/src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { initialState, store } from './store.js';
import { tray } from './tray/index.js';

const icon = path.join(__dirname, '..', '..', 'resources', 'images', 'icon.png');
const isTest = process.env.TEST === 'true';

const windowOptions: BrowserWindowConstructorOptions = {
show: false,
Expand All @@ -19,7 +20,7 @@ const windowOptions: BrowserWindowConstructorOptions = {
webPreferences: {
contextIsolation: true,
scrollBounce: true,
sandbox: true,
sandbox: !isTest,
nodeIntegration: false,
preload: path.join(__dirname, '..', 'preload', 'index.cjs'),
},
Expand Down
3 changes: 2 additions & 1 deletion apps/example-store-handlers/src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { store } from './store.js';
import { tray } from './tray/index.js';

const icon = path.join(__dirname, '..', '..', 'resources', 'images', 'icon.png');
const isTest = process.env.TEST === 'true';

const windowOptions: BrowserWindowConstructorOptions = {
show: false,
Expand All @@ -18,7 +19,7 @@ const windowOptions: BrowserWindowConstructorOptions = {
webPreferences: {
contextIsolation: true,
scrollBounce: true,
sandbox: true,
sandbox: !isTest,
nodeIntegration: false,
preload: path.join(__dirname, '..', 'preload', 'index.cjs'),
},
Expand Down
3 changes: 2 additions & 1 deletion e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"clean": "pnpm dlx shx rm -rf ./js ./node_modules pnpm-lock.yaml ./wdio-logs* ./out",
"logs": "pnpm dlx shx cat ./wdio-logs*/*.log",
"test:e2e:reducers": "cross-env APP_DIR=example-reducers pnpm run exec",
"test:e2e:reducers": "cross-env APP_DIR=example-reducers DEBUG=xvfb-maybe pnpm run exec",
"test:e2e:separate-handlers": "cross-env APP_DIR=example-separate-handlers pnpm run exec",
"test:e2e:store-handlers": "cross-env APP_DIR=example-store-handlers pnpm run exec",
"exec": "xvfb-maybe wdio run ./wdio.conf.ts"
Expand All @@ -27,6 +27,7 @@
"devDependencies": {
"@types/mocha": "^10.0.9",
"@types/node": "^22.7.5",
"@wdio/types": "^9.1.3",
"electron": "^32.2.0",
"read-package-up": "^11.0.0",
"typescript": "^5.6.3"
Expand Down
7 changes: 4 additions & 3 deletions e2e/wdio.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import type { NormalizedPackageJson } from 'read-package-up';

import { getAppBuildInfo, getBinaryPath, getElectronVersion } from '@wdio/electron-utils';

const exampleDir = process.env.APP_DIR as string;
const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
const packageJsonPath = path.join(__dirname, '..', 'apps', exampleDir, 'package.json');
const appDir = process.env.APP_DIR as string;
const packageJsonPath = path.join(__dirname, '..', 'apps', appDir, 'package.json');
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, { encoding: 'utf-8' })) as NormalizedPackageJson;
const pkg = { packageJson, path: packageJsonPath };
const electronVersion = getElectronVersion(pkg);
Expand All @@ -25,6 +25,7 @@ export const config = {
'browserName': 'electron',
'wdio:electronServiceOptions': {
appBinaryPath,
appArgs: ['--no-sandbox'],
restoreMocks: true,
},
},
Expand All @@ -34,7 +35,7 @@ export const config = {
connectionRetryTimeout: 30000,
logLevel: 'debug',
runner: 'local',
outputDir: `wdio-logs-${exampleDir}`,
outputDir: `wdio-logs-${appDir}`,
specs: ['./test/*.spec.ts'],
tsConfigPath: path.join(__dirname, 'tsconfig.json'),
framework: 'mocha',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "module",
"scripts": {
"ci": "turbo run test:unit test:e2e:reducers test:e2e:separate-handlers test:e2e:store-handlers",
"ci-linux": "turbo run test:unit test:e2e:reducers test:e2e:separate-handlers test:e2e:store-handlers --concurrency=1",
"ci-linux": "turbo run build test:e2e:reducers --only --concurrency=1",
"ci:e2e:logs": "turbo run logs",
"format": "prettier -w .",
"format:check": "prettier -c .",
Expand Down
1 change: 1 addition & 0 deletions packages/zutron/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"outDir": "./dist",
"rootDir": "./src",
"moduleResolution": "Bundler",
"skipLibCheck": true,
"strict": true,
"module": "ESNext",
"target": "ESNext"
Expand Down
32 changes: 8 additions & 24 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 74bbe8f

Please sign in to comment.