aboutsummaryrefslogtreecommitdiffstats
path: root/packages/shared
diff options
context:
space:
mode:
Diffstat (limited to 'packages/shared')
-rw-r--r--packages/shared/.eslintrc.cjs7
-rw-r--r--packages/shared/esbuild.config.js6
-rw-r--r--packages/shared/package.json7
-rw-r--r--packages/shared/src/contextBridge/SophieRenderer.ts7
-rw-r--r--packages/shared/src/index.ts5
-rw-r--r--packages/shared/tsconfig.build.json12
-rw-r--r--packages/shared/tsconfig.json14
7 files changed, 36 insertions, 22 deletions
diff --git a/packages/shared/.eslintrc.cjs b/packages/shared/.eslintrc.cjs
new file mode 100644
index 0000000..71d6ec4
--- /dev/null
+++ b/packages/shared/.eslintrc.cjs
@@ -0,0 +1,7 @@
1module.exports = {
2 env: {
3 // We must run in both node and browser, so we can't depend on either of them.
4 node: false,
5 browser: false,
6 },
7};
diff --git a/packages/shared/esbuild.config.js b/packages/shared/esbuild.config.js
index 66d6658..78249ab 100644
--- a/packages/shared/esbuild.config.js
+++ b/packages/shared/esbuild.config.js
@@ -1,8 +1,8 @@
1import { chrome, node } from '../../config/buildConstants.js'; 1import { chrome, node } from '../../config/buildConstants.js';
2import { getConfig } from '../../config/esbuildConfig.js'; 2import fileURLToDirname from '../../config/fileURLToDirname.js';
3import { fileURLToDirname } from '../../config/utils.js'; 3import getEsbuildConfig from '../../config/getEsbuildConfig.js';
4 4
5export default getConfig({ 5export default getEsbuildConfig({
6 absWorkingDir: fileURLToDirname(import.meta.url), 6 absWorkingDir: fileURLToDirname(import.meta.url),
7 entryPoints: [ 7 entryPoints: [
8 'src/index.ts', 8 'src/index.ts',
diff --git a/packages/shared/package.json b/packages/shared/package.json
index 0c06643..d77261d 100644
--- a/packages/shared/package.json
+++ b/packages/shared/package.json
@@ -7,15 +7,12 @@
7 "exports": "./dist/index.mjs", 7 "exports": "./dist/index.mjs",
8 "types": "dist/index.d.ts", 8 "types": "dist/index.d.ts",
9 "scripts": { 9 "scripts": {
10 "typecheck": "tsc" 10 "typecheck:workspace": "yarn g:typecheck",
11 "types": "yarn g:types"
11 }, 12 },
12 "dependencies": { 13 "dependencies": {
13 "mobx": "^6.3.12", 14 "mobx": "^6.3.12",
14 "mobx-state-tree": "^5.1.0", 15 "mobx-state-tree": "^5.1.0",
15 "zod": "^3.11.6" 16 "zod": "^3.11.6"
16 },
17 "devDependencies": {
18 "rimraf": "^3.0.2",
19 "typescript": "^4.5.4"
20 } 17 }
21} 18}
diff --git a/packages/shared/src/contextBridge/SophieRenderer.ts b/packages/shared/src/contextBridge/SophieRenderer.ts
index fc43b6e..9858aa9 100644
--- a/packages/shared/src/contextBridge/SophieRenderer.ts
+++ b/packages/shared/src/contextBridge/SophieRenderer.ts
@@ -18,12 +18,11 @@
18 * SPDX-License-Identifier: AGPL-3.0-only 18 * SPDX-License-Identifier: AGPL-3.0-only
19 */ 19 */
20 20
21import { SharedStoreListener } from '../stores/SharedStore';
22
23import { Action } from '../schemas'; 21import { Action } from '../schemas';
22import { SharedStoreListener } from '../stores/SharedStore';
24 23
25export interface SophieRenderer { 24export interface SophieRenderer {
26 onSharedStoreChange(listener: SharedStoreListener): Promise<void>; 25 onSharedStoreChange(this: void, listener: SharedStoreListener): Promise<void>;
27 26
28 dispatchAction(action: Action): void; 27 dispatchAction(this: void, action: Action): void;
29} 28}
diff --git a/packages/shared/src/index.ts b/packages/shared/src/index.ts
index 2f7146c..9828ec4 100644
--- a/packages/shared/src/index.ts
+++ b/packages/shared/src/index.ts
@@ -20,10 +20,7 @@
20 20
21export type { SophieRenderer } from './contextBridge/SophieRenderer'; 21export type { SophieRenderer } from './contextBridge/SophieRenderer';
22 22
23export { 23export { MainToRendererIpcMessage, RendererToMainIpcMessage } from './ipc';
24 MainToRendererIpcMessage,
25 RendererToMainIpcMessage,
26} from './ipc';
27 24
28export type { 25export type {
29 Action, 26 Action,
diff --git a/packages/shared/tsconfig.build.json b/packages/shared/tsconfig.build.json
new file mode 100644
index 0000000..9a0c835
--- /dev/null
+++ b/packages/shared/tsconfig.build.json
@@ -0,0 +1,12 @@
1{
2 "extends": "../../config/tsconfig.base.json",
3 "compilerOptions": {
4 "composite": true,
5 "declarationDir": "dist",
6 "emitDeclarationOnly": true,
7 "rootDir": "src"
8 },
9 "include": [
10 "src/**/*.ts"
11 ]
12}
diff --git a/packages/shared/tsconfig.json b/packages/shared/tsconfig.json
index ff5a29b..79889d2 100644
--- a/packages/shared/tsconfig.json
+++ b/packages/shared/tsconfig.json
@@ -1,12 +1,14 @@
1{ 1{
2 "extends": "../../tsconfig.json", 2 "extends": "./tsconfig.build.json",
3 "compilerOptions": { 3 "compilerOptions": {
4 "composite": true, 4 "composite": false,
5 "declarationDir": "dist", 5 "emitDeclarationOnly": false,
6 "emitDeclarationOnly": true, 6 "declarationDir": null,
7 "rootDir": "src" 7 "noEmit": true,
8 "rootDir": null
8 }, 9 },
9 "include": [ 10 "include": [
10 "src/**/*.ts" 11 "src/**/*.ts",
12 "esbuild.config.js"
11 ] 13 ]
12} 14}