diff options
| author | Brendan Allan <[email protected]> | 2025-12-09 19:13:51 +0800 |
|---|---|---|
| committer | Brendan Allan <[email protected]> | 2025-12-09 19:13:51 +0800 |
| commit | 0a47a3cea0256642bb4cb38112669cdace7732e5 (patch) | |
| tree | ee7a9e73568a6708a5b7e0d2d0ac62dd8937e3d4 /packages | |
| parent | 306d57fcde02b34cb486a3d539421b6877f04167 (diff) | |
| download | opencode-0a47a3cea0256642bb4cb38112669cdace7732e5.tar.gz opencode-0a47a3cea0256642bb4cb38112669cdace7732e5.zip | |
fix: use ts project references for desktop and tauri
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/desktop/tsconfig.json | 5 | ||||
| -rw-r--r-- | packages/tauri/package.json | 4 | ||||
| -rw-r--r-- | packages/tauri/src/index.tsx | 15 | ||||
| -rw-r--r-- | packages/tauri/tsconfig.json | 24 |
4 files changed, 21 insertions, 27 deletions
diff --git a/packages/desktop/tsconfig.json b/packages/desktop/tsconfig.json index 8057094c3..e91a254de 100644 --- a/packages/desktop/tsconfig.json +++ b/packages/desktop/tsconfig.json @@ -1,6 +1,7 @@ { "$schema": "https://json.schemastore.org/tsconfig", "compilerOptions": { + "composite": true, "target": "ESNext", "module": "ESNext", "skipLibCheck": true, @@ -11,7 +12,9 @@ "jsxImportSource": "solid-js", "allowJs": true, "strict": true, - "noEmit": true, + "noEmit": false, + "emitDeclarationOnly": true, + "outDir": "ts-dist", "isolatedModules": true, "paths": { "@/*": ["./src/*"] diff --git a/packages/tauri/package.json b/packages/tauri/package.json index 1300aaf93..70b9e7cc8 100644 --- a/packages/tauri/package.json +++ b/packages/tauri/package.json @@ -4,9 +4,10 @@ "version": "1.0.137", "type": "module", "scripts": { + "typecheck": "tsgo -b", "predev": "bun ./scripts/predev.ts", "dev": "vite", - "build": "tsc && vite build", + "build": "bun run typecheck && vite build", "preview": "vite preview", "tauri": "tauri" }, @@ -24,6 +25,7 @@ "@actions/artifact": "4.0.0", "@tauri-apps/cli": "^2", "@types/bun": "catalog:", + "@typescript/native-preview": "catalog:", "typescript": "~5.6.2", "vite": "catalog:" } diff --git a/packages/tauri/src/index.tsx b/packages/tauri/src/index.tsx index 4e23241ec..495cff8fc 100644 --- a/packages/tauri/src/index.tsx +++ b/packages/tauri/src/index.tsx @@ -13,10 +13,17 @@ if (import.meta.env.DEV && !(root instanceof HTMLElement)) { const platform: Platform = {} -render(() => { - onMount(() => { - if (window.__OPENCODE__.updaterEnabled) runUpdater() - }) +declare global { + interface Window { + __OPENCODE__?: { updaterEnabled?: boolean } + } +} + +render( + () => { + onMount(() => { + if(window.__OPENCODE__?.updaterEnabled) runUpdater(); + }); return ( <PlatformProvider value={platform}> diff --git a/packages/tauri/tsconfig.json b/packages/tauri/tsconfig.json index cf73096e5..b21529450 100644 --- a/packages/tauri/tsconfig.json +++ b/packages/tauri/tsconfig.json @@ -1,26 +1,8 @@ { + "extends": "../desktop/tsconfig.json", "compilerOptions": { - "target": "ES2020", - "useDefineForClassFields": true, - "module": "ESNext", - "lib": ["ES2020", "DOM", "DOM.Iterable"], - "skipLibCheck": true, - - /* Bundler mode */ - "moduleResolution": "bundler", - "allowImportingTsExtensions": true, - "resolveJsonModule": true, - "isolatedModules": true, - "noEmit": true, - - /* Linting */ - "strict": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noFallthroughCasesInSwitch": true, - - "jsx": "preserve", - "jsxImportSource": "solid-js" + "outDir": "ts-dist" }, + "references": [{ "path": "../desktop" }], "include": ["src"] } |
