Skip to content

Commit d61639a

Browse files
committed
1 parent 589ce36 commit d61639a

9 files changed

+68
-47
lines changed

Diff for: ui/src/api.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { spawn } from "child_process";
22
import type { BrowserWindow } from "electron";
33
import { app, ipcMain } from "electron";
44
import path from "path";
5-
import type { CommandData, Message, RunData, SettingsData } from "./types";
6-
import { CommandType } from "./types";
5+
import type { CommandData, Message, RunData, SettingsData } from "./types.ts";
6+
import { CommandType } from "./types.ts";
77

88
export class Api {
99
private static instance = new Api();

Diff for: ui/src/main.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { BrowserWindow, app, ipcMain, shell } from "electron";
22
import fs from "fs/promises";
33
import path from "path";
4-
import { Api } from "./api";
5-
import type { RootState } from "./stores";
6-
import { registerUpdateHandlers, startUpdatePolling } from "./update";
4+
import { Api } from "./api.ts";
5+
import type { RootState } from "./stores/index.ts";
6+
import { registerUpdateHandlers, startUpdatePolling } from "./update.ts";
77

88
// Handle creating/removing shortcuts on Windows when installing/uninstalling.
99
if (require("electron-squirrel-startup")) {

Diff for: ui/src/preload.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
// https://www.electronjs.org/docs/latest/tutorial/process-model#preload-scripts
33

44
import { contextBridge, ipcRenderer } from "electron";
5-
import type { RootState } from "./stores";
6-
import type { Message, RunData, SettingsData } from "./types";
7-
import { CommandType } from "./types";
5+
import type { RootState } from "./stores/index.ts";
6+
import type { Message, RunData, SettingsData } from "./types.ts";
7+
import { CommandType } from "./types.ts";
88

99
const electronApi = {
1010
saveState: (state: Partial<RootState>): Promise<void> =>

Diff for: ui/tsconfig.app.json

+17-29
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,20 @@
11
{
2-
"compilerOptions": {
3-
"target": "ES2021",
4-
"useDefineForClassFields": true,
5-
"lib": ["ES2021", "DOM", "DOM.Iterable"],
6-
"module": "commonjs",
7-
"skipLibCheck": true,
8-
"esModuleInterop": true,
9-
"noImplicitAny": true,
10-
"sourceMap": true,
11-
"baseUrl": ".",
12-
"outDir": "dist",
13-
14-
/* Bundler mode */
15-
"moduleResolution": "node",
16-
// "allowImportingTsExtensions": true,
17-
"resolveJsonModule": true,
18-
// "isolatedModules": true,
19-
"noEmit": true,
20-
"jsx": "react-jsx",
21-
// https://github.com/emotion-js/emotion/issues/1249#issuecomment-828088254
22-
"jsxImportSource": "@emotion/react",
23-
"types": ["vitest/globals"],
2+
"extends": "./tsconfig.base.json",
3+
"include": ["src/**/*"],
4+
"exclude": [
5+
"src/main.ts",
6+
"src/preload.ts",
7+
"src/update.ts",
8+
"src/api.ts",
249

25-
/* Linting */
26-
"strict": true,
27-
"noUnusedLocals": true,
28-
"noUnusedParameters": true,
29-
"noFallthroughCasesInSwitch": true
30-
},
31-
"include": ["src/**/*"]
10+
"src/**/*.test.*",
11+
"src/App.tesst.tsx"
12+
],
13+
"compilerOptions": {
14+
"module": "esnext",
15+
"moduleResolution": "bundler",
16+
"isolatedModules": true,
17+
"noEmit": true, // might not be needed
18+
"lib": ["esnext"]
19+
}
3220
}

Diff for: ui/tsconfig.base.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"compilerOptions": {
3+
// recommended
4+
"target": "es2016",
5+
"module": "esnext",
6+
"esModuleInterop": true,
7+
"strict": true,
8+
"skipLibCheck": true,
9+
10+
// other common options
11+
"resolveJsonModule": true,
12+
13+
// both app and node (test) need jsx
14+
"jsx": "react-jsx",
15+
// https://github.com/emotion-js/emotion/issues/1249#issuecomment-828088254
16+
"jsxImportSource": "@emotion/react"
17+
}
18+
}

Diff for: ui/tsconfig.node.json

+18-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
{
2+
"extends": "./tsconfig.base.json",
3+
"include": [
4+
"src/main.ts",
5+
"src/preload.ts",
6+
"src/update.ts",
7+
"src/api.ts",
8+
9+
"src/**/*.test.*",
10+
11+
"*.config.*",
12+
"forge.env.d.ts"
13+
],
214
"compilerOptions": {
3-
"skipLibCheck": true,
4-
"module": "ESNext",
5-
"moduleResolution": "bundler",
6-
"allowSyntheticDefaultImports": true,
7-
"strict": true
8-
},
9-
"include": ["vite.*.ts", "forge.*.ts"]
15+
"module": "nodenext",
16+
"moduleResolution": "nodenext",
17+
"noEmit": true,
18+
"allowImportingTsExtensions": true,
19+
"types": ["vitest/globals"]
20+
}
1021
}

Diff for: ui/vite.main.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
getBuildConfig,
66
getBuildDefine,
77
pluginHotRestart,
8-
} from "./vite.base.config";
8+
} from "./vite.base.config.ts";
99

1010
// https://vitejs.dev/config
1111
export default defineConfig((env) => {

Diff for: ui/vite.preload.config.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import type { ConfigEnv, UserConfig } from "vite";
22
import { defineConfig, mergeConfig } from "vite";
3-
import { external, getBuildConfig, pluginHotRestart } from "./vite.base.config";
3+
import {
4+
external,
5+
getBuildConfig,
6+
pluginHotRestart,
7+
} from "./vite.base.config.ts";
48

59
// https://vitejs.dev/config
610
export default defineConfig((env) => {

Diff for: ui/vite.renderer.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { ConfigEnv, UserConfig } from "vite";
22
import { defineConfig } from "vite";
3-
import { pluginExposeRenderer } from "./vite.base.config";
3+
import { pluginExposeRenderer } from "./vite.base.config.ts";
44

55
// https://vitejs.dev/config
66
export default defineConfig((env) => {

0 commit comments

Comments
 (0)