GeezerVison is showing github.com — fix: use ts project references for desktop and tauri · makeone/opencode@0a47a3c
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .gitignore +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -9,6 +9,7 @@ node_modules | 9 | 9 | playground | 10 | 10 | tmp | 11 | 11 | dist | | 12 | +ts-dist | 12 | 13 | .turbo | 13 | 14 | **/.serena | 14 | 15 | .serena/ | |
Collapse file Copy file name to clipboardExpand all lines: bun.lock +1Lines changed: 1 addition & 0 deletions Collapse file Copy file name to clipboardExpand all lines: packages/desktop/tsconfig.json +4-1Lines changed: 4 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | { | 2 | 2 | "$schema": "https://json.schemastore.org/tsconfig", | 3 | 3 | "compilerOptions": { | | 4 | + "composite": true, | 4 | 5 | "target": "ESNext", | 5 | 6 | "module": "ESNext", | 6 | 7 | "skipLibCheck": true, | | 11 | 12 | "jsxImportSource": "solid-js", | 12 | 13 | "allowJs": true, | 13 | 14 | "strict": true, | 14 | | - "noEmit": true, | | 15 | + "noEmit": false, | | 16 | + "emitDeclarationOnly": true, | | 17 | + "outDir": "ts-dist", | 15 | 18 | "isolatedModules": true, | 16 | 19 | "paths": { | 17 | 20 | "@/*": ["./src/*"] | |
Collapse file Copy file name to clipboardExpand all lines: packages/tauri/package.json +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 4 | 4 | "version": "1.0.137", | 5 | 5 | "type": "module", | 6 | 6 | "scripts": { | | 7 | + "typecheck": "tsgo -b", | 7 | 8 | "predev": "bun ./scripts/predev.ts", | 8 | 9 | "dev": "vite", | 9 | | - "build": "tsc && vite build", | | 10 | + "build": "bun run typecheck && vite build", | 10 | 11 | "preview": "vite preview", | 11 | 12 | "tauri": "tauri" | 12 | 13 | }, | | 24 | 25 | "@actions/artifact": "4.0.0", | 25 | 26 | "@tauri-apps/cli": "^2", | 26 | 27 | "@types/bun": "catalog:", | | 28 | + "@typescript/native-preview": "catalog:", | 27 | 29 | "typescript": "~5.6.2", | 28 | 30 | "vite": "catalog:" | 29 | 31 | } | |
Collapse file Copy file name to clipboardExpand all lines: packages/tauri/src/index.tsx +11-4Lines changed: 11 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -13,10 +13,17 @@ if (import.meta.env.DEV && !(root instanceof HTMLElement)) { | 13 | 13 |
| 14 | 14 | const platform: Platform = {} | 15 | 15 |
| 16 | | -render(() => { | 17 | | - onMount(() => { | 18 | | - if (window.__OPENCODE__.updaterEnabled) runUpdater() | 19 | | - }) | | 16 | +declare global { | | 17 | + interface Window { | | 18 | + __OPENCODE__?: { updaterEnabled?: boolean } | | 19 | + } | | 20 | +} | | 21 | + | | 22 | +render( | | 23 | + () => { | | 24 | + onMount(() => { | | 25 | + if(window.__OPENCODE__?.updaterEnabled) runUpdater(); | | 26 | + }); | 20 | 27 |
| 21 | 28 | return ( | 22 | 29 | <PlatformProvider value={platform}> | |
Collapse file Copy file name to clipboard +3-21Lines changed: 3 additions & 21 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | { | | 2 | + "extends": "../desktop/tsconfig.json", | 2 | 3 | "compilerOptions": { | 3 | | - "target": "ES2020", | 4 | | - "useDefineForClassFields": true, | 5 | | - "module": "ESNext", | 6 | | - "lib": ["ES2020", "DOM", "DOM.Iterable"], | 7 | | - "skipLibCheck": true, | 8 | | - | 9 | | - /* Bundler mode */ | 10 | | - "moduleResolution": "bundler", | 11 | | - "allowImportingTsExtensions": true, | 12 | | - "resolveJsonModule": true, | 13 | | - "isolatedModules": true, | 14 | | - "noEmit": true, | 15 | | - | 16 | | - /* Linting */ | 17 | | - "strict": true, | 18 | | - "noUnusedLocals": true, | 19 | | - "noUnusedParameters": true, | 20 | | - "noFallthroughCasesInSwitch": true, | 21 | | - | 22 | | - "jsx": "preserve", | 23 | | - "jsxImportSource": "solid-js" | | 4 | + "outDir": "ts-dist" | 24 | 5 | }, | | 6 | + "references": [{ "path": "../desktop" }], | 25 | 7 | "include": ["src"] | 26 | 8 | } |
|