Skip to content

Commit

Permalink
chore: use module-builder stub mode for more accurate types (#289)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed May 17, 2024
1 parent cdfd386 commit 913bb3a
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"build": "pnpm dev:prepare && nuxt-module-build",
"dev": "nuxi dev playground",
"dev:build": "nuxi build playground",
"dev:prepare": "pnpm nuxt-module-build --stub && nuxi prepare playground",
"dev:prepare": "pnpm nuxt-module-build --stub && nuxt-module-build prepare && nuxi prepare playground",
"docs:dev": "nuxi dev docs",
"docs:build": "nuxi generate docs",
"lint": "pnpm lint:all:eslint",
Expand All @@ -45,7 +45,7 @@
"prepublishOnly": "pnpm lint && pnpm test",
"release": "bumpp && npm publish",
"test": "vitest run",
"test:types": "tsc --noEmit && nuxt typecheck"
"test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
},
"dependencies": {
"@nuxt/kit": "^3.7.0",
Expand Down Expand Up @@ -77,4 +77,4 @@
"@nuxt/kit": "3.8.2"
},
"packageManager": "pnpm@8.6.12"
}
}
4 changes: 2 additions & 2 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default defineNuxtModule<ModuleOptions>({
// Add nitro route for verifying cloudflare token
addServerHandler({
route: '/_turnstile/validate',
handler: join(runtimeDir, 'nitro/validate.post'),
handler: join(runtimeDir, 'server/validate.post'),
})
}

Expand All @@ -97,7 +97,7 @@ export default defineNuxtModule<ModuleOptions>({
config.imports = defu(config.imports, {
presets: [
{
from: join(runtimeDir, 'nitro/utils/verify'),
from: join(runtimeDir, 'server/utils/verify'),
imports: ['verifyTurnstileToken'],
},
],
Expand Down
3 changes: 3 additions & 0 deletions src/runtime/server/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../../.nuxt/tsconfig.server.json",
}
File renamed without changes.
File renamed without changes.
7 changes: 6 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{
"extends": "./playground/.nuxt/tsconfig.json",
"extends": "./.nuxt/tsconfig.json",
"exclude": [
"playground",
"dist",
"node_modules"
]
}

0 comments on commit 913bb3a

Please sign in to comment.