Update Tailwind folder structure

pull/4243/head
mertsincan 2023-08-05 04:36:07 +03:00
parent 073c18d0f6
commit 27eb773d30
10 changed files with 46 additions and 12 deletions

View File

@ -15,6 +15,7 @@ function copyDependencies(inFolder, outFolder) {
copyDependencies('./components/lib/', 'dist/'); copyDependencies('./components/lib/', 'dist/');
copyDependencies('./components/lib/icons/', 'dist/icons/'); copyDependencies('./components/lib/icons/', 'dist/icons/');
copyDependencies('./components/lib/passthrough/', 'dist/passthrough/');
fs.copySync(path.resolve(__dirname, './components/lib/ts-helpers.d.ts'), 'dist/ts-helpers.d.ts'); fs.copySync(path.resolve(__dirname, './components/lib/ts-helpers.d.ts'), 'dist/ts-helpers.d.ts');
fs.copySync(path.resolve(__dirname, './package-build.json'), 'dist/package.json'); fs.copySync(path.resolve(__dirname, './package-build.json'), 'dist/package.json');

0
components/lib/passthrough/index.d.ts vendored Normal file
View File

View File

@ -0,0 +1,19 @@
import { mergeProps } from 'vue';
// @todo: Improve this method
export const usePassThrough = (theme, pt = {}, { merge = false }) => {
const newTheme = { ...theme };
const componentNames = Object.keys(pt);
return componentNames.reduce((t, n) => {
if (!merge) {
t[n] = pt[n];
} else {
t[n] = Object.entries(pt[n]).reduce((_t, [sk, sv]) => {
return mergeProps(t[n][sk], sv);
}, {});
}
return t;
}, newTheme);
};

View File

@ -0,0 +1,6 @@
{
"main": "./index.cjs.js",
"module": "./index.esm.js",
"unpkg": "./index.min.js",
"types": "./index.d.ts"
}

View File

@ -1,4 +1,4 @@
import { PrimeVuePTOptions } from '../config'; import { PrimeVuePTOptions } from '../../config';
interface Tailwind extends PrimeVuePTOptions {} interface Tailwind extends PrimeVuePTOptions {}

View File

@ -14,6 +14,7 @@ export const TRANSITIONS = {
leaveToClass: 'opacity-0' leaveToClass: 'opacity-0'
} }
}; };
export default { export default {
global: { global: {
css: ` css: `

View File

@ -0,0 +1,6 @@
{
"main": "./index.cjs.js",
"module": "./index.esm.js",
"unpkg": "./index.min.js",
"types": "./index.d.ts"
}

View File

@ -1,6 +0,0 @@
{
"main": "./tailwind.cjs.js",
"module": "./tailwind.esm.js",
"unpkg": "./tailwind.min.js",
"types": "./Tailwind.d.ts"
}

View File

@ -59,6 +59,11 @@ const CORE_ICON_DEPENDENCIES = {
'primevue/icons/windowminimize': 'primevue.icons.windowminimize' 'primevue/icons/windowminimize': 'primevue.icons.windowminimize'
}; };
const CORE_PASSTHROUGH_DEPENDENCIES = {
'primevue/passthrough': 'primevue.passthrough',
'primevue/passthrough/tailwind': 'primevue.passthrough.tailwind'
};
const CORE_DEPENDENCIES = { const CORE_DEPENDENCIES = {
'primevue/utils': 'primevue.utils', 'primevue/utils': 'primevue.utils',
'primevue/api': 'primevue.api', 'primevue/api': 'primevue.api',
@ -93,7 +98,7 @@ const CORE_DEPENDENCIES = {
'primevue/menu': 'primevue.menu', 'primevue/menu': 'primevue.menu',
'primevue/tieredmenu': 'primevue.tieredmenu', 'primevue/tieredmenu': 'primevue.tieredmenu',
'primevue/badge': 'primevue.badge', 'primevue/badge': 'primevue.badge',
'primevue/tailwind': 'primevue.tailwind' ...CORE_PASSTHROUGH_DEPENDENCIES
}; };
// dependencies // dependencies
@ -283,8 +288,9 @@ function addConfig() {
addEntry('config', 'PrimeVue.js', 'config'); addEntry('config', 'PrimeVue.js', 'config');
} }
function addTailwind() { function addPassThrough() {
addEntry('tailwind', 'Tailwind', 'tailwind'); addEntry('passthrough', 'index.js', 'index');
addEntry('passthrough/tailwind', 'index.js', 'index');
} }
function addUtils() { function addUtils() {
@ -322,7 +328,7 @@ addDirectives();
addServices(); addServices();
addSFC(); addSFC();
addIcon(); addIcon();
addTailwind(); addPassThrough();
addCore(); addCore();
export default entries; export default entries;

View File

@ -80,7 +80,8 @@ export default {
'primevue/terminalservice': path.resolve(__dirname, './components/lib/terminalservice/TerminalService.js'), 'primevue/terminalservice': path.resolve(__dirname, './components/lib/terminalservice/TerminalService.js'),
'primevue/dynamicdialogeventbus': path.resolve(__dirname, './components/lib/dynamicdialogeventbus/DynamicDialogEventBus.js'), 'primevue/dynamicdialogeventbus': path.resolve(__dirname, './components/lib/dynamicdialogeventbus/DynamicDialogEventBus.js'),
'primevue/virtualscroller': path.resolve(__dirname, './components/lib/virtualscroller/VirtualScroller.vue'), 'primevue/virtualscroller': path.resolve(__dirname, './components/lib/virtualscroller/VirtualScroller.vue'),
'primevue/tailwind': path.resolve(__dirname, './components/lib/tailwind/Tailwind.js') 'primevue/passthrough': path.resolve(__dirname, './components/lib/passthrough/index.js'),
'primevue/passthrough/tailwind': path.resolve(__dirname, './components/lib/passthrough/tailwind/index.js')
} }
} }
}; };