From ab5b4025e0ac61b56d6509d500b271102484f4c4 Mon Sep 17 00:00:00 2001 From: u7-u7 <116776533+u7-u7@users.noreply.github.com> Date: Mon, 26 Oct 2026 16:52:55 +0800 Subject: [PATCH] fix(extension): generate wxt types during install apps/extension/tsconfig.json (tracked) extends ./.wxt/tsconfig.json, which is gitignored and only produced by `wxt prepare`. Nothing generates it on install, so a fresh checkout cannot typecheck or run the extension tests: $ pnpm --filter @browser-skill/extension compile error TS2318: Cannot find global type 'AsyncIterableIterator'. (exit 2) $ pnpm ext:test [TSCONFIG_ERROR] Failed to load tsconfig for 'src/vitest-setup.ts': Tsconfig not found Test Files 212 failed (212) (exit 1) `wxt build` and `wxt dev` happen to generate the types as a side effect, and CI works around the gap with an explicit prepare step, but the commands README lists for checks (`pnpm ext:test`) do not. Running `wxt prepare` from the extension's postinstall script makes `pnpm install` leave the repository in a state where the documented checks work, which is the layout WXT projects use. Verified: rm -rf apps/extension/.wxt && pnpm install --frozen-lockfile regenerates the types (exit 0), then compile exits 0 and the extension test suite runs (2972 tests passed). --- apps/extension/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/extension/package.json b/apps/extension/package.json index d3e2704e..0bedec36 100644 --- a/apps/extension/package.json +++ b/apps/extension/package.json @@ -9,7 +9,8 @@ "zip": "wxt zip", "compile": "tsc --noEmit", "test": "vitest run", - "test:watch": "vitest" + "test:watch": "vitest", + "postinstall": "wxt prepare" }, "dependencies": { "@browser-skill/i18n": "workspace:*",