feat!: rewrite frontend in Vue 3 with Pinia, DaisyUI, vite-plugin-pwa
Migrates every component from class-based vue-property-decorator to
<script setup> + Composition API. Replaces Vuex 3 + vuex-class with a
single Pinia store (persisted via pinia-plugin-persistedstate). Swaps
Bulma + bulma-{checkradio,switch,pricingtable} for DaisyUI 5 utilities
on Tailwind 4. Replaces register-service-worker with vite-plugin-pwa
(workbox, skipWaiting/clientsClaim preserved).
Plugins replaced:
- vue-class-component / vue-property-decorator -> <script setup>
- vuex / vuex-class / vuex-persist -> pinia + persistedstate
- vue-i18n 8 -> vue-i18n 11 (composition mode, legacy: false)
- vue-click-outside -> @vueuse/core onClickOutside
- @xkeshi/vue-qrcode -> qrcode.vue
- vue-currency-input 1 -> vue-currency-input 3 (composable wrapper)
- bus-event (Vue instance) -> mitt
- Vue filters -> plain functions imported per component
BREAKING: drops Stripe / pricing entirely (Payment, PricingTable,
/pricing route, vue-stripe-checkout, bulma-pricingtable).
Clears unused Cypress and Jest test scaffolding; leaves a Vitest
harness behind for future tests.
This commit is contained in:
53
src/main.ts
53
src/main.ts
@@ -1,37 +1,30 @@
|
||||
import Vue from 'vue'
|
||||
import VueI18n from 'vue-i18n'
|
||||
import { createApp } from 'vue'
|
||||
import { createPinia } from 'pinia'
|
||||
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
|
||||
import App from './App.vue'
|
||||
import router from './router'
|
||||
import store from './store'
|
||||
import './styles/index.scss'
|
||||
import 'bulma-checkradio'
|
||||
import './registerServiceWorker'
|
||||
import filters from './utils/filters'
|
||||
import './utils/icons'
|
||||
import messages from './messages'
|
||||
import i18n from './i18n'
|
||||
import { useUserStore } from './stores/user'
|
||||
import { registerIcons } from './utils/icons'
|
||||
import couchService from './services/CouchService'
|
||||
import './styles/index.css'
|
||||
|
||||
Vue.use(VueI18n)
|
||||
const bootstrap = async () => {
|
||||
const app = createApp(App)
|
||||
|
||||
Vue.config.productionTip = false
|
||||
const pinia = createPinia()
|
||||
pinia.use(piniaPluginPersistedstate)
|
||||
app.use(pinia)
|
||||
|
||||
for (const filter of Object.keys(filters)) {
|
||||
Vue.filter(filter, filters[filter])
|
||||
app.use(router)
|
||||
app.use(i18n)
|
||||
registerIcons(app)
|
||||
|
||||
const userStore = useUserStore()
|
||||
couchService.start(() => userStore.publicAccountIds)
|
||||
await userStore.retrieveUser()
|
||||
|
||||
app.mount('#app')
|
||||
}
|
||||
|
||||
const i18n = new VueI18n({
|
||||
locale: 'fr',
|
||||
fallbackLocale: 'en',
|
||||
messages
|
||||
})
|
||||
|
||||
const app = async () => {
|
||||
await store.dispatch('retrieveUser')
|
||||
new Vue({
|
||||
router,
|
||||
store,
|
||||
i18n,
|
||||
render: (h) => h(App)
|
||||
}).$mount('#app')
|
||||
}
|
||||
|
||||
app()
|
||||
bootstrap()
|
||||
|
||||
Reference in New Issue
Block a user