Skip to content

Commit

Permalink
Merge branch 'main' into sm/fix-ci-release
Browse files Browse the repository at this point in the history
  • Loading branch information
goosewobbler authored Aug 22, 2024
2 parents da7d05a + 63d29a8 commit feb0bcc
Show file tree
Hide file tree
Showing 20 changed files with 662 additions and 401 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ Spiritual successor to [Spectron](https://github.com/electron-userland/spectron)

Makes testing Electron applications much easier via:

- 🚗 auto-setup of required Chromedriver
- 📦 automatic path detection of your Electron application - supports [Electron Forge](https://www.electronforge.io/), [Electron Builder](https://www.electron.build/) and unpackaged apps
- 🚗 auto-setup of required Chromedriver (for Electron v26 and above)
- 📦 automatic path detection of your Electron application
- supports [Electron Forge](https://www.electronforge.io/), [Electron Builder](https://www.electron.build/) and unpackaged apps
- 🧩 access Electron APIs within your tests
- 🕵️ mocking of Electron APIs via a Vitest-like API

Expand Down
8 changes: 4 additions & 4 deletions apps/builder-cjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-node-resolve": "^15.2.1",
"@types/node": "^20.16.1",
"@wdio/cli": "^9.0.6",
"@wdio/globals": "^9.0.6",
"@wdio/local-runner": "^9.0.6",
"@wdio/cli": "^9.0.7",
"@wdio/globals": "^9.0.7",
"@wdio/local-runner": "^9.0.7",
"@wdio/mocha-framework": "^9.0.6",
"cross-env": "^7.0.3",
"electron": "^32.0.1",
Expand All @@ -32,7 +32,7 @@
"ts-loader": "^9.4.4",
"tsx": "^4.17.0",
"typescript": "^5.5.4",
"webdriverio": "^9.0.6"
"webdriverio": "^9.0.7"
},
"peerDependencies": {
"typescript": "5.2.2"
Expand Down
8 changes: 4 additions & 4 deletions apps/builder-esm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.1",
"@types/node": "^20.16.1",
"@wdio/cli": "^9.0.6",
"@wdio/globals": "^9.0.6",
"@wdio/local-runner": "^9.0.6",
"@wdio/cli": "^9.0.7",
"@wdio/globals": "^9.0.7",
"@wdio/local-runner": "^9.0.7",
"@wdio/mocha-framework": "^9.0.6",
"cross-env": "^7.0.3",
"electron": "^32.0.1",
Expand All @@ -35,7 +35,7 @@
"ts-loader": "^9.4.4",
"tsx": "^4.17.0",
"typescript": "^5.5.4",
"webdriverio": "^9.0.6"
"webdriverio": "^9.0.7"
},
"peerDependencies": {
"typescript": "5.2.2"
Expand Down
8 changes: 4 additions & 4 deletions apps/forge-cjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-node-resolve": "^15.2.1",
"@types/node": "^20.16.1",
"@wdio/cli": "^9.0.6",
"@wdio/globals": "^9.0.6",
"@wdio/local-runner": "^9.0.6",
"@wdio/cli": "^9.0.7",
"@wdio/globals": "^9.0.7",
"@wdio/local-runner": "^9.0.7",
"@wdio/mocha-framework": "^9.0.6",
"cross-env": "^7.0.3",
"electron": "^32.0.1",
Expand All @@ -33,7 +33,7 @@
"ts-loader": "^9.4.4",
"tsx": "^4.17.0",
"typescript": "^5.5.4",
"webdriverio": "^9.0.6"
"webdriverio": "^9.0.7"
},
"peerDependencies": {
"typescript": "5.2.2"
Expand Down
8 changes: 4 additions & 4 deletions apps/forge-esm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-node-resolve": "^15.2.1",
"@types/node": "^20.16.1",
"@wdio/cli": "^9.0.6",
"@wdio/globals": "^9.0.6",
"@wdio/local-runner": "^9.0.6",
"@wdio/cli": "^9.0.7",
"@wdio/globals": "^9.0.7",
"@wdio/local-runner": "^9.0.7",
"@wdio/mocha-framework": "^9.0.6",
"cross-env": "^7.0.3",
"electron": "^32.0.1",
Expand All @@ -34,7 +34,7 @@
"ts-loader": "^9.4.4",
"tsx": "^4.17.0",
"typescript": "^5.5.4",
"webdriverio": "^9.0.6"
"webdriverio": "^9.0.7"
},
"peerDependencies": {
"typescript": "5.2.2"
Expand Down
8 changes: 4 additions & 4 deletions apps/no-binary-cjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-node-resolve": "^15.2.1",
"@types/node": "^20.16.1",
"@wdio/cli": "^9.0.6",
"@wdio/globals": "^9.0.6",
"@wdio/local-runner": "^9.0.6",
"@wdio/cli": "^9.0.7",
"@wdio/globals": "^9.0.7",
"@wdio/local-runner": "^9.0.7",
"@wdio/mocha-framework": "^9.0.6",
"cross-env": "^7.0.3",
"electron": "^32.0.1",
Expand All @@ -27,7 +27,7 @@
"ts-loader": "^9.4.4",
"tsx": "^4.17.0",
"typescript": "^5.5.4",
"webdriverio": "^9.0.6"
"webdriverio": "^9.0.7"
},
"peerDependencies": {
"typescript": "5.2.2"
Expand Down
8 changes: 4 additions & 4 deletions apps/no-binary-esm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-node-resolve": "^15.2.1",
"@types/node": "^20.16.1",
"@wdio/cli": "^9.0.6",
"@wdio/globals": "^9.0.6",
"@wdio/local-runner": "^9.0.6",
"@wdio/cli": "^9.0.7",
"@wdio/globals": "^9.0.7",
"@wdio/local-runner": "^9.0.7",
"@wdio/mocha-framework": "^9.0.6",
"cross-env": "^7.0.3",
"electron": "^32.0.1",
Expand All @@ -29,7 +29,7 @@
"ts-loader": "^9.4.4",
"tsx": "^4.17.0",
"typescript": "^5.5.4",
"webdriverio": "^9.0.6"
"webdriverio": "^9.0.7"
},
"peerDependencies": {
"typescript": "5.2.2"
Expand Down
8 changes: 4 additions & 4 deletions e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@
},
"dependencies": {
"@testing-library/webdriverio": "^3.2.1",
"@wdio/cli": "^9.0.6",
"@wdio/cli": "^9.0.7",
"@wdio/electron-utils": "workspace:*",
"@wdio/globals": "^9.0.6",
"@wdio/local-runner": "^9.0.6",
"@wdio/globals": "^9.0.7",
"@wdio/local-runner": "^9.0.7",
"@wdio/mocha-framework": "^9.0.6",
"electron": "^32.0.1",
"tsx": "^4.17.0",
"wdio-electron-service": "workspace:*",
"webdriverio": "^9.0.6",
"webdriverio": "^9.0.7",
"xvfb-maybe": "^0.2.1"
},
"devDependencies": {
Expand Down
117 changes: 103 additions & 14 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
import eslint from '@eslint/js';
import ts from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
import vitest from '@vitest/eslint-plugin';
import prettier from 'eslint-config-prettier';
import vitest from 'eslint-plugin-vitest';
import * as wdio from 'eslint-plugin-wdio';
import globals from 'globals';
import importX from 'eslint-plugin-import-x';

export default [
// Ignored dirs
{
ignores: ['**/dist/**/*', '@types/**/*'],
},
// Ignored files
{
ignores: ['**/*.config.js'],
},
// All files
{
files: ['**/*.{js,mjs,ts}'],
Expand All @@ -19,29 +24,47 @@ export default [
globals: {
...globals.es2021,
},
parserOptions: {
...importX.configs.recommended.parserOptions,
},
},
plugins: {
'import-x': importX,
},
rules: {
...eslint.configs.recommended.rules,
...importX.configs.recommended.rules,
'import-x/no-named-as-default': 'off',
'import-x/no-unresolved': 'off',
},
settings: {
'import-x/ignore': [/@rollup.*/, /shelljs/],
},
},
// Node & Electron main process files and scripts
{
files: ['**/*.{js,mjs,ts}'],
ignores: ['example*/src/preload.ts', 'example*/src/util.ts'],
ignores: ['apps/**/src/preload.ts', 'apps/**/src/util.ts'],
languageOptions: {
globals: {
...globals.node,
},
},
settings: {
...importX.configs.electron.settings,
},
},
// Electron renderer process files
{
files: ['example*/src/preload.ts', 'example*/src/util.ts'],
files: ['apps/**/src/preload.ts', 'apps/**/src/util.ts'],
languageOptions: {
globals: {
...globals.browser,
},
},
settings: {
...importX.configs.electron.settings,
},
},
// TS files
{
Expand All @@ -56,10 +79,15 @@ export default [
},
plugins: {
'@typescript-eslint': ts,
'import-x': importX,
},
settings: {
...importX.configs.typescript.settings,
},
rules: {
...ts.configs['eslint-recommended'].rules,
...ts.configs.recommended.rules,
...importX.configs.typescript.rules,
'no-undef': 'off', // redundant - TS will fail to compile with undefined vars
'no-redeclare': 'off', // redundant - TS will fail to compile with duplicate declarations
'@typescript-eslint/no-empty-interface': [
Expand All @@ -68,6 +96,12 @@ export default [
allowSingleExtends: true,
},
],
'@typescript-eslint/no-empty-object-type': [
'error',
{
allowInterfaces: 'with-single-extends',
},
],
'@typescript-eslint/no-namespace': [
'error',
{
Expand All @@ -81,42 +115,97 @@ export default [
ignoreRestSiblings: true,
argsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-explicit-any': ['warn'],
},
},
// Package TS files
{
files: ['packages/*/src/**/*.ts'],
languageOptions: {
parserOptions: {
project: 'packages/*/tsconfig.eslint.json',
},
},
rules: {
'import-x/no-extraneous-dependencies': ['error', { devDependencies: false }],
},
},
// Package CJS TS files
{
files: ['packages/**/src/cjs/**/*.ts'],
languageOptions: {
parserOptions: {
project: 'packages/*/tsconfig.eslint.json',
},
},
rules: {
'import-x/no-extraneous-dependencies': 'off',
},
},
// Example app TS files
{
files: ['example/**/*.ts'],
ignores: ['example/out/**/*.ts'],
files: ['apps/builder-cjs/**/*.ts'],
languageOptions: {
parserOptions: {
project: 'apps/builder-cjs/tsconfig.eslint.json',
},
},
rules: {
'@typescript-eslint/no-require-imports': 'off',
},
},
{
files: ['apps/builder-esm/**/*.ts'],
languageOptions: {
parserOptions: {
project: 'example/tsconfig.eslint.json',
project: 'apps/builder-esm/tsconfig.eslint.json',
},
},
},
{
files: ['example-cjs/**/*.ts'],
ignores: ['example-cjs/out/**/*.ts'],
files: ['apps/forge-cjs/**/*.ts'],
languageOptions: {
parserOptions: {
project: 'example-cjs/tsconfig.eslint.json',
project: 'apps/forge-cjs/tsconfig.eslint.json',
},
},
rules: {
'@typescript-eslint/no-require-imports': 'off',
},
},
{
files: ['apps/forge-esm/**/*.ts'],
languageOptions: {
parserOptions: {
project: 'apps/forge-esm/tsconfig.eslint.json',
},
},
},
{
files: ['apps/no-binary-cjs/**/*.ts'],
languageOptions: {
parserOptions: {
project: 'apps/no-binary-cjs/tsconfig.eslint.json',
},
},
rules: {
'@typescript-eslint/no-require-imports': 'off',
},
},
{
files: ['example-electron-builder/**/*.ts'],
ignores: ['example-electron-builder/out/**/*.ts'],
files: ['apps/no-binary-esm/**/*.ts'],
languageOptions: {
parserOptions: {
project: 'example-electron-builder/tsconfig.eslint.json',
project: 'apps/no-binary-esm/tsconfig.eslint.json',
},
},
},
// Example E2E TS files
{
files: ['example*/e2e/*.spec.ts'],
files: ['e2e/**/*.spec.ts'],
languageOptions: {
globals: {
...wdio.configs['flat/recommended'].globals,
Expand All @@ -132,7 +221,7 @@ export default [
},
// Test files
{
files: ['test/**/*.spec.ts'],
files: ['packages/**/test/**/*.spec.ts'],
plugins: {
vitest,
},
Expand Down
2 changes: 1 addition & 1 deletion fixtures/electron-in-dependencies/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Electron found in dependencies",
"scripts": {},
"dependencies": {
"electron": "^25.0.0"
"electron": "^26.0.0"
},
"devDependencies": {}
}
2 changes: 1 addition & 1 deletion fixtures/electron-in-dev-dependencies/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"scripts": {},
"dependencies": {},
"devDependencies": {
"electron": "^25.0.0"
"electron": "^26.0.0"
}
}
Loading

0 comments on commit feb0bcc

Please sign in to comment.