Skip to content

Commit

Permalink
Fixed #5898 - Themes are installed by the wrong package
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Jun 15, 2024
1 parent 03c536b commit 2fdfe2f
Show file tree
Hide file tree
Showing 47 changed files with 57 additions and 993 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions packages/auto-import-resolver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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:*"
Expand All @@ -45,4 +46,4 @@
"engines": {
"node": ">=12.11.0"
}
}
}
7 changes: 4 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,16 @@
"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"
},
"engines": {
"node": ">=12.11.0"
}
}
}
5 changes: 2 additions & 3 deletions packages/core/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/base/style/BaseStyle.js
Original file line number Diff line number Diff line change
@@ -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 }) => `
* {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/basecomponent/BaseComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/basedirective/BaseDirective.js
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/config/PrimeVue.js
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/utils/DomHandler.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { $dt } from '@primevue/themes';
import { $dt } from '@primeuix/styled';

export default {
innerWidth(el) {
Expand Down
3 changes: 1 addition & 2 deletions packages/core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
"incremental": true,
"baseUrl": ".",
"paths": {
"@primevue/core/*": ["./src/*"],
"primevue/themes/*": ["../../packages/themes/src/*"]
"@primevue/core/*": ["./src/*"]
}
},
"include": ["**/*.ts", "src/*"],
Expand Down
5 changes: 3 additions & 2 deletions packages/icons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,13 @@
"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:*"
},
"engines": {
"node": ">=12.11.0"
}
}
}
5 changes: 3 additions & 2 deletions packages/metadata/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@
"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"
},
"engines": {
"node": ">=12.11.0"
}
}
}
3 changes: 2 additions & 1 deletion packages/nuxt-module/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand All @@ -75,4 +76,4 @@
"engines": {
"node": ">=12.11.0"
}
}
}
5 changes: 1 addition & 4 deletions packages/nuxt-module/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,12 @@ export default defineNuxtModule<ModuleOptions>({

//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`
: ''
}
Expand Down
5 changes: 3 additions & 2 deletions packages/primevue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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:*",
Expand All @@ -327,4 +328,4 @@
"engines": {
"node": ">=12.11.0"
}
}
}
5 changes: 2 additions & 3 deletions packages/primevue/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/primevue/scripts/prebuild.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion packages/primevue/src/confirmpopup/ConfirmPopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

<script>
import { ConnectedOverlayScrollHandler, DomHandler, ZIndexUtils } from '@primevue/core/utils';
import { $dt } from '@primevue/themes';
import { $dt } from '@primeuix/styled';
import Button from 'primevue/button';
import ConfirmationEventBus from 'primevue/confirmationeventbus';
import FocusTrap from 'primevue/focustrap';
Expand Down
2 changes: 1 addition & 1 deletion packages/primevue/src/knob/BaseKnob.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
import BaseComponent from '@primevue/core/basecomponent';
import { $dt } from '@primevue/themes';
import { $dt } from '@primeuix/styled';
import KnobStyle from 'primevue/knob/style';
export default {
Expand Down
2 changes: 1 addition & 1 deletion packages/primevue/src/popover/Popover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<script>
import { ConnectedOverlayScrollHandler, DomHandler, UniqueComponentId, ZIndexUtils } from '@primevue/core/utils';
import { $dt } from '@primevue/themes';
import { $dt } from '@primeuix/styled';
import FocusTrap from 'primevue/focustrap';
import OverlayEventBus from 'primevue/overlayeventbus';
import Portal from 'primevue/portal';
Expand Down
2 changes: 1 addition & 1 deletion packages/primevue/src/primevue.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,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';
Expand Down
2 changes: 1 addition & 1 deletion packages/primevue/src/speeddial/SpeedDial.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<script>
import { DomHandler, UniqueComponentId } from '@primevue/core/utils';
import PlusIcon from '@primevue/icons/plus';
import { $dt } from '@primevue/themes';
import { $dt } from '@primeuix/styled';
import Button from 'primevue/button';
import Ripple from 'primevue/ripple';
import Tooltip from 'primevue/tooltip';
Expand Down
22 changes: 19 additions & 3 deletions packages/themes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,19 @@
".": "./src/index.js",
"./aura": "./src/presets/aura/index.js",
"./lara": "./src/presets/lara/index.js",
"./nora": "./src/presets/nora/index.js"
"./nora": "./src/presets/nora/index.js",
"./aura/*": {
"types": "./types/*/index.d.ts",
"import": "./src/presets/aura/*/index.js"
},
"./lara/*": {
"types": "./types/*/index.d.ts",
"import": "./src/presets/lara/*/index.js"
},
"./nora/*": {
"types": "./types/*/index.d.ts",
"import": "./src/presets/nora/*/index.js"
}
},
"publishConfig": {
"main": "./index.mjs",
Expand Down Expand Up @@ -57,9 +69,13 @@
"build:package": "pnpm run build:prebuild && pnpm run build:tokens && rollup -c && pnpm run build:postbuild",
"build:tokens": "node ./scripts/build-tokens.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"
},
"peerDependencies": {
"@primeuix/styled": "^0.0.1"
},
"engines": {
"node": ">=12.11.0"
}
}
}
3 changes: 0 additions & 3 deletions packages/themes/src/core/actions/definePreset.js

This file was deleted.

6 changes: 0 additions & 6 deletions packages/themes/src/core/actions/index.js

This file was deleted.

10 changes: 0 additions & 10 deletions packages/themes/src/core/actions/updatePreset.js

This file was deleted.

3 changes: 0 additions & 3 deletions packages/themes/src/core/actions/updatePrimaryPalette.js

This file was deleted.

3 changes: 0 additions & 3 deletions packages/themes/src/core/actions/updateSurfacePalette.js

This file was deleted.

10 changes: 0 additions & 10 deletions packages/themes/src/core/actions/usePreset.js

This file was deleted.

3 changes: 0 additions & 3 deletions packages/themes/src/core/actions/useTheme.js

This file was deleted.

Loading

0 comments on commit 2fdfe2f

Please sign in to comment.