diff --git a/framework/saleor/api/utils/fetch-graphql-api.ts b/framework/saleor/api/utils/fetch-graphql-api.ts index 71199d661..3145409ad 100644 --- a/framework/saleor/api/utils/fetch-graphql-api.ts +++ b/framework/saleor/api/utils/fetch-graphql-api.ts @@ -4,7 +4,7 @@ import fetch from './fetch' import { API_URL } from '../../const' import { getError } from '../../utils/handle-fetch-response' import { getCommerceApi } from '..' -import { getToken } from '@framework/utils' +import { getToken } from '../../utils/index' const fetchGraphqlApi: GraphQLFetcher = async (query: string, { variables } = {}, fetchOptions) => { const config = getCommerceApi().getConfig() diff --git a/pages/[...pages].tsx b/pages/[...pages].tsx index 32675d1db..a8a24b3aa 100644 --- a/pages/[...pages].tsx +++ b/pages/[...pages].tsx @@ -9,6 +9,7 @@ import { Layout } from '@components/common' import getSlug from '@lib/get-slug' import { missingLocaleInPages } from '@lib/usage-warns' import type { Page } from '@commerce/types/page' +import { useRouter } from 'next/router' export async function getStaticProps({ preview, diff --git a/tsconfig.js b/tsconfig.js index 213a5ef72..3dfc7fc25 100644 --- a/tsconfig.js +++ b/tsconfig.js @@ -1,4 +1,4 @@ -const PROVIDERS = ['bigcommerce', 'shopify', 'swell', 'vendure'] +const PROVIDERS = ['bigcommerce', 'shopify', 'swell', 'vendure', 'saleor'] function getProviderName() { return ( @@ -14,6 +14,9 @@ function getProviderName() { } const name = getProviderName() +const EXCLUDED_PROVIDERS = PROVIDERS.filter((p) => p !== name).map( + (p) => `./framework/${p}` +) module.exports = { compilerOptions: { @@ -47,10 +50,8 @@ module.exports = { include: ['next-env.d.ts', '**/*.d.ts', '**/*.ts', '**/*.tsx', '**/*.js'], exclude: [ 'node_modules', - // When running for production it may be useful to exclude the other providers + // It may be useful to exclude the other providers // from TS checking - ...(process.env.VERCEL - ? PROVIDERS.filter((p) => p !== name).map((p) => `framework/${p}`) - : []), + ...EXCLUDED_PROVIDERS, ], } diff --git a/tsconfig.json b/tsconfig.json index cefaa0305..f0ce21a3d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -22,10 +22,16 @@ "@components/*": ["components/*"], "@commerce": ["framework/commerce"], "@commerce/*": ["framework/commerce/*"], - "@framework": ["framework/local"], - "@framework/*": ["framework/local/*"] + "@framework": ["framework/shopify"], + "@framework/*": ["framework/shopify/*"] } }, "include": ["next-env.d.ts", "**/*.d.ts", "**/*.ts", "**/*.tsx", "**/*.js"], - "exclude": ["node_modules"] + "exclude": [ + "node_modules", + "./framework/bigcommerce", + "./framework/swell", + "./framework/vendure", + "./framework/saleor" + ] }