From 825a6f716b4e0dcc8991ae850956a06c3d52544e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 14 Sep 2025 14:26:28 +0000 Subject: [PATCH 1/5] chore: prepare v1.2.5 hotfix - Update version to 1.2.5 in package.json - Changelog generation skipped (manual update needed) This commit prepares the hotfix/v1.2.5 branch for hotfix. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 20709ad..1a376c3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pico-api-docs", - "version": "1.2.4", + "version": "1.2.5", "description": "PICO SulTeng API Documentation - COVID-19 Sulawesi Tengah Data API", "main": "index.js", "scripts": { From beebe25ae78f13d96f9eed06c1fe9f6ad3a95b99 Mon Sep 17 00:00:00 2001 From: Fajrian Aidil Pratama Date: Sun, 14 Sep 2025 21:30:06 +0700 Subject: [PATCH 2/5] fix: resolve TypeScript errors in Vue components - Fix route.meta.transition type assertion in App.vue - Replace $slots access with useSlots() in BaseCard.vue script setup - Add proper type annotations for variant union in CodeBlock.vue - Remove unused 't' variable in Documentation.vue --- src/App.vue | 2 +- src/components/BaseCard.vue | 6 ++++-- src/components/CodeBlock.vue | 6 +++--- src/views/Documentation.vue | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/App.vue b/src/App.vue index 27f9908..133dfea 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,7 +2,7 @@
diff --git a/src/components/BaseCard.vue b/src/components/BaseCard.vue index b5ff1ea..4e5c811 100644 --- a/src/components/BaseCard.vue +++ b/src/components/BaseCard.vue @@ -34,7 +34,7 @@ diff --git a/src/i18n.ts b/src/i18n.ts index 601f790..8bfc4bc 100644 --- a/src/i18n.ts +++ b/src/i18n.ts @@ -1,20 +1,35 @@ import { createI18n } from 'vue-i18n' -import en from './locales/en.json' -import id from './locales/id.json' -const messages = { - en, - id +// Lazy load locale messages +const loadLocaleMessages = async () => { + const modules = import.meta.glob('./locales/*.json') + const messages: Record = {} + + for (const path in modules) { + const mod = await modules[path]() as { default: any } + const locale = path.replace('./locales/', '').replace('.json', '') + messages[locale] = mod.default + } + + return messages } // Get saved language or default to English const savedLanguage = localStorage.getItem('pico-language') || 'en' +// Create i18n instance with lazy loading const i18n = createI18n({ legacy: false, locale: savedLanguage, fallbackLocale: 'en', - messages + messages: {} +}) + +// Load messages asynchronously +loadLocaleMessages().then(messages => { + Object.keys(messages).forEach(locale => { + i18n.global.setLocaleMessage(locale, messages[locale]) + }) }) export default i18n diff --git a/src/router/index.ts b/src/router/index.ts index c8e3910..7b2683d 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,7 +1,4 @@ import { createRouter, createWebHistory } from 'vue-router' -import Home from '@/views/Home.vue' -import Documentation from '@/views/Documentation.vue' -import ApiReference from '@/views/ApiReference.vue' const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), @@ -9,17 +6,17 @@ const router = createRouter({ { path: '/', name: 'home', - component: Home + component: () => import('@/views/Home.vue') }, { path: '/docs', name: 'documentation', - component: Documentation + component: () => import('@/views/Documentation.vue') }, { path: '/api', name: 'api-reference', - component: ApiReference + component: () => import('@/views/ApiReference.vue') } ] }) diff --git a/vite.config.ts b/vite.config.ts index 48d1d26..d28f706 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -12,10 +12,76 @@ export default defineConfig({ build: { outDir: 'dist', assetsDir: 'assets', + sourcemap: false, + minify: 'terser', + target: 'esnext', + reportCompressedSize: false, + terserOptions: { + compress: { + drop_console: true, + drop_debugger: true, + }, + }, rollupOptions: { input: { main: resolve(__dirname, 'index.html'), }, + output: { + chunkFileNames: 'assets/js/[name]-[hash].js', + entryFileNames: 'assets/js/[name]-[hash].js', + assetFileNames: 'assets/[ext]/[name]-[hash].[ext]', + manualChunks: (id) => { + // Node modules vendor chunks + if (id.includes('node_modules')) { + // Vue core + if (id.includes('vue/') && !id.includes('vue-router') && !id.includes('vue-i18n')) { + return 'vue-vendor' + } + // Vue ecosystem + if (id.includes('vue-router') || id.includes('vue-i18n')) { + return 'vue-ecosystem' + } + // Code syntax highlighting and math + if (id.includes('prismjs') || id.includes('vue-prism-component') || id.includes('katex')) { + return 'syntax-vendor' + } + // Animation and UI libraries + if (id.includes('aos')) { + return 'ui-vendor' + } + // Other vendor libraries + return 'vendor' + } + + // Components chunks + if (id.includes('src/components/documentation/')) { + return 'docs-components' + } + if (id.includes('src/components/')) { + return 'components' + } + + // Locale chunks + if (id.includes('src/locales/')) { + return 'locales' + } + }, + }, }, + // Increase chunk size warning limit to 1000kB for vendor chunks + chunkSizeWarningLimit: 1000, + // Split chunks more aggressively + cssCodeSplit: true, + }, + // Performance optimizations + optimizeDeps: { + include: [ + 'vue', + 'vue-router', + 'vue-i18n', + 'prismjs', + 'katex', + 'aos' + ], }, }) From cc42a21be974faaabce7c449f52a1a367765d712 Mon Sep 17 00:00:00 2001 From: Fajrian Aidil Pratama Date: Sun, 14 Sep 2025 21:41:02 +0700 Subject: [PATCH 4/5] fix: resolve TypeScript errors in Vite config for pnpm ES modules - Add @types/node dependency for Node.js type declarations - Update tsconfig.node.json to include Node.js types - Convert vite.config.ts to ES module patterns using import.meta.url - Replace __dirname with fileURLToPath for modern Node.js compatibility - Maintain all existing build optimizations and chunk splitting --- package.json | 1 + tsconfig.node.json | 3 ++- vite.config.ts | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index ca2aa77..29173f9 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "@tailwindcss/postcss": "^4.1.13", "@tailwindcss/typography": "^0.5.16", "@types/aos": "^3.0.7", + "@types/node": "^24.4.0", "@vitejs/plugin-vue": "^6.0.1", "autoprefixer": "^10.4.21", "postcss": "^8.5.6", diff --git a/tsconfig.node.json b/tsconfig.node.json index 97ede7e..1a555ac 100644 --- a/tsconfig.node.json +++ b/tsconfig.node.json @@ -5,7 +5,8 @@ "module": "ESNext", "moduleResolution": "bundler", "allowSyntheticDefaultImports": true, - "strict": true + "strict": true, + "types": ["node"] }, "include": ["vite.config.ts"] } diff --git a/vite.config.ts b/vite.config.ts index d28f706..c7441d7 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,12 +1,12 @@ import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' -import { resolve } from 'path' +import { fileURLToPath, URL } from 'node:url' export default defineConfig({ plugins: [vue()], resolve: { alias: { - '@': resolve(__dirname, 'src'), + '@': fileURLToPath(new URL('./src', import.meta.url)), }, }, build: { @@ -24,7 +24,7 @@ export default defineConfig({ }, rollupOptions: { input: { - main: resolve(__dirname, 'index.html'), + main: fileURLToPath(new URL('./index.html', import.meta.url)), }, output: { chunkFileNames: 'assets/js/[name]-[hash].js', From 632f9004df2c8626fffcc68b1ca98e0a0cd62d8c Mon Sep 17 00:00:00 2001 From: Fajrian Aidil Pratama Date: Sun, 14 Sep 2025 21:43:39 +0700 Subject: [PATCH 5/5] docs(changelog): generate changelog --- CHANGELOG.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 07d265e..745955d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,19 @@ +## [v1.2.5] - 2025-09-14 + +### Added + +- Implement comprehensive bundle optimization and code splitting (79fa266) + +### Fixed + +- Resolve typescript errors in vite config for pnpm es modules (cc42a21) +- Resolve typescript errors in vue components (beebe25) + +### Maintenance + +- Prepare v1.2.5 hotfix (825a6f7) + + ## [v1.2.3] - 2025-09-14 ### Fixed