diff --git a/__tests__/e2e/env.d.ts b/__tests__/e2e/env.d.ts new file mode 100644 index 000000000..a99cf76cc --- /dev/null +++ b/__tests__/e2e/env.d.ts @@ -0,0 +1,5 @@ +declare module '*.vue' { + import type { DefineComponent } from 'vue' + const component: DefineComponent + export default component +} diff --git a/__tests__/e2e/tsconfig.json b/__tests__/e2e/tsconfig.json new file mode 100644 index 000000000..44878152c --- /dev/null +++ b/__tests__/e2e/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../tsconfig.json", + "include": ["**/*", ".vitepress/**/*"] +} diff --git a/__tests__/init/tsconfig.json b/__tests__/init/tsconfig.json new file mode 100644 index 000000000..3c43903cf --- /dev/null +++ b/__tests__/init/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../tsconfig.json" +} diff --git a/__tests__/tsconfig.json b/__tests__/tsconfig.json index 9cce3a1ef..366c4ab87 100644 --- a/__tests__/tsconfig.json +++ b/__tests__/tsconfig.json @@ -1,12 +1,8 @@ { "extends": "../tsconfig.json", "compilerOptions": { + "noEmit": true, "isolatedModules": false, - "types": ["node", "vitest/globals"], - "paths": { - "client/*": ["../src/client/*"], - "node/*": ["../src/node/*"], - "shared/*": ["../src/shared/*"] - } + "types": ["node", "vitest/globals"] } } diff --git a/__tests__/unit/tsconfig.json b/__tests__/unit/tsconfig.json new file mode 100644 index 000000000..f7ff23294 --- /dev/null +++ b/__tests__/unit/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "types": [ + "node", + "vitest/globals", + "vite/client", + "../../src/client/shims.d.ts" + ], + "paths": { + "client/*": ["../../src/client/*"], + "node/*": ["../../src/node/*"], + "shared/*": ["../../src/shared/*"], + "vitepress": ["../../src/client/index.ts"], + "vitepress/theme": ["../../theme.d.ts"] + } + } +} diff --git a/docs/tsconfig.json b/docs/tsconfig.json new file mode 100644 index 000000000..c36178307 --- /dev/null +++ b/docs/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "noEmit": true, + "types": ["node"] + }, + "include": ["**/*", ".vitepress/**/*"] +} diff --git a/package.json b/package.json index 53245c465..44fd3a7f7 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,8 @@ "build:prepare": "pnpm clean && node scripts/copyShared.ts", "build:client": "vue-tsc --noEmit -p src/client && tsc -p src/client && node scripts/copyClient.ts", "build:node": "tsc -p src/node --noEmit && rollup --config rollup.config.ts --configPlugin esbuild", - "test": "pnpm --aggregate-output --reporter=append-only '/^test:(unit|e2e|init)$/'", + "test": "pnpm --aggregate-output --reporter=append-only '/^test:(types|unit|e2e|init)$/'", + "test:types": "tsc -p __tests__/unit && tsc -p __tests__/e2e && tsc -p __tests__/init && vue-tsc -p docs", "test:unit": "vitest run -r __tests__/unit", "test:unit:watch": "vitest -r __tests__/unit", "test:e2e": "pnpm test:e2e-dev && pnpm test:e2e-build",