diff --git a/packages/mtb/src/module.ts b/packages/mtb/src/module.ts index 5850b964..2e0ba11e 100644 --- a/packages/mtb/src/module.ts +++ b/packages/mtb/src/module.ts @@ -4,10 +4,7 @@ import { defineNuxtModule, } from '@nuxt/kit'; -// Module options TypeScript interface definition -export interface ModuleOptions {} - -export default defineNuxtModule({ +export default defineNuxtModule({ meta: { name: '@dnpm-dip/mtb', configKey: 'mtb', @@ -40,7 +37,7 @@ export default defineNuxtModule({ addImportsSources({ from: resolver.resolve('./runtime/composables/index'), - imports: ['useAPIClient', 'useMTBAPIClient'], + imports: ['useMTBAPIClient'], }); addPlugin(resolver.resolve('./runtime/plugins/api')); diff --git a/packages/mtb/src/runtime/composables/api-client.ts b/packages/mtb/src/runtime/composables/api-client.ts index 696b1d25..481710a3 100644 --- a/packages/mtb/src/runtime/composables/api-client.ts +++ b/packages/mtb/src/runtime/composables/api-client.ts @@ -1,10 +1,6 @@ -import type { APIClient } from '@dnpm-dip/core'; import { useNuxtApp } from '#imports'; import type { MTBAPIClient } from '../core/api-client'; -export function useAPIClient() { - return useNuxtApp().$api as APIClient; -} export function useMTBAPIClient() { return useNuxtApp().$mtbApi as MTBAPIClient; } diff --git a/packages/mtb/src/runtime/composables/index.ts b/packages/mtb/src/runtime/composables/index.ts index 7bf7962d..2874b3d9 100644 --- a/packages/mtb/src/runtime/composables/index.ts +++ b/packages/mtb/src/runtime/composables/index.ts @@ -1,4 +1,3 @@ export { - useAPIClient, useMTBAPIClient, } from './api-client'; diff --git a/packages/mtb/src/runtime/plugins/api.ts b/packages/mtb/src/runtime/plugins/api.ts index 0dd6486e..f4886107 100644 --- a/packages/mtb/src/runtime/plugins/api.ts +++ b/packages/mtb/src/runtime/plugins/api.ts @@ -1,13 +1,11 @@ +import type { APIClient } from '@dnpm-dip/core'; import { MTBAPIClient } from '../core/api-client'; -import { useAPIClient } from '../composables'; import { defineNuxtPlugin } from '#app'; export default defineNuxtPlugin({ enforce: 'post', async setup(nuxt) { - const baseClient = useAPIClient(); - - const client = new MTBAPIClient(baseClient); + const client = new MTBAPIClient(nuxt.$api as APIClient); return { provide: { diff --git a/packages/rd/src/module.ts b/packages/rd/src/module.ts index a9f1eaa3..d59a00a3 100644 --- a/packages/rd/src/module.ts +++ b/packages/rd/src/module.ts @@ -3,12 +3,9 @@ import { addImportsSources, addPlugin, createResolver, defineNuxtModule, } from '@nuxt/kit'; -// Module options TypeScript interface definition -export interface ModuleOptions {} - -export default defineNuxtModule({ +export default defineNuxtModule({ meta: { - name: '@dnpm-dip/rare-diseases', + name: '@dnpm-dip/rd', configKey: 'rd', }, // Default configuration options of the Nuxt module @@ -40,7 +37,7 @@ export default defineNuxtModule({ addImportsSources({ from: resolver.resolve('./runtime/composables/index'), - imports: ['useAPIClient', 'useRDAPIClient'], + imports: ['useRDAPIClient'], }); addPlugin(resolver.resolve('./runtime/plugins/api')); diff --git a/packages/rd/src/runtime/composables/api-client.ts b/packages/rd/src/runtime/composables/api-client.ts index 45fbc4ec..7e1d4a46 100644 --- a/packages/rd/src/runtime/composables/api-client.ts +++ b/packages/rd/src/runtime/composables/api-client.ts @@ -1,10 +1,6 @@ -import type { APIClient } from '@dnpm-dip/core'; import { useNuxtApp } from '#imports'; import type { RDAPIClient } from '../core/api-client'; -export function useAPIClient() { - return useNuxtApp().$api as APIClient; -} export function useRDAPIClient() { return useNuxtApp().$rdApi as RDAPIClient; } diff --git a/packages/rd/src/runtime/composables/index.ts b/packages/rd/src/runtime/composables/index.ts index 46bf3eac..19e45a53 100644 --- a/packages/rd/src/runtime/composables/index.ts +++ b/packages/rd/src/runtime/composables/index.ts @@ -1,4 +1,3 @@ export { - useAPIClient, useRDAPIClient, } from './api-client'; diff --git a/packages/rd/src/runtime/plugins/api.ts b/packages/rd/src/runtime/plugins/api.ts index 1b30010a..b5781a2a 100644 --- a/packages/rd/src/runtime/plugins/api.ts +++ b/packages/rd/src/runtime/plugins/api.ts @@ -1,13 +1,11 @@ +import type { APIClient } from '@dnpm-dip/core'; import { RDAPIClient } from '../core/api-client'; import { defineNuxtPlugin } from '#app'; -import { useAPIClient } from '../composables'; export default defineNuxtPlugin({ enforce: 'post', async setup(nuxt) { - const baseClient = useAPIClient(); - - const client = new RDAPIClient(baseClient); + const client = new RDAPIClient(nuxt.$api as APIClient); return { provide: {