From 2fdfe2f13e714f19118d612ace9f4b583fd08628 Mon Sep 17 00:00:00 2001 From: Mert Sincan Date: Sat, 15 Jun 2024 07:14:31 +0100 Subject: [PATCH] Fixed #5898 - Themes are installed by the wrong package --- package.json | 1 + packages/auto-import-resolver/package.json | 5 +- packages/core/package.json | 7 +- packages/core/rollup.config.mjs | 5 +- packages/core/src/base/style/BaseStyle.js | 2 +- .../core/src/basecomponent/BaseComponent.vue | 2 +- .../core/src/basedirective/BaseDirective.js | 2 +- packages/core/src/config/PrimeVue.js | 2 +- packages/core/src/utils/DomHandler.js | 2 +- packages/core/tsconfig.json | 3 +- packages/icons/package.json | 5 +- packages/metadata/package.json | 5 +- packages/nuxt-module/package.json | 3 +- packages/nuxt-module/src/module.ts | 5 +- packages/primevue/package.json | 5 +- packages/primevue/rollup.config.mjs | 5 +- packages/primevue/scripts/prebuild.mjs | 2 +- .../src/confirmpopup/ConfirmPopup.vue | 2 +- packages/primevue/src/knob/BaseKnob.vue | 2 +- packages/primevue/src/popover/Popover.vue | 2 +- packages/primevue/src/primevue.js | 2 +- packages/primevue/src/speeddial/SpeedDial.vue | 2 +- packages/themes/package.json | 22 +- .../themes/src/core/actions/definePreset.js | 3 - packages/themes/src/core/actions/index.js | 6 - .../themes/src/core/actions/updatePreset.js | 10 - .../src/core/actions/updatePrimaryPalette.js | 3 - .../src/core/actions/updateSurfacePalette.js | 3 - packages/themes/src/core/actions/usePreset.js | 10 - packages/themes/src/core/actions/useTheme.js | 3 - packages/themes/src/core/config/index.js | 145 --------- .../themes/src/core/helpers/color/index.js | 4 - packages/themes/src/core/helpers/color/mix.js | 39 --- .../themes/src/core/helpers/color/palette.js | 14 - .../themes/src/core/helpers/color/shade.js | 3 - .../themes/src/core/helpers/color/tint.js | 3 - packages/themes/src/core/helpers/css.js | 4 - packages/themes/src/core/helpers/dt.js | 34 --- packages/themes/src/core/helpers/index.js | 5 - packages/themes/src/core/helpers/t.js | 66 ---- .../themes/src/core/helpers/toVariables.js | 38 --- packages/themes/src/core/service/index.js | 40 --- packages/themes/src/core/utils/index.js | 2 - packages/themes/src/core/utils/sharedUtils.js | 225 -------------- packages/themes/src/core/utils/themeUtils.js | 283 ------------------ packages/themes/src/index.d.ts | 8 +- packages/themes/src/index.js | 6 +- 47 files changed, 57 insertions(+), 993 deletions(-) delete mode 100644 packages/themes/src/core/actions/definePreset.js delete mode 100644 packages/themes/src/core/actions/index.js delete mode 100644 packages/themes/src/core/actions/updatePreset.js delete mode 100644 packages/themes/src/core/actions/updatePrimaryPalette.js delete mode 100644 packages/themes/src/core/actions/updateSurfacePalette.js delete mode 100644 packages/themes/src/core/actions/usePreset.js delete mode 100644 packages/themes/src/core/actions/useTheme.js delete mode 100644 packages/themes/src/core/config/index.js delete mode 100644 packages/themes/src/core/helpers/color/index.js delete mode 100644 packages/themes/src/core/helpers/color/mix.js delete mode 100644 packages/themes/src/core/helpers/color/palette.js delete mode 100644 packages/themes/src/core/helpers/color/shade.js delete mode 100644 packages/themes/src/core/helpers/color/tint.js delete mode 100644 packages/themes/src/core/helpers/css.js delete mode 100644 packages/themes/src/core/helpers/dt.js delete mode 100644 packages/themes/src/core/helpers/index.js delete mode 100644 packages/themes/src/core/helpers/t.js delete mode 100644 packages/themes/src/core/helpers/toVariables.js delete mode 100644 packages/themes/src/core/service/index.js delete mode 100644 packages/themes/src/core/utils/index.js delete mode 100644 packages/themes/src/core/utils/sharedUtils.js delete mode 100644 packages/themes/src/core/utils/themeUtils.js diff --git a/package.json b/package.json index 09091ef05..382a9633a 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ }, "scripts": { "setup": "rm -rf **/node_modules **/**/node_modules **/dist ./pnpm-lock.yaml && pnpm install", + "link": "pnpm --filter './packages/*' dev:link", "release": "pnpm run build && pnpm recursive publish --filter './packages/*' --no-git-checks", "release:beta": "pnpm run build && pnpm recursive publish --filter './packages/*' --no-git-checks --tag beta", "release:rc": "pnpm run build && pnpm recursive publish --filter './packages/*' --no-git-checks --tag rc", diff --git a/packages/auto-import-resolver/package.json b/packages/auto-import-resolver/package.json index 8a108d4e0..1a8b0ab2f 100644 --- a/packages/auto-import-resolver/package.json +++ b/packages/auto-import-resolver/package.json @@ -33,7 +33,8 @@ "build": "NODE_ENV=production INPUT_DIR=./ OUTPUT_DIR=dist/ pnpm run build:package", "build:package": "pnpm run build:prebuild && tsup && pnpm run build:postbuild", "build:prebuild": "node ./scripts/prebuild.mjs", - "build:postbuild": "node ./scripts/postbuild.mjs" + "build:postbuild": "node ./scripts/postbuild.mjs", + "dev:link": "pnpm link --global && npm link" }, "dependencies": { "@primevue/metadata": "workspace:*" @@ -45,4 +46,4 @@ "engines": { "node": ">=12.11.0" } -} \ No newline at end of file +} diff --git a/packages/core/package.json b/packages/core/package.json index 544021301..9c2813720 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -44,10 +44,11 @@ "build": "NODE_ENV=production INPUT_DIR=src/ OUTPUT_DIR=dist/ pnpm run build:package", "build:package": "pnpm run build:prebuild && rollup -c && pnpm run build:postbuild", "build:prebuild": "node ./scripts/prebuild.mjs", - "build:postbuild": "node ./scripts/postbuild.mjs" + "build:postbuild": "node ./scripts/postbuild.mjs", + "dev:link": "pnpm link --global && npm link" }, "dependencies": { - "@primevue/themes": "workspace:*" + "@primeuix/styled": "^0.0.1" }, "peerDependencies": { "vue": "^3.0.0" @@ -55,4 +56,4 @@ "engines": { "node": ">=12.11.0" } -} \ No newline at end of file +} diff --git a/packages/core/rollup.config.mjs b/packages/core/rollup.config.mjs index 14d3af25c..3bc246257 100644 --- a/packages/core/rollup.config.mjs +++ b/packages/core/rollup.config.mjs @@ -19,7 +19,7 @@ const GLOBALS = { // externals const GLOBAL_EXTERNALS = ['vue']; -const INLINE_EXTERNALS = [/@primevue\/themes\/.*/]; +const INLINE_EXTERNALS = ['@primeuix/styled']; const EXTERNALS = [...GLOBAL_EXTERNALS, ...INLINE_EXTERNALS]; // alias @@ -42,8 +42,7 @@ const ALIAS_ENTRIES = [ return targetFile ? path.join(folderPath, targetFile) : null; } - }, - { find: '@primevue/themes', replacement: path.resolve(__dirname, '../themes/src/index.js') } + } ]; // plugins diff --git a/packages/core/src/base/style/BaseStyle.js b/packages/core/src/base/style/BaseStyle.js index 711484320..923dc8c50 100644 --- a/packages/core/src/base/style/BaseStyle.js +++ b/packages/core/src/base/style/BaseStyle.js @@ -1,6 +1,6 @@ +import { Theme, dt } from '@primeuix/styled'; import { useStyle } from '@primevue/core/usestyle'; import { ObjectUtils } from '@primevue/core/utils'; -import { Theme, dt } from '@primevue/themes'; const theme = ({ dt }) => ` * { diff --git a/packages/core/src/basecomponent/BaseComponent.vue b/packages/core/src/basecomponent/BaseComponent.vue index 226853c9b..851049329 100644 --- a/packages/core/src/basecomponent/BaseComponent.vue +++ b/packages/core/src/basecomponent/BaseComponent.vue @@ -2,7 +2,7 @@ import Base from '@primevue/core/base'; import BaseStyle from '@primevue/core/base/style'; import { DomHandler, ObjectUtils, UniqueComponentId } from '@primevue/core/utils'; -import { Theme, ThemeService } from '@primevue/themes'; +import { Theme, ThemeService } from '@primeuix/styled'; import { mergeProps } from 'vue'; import BaseComponentStyle from './style/BaseComponentStyle'; diff --git a/packages/core/src/basedirective/BaseDirective.js b/packages/core/src/basedirective/BaseDirective.js index c65e01a34..a53b22640 100644 --- a/packages/core/src/basedirective/BaseDirective.js +++ b/packages/core/src/basedirective/BaseDirective.js @@ -1,8 +1,8 @@ +import { Theme, ThemeService } from '@primeuix/styled'; import Base from '@primevue/core/base'; import BaseStyle from '@primevue/core/base/style'; import PrimeVueService from '@primevue/core/service'; import { ObjectUtils, UniqueComponentId } from '@primevue/core/utils'; -import { Theme, ThemeService } from '@primevue/themes'; import { mergeProps } from 'vue'; const BaseDirective = { diff --git a/packages/core/src/config/PrimeVue.js b/packages/core/src/config/PrimeVue.js index 9ac6d667b..dd0ae78ec 100644 --- a/packages/core/src/config/PrimeVue.js +++ b/packages/core/src/config/PrimeVue.js @@ -1,7 +1,7 @@ +import { Theme, ThemeService } from '@primeuix/styled'; import { FilterMatchMode } from '@primevue/core/api'; import BaseStyle from '@primevue/core/base/style'; import PrimeVueService from '@primevue/core/service'; -import { Theme, ThemeService } from '@primevue/themes'; import { inject, reactive, ref, watch } from 'vue'; export const defaultOptions = { diff --git a/packages/core/src/utils/DomHandler.js b/packages/core/src/utils/DomHandler.js index e2014201e..95b68c429 100755 --- a/packages/core/src/utils/DomHandler.js +++ b/packages/core/src/utils/DomHandler.js @@ -1,4 +1,4 @@ -import { $dt } from '@primevue/themes'; +import { $dt } from '@primeuix/styled'; export default { innerWidth(el) { diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index 76795a0f6..1b48fe61a 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -16,8 +16,7 @@ "incremental": true, "baseUrl": ".", "paths": { - "@primevue/core/*": ["./src/*"], - "primevue/themes/*": ["../../packages/themes/src/*"] + "@primevue/core/*": ["./src/*"] } }, "include": ["**/*.ts", "src/*"], diff --git a/packages/icons/package.json b/packages/icons/package.json index 1b3027516..60044cb47 100644 --- a/packages/icons/package.json +++ b/packages/icons/package.json @@ -35,7 +35,8 @@ "build": "NODE_ENV=production INPUT_DIR=src/ OUTPUT_DIR=dist/ pnpm run build:package", "build:package": "pnpm run build:prebuild && rollup -c && pnpm run build:postbuild", "build:prebuild": "node ./scripts/prebuild.mjs", - "build:postbuild": "node ./scripts/postbuild.mjs" + "build:postbuild": "node ./scripts/postbuild.mjs", + "dev:link": "pnpm link --global && npm link" }, "dependencies": { "@primevue/core": "workspace:*" @@ -43,4 +44,4 @@ "engines": { "node": ">=12.11.0" } -} \ No newline at end of file +} diff --git a/packages/metadata/package.json b/packages/metadata/package.json index ad3eb3db3..97c557c7d 100644 --- a/packages/metadata/package.json +++ b/packages/metadata/package.json @@ -34,7 +34,8 @@ "build": "NODE_ENV=production INPUT_DIR=src/ OUTPUT_DIR=dist/ pnpm run build:package", "build:package": "pnpm run build:prebuild && tsup && pnpm run build:postbuild", "build:prebuild": "node ./scripts/prebuild.mjs", - "build:postbuild": "node ./scripts/postbuild.mjs" + "build:postbuild": "node ./scripts/postbuild.mjs", + "dev:link": "pnpm link --global && npm link" }, "devDependencies": { "tsup": "^8.1.0" @@ -42,4 +43,4 @@ "engines": { "node": ">=12.11.0" } -} \ No newline at end of file +} diff --git a/packages/nuxt-module/package.json b/packages/nuxt-module/package.json index c576e6ea8..03330e811 100644 --- a/packages/nuxt-module/package.json +++ b/packages/nuxt-module/package.json @@ -51,6 +51,7 @@ "dev": "nuxi dev playground", "dev:build": "nuxi build playground", "dev:prepare": "nuxt-module-build --stub && nuxt-module-build prepare && nuxi prepare playground", + "dev:link": "pnpm link --global && npm link", "test": "vitest run", "test:watch": "vitest watch" }, @@ -75,4 +76,4 @@ "engines": { "node": ">=12.11.0" } -} \ No newline at end of file +} diff --git a/packages/nuxt-module/src/module.ts b/packages/nuxt-module/src/module.ts index 29e922dd8..b412d94e9 100644 --- a/packages/nuxt-module/src/module.ts +++ b/packages/nuxt-module/src/module.ts @@ -53,15 +53,12 @@ export default defineNuxtModule({ //nuxt.options.build.transpile.push('nuxt'); nuxt.options.build.transpile.push('primevue'); - /*nuxt.options.build.transpile.push('@primevue/core'); - nuxt.options.build.transpile.push('@primevue/icons'); - nuxt.options.build.transpile.push('@primevue/themes');*/ const styleContent = () => ` ${registered.styles.map((style: any) => `import ${style.as} from '${style.from}';`).join('\n')} ${ hasTheme - ? `import { Theme } from '@primevue/themes'; + ? `import { Theme } from '@primeuix/styled'; import ${importTheme.as} from '${normalize(importTheme.from)}';\n` : '' } diff --git a/packages/primevue/package.json b/packages/primevue/package.json index 4a2ad7631..09f58cff2 100644 --- a/packages/primevue/package.json +++ b/packages/primevue/package.json @@ -318,7 +318,8 @@ "build:package": "pnpm run build:prebuild && pnpm run build:api && rollup -c && pnpm run build:postbuild", "build:api": "node ./scripts/build-api.js", "build:prebuild": "node ./scripts/prebuild.mjs", - "build:postbuild": "node ./scripts/postbuild.mjs" + "build:postbuild": "node ./scripts/postbuild.mjs", + "dev:link": "pnpm link --global && npm link" }, "dependencies": { "@primevue/core": "workspace:*", @@ -327,4 +328,4 @@ "engines": { "node": ">=12.11.0" } -} \ No newline at end of file +} diff --git a/packages/primevue/rollup.config.mjs b/packages/primevue/rollup.config.mjs index 550570ba6..8a6e869ed 100644 --- a/packages/primevue/rollup.config.mjs +++ b/packages/primevue/rollup.config.mjs @@ -19,7 +19,7 @@ const GLOBALS = { // externals const GLOBAL_EXTERNALS = ['vue', 'chart.js/auto', 'quill']; -const INLINE_EXTERNALS = [/@primevue\/core\/.*/, /@primevue\/icons\/.*/]; +const INLINE_EXTERNALS = [/@primevue\/core\/.*/, /@primevue\/icons\/.*/, '@primeuix/styled']; const EXTERNALS = [...GLOBAL_EXTERNALS, ...INLINE_EXTERNALS]; // alias @@ -56,8 +56,7 @@ const ALIAS_ENTRIES = [ { find: '@primevue/core/utils', replacement: path.resolve(__dirname, '../core/src/utils/Utils.js') }, { find: '@primevue/core', replacement: path.resolve(__dirname, '../core/src/index.js') }, { find: '@primevue/icons/baseicon/style', replacement: path.resolve(__dirname, '../icons/src/baseicon/style/BaseIconStyle.js') }, - { find: '@primevue/icons/baseicon', replacement: path.resolve(__dirname, '../icons/src/baseicon/BaseIcon.vue') }, - { find: '@primevue/themes', replacement: path.resolve(__dirname, '../themes/src/index.js') } + { find: '@primevue/icons/baseicon', replacement: path.resolve(__dirname, '../icons/src/baseicon/BaseIcon.vue') } ]; // plugins diff --git a/packages/primevue/scripts/prebuild.mjs b/packages/primevue/scripts/prebuild.mjs index 8a03b2606..250b47e7b 100644 --- a/packages/primevue/scripts/prebuild.mjs +++ b/packages/primevue/scripts/prebuild.mjs @@ -23,7 +23,7 @@ export { default as BaseIcon } from '@primevue/icons/baseicon'; export { default as BaseIconStyle } from '@primevue/icons/baseicon/style'; // Themes -export * from '@primevue/themes'; +export * from '@primeuix/styled'; // UseConfirm export * from './useconfirm/UseConfirm.js'; diff --git a/packages/primevue/src/confirmpopup/ConfirmPopup.vue b/packages/primevue/src/confirmpopup/ConfirmPopup.vue index 823acdd9a..395e88545 100644 --- a/packages/primevue/src/confirmpopup/ConfirmPopup.vue +++ b/packages/primevue/src/confirmpopup/ConfirmPopup.vue @@ -59,7 +59,7 @@