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

Add plugin type definitions #418

Merged
merged 8 commits into from
Feb 23, 2019
Merged

Add plugin type definitions #418

merged 8 commits into from
Feb 23, 2019

Conversation

ypresto
Copy link
Contributor

@ypresto ypresto commented Nov 29, 2018

  • Place all type definition files in types/ dir and merge into root of package on build.
  • Fix lack of string | number | Date in arguments
  • Add argument types to locale() methods and fix plugin option type
  • Added type definitions of plugins
  • Bumped rollup but still have @types/*** in its dependencies, causes tsc compile error without workaround...

Fixes #297

@codecov-io
Copy link

codecov-io commented Nov 29, 2018

Codecov Report

Merging #418 into dev will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@         Coverage Diff         @@
##            dev   #418   +/-   ##
===================================
  Coverage   100%   100%           
===================================
  Files        58     58           
  Lines       511    511           
  Branches     85     85           
===================================
  Hits        511    511

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 35e268a...0bb72c6. Read the comment docs.

@ypresto ypresto force-pushed the plugin-types branch 2 times, most recently from 2a41045 to 648ba53 Compare November 29, 2018 12:54
@yashwp
Copy link

yashwp commented Dec 2, 2018

@ypresto Thanks, bro :) Anyways I've rolled back to moment.js

@iamkun iamkun mentioned this pull request Jan 16, 2019
@iamkun
Copy link
Owner

iamkun commented Jan 21, 2019

Hi @ypresto , we are working on this PR. And there is a discussion on #364.

Join us please if you have time, so that we can see what we can do to make this pr get merged.


declare namespace dayjs {
export type ConfigType = string | number | Date | Dayjs
export type DateType = string | number | Date | Dayjs
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could be a breaking change for those, who use TS and rely on semver. I suppose it is better to increase at least minor version, or to not change naming right now at all, but leave comments that it is deprecated and will be replaced in newer versions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added type alias with @deprecated marker!

@ypresto ypresto changed the base branch from master to dev February 21, 2019 06:19
@ypresto
Copy link
Contributor Author

ypresto commented Feb 21, 2019

Created plugin type defs which added after PR submit..!

@dmk1111
Copy link

dmk1111 commented Feb 21, 2019

Looks good to me

@iamkun
Copy link
Owner

iamkun commented Feb 21, 2019

@ypresto I like this plugin type definition in module augmentation。
Come and join me here, if you have time.

https://gitter.im/iamkun/dayjs

@ypresto
Copy link
Contributor Author

ypresto commented Feb 21, 2019

I added comment here :) #364 (comment)

@ypresto
Copy link
Contributor Author

ypresto commented Feb 22, 2019

Fixed missing OptionType signature, especially for dayjs('05/02/69 1:02:03 PM -05:00', 'MM/DD/YY H:mm:ss A Z').
See discussion here: #364 (comment)

@iamkun iamkun merged commit 361d437 into iamkun:dev Feb 23, 2019
@ypresto ypresto deleted the plugin-types branch February 23, 2019 17:40
iamkun pushed a commit that referenced this pull request Feb 24, 2019
## [1.8.7](v1.8.6...v1.8.7) (2019-02-24)

### Bug Fixes

* Add plugin type definitions ([#418](#418)) ([361d437](361d437))
* Add Swahili locale ([#508](#508)) ([b9cee84](b9cee84))
* Parse month string 'MMMM MMM (February, Feb)' in customParseFormat ([#457](#457)) ([f343206](f343206))
* Update declaration file .diff .isBefore .isSame .isAfter ([#496](#496)) ([4523275](4523275))
* Word orders corrections for locale 'fa' ([#491](#491)) ([56050c2](56050c2))
@iamkun
Copy link
Owner

iamkun commented Feb 24, 2019

🎉 This PR is included in version 1.8.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

andrewhood125ruhuc added a commit to andrewhood125ruhuc/SidRH2 that referenced this pull request May 10, 2022
## [1.8.7](iamkun/dayjs@v1.8.6...v1.8.7) (2019-02-24)

### Bug Fixes

* Add plugin type definitions ([#418](iamkun/dayjs#418)) ([361d437](iamkun/dayjs@361d437))
* Add Swahili locale ([#508](iamkun/dayjs#508)) ([b9cee84](iamkun/dayjs@b9cee84))
* Parse month string 'MMMM MMM (February, Feb)' in customParseFormat ([#457](iamkun/dayjs#457)) ([f343206](iamkun/dayjs@f343206))
* Update declaration file .diff .isBefore .isSame .isAfter ([#496](iamkun/dayjs#496)) ([4523275](iamkun/dayjs@4523275))
* Word orders corrections for locale 'fa' ([#491](iamkun/dayjs#491)) ([56050c2](iamkun/dayjs@56050c2))
andrewhood125ruhuc added a commit to andrewhood125ruhuc/SidRH2 that referenced this pull request May 10, 2022
## [1.8.7](iamkun/dayjs@v1.8.6...v1.8.7) (2019-02-24)

### Bug Fixes

* Add plugin type definitions ([#418](iamkun/dayjs#418)) ([361d437](iamkun/dayjs@361d437))
* Add Swahili locale ([#508](iamkun/dayjs#508)) ([b9cee84](iamkun/dayjs@b9cee84))
* Parse month string 'MMMM MMM (February, Feb)' in customParseFormat ([#457](iamkun/dayjs#457)) ([f343206](iamkun/dayjs@f343206))
* Update declaration file .diff .isBefore .isSame .isAfter ([#496](iamkun/dayjs#496)) ([4523275](iamkun/dayjs@4523275))
* Word orders corrections for locale 'fa' ([#491](iamkun/dayjs#491)) ([56050c2](iamkun/dayjs@56050c2))
splashwizard pushed a commit to splashwizard/tracking-time that referenced this pull request Oct 21, 2024
## [1.8.7](iamkun/dayjs@v1.8.6...v1.8.7) (2019-02-24)

### Bug Fixes

* Add plugin type definitions ([#418](iamkun/dayjs#418)) ([361d437](iamkun/dayjs@361d437))
* Add Swahili locale ([#508](iamkun/dayjs#508)) ([b9cee84](iamkun/dayjs@b9cee84))
* Parse month string 'MMMM MMM (February, Feb)' in customParseFormat ([#457](iamkun/dayjs#457)) ([f343206](iamkun/dayjs@f343206))
* Update declaration file .diff .isBefore .isSame .isAfter ([#496](iamkun/dayjs#496)) ([4523275](iamkun/dayjs@4523275))
* Word orders corrections for locale 'fa' ([#491](iamkun/dayjs#491)) ([56050c2](iamkun/dayjs@56050c2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Property 'fromNow' does not exist on type 'Dayjs'
5 participants