DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.
fix(tooling): typecheck workspace sources without generated declarations (#849)
SkanderBot39d4157ddf7e
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex a3257e59..ababbcb2 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -56,14 +56,17 @@ jobs:- name: Install dependenciesrun: pnpm install --frozen-lockfile+ - name: Type check sources before generating declarations+ run: pnpm run typecheck+# 插件 client 类型经 workspace 包的 exports 指向构建产物(dist/client.d.cts),# typecheck/lint 前先构建两个核心共享包,否则全新检出会报# "Cannot find module 'dsh-tauri/client'"。- name: Build core packagesrun: pnpm --filter dsh-tauri build && pnpm --filter dsh-tauri-ui build- - name: Type check- run: pnpm run typecheck+ - name: Type check package exports+ run: pnpm exec tsc --noEmit- name: Lintrun: pnpm run lintdiff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.mdindex 49d30d92..6dca5c4e 100644--- a/docs/DEVELOPMENT.md+++ b/docs/DEVELOPMENT.md@@ -38,6 +38,8 @@ Run from the repository root:For portable desktop/plugin development, use separate terminals for the plugin watcher and `pnpm tauri dev`.+`pnpm typecheck` checks workspace package sources through `tsconfig.typecheck.json`, so a fresh checkout needs only `pnpm install`, without generated declarations or a running plugin watcher. Build and runtime resolution still use package exports; CI builds the shared packages and tests their packaged entrypoints separately.+**Build protection:** [AGENTS.md](<../AGENTS.md>) forbids builds during plugin changes. `pnpm build:plugins`, `pnpm build`, `pnpm build:debug`, and `pnpm tauri build` are deliberate artifact-preparation/release actions; `pnpm build` also invokes the plugin prebuild.## Validationdiff --git a/docs/DEVELOPMENT.zh.md b/docs/DEVELOPMENT.zh.mdindex c54ff89f..48269281 100644--- a/docs/DEVELOPMENT.zh.md+++ b/docs/DEVELOPMENT.zh.md@@ -38,6 +38,8 @@ macOS 运行时最低版本为 12+,Web 界面需要 Safari 17.4+ 能力。Linu跨平台开发建议分别在两个终端运行插件 watcher 与 `pnpm tauri dev`。+`pnpm typecheck` 通过 `tsconfig.typecheck.json` 检查工作区包源码,因此全新检出后只需 `pnpm install`,不依赖生成的声明文件或插件 watcher。构建和运行时仍通过包 exports 解析;CI 会单独构建共享包并验证其产物入口。+**构建保护:** [AGENTS.md](<../AGENTS.md>) 禁止在插件改动期间执行构建。`pnpm build:plugins`、`pnpm build`、`pnpm build:debug`、`pnpm tauri build` 仅用于明确的产物准备 / 发布;`pnpm build` 还会触发插件 prebuild。## 验证diff --git a/package.json b/package.jsonindex 9c651007..86f0f794 100644--- a/package.json+++ b/package.json@@ -24,7 +24,7 @@"test:e2e:desktop": "vitest --project desktop","lint": "eslint","lint:fix": "eslint . --fix",- "typecheck": "tsc --noEmit",+ "typecheck": "tsc --project tsconfig.typecheck.json --noEmit","icons": "tauri icon public/favicon.svg && tsx scripts/rebuild-macos-icon.ts"},"dependencies": {diff --git a/tsconfig.typecheck.json b/tsconfig.typecheck.jsonnew file mode 100644index 00000000..d5b1d219--- /dev/null+++ b/tsconfig.typecheck.json@@ -0,0 +1,12 @@+{+ "extends": "./tsconfig.json",+ "compilerOptions": {+ "paths": {+ "@/*": ["src/*"],+ "dsh-tauri": ["packages/dsh-tauri/src/index.ts"],+ "dsh-tauri/client": ["packages/dsh-tauri/src/client/index.ts"],+ "dsh-tauri-ui": ["packages/dsh-tauri-ui/src/index.ts"],+ "dsh-tauri-ui/client": ["packages/dsh-tauri-ui/src/client/index.ts"]+ }+ }+}