[BUG] Vue Calendar package.json does not specify types
Description
The @bryntum/calendar-vue-3 package is missing the types field in its package.json, and its type definition file (lib/index.d.ts) incorrectly re-exports from source files instead of compiled type definitions. This causes TypeScript to analyze the library's source .vue and .ts files, which fail strict mode type checking when used with @vue/tsconfig v0.8.0 or higher.
Steps to Reproduce
This issue occurs during TypeScript compilation, not in a running demo. To reproduce:
- Create a Vue 3 project with TypeScript
- Install
@bryntum/[email protected] - Use
@vue/tsconfig@^0.8.0(which enables strict TypeScript checks) - Import and use
BryntumCalendarcomponent in your code - Run
vue-tsc --buildor any TypeScript type-checking command - Observe TypeScript errors from Bryntum's source files in
node_modules
Example TypeScript errors:
node_modules/.pnpm/@[email protected]/node_modules/@bryntum/calendar-vue-3/src/components/BryntumDemoHeader.vue(57,21): error TS2532: Object is possibly 'undefined'.
node_modules/.pnpm/@[email protected]/node_modules/@bryntum/calendar-vue-3/src/components/BryntumDemoHeader.vue(70,43): error TS2532: Object is possibly 'undefined'.
node_modules/.pnpm/@[email protected]/node_modules/@bryntum/calendar-vue-3/src/helper/WrapperHelper.ts(122,40): error TS2532: Object is possibly 'undefined'.
Expected Behavior
-
The
package.jsonshould include atypesfield pointing to the main type definition file:{ "types": "./lib/index.d.ts" } -
The
lib/index.d.tsfile should re-export from compiled type definitions, not source files:// Current (incorrect): export { default as BryntumCalendar } from '../src/components/BryntumCalendar.vue'; export * from '../src/components/BryntumCalendarProps'; // Expected (correct): export { default as BryntumCalendar } from './components/BryntumCalendar.vue.d.ts'; export * from './components/BryntumCalendarProps'; -
TypeScript should only analyze the compiled
.d.tsfiles, not the source.vueand.tsfiles, preventing strict mode errors from the library's internal implementation. -
no typechecking of the node_modules
Actual Behavior
-
package.jsonlacks thetypesfield, causing TypeScript to fall back to heuristic module resolution -
lib/index.d.tsuses paths like'../src/components/*.vue', forcing TypeScript to load and check source files - TypeScript applies strict checks to Bryntum's source code, causing compilation failures with errors like "Object is possibly 'undefined'"
Screenshots / Logs
Current package.json (missing types field):
{
"name": "@bryntum/calendar-vue-3",
"version": "6.3.3",
"type": "module",
"main": "./lib/index.js",
"module": "./lib/index.js"
// Missing: "types": "./lib/index.d.ts"
}
Current lib/index.d.ts (incorrect paths):
export { default as BryntumFullscreenButton } from '../src/components/BryntumFullscreenButton.vue';
export { default as BryntumDemoHeader } from '../src/components/BryntumDemoHeader.vue';
export { default as BryntumAgendaView } from '../src/components/BryntumAgendaView.vue';
// ... 167 lines total, all pointing to ../src/ instead of ./components/
Environment
- OS: macOS (Darwin 24.6.0)
- Node.js: v22.20.0
- TypeScript: ~5.9.3
- Bryntum Version: @bryntum/[email protected]
- vue-tsc: 3.0.8
- @vue/tsconfig: 0.8.1
Additional Context
expectation is for the proper exporting of the types
typechecking performance is also horrible due to this issue
Suggested Fix: Update the build process to:
- Add
"types": "./lib/index.d.ts"to package.json - Generate
lib/index.d.tswith relative paths to compiled definitions (e.g.,./components/*.vue.d.ts) instead of source files (e.g.,../src/components/*.vue)
Ok. Thank you for the suggestion. We will add types
Regarding index.d.ts
export { default as BryntumFullscreenButton } from '../src/components/BryntumFullscreenButton.vue';
Targets BryntumFullscreenButton.vue.d.ts, which is an omitted d.ts extension in import
Ok. Thank you for the suggestion. We will add
typesRegarding
index.d.tsexport { default as BryntumFullscreenButton } from '../src/components/BryntumFullscreenButton.vue';Targets
BryntumFullscreenButton.vue.d.ts, which is an omittedd.tsextension in import
Awesome thank you! Is it something we can expect in a patch version of the Vue dependency?
We will try to do it in next 6.3.4 patch.
Fyi: @bryntum/schedulerpro-vue-3 seems to be also affected leading to similar errors. Can this be fixed?
It is fixed for all packages. Will be released with 6.3.4 version