-
Notifications
You must be signed in to change notification settings - Fork 85
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
fix: Adjust Typescript definition export #5583
Conversation
@@ -39,22 +39,27 @@ | |||
"require": "./dist/index.cjs" | |||
}, | |||
"./dist/Components/*.js": { | |||
"types": "./dist/components/*/index.d.ts", | |||
"import": "./dist/Components/*.mjs", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would be so happy to get rid of the uppercase path...
@@ -607,7 +607,7 @@ export default defineComponent({ | |||
}, | |||
|
|||
ncPopoverTriggerAttrs() { | |||
return this.getNcPopoverTriggerAttrs() | |||
return (this.getNcPopoverTriggerAttrs as () => Record<string, string|undefined>)() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When using Options API it is always infered as unknown
only Composition API (setup) will provide correct type information without any need to cast it here.
@@ -3,5 +3,5 @@ | |||
"compilerOptions": { | |||
"rootDir": ".." | |||
}, | |||
"include": ["./**/*.ts"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we only need to reset the excludes from the root config
Make sure Typescript definitions are correctly exported. Also export them from the package. Signed-off-by: Ferdinand Thiessen <[email protected]>
libraryFormats: ['es', 'cjs'], | ||
libraryFormats: ['cjs', 'es'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure Typescript definitions are emitted for ESM output (overwrites the CJS)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks fine
☑️ Resolves
Make sure Typescript definitions are correctly exported. Also export them from the package.
🖼️ Screenshots
🏁 Checklist
next
requested with a Vue 3 upgrade