-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"extends": "../tsconfig.json", | ||
"exclude": [], | ||
"include": ["./**/*.ts"], | ||
"compilerOptions": { | ||
"rootDir": "..", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. When using Options API it is always infered as |
||
}, | ||
}, | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,5 @@ | |
"compilerOptions": { | ||
"rootDir": ".." | ||
}, | ||
"include": ["./**/*.ts"], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we only need to reset the excludes from the root config |
||
"exclude": [], | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ import { defineConfig } from 'vite' | |
|
||
import md5 from 'md5' | ||
|
||
import l10nPlugin from './build/l10n-plugin.mts' | ||
import l10nPlugin from './build/l10n-plugin.mjs' | ||
|
||
const appVersion = JSON.stringify(process.env.npm_package_version || 'nextcloud-vue') | ||
const versionHash = md5(appVersion).slice(0, 7) as string | ||
|
@@ -94,6 +94,15 @@ export default defineConfig((env) => { | |
const createConfig = createLibConfig(entryPoints, { | ||
// Add our overrides to the config | ||
config: overrides, | ||
// Only create declarations for source files | ||
DTSPluginOptions: { | ||
include: ['src/**/*.ts', 'src/**/*.js', 'src/**/*.vue'], | ||
compilerOptions: { | ||
declaration: true, | ||
rootDir: 'src', | ||
noEmit: false, | ||
}, | ||
}, | ||
// By default all dependencies are external, but no path imports | ||
nodeExternalsOptions: { | ||
// Packages with paths imports should be added here to mark them as external as well | ||
|
@@ -104,7 +113,7 @@ export default defineConfig((env) => { | |
// For backwards compatibility we include the css within the js files | ||
inlineCSS: true, | ||
// Build CommonJS files for backwards compatibility | ||
libraryFormats: ['es', 'cjs'], | ||
libraryFormats: ['cjs', 'es'], | ||
Comment on lines
-107
to
+116
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Make sure Typescript definitions are emitted for ESM output (overwrites the CJS) |
||
replace: { | ||
PRODUCTION: JSON.stringify(env.mode === 'production'), | ||
SCOPE_VERSION, | ||
|
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...