From f48d8293d74bba97c4cf596b8f48819c2ae25a00 Mon Sep 17 00:00:00 2001 From: Mo Gorhom Date: Fri, 31 Jul 2020 17:38:30 +0200 Subject: [PATCH] chore: added script to copy types file to lib --- package.json | 4 +- src/components/flatList/FlatList.tsx | 2 +- src/components/scrollView/ScrollView.tsx | 5 ++- src/components/sectionList/SectionList.tsx | 5 ++- tsconfig.json | 4 +- yarn.lock | 51 ++++++++++++++++++++-- 6 files changed, 62 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index db1862d82..446cd661b 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,8 @@ "scripts": { "typescript": "tsc --noEmit", "lint": "eslint \"**/*.{js,ts,tsx}\"", - "build": "bob build", + "build": "bob build && yarn copy-dts", + "copy-dts": "copyfiles -u 1 \"src/**/*.d.ts\" lib/typescript", "release": "release-it", "example": "yarn --cwd example", "bootstrap": "yarn install && yarn example" @@ -49,6 +50,7 @@ "@types/react": "^16.9.19", "@types/react-native": "0.61.10", "auto-changelog": "^2.2.0", + "copyfiles": "^2.3.0", "eslint": "^7.5.0", "eslint-config-prettier": "^6.11.0", "eslint-plugin-prettier": "^3.1.4", diff --git a/src/components/flatList/FlatList.tsx b/src/components/flatList/FlatList.tsx index 24a7cf961..470db27e9 100644 --- a/src/components/flatList/FlatList.tsx +++ b/src/components/flatList/FlatList.tsx @@ -14,7 +14,7 @@ import { import Reanimated from 'react-native-reanimated'; import { NativeViewGestureHandler } from 'react-native-gesture-handler'; import { useBottomSheetInternal } from '../../hooks'; -import { BottomSheetFlatListProps, BottomSheetFlatList } from './types'; +import type { BottomSheetFlatListProps, BottomSheetFlatList } from './types'; const AnimatedFlatList = Reanimated.createAnimatedComponent( RNFlatList diff --git a/src/components/scrollView/ScrollView.tsx b/src/components/scrollView/ScrollView.tsx index 6640f58eb..c385954af 100644 --- a/src/components/scrollView/ScrollView.tsx +++ b/src/components/scrollView/ScrollView.tsx @@ -14,7 +14,10 @@ import { import Reanimated from 'react-native-reanimated'; import { NativeViewGestureHandler } from 'react-native-gesture-handler'; import { useBottomSheetInternal } from '../../hooks'; -import { BottomSheetScrollView, BottomSheetScrollViewProps } from './types'; +import type { + BottomSheetScrollView, + BottomSheetScrollViewProps, +} from './types'; const AnimatedScrollView = Reanimated.createAnimatedComponent( RNScrollView diff --git a/src/components/sectionList/SectionList.tsx b/src/components/sectionList/SectionList.tsx index 855a458a7..1e1fa33ce 100644 --- a/src/components/sectionList/SectionList.tsx +++ b/src/components/sectionList/SectionList.tsx @@ -14,7 +14,10 @@ import { import Reanimated from 'react-native-reanimated'; import { NativeViewGestureHandler } from 'react-native-gesture-handler'; import { useBottomSheetInternal } from '../../hooks'; -import { BottomSheetSectionListProps, BottomSheetSectionList } from './types'; +import type { + BottomSheetSectionListProps, + BottomSheetSectionList, +} from './types'; const AnimatedSectionList = Reanimated.createAnimatedComponent( RNSectionList diff --git a/tsconfig.json b/tsconfig.json index 5ef1a11fc..310b40ba9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,4 @@ { - "exclude": ["./example"], "compilerOptions": { "baseUrl": ".", "paths": { @@ -24,5 +23,6 @@ "strict": true, "target": "esnext" }, + "exclude": ["example"], "include": ["src"] -} \ No newline at end of file +} diff --git a/yarn.lock b/yarn.lock index be11d7c6a..0c64fcb4d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3038,6 +3038,18 @@ copy-descriptor@^0.1.0: resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= +copyfiles@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/copyfiles/-/copyfiles-2.3.0.tgz#1c26ebbe3d46bba2d309a3fd8e3aaccf53af8c76" + integrity sha512-73v7KFuDFJ/ofkQjZBMjMBFWGgkS76DzXvBMUh7djsMOE5EELWtAO/hRB6Wr5Vj5Zg+YozvoHemv0vnXpqxmOQ== + dependencies: + glob "^7.0.5" + minimatch "^3.0.3" + mkdirp "^1.0.4" + noms "0.0.0" + through2 "^2.0.1" + yargs "^15.3.1" + core-js-compat@^3.6.2: version "3.6.5" resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.6.5.tgz#2a51d9a4e25dfd6e690251aa81f99e3c05481f1c" @@ -4272,7 +4284,7 @@ glob-parent@^5.0.0, glob-parent@^5.1.0: dependencies: is-glob "^4.0.1" -glob@^7.0.0, glob@^7.1.3, glob@^7.1.6: +glob@^7.0.0, glob@^7.0.5, glob@^7.1.3, glob@^7.1.6: version "7.1.6" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== @@ -4628,7 +4640,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@2.0.4, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3: +inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.1, inherits@~2.0.3: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -5014,6 +5026,11 @@ is-yarn-global@^0.3.0: resolved "https://registry.yarnpkg.com/is-yarn-global/-/is-yarn-global-0.3.0.tgz#d502d3382590ea3004893746754c89139973e232" integrity sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw== +isarray@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" + integrity sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8= + isarray@1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -5935,7 +5952,7 @@ min-indent@^1.0.0: resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== -minimatch@^3.0.4: +minimatch@^3.0.3, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== @@ -5979,6 +5996,11 @@ mkdirp@^0.5.1: dependencies: minimist "^1.2.5" +mkdirp@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" + integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== + modify-values@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022" @@ -6084,6 +6106,14 @@ node-stream-zip@^1.9.1: resolved "https://registry.yarnpkg.com/node-stream-zip/-/node-stream-zip-1.11.2.tgz#5d0124b80e2942afd7f5853a36ceb0d65c1d9e77" integrity sha512-cowCX+OyzS3tN2i4BMMFxCr/pE6cQlEMTbVCugmos0TNEJQNtcG04tR41CY8lumO1I7F5GFiLaU4WavomJthaA== +noms@0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/noms/-/noms-0.0.0.tgz#da8ebd9f3af9d6760919b27d9cdc8092a7332859" + integrity sha1-2o69nzr51nYJGbJ9nNyAkqczKFk= + dependencies: + inherits "^2.0.1" + readable-stream "~1.0.31" + normalize-package-data@^2.3.0, normalize-package-data@^2.3.2, normalize-package-data@^2.3.4, normalize-package-data@^2.3.5, normalize-package-data@^2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" @@ -6954,6 +6984,16 @@ readable-stream@^2.0.1, readable-stream@^2.2.2, readable-stream@~2.3.6: string_decoder "~1.1.1" util-deprecate "~1.0.1" +readable-stream@~1.0.31: + version "1.0.34" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" + integrity sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw= + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + rechoir@^0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" @@ -7772,6 +7812,11 @@ string_decoder@^1.1.1: dependencies: safe-buffer "~5.2.0" +string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + integrity sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ= + string_decoder@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8"