From 6e5a2035ac47666a25369f5d2007596dce77bb5a Mon Sep 17 00:00:00 2001 From: Deisling Eduard <41228762+edikdeisling@users.noreply.github.com> Date: Thu, 21 Nov 2024 17:20:08 +0200 Subject: [PATCH] feat: build improve (#167) * feat: build improve ref #166, #167 Co-authored-by: Eduard Deisling --- packages/configs/tsconfig.json | 4 +- .../.vitepress/components/ThemeSwitcher.vue | 92 ------------------- .../.vitepress/configuration/vite.ts | 3 - .../demos/button-group/ButtonGroupExample.vue | 3 - packages/ui/package.json | 1 - packages/ui/scripts/buildPlugin.ts | 13 +-- .../theme-switcher/themeSwitcher.vue | 8 +- .../ui/src/composables/useColorScheme.spec.ts | 13 +-- packages/ui/src/composables/useColorScheme.ts | 34 +++---- packages/ui/vite.config.ts | 5 - pnpm-lock.yaml | 21 +++-- 11 files changed, 35 insertions(+), 162 deletions(-) delete mode 100644 packages/documentation/.vitepress/components/ThemeSwitcher.vue diff --git a/packages/configs/tsconfig.json b/packages/configs/tsconfig.json index 526536dde..7d68b7975 100644 --- a/packages/configs/tsconfig.json +++ b/packages/configs/tsconfig.json @@ -27,9 +27,7 @@ /* Paths */ "baseUrl": ".", "paths": { - "@/*": ["./src/*"], - "@demos/*": ["../demos/*"], - "react": [""] + "@/*": ["./src/*"] } }, "include": ["src", "src/**/*.{ts,vue}"], diff --git a/packages/documentation/.vitepress/components/ThemeSwitcher.vue b/packages/documentation/.vitepress/components/ThemeSwitcher.vue deleted file mode 100644 index 703537787..000000000 --- a/packages/documentation/.vitepress/components/ThemeSwitcher.vue +++ /dev/null @@ -1,92 +0,0 @@ - - - - - diff --git a/packages/documentation/.vitepress/configuration/vite.ts b/packages/documentation/.vitepress/configuration/vite.ts index 818ea35cd..7543a2ebf 100644 --- a/packages/documentation/.vitepress/configuration/vite.ts +++ b/packages/documentation/.vitepress/configuration/vite.ts @@ -5,9 +5,6 @@ export const vite = { resolve: { alias: { '@': path.resolve(__dirname, '../../../ui/src'), - 'components': path.join(__dirname, '../../components'), - '@demos': path.join(__dirname, '../../../examples/demos'), - '@examples': path.join(__dirname, '../../../examples'), } }, css: { diff --git a/packages/examples/demos/button-group/ButtonGroupExample.vue b/packages/examples/demos/button-group/ButtonGroupExample.vue index 33376388b..72ee5bed0 100644 --- a/packages/examples/demos/button-group/ButtonGroupExample.vue +++ b/packages/examples/demos/button-group/ButtonGroupExample.vue @@ -1,10 +1,7 @@ diff --git a/packages/ui/package.json b/packages/ui/package.json index 5cfc1c0a6..1d00f0634 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -99,7 +99,6 @@ "@vitest/utils": "2.1.2", "@vue/test-utils": "2.4.6", "browserslist": "4.23.0", - "csstype": "3.1.3", "cypress": "13.12.0", "eslint": "9.12.0", "eslint-plugin-cypress": "3.5.0", diff --git a/packages/ui/scripts/buildPlugin.ts b/packages/ui/scripts/buildPlugin.ts index b7c81a76e..2a9211762 100644 --- a/packages/ui/scripts/buildPlugin.ts +++ b/packages/ui/scripts/buildPlugin.ts @@ -29,13 +29,10 @@ export function buildPlugin(): Plugin[] { sourceMap: false, paths: { '@/*': ['./src/*'], - '@demos/*': ['../../demos/*'], - 'csstype': ['node_modules/csstype'] } }, copyDtsFiles: true, - pathsToAliases: false, - aliasesExclude: [/^@ui-kit\/(services|hooks|config)/] + pathsToAliases: false }), ]; @@ -50,10 +47,7 @@ export function buildPlugin(): Plugin[] { sourcemap: true, lib: { entry: { - 'index': 'src/index.ts', - // TODO add more entries - 'button': 'src/components/button/public.ts', - 'components/buttonGroup': 'src/components/button-group/public.ts', + index: 'src/index.ts', }, formats: ['es'], name: 'Acronis Ui Component Library', @@ -74,8 +68,7 @@ export function buildPlugin(): Plugin[] { }, chunkFileNames: '[name].[hash].js', assetFileNames: 'assets/[name][extname]' - }, - external: ['vue'] + } }, chunkSizeWarningLimit: 10000 } diff --git a/packages/ui/src/components/theme-switcher/themeSwitcher.vue b/packages/ui/src/components/theme-switcher/themeSwitcher.vue index 16e419943..0b06e9272 100644 --- a/packages/ui/src/components/theme-switcher/themeSwitcher.vue +++ b/packages/ui/src/components/theme-switcher/themeSwitcher.vue @@ -1,7 +1,7 @@ @@ -18,9 +18,9 @@