nathanreyes / v-calendar

An elegant calendar and datepicker plugin for Vue.
https://vcalendar.io
MIT License
4.32k stars 840 forks source link

Module 'v-calendar' should export types from utils package #1472

Open AdrienLeblanc opened 1 month ago

AdrienLeblanc commented 1 month ago

Hello !

Context :

We are currently using v-calendar 3.1.2 and are facing a problem with some types not being properly exported by 'v-calendar' module. Our Vue project is built with Vite and it seems that Vite is not capable of resolving an import at the start.

image

In fact, we import { AttributeConfig } from 'v-calendar/dist/types/src/utils/attribute' for typing purposes to make the code clearer, sadly it is currently not exported by the 'v-calendar' module in the beginning. I tried to configure my project to bypass this warning, in vain.

Proposed solution:

Is it possible to add the different types to the exports of the module ? So we can use proper typing on our side. AttributeConfig is not the only one, the goal would be to export the maximum of types developers might use in the future also.

Thanks !

cojohnson1999 commented 1 month ago

I'm facing the same problem with V-Calendar version 3.1.2 with types exported from v-calendar/dist/types/src/utils/date/helpers. When importing the DateParts interface for typing purposes, I get the following Vite build error:

error TS2307: Cannot find module 'v-calendar/dist/types/src/utils/date/helpers' or its corresponding type declarations.

import { DateParts } from 'v-calendar/dist/types/src/utils/date/helpers';

Having these types be exported properly would be great.