import { createSSRApp } from 'vue'
import * as Pinia from 'pinia'

import App from './App.vue'
import { setupAppConfig } from '/@/config/app'
import { setupStore } from '/@/store'
import { setupI18n } from '/@/locales'

import fuiConfig from './components/firstui/fui-config'

export function createApp() {
    const app = createSSRApp(App)

    // 注册 APP 配置
    setupAppConfig(app)

    // 配置 store
    setupStore(app)

    // 配置 i18n
    setupI18n(app)

    //全局组件配置
    // @ts-ignore
    uni.$fui = fuiConfig

    return {
        app,
        Pinia,
    }
}
