From 1e65b776f03b84969b625f5ed677c75f0ba9194d Mon Sep 17 00:00:00 2001 From: Adi Dahiya Date: Wed, 4 Sep 2019 16:07:10 -0400 Subject: [PATCH 1/4] Upgrade TypeScript to 3.1 --- package.json | 2 +- types/DayPicker.d.ts | 2 +- types/DayPickerInput.d.ts | 2 +- types/common.d.ts | 2 +- types/index.d.ts | 2 +- types/moment.d.ts | 2 +- types/props.d.ts | 2 +- types/utils.d.ts | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 446dee8388..bb1b07d5fa 100644 --- a/package.json +++ b/package.json @@ -97,7 +97,7 @@ "react-dom": "^16.4.2", "react-test-renderer": "^16.4.2", "rimraf": "^2.6.2", - "typescript": "^3.0.1", + "typescript": "^3.1.6", "webpack": "^3.10.0" }, "dependencies": { diff --git a/types/DayPicker.d.ts b/types/DayPicker.d.ts index fe4e004716..5e519aac1d 100644 --- a/types/DayPicker.d.ts +++ b/types/DayPicker.d.ts @@ -1,4 +1,4 @@ -// TypeScript Version: 2.3 +// TypeScript Version: 3.1 import * as React from 'react'; import { LocaleUtils, ModifiersUtils, DateUtils } from './utils'; diff --git a/types/DayPickerInput.d.ts b/types/DayPickerInput.d.ts index b4c6815f03..2d5e8a7bbe 100644 --- a/types/DayPickerInput.d.ts +++ b/types/DayPickerInput.d.ts @@ -1,4 +1,4 @@ -// TypeScript Version: 2.3 +// TypeScript Version: 3.1 import * as React from 'react'; import { DayPickerInputProps } from './props'; diff --git a/types/common.d.ts b/types/common.d.ts index 958ec1ef62..613c086290 100644 --- a/types/common.d.ts +++ b/types/common.d.ts @@ -1,4 +1,4 @@ -// TypeScript Version: 2.3 +// TypeScript Version: 3.1 export interface ClassNames { container: string; diff --git a/types/index.d.ts b/types/index.d.ts index 265a978f97..4495a5cc84 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1,4 +1,4 @@ -// TypeScript Version: 2.3 +// TypeScript Version: 3.1 export { default } from './DayPicker'; diff --git a/types/moment.d.ts b/types/moment.d.ts index 57041b73b2..d560a5720d 100644 --- a/types/moment.d.ts +++ b/types/moment.d.ts @@ -1,4 +1,4 @@ -// TypeScript Version: 2.3 +// TypeScript Version: 3.1 import { LocaleUtils } from './utils'; diff --git a/types/props.d.ts b/types/props.d.ts index eacff8e9e7..516c96e680 100644 --- a/types/props.d.ts +++ b/types/props.d.ts @@ -1,4 +1,4 @@ -// TypeScript Version: 2.3 +// TypeScript Version: 3.1 import * as React from 'react'; import { diff --git a/types/utils.d.ts b/types/utils.d.ts index 071d07d290..06c766a532 100644 --- a/types/utils.d.ts +++ b/types/utils.d.ts @@ -1,4 +1,4 @@ -// TypeScript Version: 2.3 +// TypeScript Version: 3.1 import { RangeModifier, Modifier } from './common'; From de74f4aa75e3d3bcfc1c5b6affe2626c3dad7a49 Mon Sep 17 00:00:00 2001 From: Adi Dahiya Date: Wed, 4 Sep 2019 16:08:08 -0400 Subject: [PATCH 2/4] Remove explicit TypeScript dependency --- package.json | 2 +- types/tsconfig.json | 2 +- yarn.lock | 23 ++++++++++++++++++----- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index bb1b07d5fa..837655b9d6 100644 --- a/package.json +++ b/package.json @@ -57,6 +57,7 @@ "react": "~0.13.x || ~0.14.x || ^15.0.0 || ^16.0.0" }, "devDependencies": { + "@types/react": "^16.9.2", "autoprefixer": "^8.4.1", "babel-cli": "^6.26.0", "babel-core": "^6.26.3", @@ -97,7 +98,6 @@ "react-dom": "^16.4.2", "react-test-renderer": "^16.4.2", "rimraf": "^2.6.2", - "typescript": "^3.1.6", "webpack": "^3.10.0" }, "dependencies": { diff --git a/types/tsconfig.json b/types/tsconfig.json index c008f37e2e..c4fb004dff 100644 --- a/types/tsconfig.json +++ b/types/tsconfig.json @@ -5,7 +5,7 @@ "es6", "dom" ], - "noImplicitAny": false, + "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, "noEmit": true, diff --git a/yarn.lock b/yarn.lock index 0919ec63a9..5d782a0584 100644 --- a/yarn.lock +++ b/yarn.lock @@ -133,6 +133,19 @@ resolved "https://registry.yarnpkg.com/@types/parsimmon/-/parsimmon-1.10.0.tgz#ffb81cb023ff435a41d4710a29ab23c561dc9fdf" integrity sha512-bsTIJFVQv7jnvNiC42ld2pQW2KRI+pAG243L+iATvqzy3X6+NH1obz2itRKDZZ8VVhN3wjwYax/VBGCcXzgTqQ== +"@types/prop-types@*": + version "15.7.2" + resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.2.tgz#0e58ae66773d7fd7c372a493aff740878ec9ceaa" + integrity sha512-f8JzJNWVhKtc9dg/dyDNfliTKNOJSLa7Oht/ElZdF/UbMUmAH3rLmAk3ODNjw0mZajDEgatA03tRjB4+Dp/tzA== + +"@types/react@^16.9.2": + version "16.9.2" + resolved "https://registry.yarnpkg.com/@types/react/-/react-16.9.2.tgz#6d1765431a1ad1877979013906731aae373de268" + integrity sha512-jYP2LWwlh+FTqGd9v7ynUKZzjj98T8x7Yclz479QdRhHfuW9yQ+0jjnD31eXSXutmBpppj5PYNLYLRfnZJvcfg== + dependencies: + "@types/prop-types" "*" + csstype "^2.2.0" + abab@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.0.tgz#aba0ab4c5eee2d4c79d3487d85450fb2376ebb0f" @@ -1980,6 +1993,11 @@ cssstyle@^1.0.0: dependencies: cssom "0.3.x" +csstype@^2.2.0: + version "2.6.6" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.6.tgz#c34f8226a94bbb10c32cc0d714afdf942291fc41" + integrity sha512-RpFbQGUE74iyPgvr46U9t1xoQBM8T4BL8SxrN66Le2xYAPSaDJJKeztV3awugusb3g3G9iL8StmkBBXhcbbXhg== + d@1: version "1.0.1" resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a" @@ -6950,11 +6968,6 @@ type@^1.0.1: resolved "https://registry.yarnpkg.com/type/-/type-1.0.1.tgz#084c9a17fcc9151a2cdb1459905c2e45e4bb7d61" integrity sha512-MAM5dBMJCJNKs9E7JXo4CXRAansRfG0nlJxW7Wf6GZzSOvH31zClSaHdIMWLehe/EGMBkqeC55rrkaOr5Oo7Nw== -typescript@^3.0.1: - version "3.5.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.3.tgz#c830f657f93f1ea846819e929092f5fe5983e977" - integrity sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g== - typescript@next: version "3.6.0-dev.20190803" resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.6.0-dev.20190803.tgz#f428649ed50cc2d3c8a180acc8afb27881ecd268" From 0d34f20a3382bea98cd9f6ddb53062b9dbf2cca9 Mon Sep 17 00:00:00 2001 From: Adi Dahiya Date: Wed, 4 Sep 2019 16:09:06 -0400 Subject: [PATCH 3/4] Remove redundant type exports --- types/index.d.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/types/index.d.ts b/types/index.d.ts index 4495a5cc84..4fda8e8245 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1,12 +1,6 @@ // TypeScript Version: 3.1 export { default } from './DayPicker'; - -import * as UtilTypes from './utils'; export * from './common'; export * from './props'; export * from './utils'; - -export const DateUtils: typeof UtilTypes.DateUtils; -export const LocaleUtils: typeof UtilTypes.LocaleUtils; -export const ModifiersUtils: typeof UtilTypes.ModifiersUtils; From 8305deefd6b59d0baf9eadfbd9753ad8cb814fa7 Mon Sep 17 00:00:00 2001 From: Adi Dahiya Date: Wed, 4 Sep 2019 16:13:59 -0400 Subject: [PATCH 4/4] Add types/README.md --- types/README.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 types/README.md diff --git a/types/README.md b/types/README.md new file mode 100644 index 0000000000..327e97eb14 --- /dev/null +++ b/types/README.md @@ -0,0 +1,5 @@ +# TypeScript Definitions + +react-day-picker includes type definitions which the TypeScript compiler and language services can use to check your usage of the library. + +Note that _only exports from the root of the package_ (`import { ... } from "react-day-picker"`) are considered part of the public API.