Skip to content
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

missing dayjs module in develop branch #234

Closed
pintux opened this issue Mar 23, 2021 · 7 comments
Closed

missing dayjs module in develop branch #234

pintux opened this issue Mar 23, 2021 · 7 comments
Assignees
Labels
Milestone

Comments

@pintux
Copy link

pintux commented Mar 23, 2021

I've installed version 2.0.0-develop.2 in a TypeScript project. At compile time, on my project, I'm getting:

node_modules/ical-generator/dist/types.d.ts:3:23 - error TS2307: Cannot find module 'dayjs' or its corresponding type declarations.

3 import { Dayjs } from 'dayjs';

Found 1 error.
@sebbo2002 sebbo2002 self-assigned this Mar 23, 2021
@sebbo2002 sebbo2002 added the bug label Mar 23, 2021
@sebbo2002 sebbo2002 added this to the v2.0.0 🎉 milestone Mar 23, 2021
sebbo2002 pushed a commit that referenced this issue Mar 23, 2021
# [2.0.0-develop.4](v2.0.0-develop.3...v2.0.0-develop.4) (2021-03-23)

### Bug Fixes

* **Event:** Remove `moment` dependency in constructor ([8331d4c](8331d4c)), closes [#234](#234)
@sebbo2002
Copy link
Owner

sebbo2002 commented Mar 23, 2021

Could you try version 2.0.0-develop.4 again? Thank you.

@pintux
Copy link
Author

pintux commented Mar 24, 2021

Using 2.0.0-develop.8 version I'm getting the following errors, same happens with 2.0.0-develop.4:

node_modules/ical-generator/dist/event.d.ts:1:28 - error TS2307: Cannot find module 'rrule' or its corresponding type declarations.

1 import type { RRule } from 'rrule';
                             ~~~~~~~

node_modules/ical-generator/dist/types.d.ts:3:28 - error TS2307: Cannot find module 'dayjs' or its corresponding type declarations.

3 import type { Dayjs } from 'dayjs';
                             ~~~~~~~


Found 2 errors.

@sebbo2002
Copy link
Owner

Oh crap, how stupid of me. I'll take care of it tonight.

@sebbo2002 sebbo2002 reopened this Mar 24, 2021
@sebbo2002
Copy link
Owner

Okay, thought I forgot to add the type flag for RRule, but that's not the issue. I tested it locally, it works for me. Do you use typescript >= 3.8? The type only imports are introduced in this version…

Bildschirmfoto 2021-03-24 um 20 05 05

@pintux
Copy link
Author

pintux commented Mar 30, 2021

I'm using TypeScript 3.9.9 and (now) ical-generator version ^2.0.0-develop.14".

> tsc -v && tsc

Version 3.9.9
node_modules/ical-generator/dist/event.d.ts:1:28 - error TS2307: Cannot find module 'rrule' or its corresponding type declarations.

1 import type { RRule } from 'rrule';
                             ~~~~~~~

node_modules/ical-generator/dist/types.d.ts:3:28 - error TS2307: Cannot find module 'dayjs' or its corresponding type declarations.

3 import type { Dayjs } from 'dayjs';
                             ~~~~~~~


Found 2 errors.

I will try with a clean project

@sebbo2002
Copy link
Owner

Okay, I have now been able to reproduce the whole thing. Apparently, the dependencies must still be present when compiling in order to be able to check the types. Even if you use type-only imports. This is of course very annoying. I would put the dependencies in optionalDependencies, then they are usually installed automatically (if not already done). And since they will no longer be in the JavaScript, there should be no issue with this solution. I will do this in the next few days, but I don't have the time now.

@sebbo2002
Copy link
Owner

Okay, I have now packed the supported external libraries into peerDependencies. This way they should always be installed with npm 7. I hope this solves the problem. peerDependencies are installed with npm@7, before that you have to install them manually. I will add to the FAQ accordingly.

This was referenced Apr 10, 2021
sebbo2002 pushed a commit that referenced this issue Apr 28, 2021
# [2.0.0](v1.15.4...v2.0.0) (2021-04-28)

### Bug Fixes

* **package.json:** add temporary version ([0bc117e](0bc117e))
* Allow to set null values within object constructors ([8b87183](8b87183))
* **deps:** Also define libs as devDependency for tests ([c04ae32](c04ae32))
* **deps:** Define supported libs as peerDependencies ([84e2784](84e2784))
* Make peer dependencies optional ([b384ac7](b384ac7)), closes [#244](#244)
* **Tools:** Prevent formatDate() from using global timezones prefixed with a slash ([85ab7b2](85ab7b2))
* **deps:** Put necessary typings in peerDependencies as well :/ ([14f0f43](14f0f43))
* **Event:** Remove `moment` dependency in constructor ([8331d4c](8331d4c)), closes [#234](#234)

### Code Refactoring

* **Calendar:** Remove moment.Duration from `ttl()` method ([c6ccd12](c6ccd12))
* Update error URLs ([2aedf55](2aedf55))

### Features

* **Event:** Add `priority()` method ([247039f](247039f)), closes [#163](#163)
* **Attendee:** Add `x()` method for custom attributes ([5d9d686](5d9d686)), closes [#183](#183)
* **Calendar:** add new clear method ([1ebefcb](1ebefcb)), closes [#188](#188)
* Add ReleaseBot ([2fba164](2fba164))
* **Calendar:** Add support for external VTimezone generator ([f4bc8e0](f4bc8e0)), closes [#122](#122)
* **Event:** Allow `X-APPLE-STRUCTURED-LOCATION` without address ([4e63e29](4e63e29)), closes [#236](#236)
* **Event:** Make organizer.email optional ([8450492](8450492)), closes [#137](#137)
* **Event:** Merge `location()`, `appleLocation()` and `geo()` ([62c1516](62c1516)), closes [#187](#187)
* Merge event's `description()` and `htmlDescription()` ([ce537f8](ce537f8))
* Support moment.js, Day.js and Luxon ([#91](#91), BREAKING CHANGE) ([6db24ee](6db24ee))
* **Event:** Support RRule objects and raw strings in `repeating()` ([4436785](4436785)), closes [#190](#190)
* Updated the entire codebase to Typescript ([d013dc0](d013dc0))
* **Events:** Use uuid-random for random UUIDs (close [#215](#215)) ([a4c19cc](a4c19cc))

### BREAKING CHANGES

* Some error messages changed, so if you check for error , please double check them now.
* `htmlDescription()` was removed, use `description()` instead.
* **Calendar:** `ttl()` will now return a number, not a `moment.Duration`. You can still use `moment.Duration` to set the `ttl` value.
* **Event:** `geo()` and `appleLocation()` are not available anymore, use `location()` instead and pass an location object (with title, radius, etc.)
* **Calendar:** Calendar's `clear()` method is a completely new implementation and, unlike previous versions, will not reset metadata such as `name` or `prodId`. Only the events will be removed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants