From e8e1b5e2448a19c767d9192040a170c354008de7 Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 23 Sep 2024 14:38:01 +0200 Subject: [PATCH] fix: feedback ac for direct import if three shaking is not working --- packages/themes/README.md | 3 ++- packages/themes/package.json | 5 +++++ packages/themes/src/themes/console/dark/index.ts | 6 ++---- packages/themes/src/themes/console/darker/index.ts | 6 ++---- packages/themes/src/themes/console/light/index.ts | 6 ++---- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/themes/README.md b/packages/themes/README.md index 6e5b36cde7..e44080c262 100644 --- a/packages/themes/README.md +++ b/packages/themes/README.md @@ -18,7 +18,8 @@ $ pnpm add @ultraviolet/ui @ultraviolet/themes @emotion/react @emotion/styled ```js import { normalize, Button } from '@ultraviolet/ui' -import { consoleDarkTheme } from '@ultraviolet/themes' // << Here we import the theme we want to use +import { consoleDarkTheme } from '@ultraviolet/themes' // Here we import the theme we want to use +// import { consoleLightTheme } from "@ultraviolet/themes/console/light" // Alternatively you can directly import the light theme if your bundler doesn't have tree-shaking capabilities import { Global, css, ThemeProvider } from '@emotion/react' const App = () => ( diff --git a/packages/themes/package.json b/packages/themes/package.json index 768168ec47..af9b565059 100644 --- a/packages/themes/package.json +++ b/packages/themes/package.json @@ -46,6 +46,11 @@ "types": "./dist/index.d.ts", "require": "./dist/index.cjs", "default": "./dist/index.js" + }, + "./console/*": { + "types": "./dist/themes/console/index.d.ts", + "require": "./dist/themes/console/index.cjs", + "default": "./dist/themes/console/index.js" } }, "dependencies": { diff --git a/packages/themes/src/themes/console/dark/index.ts b/packages/themes/src/themes/console/dark/index.ts index 772e2f9048..28f4bb746f 100644 --- a/packages/themes/src/themes/console/dark/index.ts +++ b/packages/themes/src/themes/console/dark/index.ts @@ -2,7 +2,5 @@ import deepmerge from 'deepmerge' import { deprecatedDarkTokens } from '../deprecated/dark' import { darkTheme } from './__generated__' -export const consoleDarkTheme = deepmerge( - darkTheme, - deprecatedDarkTokens, -) as typeof darkTheme & typeof deprecatedDarkTokens +export const consoleDarkTheme: typeof darkTheme & typeof deprecatedDarkTokens = + deepmerge(darkTheme, deprecatedDarkTokens) diff --git a/packages/themes/src/themes/console/darker/index.ts b/packages/themes/src/themes/console/darker/index.ts index 7b912a7f4d..eea0d2a338 100644 --- a/packages/themes/src/themes/console/darker/index.ts +++ b/packages/themes/src/themes/console/darker/index.ts @@ -2,7 +2,5 @@ import deepmerge from 'deepmerge' import { deprecatedDarkerTokens } from '../deprecated/darker' import { darkerTheme } from './__generated__' -export const consoleDarkerTheme = deepmerge( - darkerTheme, - deprecatedDarkerTokens, -) as typeof darkerTheme & typeof deprecatedDarkerTokens +export const consoleDarkerTheme: typeof darkerTheme & + typeof deprecatedDarkerTokens = deepmerge(darkerTheme, deprecatedDarkerTokens) diff --git a/packages/themes/src/themes/console/light/index.ts b/packages/themes/src/themes/console/light/index.ts index b472a2f36d..0e037f4e35 100644 --- a/packages/themes/src/themes/console/light/index.ts +++ b/packages/themes/src/themes/console/light/index.ts @@ -2,7 +2,5 @@ import deepmerge from 'deepmerge' import { deprecatedLightTokens } from '../deprecated/light' import { lightTheme } from './__generated__' -export const consoleLightTheme = deepmerge( - lightTheme, - deprecatedLightTokens, -) as typeof lightTheme & typeof deprecatedLightTokens +export const consoleLightTheme: typeof lightTheme & + typeof deprecatedLightTokens = deepmerge(lightTheme, deprecatedLightTokens)