From ee8e35aabd09f903dfb0cf4b14c019351c475a2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Tue, 20 Dec 2022 15:32:32 +0300 Subject: [PATCH] prettier warnings fixed --- .prettierignore | 4 +++- api-generator/build-api.js | 6 ++++++ layouts/default.vue | 19 ++++++++++--------- nuxt.config.js | 1 - plugins/fullcalendar.client.js | 1 + rollup.config.js | 1 + service/CustomerService.js | 1 + 7 files changed, 22 insertions(+), 11 deletions(-) diff --git a/.prettierignore b/.prettierignore index 728fc9f8a..dee7b1425 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,8 +2,10 @@ build coverage dist -out public styles node_modules .vscode +dist +.nuxt +.output \ No newline at end of file diff --git a/api-generator/build-api.js b/api-generator/build-api.js index 7fc286c2a..63b11b9c9 100644 --- a/api-generator/build-api.js +++ b/api-generator/build-api.js @@ -17,6 +17,7 @@ const fileModules = {}, veturAttributes = {}; const files = fs.readdirSync(componentPath); + files.forEach((file) => { const { name } = path.parse(file); @@ -123,11 +124,13 @@ const createWebTypes = (component) => { const createVeturTags = (component) => { const attributes = []; + if (component.props) { component.props.forEach((comp) => { attributes.push(comp.name); }); } + if (attributes.length > 0) { veturTags[component.name] = { description: component.description, @@ -154,10 +157,13 @@ Object.keys(fileModules).forEach((p) => { }); const webTypesJson = JSON.stringify(webTypes, null, 2); + fs.writeFileSync(path.resolve(distDir, 'web-types.json'), webTypesJson); const veturTagsJson = JSON.stringify(veturTags, null, 2); + fs.writeFileSync(path.resolve(distDir, 'vetur-tags.json'), veturTagsJson); const veturAttributesJson = JSON.stringify(veturAttributes, null, 2); + fs.writeFileSync(path.resolve(distDir, 'vetur-attributes.json'), veturAttributesJson); diff --git a/layouts/default.vue b/layouts/default.vue index e6577f428..9f7387524 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -32,15 +32,6 @@ export default { sidebarActive: false }; }, - mounted() { - if (this.isOutdatedIE()) { - this.$toast.add({ - severity: 'warn', - summary: 'Limited Functionality', - detail: 'Although PrimeVue supports IE11, ThemeSwitcher in this application cannot be not fully supported by your browser. Please use a modern browser for the best experience of the showcase.' - }); - } - }, watch: { $route: { immediate: true, @@ -59,6 +50,15 @@ export default { } } }, + mounted() { + if (this.isOutdatedIE()) { + this.$toast.add({ + severity: 'warn', + summary: 'Limited Functionality', + detail: 'Although PrimeVue supports IE11, ThemeSwitcher in this application cannot be not fully supported by your browser. Please use a modern browser for the best experience of the showcase.' + }); + } + }, methods: { onMenuButtonClick() { if (this.sidebarActive) { @@ -94,6 +94,7 @@ export default { }, isOutdatedIE() { let ua = window.navigator.userAgent; + if (ua.indexOf('MSIE ') > 0 || ua.indexOf('Trident/') > 0) { return true; } diff --git a/nuxt.config.js b/nuxt.config.js index c62964f60..e066ad8de 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -1,6 +1,5 @@ import vueJsx from '@vitejs/plugin-vue-jsx'; const path = require('path'); - const baseUrl = process.env.NODE_ENV === 'production' ? '/primevue-nuxt/' : '/'; // https://v3.nuxtjs.org/api/configuration/nuxt.config diff --git a/plugins/fullcalendar.client.js b/plugins/fullcalendar.client.js index d54d287be..5cd93b5a9 100644 --- a/plugins/fullcalendar.client.js +++ b/plugins/fullcalendar.client.js @@ -12,6 +12,7 @@ const $fullCalendar = { Vue.config.globalProperties.$fullCalendar = FullCalendar; } }; + export default defineNuxtPlugin((nuxtApp) => { nuxtApp.vueApp.use($fullCalendar); }); diff --git a/rollup.config.js b/rollup.config.js index 2dbd437c9..0ba767ce6 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -144,6 +144,7 @@ function addSFC() { .forEach(({ name: folderName }) => { fs.readdirSync(path.resolve(__dirname, './components/' + folderName)).forEach((file) => { let name = file.split(/(.vue)$|(.js)$/)[0].toLowerCase(); + if (/\.vue$/.test(file) && name === folderName) { addEntry(folderName, file, name); } diff --git a/service/CustomerService.js b/service/CustomerService.js index 482e84aaf..27a74f40e 100755 --- a/service/CustomerService.js +++ b/service/CustomerService.js @@ -31,6 +31,7 @@ export default class CustomerService { .map((k) => encodeURIComponent(k) + '=' + encodeURIComponent(params[k])) .join('&') : ''; + return fetch('https://www.primefaces.org/data/customers?' + queryParams).then((res) => res.json()); } }