import pkg from '../../../package.json'; import { services } from './services'; const PrimeVue = { version: '^4.0.0', description: 'PrimeVue is an open source UI library for Vue featuring a rich set of 80+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeBlock, which has 400+ ready to use UI blocks to build spectacular applications in no time.' }; const app_dependencies = pkg ? pkg.devDependencies : {}; const core_dependencies = { vue: '^3.2.45', '@vitejs/plugin-vue': '^4.0.0', vite: '^4.0.0', primevue: pkg.version || PrimeVue.version || 'latest', '@primevue/themes': pkg.version || PrimeVue.version || 'latest', '@primevue/auto-import-resolver': pkg.version || PrimeVue.version || 'latest', primeicons: app_dependencies['primeicons'] || 'latest', tailwindcss: app_dependencies['tailwindcss'] || 'latest', autoprefixer: app_dependencies['autoprefixer'] || 'latest', postcss: app_dependencies['postcss'] || 'latest', 'tailwindcss-primeui': app_dependencies['tailwindcss-primeui'] || 'latest', 'unplugin-vue-components': 'latest' }; // create-vue -> https://github.com/vuejs/create-vue const getVueApp = (props = {}, sourceType) => { const path = 'src/'; const { code: sources, title = 'primevue_demo', description = '', service, extPages, dependencies: deps, component, extFiles } = props; const dependencies = { ...core_dependencies, ...deps }; const fileExtension = '.vue'; const mainFileName = 'App'; const sourceFileName = `${path}${mainFileName}${fileExtension}`; let extFilesSource = extFiles ? extFiles[sourceType.language] : {}; let element = '', imports = '', themeSwitchCode = ''; if (deps !== null && component !== null) { imports += `import ${component} from 'primevue/${component.toLowerCase()}'; `; element += `app.component('${component}', ${component}); `; } // App.vue themeSwitchCode = ''.concat( `