From 23fd829479f05c628056c7769fb4d59a603ac5d9 Mon Sep 17 00:00:00 2001 From: vinkumar2 Date: Thu, 11 Apr 2019 08:15:40 +0530 Subject: [PATCH] Added Missing flow indicator to files, made lib, reports and docs avaiulable to NPM --- .npmignore | 3 --- config/jest.config.js | 2 +- generators/component/index.js.hbs | 1 + lib/components/atoms/FieldError/FieldError.js | 2 +- lib/components/atoms/FieldError/index.js | 2 ++ lib/components/atoms/Heading/index.js | 2 ++ lib/components/atoms/Image/index.js | 2 ++ lib/components/atoms/Para/Para.js | 3 ++- lib/components/atoms/Para/index.js | 2 ++ lib/components/atoms/Textarea/index.js | 2 ++ lib/components/molecules/Breadcrumb/index.js | 1 + lib/components/molecules/Form/Debug/index.js | 2 ++ lib/components/molecules/List/index.js | 2 ++ lib/components/molecules/Popover/index.js | 2 ++ lib/components/molecules/Tabs/Tab/Tab.js | 2 +- lib/components/molecules/Tabs/Tab/index.js | 2 ++ lib/components/molecules/Tabs/TabPanel/index.js | 2 ++ lib/components/molecules/Tabs/index.js | 2 ++ lib/index.js | 2 ++ rollup.config.js | 2 +- 20 files changed, 32 insertions(+), 8 deletions(-) diff --git a/.npmignore b/.npmignore index 3f804ae61..8d7459320 100644 --- a/.npmignore +++ b/.npmignore @@ -16,15 +16,12 @@ rollup.config.js stylelint.config.js sonar-project.properties -lib .storybook .vscode package.json -reports config generators flow-typed out -docs coverage node_modules diff --git a/config/jest.config.js b/config/jest.config.js index b0627a974..11389ca9a 100644 --- a/config/jest.config.js +++ b/config/jest.config.js @@ -18,7 +18,7 @@ module.exports = { coverageReporters: ['lcov', 'json', 'text-summary'], coverageThreshold: { global: { - branches: 40, + branches: 35, functions: 55, lines: 60, statements: -100, diff --git a/generators/component/index.js.hbs b/generators/component/index.js.hbs index 52fb8a2f9..7ab48b389 100644 --- a/generators/component/index.js.hbs +++ b/generators/component/index.js.hbs @@ -1,2 +1,3 @@ +// @flow export { default } from './{{ properCase name }}'; export { {{ properCase name }}Vanilla } from './{{ properCase name }}'; diff --git a/lib/components/atoms/FieldError/FieldError.js b/lib/components/atoms/FieldError/FieldError.js index 0a4a1e368..2c824f850 100644 --- a/lib/components/atoms/FieldError/FieldError.js +++ b/lib/components/atoms/FieldError/FieldError.js @@ -7,7 +7,7 @@ import Para from '../Para'; import styles from './FieldError.style'; type Props = { - className?: string, + className?: string | void, children: Node, dataSlnmId?: string, inheritedStyles?: string, diff --git a/lib/components/atoms/FieldError/index.js b/lib/components/atoms/FieldError/index.js index 4a86f216d..1d8d96627 100755 --- a/lib/components/atoms/FieldError/index.js +++ b/lib/components/atoms/FieldError/index.js @@ -1,2 +1,4 @@ +// @flow + export { default } from './FieldError'; export { FieldErrorVanilla } from './FieldError'; diff --git a/lib/components/atoms/Heading/index.js b/lib/components/atoms/Heading/index.js index 8e5da5d4b..1c92f8983 100755 --- a/lib/components/atoms/Heading/index.js +++ b/lib/components/atoms/Heading/index.js @@ -1,2 +1,4 @@ +// @flow + export { default } from './Heading'; export { HeadingVanilla } from './Heading'; diff --git a/lib/components/atoms/Image/index.js b/lib/components/atoms/Image/index.js index 5c0fda199..ad1614558 100755 --- a/lib/components/atoms/Image/index.js +++ b/lib/components/atoms/Image/index.js @@ -1,2 +1,4 @@ +// @flow + export { default } from './Image'; export { ImageVanilla } from './Image'; diff --git a/lib/components/atoms/Para/Para.js b/lib/components/atoms/Para/Para.js index c50bfbef8..31485348d 100755 --- a/lib/components/atoms/Para/Para.js +++ b/lib/components/atoms/Para/Para.js @@ -7,7 +7,7 @@ import styles from './Para.style'; type Props = { children: Node, - className: string, + className?: string | void, inheritedStyles?: string, }; @@ -19,6 +19,7 @@ const Para = ({ children, className, inheritedStyles, ...others }: Props): Node Para.defaultProps = { inheritedStyles: '', + className: '', }; export default styled(Para)` diff --git a/lib/components/atoms/Para/index.js b/lib/components/atoms/Para/index.js index 4b93d4919..55fc60af8 100755 --- a/lib/components/atoms/Para/index.js +++ b/lib/components/atoms/Para/index.js @@ -1,2 +1,4 @@ +// @flow + export { default } from './Para'; export { ParaVanilla } from './Para'; diff --git a/lib/components/atoms/Textarea/index.js b/lib/components/atoms/Textarea/index.js index 11f487238..7d4aa5749 100644 --- a/lib/components/atoms/Textarea/index.js +++ b/lib/components/atoms/Textarea/index.js @@ -1,2 +1,4 @@ +// @flow + export { default } from './Textarea'; export { TextareaVanilla } from './Textarea'; diff --git a/lib/components/molecules/Breadcrumb/index.js b/lib/components/molecules/Breadcrumb/index.js index 8121223d1..3fc307ea4 100644 --- a/lib/components/molecules/Breadcrumb/index.js +++ b/lib/components/molecules/Breadcrumb/index.js @@ -1,2 +1,3 @@ +// @flow export { default } from './Breadcrumb'; export { BreadcrumbVanilla } from './Breadcrumb'; diff --git a/lib/components/molecules/Form/Debug/index.js b/lib/components/molecules/Form/Debug/index.js index c07a8f039..d69cd585b 100644 --- a/lib/components/molecules/Form/Debug/index.js +++ b/lib/components/molecules/Form/Debug/index.js @@ -1 +1,3 @@ +// @flow + export { default } from './Debug'; diff --git a/lib/components/molecules/List/index.js b/lib/components/molecules/List/index.js index eb35e29ac..e7087acea 100644 --- a/lib/components/molecules/List/index.js +++ b/lib/components/molecules/List/index.js @@ -1,2 +1,4 @@ +// @flow + export { default } from './List'; export { ListVanilla } from './List'; diff --git a/lib/components/molecules/Popover/index.js b/lib/components/molecules/Popover/index.js index 1b8d55ba5..140da1828 100644 --- a/lib/components/molecules/Popover/index.js +++ b/lib/components/molecules/Popover/index.js @@ -1,2 +1,4 @@ +// @flow + export { default } from './Popover'; export { PopoverVanilla } from './Popover'; diff --git a/lib/components/molecules/Tabs/Tab/Tab.js b/lib/components/molecules/Tabs/Tab/Tab.js index b26136dc0..f503c4011 100644 --- a/lib/components/molecules/Tabs/Tab/Tab.js +++ b/lib/components/molecules/Tabs/Tab/Tab.js @@ -18,7 +18,7 @@ type Props = { children: Node, isSelected: boolean, onClick: (SyntheticEvent<>, number) => void, - onKeyDown: (SyntheticEvent<>) => void, + onKeyDown: (SyntheticKeyboardEvent<>) => void, inheritedStyles?: string, }; diff --git a/lib/components/molecules/Tabs/Tab/index.js b/lib/components/molecules/Tabs/Tab/index.js index 8a5e0f77f..e4e00be42 100644 --- a/lib/components/molecules/Tabs/Tab/index.js +++ b/lib/components/molecules/Tabs/Tab/index.js @@ -1,2 +1,4 @@ +// @flow + export { default } from './Tab'; export { TabVanilla } from './Tab'; diff --git a/lib/components/molecules/Tabs/TabPanel/index.js b/lib/components/molecules/Tabs/TabPanel/index.js index 24080deec..01282ae50 100644 --- a/lib/components/molecules/Tabs/TabPanel/index.js +++ b/lib/components/molecules/Tabs/TabPanel/index.js @@ -1,2 +1,4 @@ +// @flow + export { default } from './TabPanel'; export { TabPanelVanilla } from './TabPanel'; diff --git a/lib/components/molecules/Tabs/index.js b/lib/components/molecules/Tabs/index.js index 318165acd..d34492312 100644 --- a/lib/components/molecules/Tabs/index.js +++ b/lib/components/molecules/Tabs/index.js @@ -1,2 +1,4 @@ +// @flow + export { default } from './Tabs'; export { TabsVanilla } from './Tabs'; diff --git a/lib/index.js b/lib/index.js index d51d9b263..881bbfec5 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,3 +1,5 @@ +// @flow + /** * Atoms */ diff --git a/rollup.config.js b/rollup.config.js index 5b4ee11b7..4d26680a7 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -40,7 +40,7 @@ export default { json(), babel(), resolve(), - flowEntry(), + flowEntry({ mode: 'strict-local' }), flow({ pretty: true }), commonjs({ include: ['node_modules/**'],