New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
__VLS_WithTemplateSlots breaks api-extractor #2237
Comments
It is not purely a by-product, it allows your component slots to be recognized via .d.ts by Volar to support slots intellisense and type check. But if you don't want to build slots types, you can have a special tsconfig with config
{
"extends": "./tsconfig.json",
"vueCompilerOptions": {
"skipTemplateCodegen": true
}
}
|
You're right, "byproduct" does have a negative connotation, and "product" would have sufficed. However, including that option did not change the emitted d.ts files for me. Here is my modified tsconfig.dts.json file as you suggest: {
"extends": "./tsconfig.json",
"compilerOptions": {
"declaration": true,
"emitDeclarationOnly": true,
"declarationDir": "build"
},
"vueCompilerOptions": {
"skipTemplateCodegen": true
}
} It still emits the code: declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{ I actually do want the DefineComponent to be emitted, however, so that the imported values can be typed correctly when passed to my app.component calls in the module that imports this library. I find that really helpful, and it has worked great in the past until 1.0.10 when it went all pear shaped and forced me to But back to the issue, since This isn't to say that I can't just ignore the exit code from api-extractor and continue by build anyway, because it doesn't prevent the dts files from being generated and working where needed, but with all the messaging spam it makes it hard to find actual issues. Maybe this is a failing of api-extractor and I should just forego rolling up the .d.ts files, but it's a great linting tool for preventing issues when generating documenattion with typedoc. So if there was a way to disable this Volar-specific wrapper and just generate the actual DefineComponent type, I believe that would 100% fix the issue. Thanks! |
We use api-extractor to roll up .d.ts files to a single file, as well as for generating a document model JSON file.
api-extractor now generates a warning for every SFC that uses slots, e.g.
I don't want to ignore this message, because a missing export in the rolled up .d.ts file will break builds, so we want the build process to error. But _VLS_WithTemplateSlots is a synthetic byproduct of vue-tsc, and not at all useful in the final .d.ts.
Is there a workaround, other than ignoring ae-forgotten-export messages?
The text was updated successfully, but these errors were encountered: