refactor: module federation
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
22
src/main.ts
22
src/main.ts
@@ -1,10 +1,6 @@
|
|||||||
import type { App as Vue } from 'vue'
|
import type { App as Vue } from 'vue'
|
||||||
import routes from '@/routes'
|
import routes from '@/routes'
|
||||||
import integrations from '@/integrations'
|
import integrations from '@/integrations'
|
||||||
import { useCollectionsStore } from '@/stores/collectionsStore'
|
|
||||||
import { useEntitiesStore } from '@/stores/entitiesStore'
|
|
||||||
import { useProvidersStore } from '@/stores/providersStore'
|
|
||||||
import { useServicesStore } from '@/stores/servicesStore'
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mail Manager Module Boot Script
|
* Mail Manager Module Boot Script
|
||||||
@@ -23,21 +19,15 @@ export const css = ['__CSS_FILENAME_PLACEHOLDER__']
|
|||||||
// Export routes and integrations for module system
|
// Export routes and integrations for module system
|
||||||
export { routes, integrations }
|
export { routes, integrations }
|
||||||
|
|
||||||
// Export stores for external use if needed
|
// Export services, stores and models for external use
|
||||||
export { useCollectionsStore, useEntitiesStore, useProvidersStore, useServicesStore }
|
export * from '@/services'
|
||||||
|
export * from '@/stores'
|
||||||
|
export * from '@/models'
|
||||||
|
|
||||||
// Export composables
|
// Export composables for external use
|
||||||
export { useMailSync } from '@/composables/useMailSync'
|
export { useMailSync } from '@/composables/useMailSync'
|
||||||
|
|
||||||
// Export services
|
// Export components for external use
|
||||||
export { providerService, serviceService, collectionService, entityService } from '@/services'
|
|
||||||
|
|
||||||
// Export models
|
|
||||||
export { CollectionObject, CollectionPropertiesObject } from '@/models/collection'
|
|
||||||
export { MessageObject } from '@/models/message'
|
|
||||||
export { EntityObject } from '@/models/entity'
|
|
||||||
|
|
||||||
// Export components
|
|
||||||
export { default as AddAccountDialog } from '@/components/AddAccountDialog.vue'
|
export { default as AddAccountDialog } from '@/components/AddAccountDialog.vue'
|
||||||
export { default as EditAccountDialog } from '@/components/EditAccountDialog.vue'
|
export { default as EditAccountDialog } from '@/components/EditAccountDialog.vue'
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,14 @@
|
|||||||
export { CollectionObject } from './collection';
|
|
||||||
export { EntityObject } from './entity';
|
|
||||||
export { ProviderObject } from './provider';
|
export { ProviderObject } from './provider';
|
||||||
export { ServiceObject } from './service';
|
export { ServiceObject } from './service';
|
||||||
|
export {
|
||||||
|
CollectionObject,
|
||||||
|
CollectionPropertiesObject
|
||||||
|
} from './collection';
|
||||||
|
export { EntityObject } from './entity';
|
||||||
|
export {
|
||||||
|
MessageObject,
|
||||||
|
MessagePartObject
|
||||||
|
} from './message';
|
||||||
export {
|
export {
|
||||||
Identity,
|
Identity,
|
||||||
IdentityNone,
|
IdentityNone,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
* Provides a centralized way to make API calls with envelope wrapping/unwrapping
|
* Provides a centralized way to make API calls with envelope wrapping/unwrapping
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { createFetchWrapper } from '@KTXC/utils/helpers/fetch-wrapper-core';
|
import { createFetchWrapper } from '@KTXC';
|
||||||
import type { ApiRequest, ApiResponse } from '../types/common';
|
import type { ApiRequest, ApiResponse } from '../types/common';
|
||||||
|
|
||||||
const fetchWrapper = createFetchWrapper();
|
const fetchWrapper = createFetchWrapper();
|
||||||
|
|||||||
@@ -41,13 +41,16 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
external: [
|
external: [
|
||||||
'pinia',
|
|
||||||
'vue',
|
'vue',
|
||||||
'vue-router',
|
'vue-router',
|
||||||
// Externalize shared utilities from core to avoid duplication
|
'pinia',
|
||||||
/^@KTXC\/utils\//,
|
'@KTXC',
|
||||||
],
|
],
|
||||||
output: {
|
output: {
|
||||||
|
paths: (id) => {
|
||||||
|
if (id === '@KTXC') return '/js/ktxc.mjs'
|
||||||
|
return id
|
||||||
|
},
|
||||||
assetFileNames: (assetInfo) => {
|
assetFileNames: (assetInfo) => {
|
||||||
if (assetInfo.name?.endsWith('.css')) {
|
if (assetInfo.name?.endsWith('.css')) {
|
||||||
return 'mail_manager-[hash].css'
|
return 'mail_manager-[hash].css'
|
||||||
|
|||||||
Reference in New Issue
Block a user