diff --git a/framework/swell/api/operations/get-site-info.ts b/framework/swell/api/operations/get-site-info.ts index 36fcebf01..ffb0c1542 100644 --- a/framework/swell/api/operations/get-site-info.ts +++ b/framework/swell/api/operations/get-site-info.ts @@ -1,8 +1,8 @@ import getCategories from '../../utils/get-categories' import getVendors, { Brands } from '../../utils/get-vendors' import { Provider, SwellConfig } from '../' -import { OperationContext } from '@commerce/api/operations' -import { Category } from '@commerce/types/site' +import type { OperationContext } from '@commerce/api/operations' +import type { Category } from '@commerce/types/site' export type GetSiteInfoResult< T extends { categories: any[]; brands: any[] } = { diff --git a/framework/swell/common/get-site-info.ts b/framework/swell/common/get-site-info.ts deleted file mode 100644 index a6b8aa46a..000000000 --- a/framework/swell/common/get-site-info.ts +++ /dev/null @@ -1,33 +0,0 @@ -import getCategories from '../utils/get-categories' -import getVendors, { Brands } from '../utils/get-vendors' -import { Category } from '@commerce/types' -import { getConfig, SwellConfig } from '../api' - -export type GetSiteInfoResult< - T extends { categories: any[]; brands: any[] } = { - categories: Category[] - brands: Brands - } -> = T - -const getSiteInfo = async (options?: { - variables?: any - config: SwellConfig - preview?: boolean -}): Promise => { - let { config } = options ?? {} - - config = getConfig(config) - - const categoriesPromise = getCategories(config) - const brandsPromise = getVendors(config) - const categories = await categoriesPromise - const brands = await brandsPromise - - return { - categories, - brands, - } -} - -export default getSiteInfo diff --git a/tsconfig.json b/tsconfig.json index 0b71cd09b..911e7c149 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -22,8 +22,8 @@ "@components/*": ["components/*"], "@commerce": ["framework/commerce"], "@commerce/*": ["framework/commerce/*"], - "@framework": ["framework/local"], - "@framework/*": ["framework/local/*"] + "@framework": ["framework/swell"], + "@framework/*": ["framework/swell/*"] } }, "include": ["next-env.d.ts", "**/*.d.ts", "**/*.ts", "**/*.tsx", "**/*.js"], @@ -31,7 +31,6 @@ "node_modules", "./framework/bigcommerce", "./framework/shopify", - "./framework/swell", "./framework/vendure", "./framework/saleor" ]