incorrect type generation
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 275
- Forks
- 35
- Avg merge
- 4h 42m
- Merged PRs (30d)
- 6
Description
What happens?
My module.ts
import type { LogEntry } from "./runtime/server/types/LogEntry";
export interface ModuleOptions {
delayOnBan: boolean;
log: false | LogEntry;
}
export default defineNuxtModule<ModuleOptions>({
meta: {
name: "nuxt-api-shield",
configKey: "nuxtApiShield",
},
defaults: {
delayOnBan: true,
log: false,
},
After running yarn dev:prepare I get the following in .nuxt/types/schema.d.ts
interface PublicRuntimeConfig {
nuxtApiShield: {
delayOnBan: boolean,
log: boolean,
},
}
What is expected?
log type should be false | LogEntry
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the shown module.ts example by running yarn dev:prepare, then inspect the generated .nuxt/types/schema.d.ts and the module-builder type-generation entry points. Done means the generated nuxtApiShield.log type remains false | LogEntry instead of being reduced to boolean.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nuxt, typescript
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100