diff --git a/.changeset/large-bottles-own.md b/.changeset/large-bottles-own.md new file mode 100644 index 0000000..2e39832 --- /dev/null +++ b/.changeset/large-bottles-own.md @@ -0,0 +1,6 @@ +--- +"@fessional/razor-common": patch +"@fessional/razor-mobile": patch +--- + +🏷️ global import common types #56 diff --git a/layers/common/nuxt.config.ts b/layers/common/nuxt.config.ts index 1874624..d19d3e9 100644 --- a/layers/common/nuxt.config.ts +++ b/layers/common/nuxt.config.ts @@ -22,8 +22,5 @@ export default defineNuxtConfig({ }, typescript: { typeCheck: true, - tsConfig: { - include: ['./types/*'], - }, }, }); diff --git a/layers/common/package.json b/layers/common/package.json index e48415e..305aa56 100644 --- a/layers/common/package.json +++ b/layers/common/package.json @@ -36,4 +36,4 @@ "@vueuse/nuxt": "catalog:common", "vue": "catalog:common" } -} +} \ No newline at end of file diff --git a/layers/common/test/typed-fetching.test.ts b/layers/common/test/typed-fetching.test.ts index bd72d00..d306d9c 100644 --- a/layers/common/test/typed-fetching.test.ts +++ b/layers/common/test/typed-fetching.test.ts @@ -1,6 +1,5 @@ import { describe, it, expect, vi } from 'vitest'; import { fetchingData, fetchingDataAsync } from '../utils/typed-fetching'; -import type { DataResult } from '../types/common'; describe('fetchingData', () => { it('should call loading with true and false', () => { diff --git a/layers/common/types/common.d.ts b/layers/common/types/common.global.d.ts similarity index 66% rename from layers/common/types/common.d.ts rename to layers/common/types/common.global.d.ts index 97c2d69..98b41ba 100644 --- a/layers/common/types/common.d.ts +++ b/layers/common/types/common.global.d.ts @@ -1,4 +1,4 @@ -export interface DataResult { +interface DataResult { success: boolean; data?: T; message?: string; diff --git a/layers/common/utils/typed-fetching.ts b/layers/common/utils/typed-fetching.ts index d09d3ae..f8a6122 100644 --- a/layers/common/utils/typed-fetching.ts +++ b/layers/common/utils/typed-fetching.ts @@ -1,6 +1,4 @@ -import type { DataResult } from '../types/common'; - -export type TypedFetchingOptions = { +export type TypedFetchingOptions = { /** * @param status - true if loading, false if done */ diff --git a/layers/mobile/test/ionic-fetching.test.ts b/layers/mobile/test/ionic-fetching.test.ts index d3e5309..f57ecc2 100644 --- a/layers/mobile/test/ionic-fetching.test.ts +++ b/layers/mobile/test/ionic-fetching.test.ts @@ -1,7 +1,6 @@ import { describe, it, expect, vi, beforeEach } from 'vitest'; import { loadingController, alertController } from '@ionic/vue'; import { ionicFetchingDataAsync } from '../utils/ionic-fetching'; -import type { DataResult } from '~razor-common/types/common'; // Mocking Ionic controllers vi.mock('@ionic/vue', () => ({ diff --git a/layers/mobile/utils/ionic-fetching.ts b/layers/mobile/utils/ionic-fetching.ts index 8ed53cd..e046176 100644 --- a/layers/mobile/utils/ionic-fetching.ts +++ b/layers/mobile/utils/ionic-fetching.ts @@ -1,5 +1,4 @@ import { loadingController, alertController } from '@ionic/vue'; -import type { DataResult } from '~razor-common/types/common'; import { fetchingResultAsync } from '~razor-common/utils/typed-fetching'; function _failure(message?: string, code?: string) {