From 7d1fc92711ce1ee6004359e39ecb46b8b6c49204 Mon Sep 17 00:00:00 2001 From: Nathan Nelson Date: Thu, 27 Apr 2023 08:50:46 +0100 Subject: [PATCH] chore: fix rollup css (#194) * build(bump versions): bumping versions bumping versions BREAKING CHANGE: styles now need to be imported separately * build(rollup): update to fix css exports * build(package.json): updates to all packages to trigger version bump --- package.json | 1 - packages/accordion/package.json | 1 - packages/badge/package.json | 1 - packages/button/package.json | 1 - packages/chip/package.json | 1 - packages/collapse/package.json | 1 - packages/dropdown/package.json | 1 - packages/fonts/package.json | 1 - packages/form-control/package.json | 1 - packages/icons/package.json | 1 - packages/input/package.json | 1 - packages/logo/package.json | 1 - packages/pagination/package.json | 1 - packages/pill/package.json | 1 - packages/review-rating/package.json | 1 - packages/switch/package.json | 1 - packages/textarea/package.json | 1 - packages/themes/package.json | 1 - packages/typography/package.json | 1 - rollup.config.js | 21 ++++++++++++++++++++- 20 files changed, 20 insertions(+), 20 deletions(-) diff --git a/package.json b/package.json index ba7f15217..586ad4579 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,6 @@ "uikit", "react", "components", - "modules", "heycar", "typescript", "ui-components", diff --git a/packages/accordion/package.json b/packages/accordion/package.json index c24d44102..9559605d3 100644 --- a/packages/accordion/package.json +++ b/packages/accordion/package.json @@ -12,7 +12,6 @@ "uikit", "react", "components", - "modules", "heycar", "typescript", "ui-components", diff --git a/packages/badge/package.json b/packages/badge/package.json index b48d6ad78..a6511b259 100644 --- a/packages/badge/package.json +++ b/packages/badge/package.json @@ -12,7 +12,6 @@ "uikit", "react", "components", - "modules", "heycar", "typescript", "ui-components", diff --git a/packages/button/package.json b/packages/button/package.json index dad8d1545..dbcb479b0 100644 --- a/packages/button/package.json +++ b/packages/button/package.json @@ -12,7 +12,6 @@ "uikit", "react", "components", - "modules", "heycar", "typescript", "ui-components", diff --git a/packages/chip/package.json b/packages/chip/package.json index 70ad8e35d..58d925b65 100644 --- a/packages/chip/package.json +++ b/packages/chip/package.json @@ -12,7 +12,6 @@ "uikit", "react", "components", - "modules", "heycar", "typescript", "ui-components", diff --git a/packages/collapse/package.json b/packages/collapse/package.json index 09a4fa239..85f79efea 100644 --- a/packages/collapse/package.json +++ b/packages/collapse/package.json @@ -12,7 +12,6 @@ "uikit", "react", "components", - "modules", "heycar", "typescript", "ui-components", diff --git a/packages/dropdown/package.json b/packages/dropdown/package.json index a0912d6a6..3edd554c5 100644 --- a/packages/dropdown/package.json +++ b/packages/dropdown/package.json @@ -12,7 +12,6 @@ "uikit", "react", "components", - "modules", "heycar", "typescript", "ui-components", diff --git a/packages/fonts/package.json b/packages/fonts/package.json index 73172718a..b69ee6d58 100644 --- a/packages/fonts/package.json +++ b/packages/fonts/package.json @@ -11,7 +11,6 @@ "uikit", "react", "components", - "modules", "heycar", "typescript", "ui-components", diff --git a/packages/form-control/package.json b/packages/form-control/package.json index c9a76bedf..10b007005 100644 --- a/packages/form-control/package.json +++ b/packages/form-control/package.json @@ -12,7 +12,6 @@ "uikit", "react", "components", - "modules", "heycar", "typescript", "ui-components", diff --git a/packages/icons/package.json b/packages/icons/package.json index a8b74f6ed..9f54f19e8 100644 --- a/packages/icons/package.json +++ b/packages/icons/package.json @@ -9,7 +9,6 @@ "uikit", "react", "components", - "modules", "heycar", "typescript", "ui-components", diff --git a/packages/input/package.json b/packages/input/package.json index 97893fba7..27a3733dc 100644 --- a/packages/input/package.json +++ b/packages/input/package.json @@ -12,7 +12,6 @@ "uikit", "react", "components", - "modules", "heycar", "typescript", "ui-components", diff --git a/packages/logo/package.json b/packages/logo/package.json index 7773ec572..9e42e54d5 100644 --- a/packages/logo/package.json +++ b/packages/logo/package.json @@ -12,7 +12,6 @@ "uikit", "react", "components", - "modules", "heycar", "typescript", "ui-components", diff --git a/packages/pagination/package.json b/packages/pagination/package.json index 068bef58b..224eda712 100644 --- a/packages/pagination/package.json +++ b/packages/pagination/package.json @@ -12,7 +12,6 @@ "uikit", "react", "components", - "modules", "heycar", "typescript", "ui-components", diff --git a/packages/pill/package.json b/packages/pill/package.json index fc0092056..ee1939987 100644 --- a/packages/pill/package.json +++ b/packages/pill/package.json @@ -12,7 +12,6 @@ "uikit", "react", "components", - "modules", "heycar", "typescript", "ui-components", diff --git a/packages/review-rating/package.json b/packages/review-rating/package.json index a321700a0..d0f1023cc 100644 --- a/packages/review-rating/package.json +++ b/packages/review-rating/package.json @@ -12,7 +12,6 @@ "uikit", "react", "components", - "modules", "heycar", "typescript", "ui-components", diff --git a/packages/switch/package.json b/packages/switch/package.json index dd7f1790a..127fffff5 100644 --- a/packages/switch/package.json +++ b/packages/switch/package.json @@ -12,7 +12,6 @@ "uikit", "react", "components", - "modules", "heycar", "typescript", "ui-components", diff --git a/packages/textarea/package.json b/packages/textarea/package.json index a2c9a35c6..f49e5ede1 100644 --- a/packages/textarea/package.json +++ b/packages/textarea/package.json @@ -12,7 +12,6 @@ "uikit", "react", "components", - "modules", "heycar", "typescript", "ui-components", diff --git a/packages/themes/package.json b/packages/themes/package.json index cf1f1f410..3b764e3c2 100644 --- a/packages/themes/package.json +++ b/packages/themes/package.json @@ -8,7 +8,6 @@ "uikit", "react", "components", - "modules", "heycar", "typescript", "ui-components", diff --git a/packages/typography/package.json b/packages/typography/package.json index 1827b59a1..1eeafa931 100644 --- a/packages/typography/package.json +++ b/packages/typography/package.json @@ -9,7 +9,6 @@ "uikit", "react", "components", - "modules", "heycar", "typescript", "ui-components", diff --git a/rollup.config.js b/rollup.config.js index a66d9d2e4..5d718459e 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -10,6 +10,7 @@ import { ScriptTarget } from 'typescript'; import addCssImports from './tools/rollup/addCssImports'; import bundleCss from './tools/rollup/bundleCss'; +import generateClassNameHash from './tools/rollup/generateClassNameHash'; import { coreComponentsResolver, coreComponentsRootPackageResolver, @@ -169,7 +170,25 @@ const esm = { }), }), json(), - postcss({ plugins: [], sourceMap: true, extract: true, minimize: true }), + postcss({ + plugins: [], + sourceMap: true, + extract: true, + minimize: true, + modules: { + generateScopedName: function (name, fileName) { + const relativeFileName = path.relative(currentPackageDir, fileName); + const hash = generateClassNameHash( + pkg.name, + rootPkg.version, + relativeFileName, + ); + + return `${currentComponentName}__${name}_${hash}`; + }, + }, + autoModules: false, + }), copyPlugin(esmDist), ], };