From 19532043a4ac39f98e81eb07c5da8f7102b8669f Mon Sep 17 00:00:00 2001 From: fritzschoff Date: Wed, 30 Mar 2022 13:58:09 +0200 Subject: [PATCH 1/7] feat(webpack): push for mati --- src/components/Icons/index.ts | 87 ++++++++++++++++++----------------- src/components/index.ts | 20 ++++---- webpack.config.js | 2 +- 3 files changed, 56 insertions(+), 53 deletions(-) diff --git a/src/components/Icons/index.ts b/src/components/Icons/index.ts index 81c7488..8d0be9a 100644 --- a/src/components/Icons/index.ts +++ b/src/components/Icons/index.ts @@ -1,42 +1,45 @@ -export { default as ArrowLinkOffIcon } from './ArrowLinkOffIcon'; -export { default as MinusIcon } from './MinusIcon'; -export { default as PlusIcon } from './PlusIcon'; -export { default as ArrowDownIcon } from './ArrowDownIcon'; -export { default as ArrowDropdownDownIcon } from './ArrowDropdownDownIcon'; -export { default as ArrowLeftIcon } from './ArrowLeftIcon'; -export { default as ArrowRightIcon } from './ArrowRightIcon'; -export { default as ArrowDropdownLeftIcon } from './ArrowDropdownLeftIcon'; -export { default as ArrowDropdownRightIcon } from './ArrowDropdownRightIcon'; -export { default as ArrowDropdownUpIcon } from './ArrowDropdownUpIcon'; -export { default as ArrowUpIcon } from './ArrowUpIcon'; -export { default as ArrowTriangleDownIcon } from './ArrowTriangleDownIcon'; -export { default as ArrowTriangleUpIcon } from './ArrowTriangleUpIcon'; -export { default as ArrowTriangleRightIcon } from './ArrowTriangleRightIcon'; -export { default as ArrowTriangleLeftIcon } from './ArrowTriangleLeftIcon'; -export { default as BinIcon } from './BinIcon'; -export { default as CautionIcon } from './CautionIcon'; -export { default as ClockIcon } from './ClockIcon'; -export { default as CloseIcon } from './CloseIcon'; -export { default as CopyIcon } from './CopyIcon'; -export { default as EditIcon } from './EditIcon'; -export { default as FilterIcon } from './FilterIcon'; -export { default as GridIcon } from './GridIcon'; -export { default as ListIcon } from './ListIcon'; -export { default as MenuIcon } from './MenuIcon'; -export { default as PinIcon } from './PinIcon'; -export { default as PlusBorderIcon } from './PlusBorderIcon'; -export { default as PrintIcon } from './PrintIcon'; -export { default as SearchIcon } from './SearchIcon'; -export { default as SettingsIcon } from './SettingsIcon'; -export { default as SkipLeftIcon } from './SkipLeftIcon'; -export { default as SkipRightIcon } from './SkipRightIcon'; -export { default as SortListIcon } from './SortListIcon'; -export { default as ThreeDotsKebabIcon } from './ThreeDotsKebabIcon'; -export { default as ThreeDotsMenuIcon } from './ThreeDotsMenuIcon'; -export { default as TickIcon } from './TickIcon'; -export { default as TrashIcon } from './TrashIcon'; -export { default as WalletIcon } from './WalletIcon'; -export { default as SNXIcon } from './SNXIcon'; -export { default as GitHubIcon } from './GitHubIcon'; -export { default as TwitterIcon } from './TwitterIcon'; -export { default as DiscordIcon } from './DiscordIcon'; +import ArrowRightIcon from './ArrowRightIcon'; + +export * from './ArrowLinkOffIcon'; +export * from './MinusIcon'; +export * from './PlusIcon'; +export * from './ArrowDownIcon'; +export * from './ArrowDropdownDownIcon'; +export * from './ArrowLeftIcon'; +// TODO how to rexport a default import or do a barrel export ??? +export { ArrowRightIcon }; +export * from './ArrowDropdownLeftIcon'; +export * from './ArrowDropdownRightIcon'; +export * from './ArrowDropdownUpIcon'; +export * from './ArrowUpIcon'; +export * from './ArrowTriangleDownIcon'; +export * from './ArrowTriangleUpIcon'; +export * from './ArrowTriangleRightIcon'; +export * from './ArrowTriangleLeftIcon'; +export * from './BinIcon'; +export * from './CautionIcon'; +export * from './ClockIcon'; +export * from './CloseIcon'; +export * from './CopyIcon'; +export * from './EditIcon'; +export * from './FilterIcon'; +export * from './GridIcon'; +export * from './ListIcon'; +export * from './MenuIcon'; +export * from './PinIcon'; +export * from './PlusBorderIcon'; +export * from './PrintIcon'; +export * from './SearchIcon'; +export * from './SettingsIcon'; +export * from './SkipLeftIcon'; +export * from './SkipRightIcon'; +export * from './SortListIcon'; +export * from './ThreeDotsKebabIcon'; +export * from './ThreeDotsMenuIcon'; +export * from './TickIcon'; +export * from './TrashIcon'; +export * from './WalletIcon'; +export * from './SNXIcon'; +export * from './GitHubIcon'; +export * from './TwitterIcon'; +export * from './DiscordIcon'; diff --git a/src/components/index.ts b/src/components/index.ts index 4afd422..a743fa4 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -1,11 +1,11 @@ -export { default as Button } from './Button'; -export { default as ExternalLink } from './ExternalLink'; -export { default as IconButton } from './IconButton'; +export * from './Button'; +export * from './ExternalLink'; +export * from './IconButton'; export * from './Icons'; -export { default as Tabs } from './Tabs'; -export { default as LinkButton } from './LinkButton'; -export { default as Selector } from './Selector'; -export { default as Dropdown } from './Dropdown'; -export { default as Card } from './Card'; -export { default as Carousel } from './Carousel'; -export { default as Banner } from './Banner'; +export * from './Tabs'; +export * from './LinkButton'; +export * from './Selector'; +export * from './Dropdown'; +export * from './Card'; +export * from './Carousel'; +export * from './Banner'; diff --git a/webpack.config.js b/webpack.config.js index a591ab2..46a50c8 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -39,6 +39,6 @@ module.exports = { }, output: { path: path.resolve(__dirname, 'dist'), - filename: '[name].js', + filename: 'index.js', }, }; From 02bab5ae772535e2f55b2f8c9df47fdb3967fe52 Mon Sep 17 00:00:00 2001 From: fritzschoff Date: Wed, 30 Mar 2022 14:03:49 +0200 Subject: [PATCH 2/7] removed unused fonts --- src/styles/fonts.ts | 64 ++++++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 36 deletions(-) diff --git a/src/styles/fonts.ts b/src/styles/fonts.ts index 71722f6..a4be8bd 100644 --- a/src/styles/fonts.ts +++ b/src/styles/fonts.ts @@ -1,40 +1,32 @@ import { css } from 'styled-components'; export default { - body: css` - font-family: Inter; - font-size: 1.16rem; - `, - h1: css` - font-family: Inter; - font-size: 3.33rem; - `, - h2: css` - font-family: Inter; - font-size: 2.66rem; - `, - h3: css` - font-family: Inter; - font-size: 2rem; - `, - h4: css` - font-family: Inter; - font-size: 1.5rem; - `, - h5: css` - font-family: Inter; - font-size: 1.16rem; - `, - h6: css` - font-family: Inter; - font-size: 1rem; - `, - regular: `Inter`, - interBold: `Inter Bold`, - interSemiBold: `Inter Semi Bold`, - mono: `GT America Mono`, - condensedBold: `GT America Condensed-Bold`, - condensedMedium: `GT America Condensed-Medium`, - extended: `GT America Extended Bold`, - expanded: `GT America Expanded Black`, + body: css` + font-family: Inter; + font-size: 1.16rem; + `, + h1: css` + font-family: Inter; + font-size: 3.33rem; + `, + h2: css` + font-family: Inter; + font-size: 2.66rem; + `, + h3: css` + font-family: Inter; + font-size: 2rem; + `, + h4: css` + font-family: Inter; + font-size: 1.5rem; + `, + h5: css` + font-family: Inter; + font-size: 1.16rem; + `, + h6: css` + font-family: Inter; + font-size: 1rem; + `, }; From e1feb78c35c2b35fd255302b3d5db9d0fbdca6ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mati=CC=81as?= Date: Wed, 30 Mar 2022 15:37:33 -0300 Subject: [PATCH 3/7] fix default exports --- src/components/Button.tsx | 2 +- src/components/Icons/index.ts | 87 +++++++++++++++++------------------ src/components/index.ts | 21 +++++---- 3 files changed, 54 insertions(+), 56 deletions(-) diff --git a/src/components/Button.tsx b/src/components/Button.tsx index f7b3bf2..b5304f0 100644 --- a/src/components/Button.tsx +++ b/src/components/Button.tsx @@ -132,7 +132,7 @@ const StyledButtonText = styled.span<{ size?: ButtonProps['size']; }>` font-size: ${({ size }) => determineFontSize(size)}; - font-family: ${fonts.interBold}; + font-family: ${fonts.body}; line-height: 17px; font-weight: bold; ${({ variant }) => variant === 'tertiary' && 'color: whitey'}; diff --git a/src/components/Icons/index.ts b/src/components/Icons/index.ts index 8d0be9a..605c295 100644 --- a/src/components/Icons/index.ts +++ b/src/components/Icons/index.ts @@ -1,45 +1,42 @@ -import ArrowRightIcon from './ArrowRightIcon'; - -export * from './ArrowLinkOffIcon'; -export * from './MinusIcon'; -export * from './PlusIcon'; -export * from './ArrowDownIcon'; -export * from './ArrowDropdownDownIcon'; -export * from './ArrowLeftIcon'; -// TODO how to rexport a default import or do a barrel export ??? -export { ArrowRightIcon }; -export * from './ArrowDropdownLeftIcon'; -export * from './ArrowDropdownRightIcon'; -export * from './ArrowDropdownUpIcon'; -export * from './ArrowUpIcon'; -export * from './ArrowTriangleDownIcon'; -export * from './ArrowTriangleUpIcon'; -export * from './ArrowTriangleRightIcon'; -export * from './ArrowTriangleLeftIcon'; -export * from './BinIcon'; -export * from './CautionIcon'; -export * from './ClockIcon'; -export * from './CloseIcon'; -export * from './CopyIcon'; -export * from './EditIcon'; -export * from './FilterIcon'; -export * from './GridIcon'; -export * from './ListIcon'; -export * from './MenuIcon'; -export * from './PinIcon'; -export * from './PlusBorderIcon'; -export * from './PrintIcon'; -export * from './SearchIcon'; -export * from './SettingsIcon'; -export * from './SkipLeftIcon'; -export * from './SkipRightIcon'; -export * from './SortListIcon'; -export * from './ThreeDotsKebabIcon'; -export * from './ThreeDotsMenuIcon'; -export * from './TickIcon'; -export * from './TrashIcon'; -export * from './WalletIcon'; -export * from './SNXIcon'; -export * from './GitHubIcon'; -export * from './TwitterIcon'; -export * from './DiscordIcon'; +export { default as ArrowLinkOffIcon } from './ArrowLinkOffIcon'; +export { default as MinusIcon } from './MinusIcon'; +export { default as PlusIcon } from './PlusIcon'; +export { default as ArrowDownIcon } from './ArrowDownIcon'; +export { default as ArrowDropdownDownIcon } from './ArrowDropdownDownIcon'; +export { default as ArrowLeftIcon } from './ArrowLeftIcon'; +export { default as ArrowDropdownLeftIcon } from './ArrowDropdownLeftIcon'; +export { default as ArrowDropdownRightIcon } from './ArrowDropdownRightIcon'; +export { default as ArrowDropdownUpIcon } from './ArrowDropdownUpIcon'; +export { default as ArrowUpIcon } from './ArrowUpIcon'; +export { default as ArrowTriangleDownIcon } from './ArrowTriangleDownIcon'; +export { default as ArrowTriangleUpIcon } from './ArrowTriangleUpIcon'; +export { default as ArrowTriangleRightIcon } from './ArrowTriangleRightIcon'; +export { default as ArrowTriangleLeftIcon } from './ArrowTriangleLeftIcon'; +export { default as ArrowRightIcon } from './ArrowRightIcon'; +export { default as BinIcon } from './BinIcon'; +export { default as CautionIcon } from './CautionIcon'; +export { default as ClockIcon } from './ClockIcon'; +export { default as CloseIcon } from './CloseIcon'; +export { default as CopyIcon } from './CopyIcon'; +export { default as EditIcon } from './EditIcon'; +export { default as FilterIcon } from './FilterIcon'; +export { default as GridIcon } from './GridIcon'; +export { default as ListIcon } from './ListIcon'; +export { default as MenuIcon } from './MenuIcon'; +export { default as PinIcon } from './PinIcon'; +export { default as PlusBorderIcon } from './PlusBorderIcon'; +export { default as PrintIcon } from './PrintIcon'; +export { default as SearchIcon } from './SearchIcon'; +export { default as SettingsIcon } from './SettingsIcon'; +export { default as SkipLeftIcon } from './SkipLeftIcon'; +export { default as SkipRightIcon } from './SkipRightIcon'; +export { default as SortListIcon } from './SortListIcon'; +export { default as ThreeDotsKebabIcon } from './ThreeDotsKebabIcon'; +export { default as ThreeDotsMenuIcon } from './ThreeDotsMenuIcon'; +export { default as TickIcon } from './TickIcon'; +export { default as TrashIcon } from './TrashIcon'; +export { default as WalletIcon } from './WalletIcon'; +export { default as SNXIcon } from './SNXIcon'; +export { default as GitHubIcon } from './GitHubIcon'; +export { default as TwitterIcon } from './TwitterIcon'; +export { default as DiscordIcon } from './DiscordIcon'; diff --git a/src/components/index.ts b/src/components/index.ts index a743fa4..aac8801 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -1,11 +1,12 @@ -export * from './Button'; -export * from './ExternalLink'; -export * from './IconButton'; +export { default as Button } from './Button'; +export { default as ExternalLink } from './ExternalLink'; +export { default as IconButton } from './IconButton'; +export { default as Tabs } from './Tabs'; +export { default as LinkButton } from './LinkButton'; +export { default as Selector } from './Selector'; +export { default as Dropdown } from './Dropdown'; +export { default as Card } from './Card'; +export { default as Carousel } from './Carousel'; +export { default as Banner } from './Banner'; + export * from './Icons'; -export * from './Tabs'; -export * from './LinkButton'; -export * from './Selector'; -export * from './Dropdown'; -export * from './Card'; -export * from './Carousel'; -export * from './Banner'; From 46d06460ec6e6a921730a5cb5631e0696a77dc66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mati=CC=81as?= Date: Wed, 30 Mar 2022 15:48:52 -0300 Subject: [PATCH 4/7] fix imports order --- src/components/Icons/index.ts | 2 +- src/components/index.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/Icons/index.ts b/src/components/Icons/index.ts index 605c295..81c7488 100644 --- a/src/components/Icons/index.ts +++ b/src/components/Icons/index.ts @@ -4,6 +4,7 @@ export { default as PlusIcon } from './PlusIcon'; export { default as ArrowDownIcon } from './ArrowDownIcon'; export { default as ArrowDropdownDownIcon } from './ArrowDropdownDownIcon'; export { default as ArrowLeftIcon } from './ArrowLeftIcon'; +export { default as ArrowRightIcon } from './ArrowRightIcon'; export { default as ArrowDropdownLeftIcon } from './ArrowDropdownLeftIcon'; export { default as ArrowDropdownRightIcon } from './ArrowDropdownRightIcon'; export { default as ArrowDropdownUpIcon } from './ArrowDropdownUpIcon'; @@ -12,7 +13,6 @@ export { default as ArrowTriangleDownIcon } from './ArrowTriangleDownIcon'; export { default as ArrowTriangleUpIcon } from './ArrowTriangleUpIcon'; export { default as ArrowTriangleRightIcon } from './ArrowTriangleRightIcon'; export { default as ArrowTriangleLeftIcon } from './ArrowTriangleLeftIcon'; -export { default as ArrowRightIcon } from './ArrowRightIcon'; export { default as BinIcon } from './BinIcon'; export { default as CautionIcon } from './CautionIcon'; export { default as ClockIcon } from './ClockIcon'; diff --git a/src/components/index.ts b/src/components/index.ts index aac8801..4afd422 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -1,6 +1,7 @@ export { default as Button } from './Button'; export { default as ExternalLink } from './ExternalLink'; export { default as IconButton } from './IconButton'; +export * from './Icons'; export { default as Tabs } from './Tabs'; export { default as LinkButton } from './LinkButton'; export { default as Selector } from './Selector'; @@ -8,5 +9,3 @@ export { default as Dropdown } from './Dropdown'; export { default as Card } from './Card'; export { default as Carousel } from './Carousel'; export { default as Banner } from './Banner'; - -export * from './Icons'; From 77ca0c8d641edb8b23bbe40304c0689d80305c8f Mon Sep 17 00:00:00 2001 From: fritzschoff Date: Thu, 31 Mar 2022 13:44:07 +0200 Subject: [PATCH 5/7] fix(build): fixed build with fonts --- src/components/Button.tsx | 2 +- src/styles/fonts.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/Button.tsx b/src/components/Button.tsx index b5304f0..f7b3bf2 100644 --- a/src/components/Button.tsx +++ b/src/components/Button.tsx @@ -132,7 +132,7 @@ const StyledButtonText = styled.span<{ size?: ButtonProps['size']; }>` font-size: ${({ size }) => determineFontSize(size)}; - font-family: ${fonts.body}; + font-family: ${fonts.interBold}; line-height: 17px; font-weight: bold; ${({ variant }) => variant === 'tertiary' && 'color: whitey'}; diff --git a/src/styles/fonts.ts b/src/styles/fonts.ts index a4be8bd..53f1e35 100644 --- a/src/styles/fonts.ts +++ b/src/styles/fonts.ts @@ -29,4 +29,6 @@ export default { font-family: Inter; font-size: 1rem; `, + regular: `Inter`, + interBold: `Inter Bold`, }; From ae2d88c857223581641c68818bbd8f371bfaae41 Mon Sep 17 00:00:00 2001 From: fritzschoff Date: Thu, 31 Mar 2022 13:49:36 +0200 Subject: [PATCH 6/7] feat(webpack): added auto export lib --- package.json | 1 + src/components/index.js | 11 +++++++++++ webpack.config.js | 9 +++++++++ yarn.lock | 5 +++++ 4 files changed, 26 insertions(+) create mode 100644 src/components/index.js diff --git a/package.json b/package.json index 36600ab..9990347 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "ts-loader": "^9.2.8", "typescript": "4.5.5", "webpack": "^5.70.0", + "webpack-auto-export": "^0.1.0", "webpack-cli": "^4.9.2", "yalc": "1.0.0-pre.53" }, diff --git a/src/components/index.js b/src/components/index.js new file mode 100644 index 0000000..8ca460f --- /dev/null +++ b/src/components/index.js @@ -0,0 +1,11 @@ +export * from './Banner'; +export * from './Button'; +export * from './Card'; +export * from './Carousel'; +export * from './Dropdown'; +export * from './ExternalLink'; +export * from './IconButton'; +export * from './Icons'; +export * from './LinkButton'; +export * from './Selector'; +export * from './Tabs'; diff --git a/webpack.config.js b/webpack.config.js index 46a50c8..495d984 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,8 +1,17 @@ const path = require('path'); +const AutoExport = require('webpack-auto-export'); module.exports = { entry: './src/index.ts', mode: 'production', + plugins: [ + new AutoExport({ + extension: '.js', // define extension of generated index file + exportType: 'named', // the default way to export. values can be: 'named' | 'default' | 'detect' + baseDir: './src', // base directory to observe the changes + paths: ['components'], + }), + ], module: { rules: [ { diff --git a/yarn.lock b/yarn.lock index 7f942fa..bd2722d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12493,6 +12493,11 @@ webidl-conversions@^3.0.0: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= +webpack-auto-export@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/webpack-auto-export/-/webpack-auto-export-0.1.0.tgz#21db6752619d102333f30a725c0f084d4e068400" + integrity sha512-vt4WK2lIIxU3sr+zK81pdcW3qSBdkFXKfsO0Yy/T8zHntO3RXbdUX+vcc3TQfQ1V1JfRCGUyLPEQ4w3j0HnHMQ== + webpack-cli@^4.9.2: version "4.9.2" resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.9.2.tgz#77c1adaea020c3f9e2db8aad8ea78d235c83659d" From 12d8253cd997d049715c4b2df05caae016b13ccc Mon Sep 17 00:00:00 2001 From: fritzschoff Date: Thu, 14 Apr 2022 16:11:41 +0100 Subject: [PATCH 7/7] merged master --- src/components/index.js | 3 ++- webpack.config.js | 4 ---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/components/index.js b/src/components/index.js index 8ca460f..c1cc525 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -1,4 +1,4 @@ -export * from './Banner'; +export * from './Accordion'; export * from './Button'; export * from './Card'; export * from './Carousel'; @@ -9,3 +9,4 @@ export * from './Icons'; export * from './LinkButton'; export * from './Selector'; export * from './Tabs'; +export * from './TextInput'; diff --git a/webpack.config.js b/webpack.config.js index 495d984..2788ae8 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -46,8 +46,4 @@ module.exports = { resolve: { extensions: ['.tsx', '.ts', '.js', '.css', '.woff', '.woff2'], }, - output: { - path: path.resolve(__dirname, 'dist'), - filename: 'index.js', - }, };