diff options
Diffstat (limited to 'packages/preload')
-rw-r--r-- | packages/preload/jest.config.js | 9 | ||||
-rw-r--r-- | packages/preload/package.json | 3 | ||||
-rw-r--r-- | packages/preload/src/index.ts | 3 | ||||
-rw-r--r-- | packages/preload/tsconfig.json | 7 |
4 files changed, 19 insertions, 3 deletions
diff --git a/packages/preload/jest.config.js b/packages/preload/jest.config.js new file mode 100644 index 0000000..3b5d436 --- /dev/null +++ b/packages/preload/jest.config.js | |||
@@ -0,0 +1,9 @@ | |||
1 | // @ts-check | ||
2 | |||
3 | const rootConfig = require('../../jest.config.js'); | ||
4 | |||
5 | /** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ | ||
6 | module.exports = { | ||
7 | ...rootConfig, | ||
8 | testEnvironment: 'jsdom', | ||
9 | }; | ||
diff --git a/packages/preload/package.json b/packages/preload/package.json index a4bd75f..a44936b 100644 --- a/packages/preload/package.json +++ b/packages/preload/package.json | |||
@@ -7,6 +7,7 @@ | |||
7 | "types": "dist-types/index.d.ts", | 7 | "types": "dist-types/index.d.ts", |
8 | "scripts": { | 8 | "scripts": { |
9 | "clean": "rimraf dist dist-types tsconfig.tsbuildinfo", | 9 | "clean": "rimraf dist dist-types tsconfig.tsbuildinfo", |
10 | "test": "jest", | ||
10 | "build": "vite build", | 11 | "build": "vite build", |
11 | "typecheck": "tsc" | 12 | "typecheck": "tsc" |
12 | }, | 13 | }, |
@@ -20,7 +21,9 @@ | |||
20 | "@types/jest": "^27.0.3", | 21 | "@types/jest": "^27.0.3", |
21 | "jest": "^27.4.5", | 22 | "jest": "^27.4.5", |
22 | "jest-mock": "^27.4.2", | 23 | "jest-mock": "^27.4.2", |
24 | "jsdom": "^19.0.0", | ||
23 | "rimraf": "^3.0.2", | 25 | "rimraf": "^3.0.2", |
26 | "ts-jest": "^27.1.2", | ||
24 | "typescript": "^4.5.4", | 27 | "typescript": "^4.5.4", |
25 | "vite": "^2.7.6" | 28 | "vite": "^2.7.6" |
26 | } | 29 | } |
diff --git a/packages/preload/src/index.ts b/packages/preload/src/index.ts index 2703d40..ef466b4 100644 --- a/packages/preload/src/index.ts +++ b/packages/preload/src/index.ts | |||
@@ -21,8 +21,7 @@ | |||
21 | import { contextBridge } from 'electron'; | 21 | import { contextBridge } from 'electron'; |
22 | 22 | ||
23 | import { createSophieRenderer } from './contextBridge/SophieRendererImpl'; | 23 | import { createSophieRenderer } from './contextBridge/SophieRendererImpl'; |
24 | import { IpcRendererService } from './services/IpcRendererService'; | ||
25 | 24 | ||
26 | const sophieRenderer = createSophieRenderer(new IpcRendererService()); | 25 | const sophieRenderer = createSophieRenderer(); |
27 | 26 | ||
28 | contextBridge.exposeInMainWorld('sophieRenderer', sophieRenderer); | 27 | contextBridge.exposeInMainWorld('sophieRenderer', sophieRenderer); |
diff --git a/packages/preload/tsconfig.json b/packages/preload/tsconfig.json index 2e0b10f..ab274a1 100644 --- a/packages/preload/tsconfig.json +++ b/packages/preload/tsconfig.json | |||
@@ -5,7 +5,12 @@ | |||
5 | "declarationDir": "dist-types", | 5 | "declarationDir": "dist-types", |
6 | "emitDeclarationOnly": true, | 6 | "emitDeclarationOnly": true, |
7 | "rootDir": "src", | 7 | "rootDir": "src", |
8 | "libs": [ | 8 | "lib": [ |
9 | "dom", | ||
10 | "dom.iterable", | ||
11 | "esnext" | ||
12 | ], | ||
13 | "types": [ | ||
9 | "@types/jest" | 14 | "@types/jest" |
10 | ] | 15 | ] |
11 | }, | 16 | }, |