pull/5880/head
Mert Sincan 2024-06-13 10:13:21 +01:00
commit 13bf40cd36
1 changed files with 3 additions and 47 deletions

View File

@ -11,7 +11,6 @@ const app_dependencies = pkg ? pkg.devDependencies : {};
const core_dependencies = {
vue: '^3.2.45',
'vue-router': '^4.1.6',
'@vitejs/plugin-vue': '^4.0.0',
vite: '^4.0.0',
primevue: PrimeVue.version || 'latest',
@ -31,17 +30,10 @@ const getVueApp = (props = {}, sourceType) => {
const fileExtension = '.vue';
const mainFileName = 'App';
const sourceFileName = `${path}${mainFileName}${fileExtension}`;
let extFilesSource = extFiles ? extFiles[sourceType.language] : {};
let element = '',
imports = '',
themeSwitchCode = '',
routeFiles = {};
sources.routeFiles &&
Object.entries(sources.routeFiles).forEach(([key, value]) => {
routeFiles[`${path + key}`] = {
content: value
};
});
themeSwitchCode = '';
if (deps !== null && component !== null) {
imports += `import ${component} from 'primevue/${component.toLowerCase()}';
@ -136,7 +128,6 @@ import PrimeVue from "primevue/config";
import AppState from './plugins/appState.js';
import Noir from './presets/Noir.js';
import ThemeSwitcher from './components/ThemeSwitcher.vue';
import { router } from "./router";
import AutoComplete from 'primevue/autocomplete';
import Accordion from 'primevue/accordion';
import AccordionPanel from 'primevue/accordionpanel';
@ -274,7 +265,6 @@ app.use(AppState);
app.use(ConfirmationService);
app.use(ToastService);
app.use(DialogService);
app.use(router);
app.directive('tooltip', Tooltip);
app.directive('badge', BadgeDirective);
@ -1133,15 +1123,6 @@ export default {
[`${path}flags.css`]: {
content: staticStyles.flags
},
[`${path}router.js`]: {
content: `import { createRouter, createWebHistory } from "vue-router";
import ${mainFileName} from "./${mainFileName}${fileExtension}";
export const router = createRouter({
history: createWebHistory(),
routes: [{ path: "/", component: ${mainFileName} }]
});`
},
[`${sourceFileName}`]: {
content: themeSwitchCode
},
@ -1173,34 +1154,9 @@ export const router = createRouter({
</g>
</svg>`
},
...routeFiles,
...extFiles
...extFilesSource
};
if (extPages && extPages.length >= 1) {
let routePaths = '';
let viewImports = '';
extPages.forEach((page, index) => {
let compPath = page.tabName.replace('Demo', '').toLowerCase();
routePaths += `{ path: "/${index === 0 ? '' : compPath}", component: ${page.tabName} },\n`;
viewImports += `import ${page.tabName} from "./components/${page.tabName}${fileExtension}";\n`;
files[`${path}components/${page.tabName}${fileExtension}`] = {
content: page.content
};
});
files[`${path}router.js`] = {
content: `import { createRouter, createWebHistory } from "vue-router";
${viewImports}
export const router = createRouter({
history: createWebHistory(),
routes: [ ${routePaths}]
});`
};
}
if (service) {
service.forEach((name) => {
files[`${path}service/${name}.js`] = {