From a958c51542e4a48331984a14cf225934e2c3a716 Mon Sep 17 00:00:00 2001 From: onmax Date: Fri, 17 Apr 2026 14:12:19 +0200 Subject: [PATCH] fix(ci): restore plugin inference fixture --- src/runtime/server/utils/auth.ts | 2 -- .../tsconfig.type-check.json | 25 ++++--------------- .../virtual-modules.d.ts | 8 ++++++ 3 files changed, 13 insertions(+), 22 deletions(-) create mode 100644 test/cases/plugins-type-inference/virtual-modules.d.ts diff --git a/src/runtime/server/utils/auth.ts b/src/runtime/server/utils/auth.ts index f7fbda4..f892281 100644 --- a/src/runtime/server/utils/auth.ts +++ b/src/runtime/server/utils/auth.ts @@ -1,8 +1,6 @@ import type { BetterAuthOptions } from 'better-auth' import type { H3Event } from 'h3' -// @ts-expect-error Nuxt generates this virtual module in app builds. import { createDatabase, db } from '#auth/database' -// @ts-expect-error Nuxt generates this virtual module in app builds. import { createSecondaryStorage } from '#auth/secondary-storage' import createServerAuth from '#auth/server' import { betterAuth } from 'better-auth' diff --git a/test/cases/plugins-type-inference/tsconfig.type-check.json b/test/cases/plugins-type-inference/tsconfig.type-check.json index 609d8fe..8df8472 100644 --- a/test/cases/plugins-type-inference/tsconfig.type-check.json +++ b/test/cases/plugins-type-inference/tsconfig.type-check.json @@ -1,26 +1,11 @@ { + "extends": "./.nuxt/tsconfig.json", "compilerOptions": { - "target": "ESNext", - "lib": [ - "ESNext", - "DOM" - ], - "baseUrl": ".", - "module": "preserve", - "moduleResolution": "bundler", - "paths": { - "#auth/client": ["./app/auth.config"], - "#auth/server": ["./server/auth.config"], - "#nuxt-better-auth": ["../../../src/runtime/types/augment"] - }, - "types": [], - "strict": true, - "noEmit": true, - "skipLibCheck": true + "noEmit": true }, - "files": [ - "./.nuxt/types/nuxt-better-auth-infer.d.ts", - "./.nuxt/types/nuxt-better-auth-nitro.d.ts", + "include": [ + "./.nuxt/nuxt.d.ts", + "./virtual-modules.d.ts", "./typecheck-target.ts" ] } diff --git a/test/cases/plugins-type-inference/virtual-modules.d.ts b/test/cases/plugins-type-inference/virtual-modules.d.ts new file mode 100644 index 0000000..8a75f14 --- /dev/null +++ b/test/cases/plugins-type-inference/virtual-modules.d.ts @@ -0,0 +1,8 @@ +declare module '#auth/database' { + export const db: any + export function createDatabase(...args: any[]): any +} + +declare module '#auth/secondary-storage' { + export function createSecondaryStorage(...args: any[]): any +}