From c831b55a77bb5869dadc34879a19ec1ff24d138c Mon Sep 17 00:00:00 2001 From: Danny-Robinson Date: Mon, 12 Oct 2020 16:37:18 +0100 Subject: [PATCH 1/7] Export component types --- src/ts/index.ts | 55 ++++++++++++++++++++++++++++++++++++++++++---- src/ts/store.tsx | 2 ++ tsconfig.dist.json | 1 + 3 files changed, 54 insertions(+), 4 deletions(-) diff --git a/src/ts/index.ts b/src/ts/index.ts index 632aca3dc..1d737df67 100644 --- a/src/ts/index.ts +++ b/src/ts/index.ts @@ -1,6 +1,6 @@ export { default as Alert } from './components/misc/alert'; -export { default as AppRoot } from './components/app/root'; export { default as Anchor } from './components/misc/anchor'; +export { default as AppRoot } from './components/app/root'; export { default as Badge } from './components/misc/badge'; export { default as Banner } from './components/banners/banner'; export { default as Button } from './components/forms/button'; @@ -9,10 +9,9 @@ export { default as Collapse } from './components/misc/collapse'; export { default as Column } from './components/grid/column'; export { default as Container } from './components/grid/container'; export { default as ContentBox } from './components/content/content-box'; -export { default as ContentBoxHeader } from './components/content/content-box-header'; export { default as ContentBoxFooter } from './components/content/content-box-footer'; +export { default as ContentBoxHeader } from './components/content/content-box-header'; export { default as CookieBanner } from './components/banners/cookie-banner'; -export { CookieBannerRenderProps } from './components/banners/cookie-banner'; export { default as DabIpsum } from './components/prototyping/dab-ipsum'; export { default as Footer } from './components/navigation/footer'; export { default as FormGroup } from './components/forms/form-group'; @@ -36,7 +35,6 @@ export { default as Section } from './components/content/section'; export { default as SideBar } from './components/navigation/side-bar'; export { default as SpacedGroup } from './components/misc/spaced-group'; export { default as SpeechBubble } from './components/misc/speech-bubble'; -export { default as Tabs } from './components/tabs/tabs'; export { default as Tab } from './components/tabs/tab'; export { default as Table } from './components/tables/table'; export { default as TableBody } from './components/tables/table-body'; @@ -44,4 +42,53 @@ export { default as TableCell } from './components/tables/table-cell'; export { default as TableHead } from './components/tables/table-head'; export { default as TableHeader } from './components/tables/table-header'; export { default as TableRow } from './components/tables/table-row'; +export { default as Tabs } from './components/tabs/tabs'; export { default as Well } from './components/misc/well'; + +export { AlertProps } from './components/misc/alert'; +export { AnchorProps } from './components/misc/anchor'; +export { AppRootProps } from './components/app/root'; +export { BadgeProps } from './components/misc/badge'; +export { BannerProps } from './components/banners/banner'; +export { ButtonProps } from './components/forms/button'; +export { CodeBlockProps } from './components/misc/code-block'; +export { CollapseProps } from './components/misc/collapse'; +export { ColumnProps } from './components/grid/column'; +export { ContainerProps } from './components/grid/container'; +export { ContentBoxFooterProps } from './components/content/content-box-footer'; +export { ContentBoxHeaderProps } from './components/content/content-box-header'; +export { ContentBoxProps } from './components/content/content-box'; +export { CookieBannerProps } from './components/banners/cookie-banner'; +export { CookieBannerRenderProps } from './components/banners/cookie-banner'; +export { DabIpsumProps } from './components/prototyping/dab-ipsum'; +export { FooterProps } from './components/navigation/footer'; +export { FormGroupProps } from './components/forms/form-group'; +export { HighlightProps } from './components/misc/highlight'; +export { InputGroupAddonProps } from './components/forms/input-group-addon'; +export { InputGroupProps } from './components/forms/input-group'; +export { InputWithPrefixSuffixProps } from './components/precomposed/input-with-prefix-suffix'; +export { ModalBodyProps } from './components/modals/modal-body'; +export { ModalCloseIconProps } from './components/modals/modal-close-icon'; +export { ModalFooterProps } from './components/modals/modal-footer'; +export { ModalHeaderProps } from './components/modals/modal-header'; +export { ModalProps } from './components/modals/modal'; +export { ModalRendererProps } from './components/modals/modal-renderer'; +export { NavBarProps } from './components/navigation/nav-bar'; +export { NavItemProps } from './components/navigation/nav-item'; +export { NavProps } from './components/navigation/nav'; +export { PaginationDisplayProps } from './components/pagination/pagination-display'; +export { PaginationProps } from './components/pagination/pagination'; +export { RowProps } from './components/grid/row'; +export { SectionProps } from './components/content/section'; +export { SideBarProps } from './components/navigation/side-bar'; +export { SpacedGroupProps } from './components/misc/spaced-group'; +export { SpeechBubbleProps } from './components/misc/speech-bubble'; +export { TableBodyProps } from './components/tables/table-body'; +export { TableCellProps } from './components/tables/table-cell'; +export { TableHeaderProps } from './components/tables/table-header'; +export { TableHeadProps } from './components/tables/table-head'; +export { TableProps } from './components/tables/table'; +export { TableRowProps } from './components/tables/table-row'; +export { TabProps } from './components/tabs/tab'; +export { TabsProps } from './components/tabs/tabs'; +export { WellProps } from './components/misc/well'; diff --git a/src/ts/store.tsx b/src/ts/store.tsx index 79fe40a86..192890824 100644 --- a/src/ts/store.tsx +++ b/src/ts/store.tsx @@ -4,6 +4,8 @@ export type ComponentType

= | React.ComponentClass

| React.StatelessComponent

; + +// @internal export type StoreState = Partial<{ hasFixedNavBar: boolean; hasStickyFooter: boolean; diff --git a/tsconfig.dist.json b/tsconfig.dist.json index afe9976f6..13bfdf364 100644 --- a/tsconfig.dist.json +++ b/tsconfig.dist.json @@ -4,6 +4,7 @@ "declaration": true, "sourceMap": true, "listEmittedFiles": true, + "stripInternal": true, "rootDir": "./src/ts/", "outDir": "./dist/js/" }, From 3904b57a30cba155c7b0433ce616f50d44851c2b Mon Sep 17 00:00:00 2001 From: Danny-Robinson Date: Mon, 12 Oct 2020 16:44:49 +0100 Subject: [PATCH 2/7] Now inline --- src/ts/index.ts | 139 ++++++++++++++++-------------------------------- 1 file changed, 46 insertions(+), 93 deletions(-) diff --git a/src/ts/index.ts b/src/ts/index.ts index 1d737df67..6fb4f5b8a 100644 --- a/src/ts/index.ts +++ b/src/ts/index.ts @@ -1,94 +1,47 @@ -export { default as Alert } from './components/misc/alert'; -export { default as Anchor } from './components/misc/anchor'; -export { default as AppRoot } from './components/app/root'; -export { default as Badge } from './components/misc/badge'; -export { default as Banner } from './components/banners/banner'; -export { default as Button } from './components/forms/button'; -export { default as CodeBlock } from './components/misc/code-block'; -export { default as Collapse } from './components/misc/collapse'; -export { default as Column } from './components/grid/column'; -export { default as Container } from './components/grid/container'; -export { default as ContentBox } from './components/content/content-box'; -export { default as ContentBoxFooter } from './components/content/content-box-footer'; -export { default as ContentBoxHeader } from './components/content/content-box-header'; -export { default as CookieBanner } from './components/banners/cookie-banner'; -export { default as DabIpsum } from './components/prototyping/dab-ipsum'; -export { default as Footer } from './components/navigation/footer'; -export { default as FormGroup } from './components/forms/form-group'; -export { default as Highlight } from './components/misc/highlight'; -export { default as InputGroup } from './components/forms/input-group'; -export { default as InputGroupAddon } from './components/forms/input-group-addon'; -export { default as InputWithPrefixSuffix } from './components/precomposed/input-with-prefix-suffix'; -export { default as Modal } from './components/modals/modal'; -export { default as ModalBody } from './components/modals/modal-body'; -export { default as ModalCloseIcon } from './components/modals/modal-close-icon'; -export { default as ModalFooter } from './components/modals/modal-footer'; -export { default as ModalHeader } from './components/modals/modal-header'; -export { default as ModalRenderer } from './components/modals/modal-renderer'; -export { default as Nav } from './components/navigation/nav'; -export { default as NavBar } from './components/navigation/nav-bar'; -export { default as NavItem } from './components/navigation/nav-item'; -export { default as Pagination } from './components/pagination/pagination'; -export { default as PaginationDisplay } from './components/pagination/pagination-display'; -export { default as Row } from './components/grid/row'; -export { default as Section } from './components/content/section'; -export { default as SideBar } from './components/navigation/side-bar'; -export { default as SpacedGroup } from './components/misc/spaced-group'; -export { default as SpeechBubble } from './components/misc/speech-bubble'; -export { default as Tab } from './components/tabs/tab'; -export { default as Table } from './components/tables/table'; -export { default as TableBody } from './components/tables/table-body'; -export { default as TableCell } from './components/tables/table-cell'; -export { default as TableHead } from './components/tables/table-head'; -export { default as TableHeader } from './components/tables/table-header'; -export { default as TableRow } from './components/tables/table-row'; -export { default as Tabs } from './components/tabs/tabs'; -export { default as Well } from './components/misc/well'; - -export { AlertProps } from './components/misc/alert'; -export { AnchorProps } from './components/misc/anchor'; -export { AppRootProps } from './components/app/root'; -export { BadgeProps } from './components/misc/badge'; -export { BannerProps } from './components/banners/banner'; -export { ButtonProps } from './components/forms/button'; -export { CodeBlockProps } from './components/misc/code-block'; -export { CollapseProps } from './components/misc/collapse'; -export { ColumnProps } from './components/grid/column'; -export { ContainerProps } from './components/grid/container'; -export { ContentBoxFooterProps } from './components/content/content-box-footer'; -export { ContentBoxHeaderProps } from './components/content/content-box-header'; -export { ContentBoxProps } from './components/content/content-box'; -export { CookieBannerProps } from './components/banners/cookie-banner'; +export { default as Alert, AlertProps } from './components/misc/alert'; +export { default as AppRoot, AppRootProps } from './components/app/root'; +export { default as Anchor, AnchorProps } from './components/misc/anchor'; +export { default as Badge, BadgeProps } from './components/misc/badge'; +export { default as Banner, BannerProps } from './components/banners/banner'; +export { default as Button, ButtonProps } from './components/forms/button'; +export { default as CodeBlock, CodeBlockProps } from './components/misc/code-block'; +export { default as Collapse, CollapseProps } from './components/misc/collapse'; +export { default as Column, ColumnProps } from './components/grid/column'; +export { default as Container, ContainerProps } from './components/grid/container'; +export { default as ContentBox, ContentBoxProps } from './components/content/content-box'; +export { default as ContentBoxHeader, ContentBoxHeaderProps } from './components/content/content-box-header'; +export { default as ContentBoxFooter, ContentBoxFooterProps } from './components/content/content-box-footer'; +export { default as CookieBanner, CookieBannerProps } from './components/banners/cookie-banner'; export { CookieBannerRenderProps } from './components/banners/cookie-banner'; -export { DabIpsumProps } from './components/prototyping/dab-ipsum'; -export { FooterProps } from './components/navigation/footer'; -export { FormGroupProps } from './components/forms/form-group'; -export { HighlightProps } from './components/misc/highlight'; -export { InputGroupAddonProps } from './components/forms/input-group-addon'; -export { InputGroupProps } from './components/forms/input-group'; -export { InputWithPrefixSuffixProps } from './components/precomposed/input-with-prefix-suffix'; -export { ModalBodyProps } from './components/modals/modal-body'; -export { ModalCloseIconProps } from './components/modals/modal-close-icon'; -export { ModalFooterProps } from './components/modals/modal-footer'; -export { ModalHeaderProps } from './components/modals/modal-header'; -export { ModalProps } from './components/modals/modal'; -export { ModalRendererProps } from './components/modals/modal-renderer'; -export { NavBarProps } from './components/navigation/nav-bar'; -export { NavItemProps } from './components/navigation/nav-item'; -export { NavProps } from './components/navigation/nav'; -export { PaginationDisplayProps } from './components/pagination/pagination-display'; -export { PaginationProps } from './components/pagination/pagination'; -export { RowProps } from './components/grid/row'; -export { SectionProps } from './components/content/section'; -export { SideBarProps } from './components/navigation/side-bar'; -export { SpacedGroupProps } from './components/misc/spaced-group'; -export { SpeechBubbleProps } from './components/misc/speech-bubble'; -export { TableBodyProps } from './components/tables/table-body'; -export { TableCellProps } from './components/tables/table-cell'; -export { TableHeaderProps } from './components/tables/table-header'; -export { TableHeadProps } from './components/tables/table-head'; -export { TableProps } from './components/tables/table'; -export { TableRowProps } from './components/tables/table-row'; -export { TabProps } from './components/tabs/tab'; -export { TabsProps } from './components/tabs/tabs'; -export { WellProps } from './components/misc/well'; +export { default as DabIpsum, DabIpsumProps } from './components/prototyping/dab-ipsum'; +export { default as Footer, FooterProps } from './components/navigation/footer'; +export { default as FormGroup, FormGroupProps } from './components/forms/form-group'; +export { default as Highlight, HighlightProps } from './components/misc/highlight'; +export { default as InputGroup, InputGroupProps } from './components/forms/input-group'; +export { default as InputGroupAddon, InputGroupAddonProps } from './components/forms/input-group-addon'; +export { default as InputWithPrefixSuffix, InputWithPrefixSuffixProps } from './components/precomposed/input-with-prefix-suffix'; +export { default as Modal, ModalProps } from './components/modals/modal'; +export { default as ModalBody, ModalBodyProps } from './components/modals/modal-body'; +export { default as ModalCloseIcon, ModalCloseIconProps } from './components/modals/modal-close-icon'; +export { default as ModalFooter, ModalFooterProps } from './components/modals/modal-footer'; +export { default as ModalHeader, ModalHeaderProps } from './components/modals/modal-header'; +export { default as ModalRenderer, ModalRendererProps } from './components/modals/modal-renderer'; +export { default as Nav, NavProps } from './components/navigation/nav'; +export { default as NavBar, NavBarProps } from './components/navigation/nav-bar'; +export { default as NavItem, NavItemProps } from './components/navigation/nav-item'; +export { default as Pagination, PaginationProps } from './components/pagination/pagination'; +export { default as PaginationDisplay, PaginationDisplayProps } from './components/pagination/pagination-display'; +export { default as Row, RowProps } from './components/grid/row'; +export { default as Section, SectionProps } from './components/content/section'; +export { default as SideBar, SideBarProps } from './components/navigation/side-bar'; +export { default as SpacedGroup, SpacedGroupProps } from './components/misc/spaced-group'; +export { default as SpeechBubble, SpeechBubbleProps } from './components/misc/speech-bubble'; +export { default as Tabs, TabsProps } from './components/tabs/tabs'; +export { default as Tab, TabProps } from './components/tabs/tab'; +export { default as Table, TableProps } from './components/tables/table'; +export { default as TableBody, TableBodyProps } from './components/tables/table-body'; +export { default as TableCell, TableCellProps } from './components/tables/table-cell'; +export { default as TableHead, TableHeadProps } from './components/tables/table-head'; +export { default as TableHeader, TableHeaderProps } from './components/tables/table-header'; +export { default as TableRow, TableRowProps } from './components/tables/table-row'; +export { default as Well, WellProps } from './components/misc/well'; \ No newline at end of file From a305595468847cf93d75a0306bffa5e1db7ce236 Mon Sep 17 00:00:00 2001 From: Danny-Robinson Date: Mon, 12 Oct 2020 16:45:30 +0100 Subject: [PATCH 3/7] Changed to doc comment Co-authored-by: Jake 'Sid' Smith --- src/ts/store.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ts/store.tsx b/src/ts/store.tsx index 192890824..8dcebb945 100644 --- a/src/ts/store.tsx +++ b/src/ts/store.tsx @@ -5,7 +5,9 @@ export type ComponentType

= | React.StatelessComponent

; -// @internal +/** + * @internal + */ export type StoreState = Partial<{ hasFixedNavBar: boolean; hasStickyFooter: boolean; From dbfa14900d84db0db30a1c8923d7195f0179f052 Mon Sep 17 00:00:00 2001 From: Danny-Robinson Date: Mon, 12 Oct 2020 16:50:39 +0100 Subject: [PATCH 4/7] Prettier --- src/ts/index.ts | 147 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 117 insertions(+), 30 deletions(-) diff --git a/src/ts/index.ts b/src/ts/index.ts index 6fb4f5b8a..c929e76dd 100644 --- a/src/ts/index.ts +++ b/src/ts/index.ts @@ -4,44 +4,131 @@ export { default as Anchor, AnchorProps } from './components/misc/anchor'; export { default as Badge, BadgeProps } from './components/misc/badge'; export { default as Banner, BannerProps } from './components/banners/banner'; export { default as Button, ButtonProps } from './components/forms/button'; -export { default as CodeBlock, CodeBlockProps } from './components/misc/code-block'; +export { + default as CodeBlock, + CodeBlockProps, +} from './components/misc/code-block'; export { default as Collapse, CollapseProps } from './components/misc/collapse'; export { default as Column, ColumnProps } from './components/grid/column'; -export { default as Container, ContainerProps } from './components/grid/container'; -export { default as ContentBox, ContentBoxProps } from './components/content/content-box'; -export { default as ContentBoxHeader, ContentBoxHeaderProps } from './components/content/content-box-header'; -export { default as ContentBoxFooter, ContentBoxFooterProps } from './components/content/content-box-footer'; -export { default as CookieBanner, CookieBannerProps } from './components/banners/cookie-banner'; +export { + default as Container, + ContainerProps, +} from './components/grid/container'; +export { + default as ContentBox, + ContentBoxProps, +} from './components/content/content-box'; +export { + default as ContentBoxHeader, + ContentBoxHeaderProps, +} from './components/content/content-box-header'; +export { + default as ContentBoxFooter, + ContentBoxFooterProps, +} from './components/content/content-box-footer'; +export { + default as CookieBanner, + CookieBannerProps, +} from './components/banners/cookie-banner'; export { CookieBannerRenderProps } from './components/banners/cookie-banner'; -export { default as DabIpsum, DabIpsumProps } from './components/prototyping/dab-ipsum'; +export { + default as DabIpsum, + DabIpsumProps, +} from './components/prototyping/dab-ipsum'; export { default as Footer, FooterProps } from './components/navigation/footer'; -export { default as FormGroup, FormGroupProps } from './components/forms/form-group'; -export { default as Highlight, HighlightProps } from './components/misc/highlight'; -export { default as InputGroup, InputGroupProps } from './components/forms/input-group'; -export { default as InputGroupAddon, InputGroupAddonProps } from './components/forms/input-group-addon'; -export { default as InputWithPrefixSuffix, InputWithPrefixSuffixProps } from './components/precomposed/input-with-prefix-suffix'; +export { + default as FormGroup, + FormGroupProps, +} from './components/forms/form-group'; +export { + default as Highlight, + HighlightProps, +} from './components/misc/highlight'; +export { + default as InputGroup, + InputGroupProps, +} from './components/forms/input-group'; +export { + default as InputGroupAddon, + InputGroupAddonProps, +} from './components/forms/input-group-addon'; +export { + default as InputWithPrefixSuffix, + InputWithPrefixSuffixProps, +} from './components/precomposed/input-with-prefix-suffix'; export { default as Modal, ModalProps } from './components/modals/modal'; -export { default as ModalBody, ModalBodyProps } from './components/modals/modal-body'; -export { default as ModalCloseIcon, ModalCloseIconProps } from './components/modals/modal-close-icon'; -export { default as ModalFooter, ModalFooterProps } from './components/modals/modal-footer'; -export { default as ModalHeader, ModalHeaderProps } from './components/modals/modal-header'; -export { default as ModalRenderer, ModalRendererProps } from './components/modals/modal-renderer'; +export { + default as ModalBody, + ModalBodyProps, +} from './components/modals/modal-body'; +export { + default as ModalCloseIcon, + ModalCloseIconProps, +} from './components/modals/modal-close-icon'; +export { + default as ModalFooter, + ModalFooterProps, +} from './components/modals/modal-footer'; +export { + default as ModalHeader, + ModalHeaderProps, +} from './components/modals/modal-header'; +export { + default as ModalRenderer, + ModalRendererProps, +} from './components/modals/modal-renderer'; export { default as Nav, NavProps } from './components/navigation/nav'; -export { default as NavBar, NavBarProps } from './components/navigation/nav-bar'; -export { default as NavItem, NavItemProps } from './components/navigation/nav-item'; -export { default as Pagination, PaginationProps } from './components/pagination/pagination'; -export { default as PaginationDisplay, PaginationDisplayProps } from './components/pagination/pagination-display'; +export { + default as NavBar, + NavBarProps, +} from './components/navigation/nav-bar'; +export { + default as NavItem, + NavItemProps, +} from './components/navigation/nav-item'; +export { + default as Pagination, + PaginationProps, +} from './components/pagination/pagination'; +export { + default as PaginationDisplay, + PaginationDisplayProps, +} from './components/pagination/pagination-display'; export { default as Row, RowProps } from './components/grid/row'; export { default as Section, SectionProps } from './components/content/section'; -export { default as SideBar, SideBarProps } from './components/navigation/side-bar'; -export { default as SpacedGroup, SpacedGroupProps } from './components/misc/spaced-group'; -export { default as SpeechBubble, SpeechBubbleProps } from './components/misc/speech-bubble'; +export { + default as SideBar, + SideBarProps, +} from './components/navigation/side-bar'; +export { + default as SpacedGroup, + SpacedGroupProps, +} from './components/misc/spaced-group'; +export { + default as SpeechBubble, + SpeechBubbleProps, +} from './components/misc/speech-bubble'; export { default as Tabs, TabsProps } from './components/tabs/tabs'; export { default as Tab, TabProps } from './components/tabs/tab'; export { default as Table, TableProps } from './components/tables/table'; -export { default as TableBody, TableBodyProps } from './components/tables/table-body'; -export { default as TableCell, TableCellProps } from './components/tables/table-cell'; -export { default as TableHead, TableHeadProps } from './components/tables/table-head'; -export { default as TableHeader, TableHeaderProps } from './components/tables/table-header'; -export { default as TableRow, TableRowProps } from './components/tables/table-row'; -export { default as Well, WellProps } from './components/misc/well'; \ No newline at end of file +export { + default as TableBody, + TableBodyProps, +} from './components/tables/table-body'; +export { + default as TableCell, + TableCellProps, +} from './components/tables/table-cell'; +export { + default as TableHead, + TableHeadProps, +} from './components/tables/table-head'; +export { + default as TableHeader, + TableHeaderProps, +} from './components/tables/table-header'; +export { + default as TableRow, + TableRowProps, +} from './components/tables/table-row'; +export { default as Well, WellProps } from './components/misc/well'; From bc745c69cdca25567f4c88e751a4b78dfa3cdfba Mon Sep 17 00:00:00 2001 From: Danny-Robinson Date: Mon, 12 Oct 2020 17:13:00 +0100 Subject: [PATCH 5/7] Even prettier --- src/ts/store.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ts/store.tsx b/src/ts/store.tsx index 8dcebb945..c62cafa24 100644 --- a/src/ts/store.tsx +++ b/src/ts/store.tsx @@ -4,9 +4,8 @@ export type ComponentType

= | React.ComponentClass

| React.StatelessComponent

; - /** - * @internal + * @internal */ export type StoreState = Partial<{ hasFixedNavBar: boolean; From 14254a2ec43db6e5c527b46eae26654d473b5e13 Mon Sep 17 00:00:00 2001 From: Danny-Robinson Date: Mon, 12 Oct 2020 17:28:52 +0100 Subject: [PATCH 6/7] Update tests --- tests/components.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tests/components.ts b/tests/components.ts index 54deabba6..bef26c216 100644 --- a/tests/components.ts +++ b/tests/components.ts @@ -58,27 +58,21 @@ describe('components', () => { }); }); - it('should all be exported from the index file', () => { + it('should all be exported from the index file with their props', () => { components.forEach(filePath => { const content = fs.readFileSync(filePath, UTF8); - const defaultExport = MATCHES_DEFAULT_EXPORT.exec(content); - if (!defaultExport) { throw new Error(`No default export in component at ${filePath}`); } - if (!fs.existsSync(INDEX_FILE_PATH)) { throw new Error(`Could not find index file at ${INDEX_FILE_PATH}`); } - const indexContent = fs.readFileSync(INDEX_FILE_PATH, UTF8); - const indexRegex = new RegExp( - `^export\\s+{\\s+default\\s+as\\s+${defaultExport[1]},?\\s+}\\s+from\\s+'[a-z/.-]+';$`, + `^export\\s+{\\s+default\\s+as\\s+${defaultExport[1]},?\\s+${defaultExport[1]}Props,?\\s+}\\s+from\\s+'[a-z/.-]+';$`, 'm' ); - if (!indexRegex.test(indexContent)) { throw new Error( `Component ${defaultExport[1]} is not exported from default at ${INDEX_FILE_PATH}` From 9ee1b1b9419eca1d6ae533e0047549d84172f727 Mon Sep 17 00:00:00 2001 From: Danny-Robinson Date: Mon, 12 Oct 2020 17:50:21 +0100 Subject: [PATCH 7/7] 0.12.1 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3e6639f76..9934067c9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@dabapps/roe", - "version": "0.12.0", + "version": "0.12.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 6145c53b9..02d3956df 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@dabapps/roe", - "version": "0.12.0", + "version": "0.12.1", "description": "A collection of React components, styles, mixins, and atomic CSS classes to aid with the development of web applications.", "main": "dist/js/index.js", "types": "dist/js/index.d.ts",