Saleor was not in the providers list

This commit is contained in:
Bel Curcio 2021-06-14 18:00:24 -03:00
parent a17e0f8309
commit 55f3a432b8
4 changed files with 17 additions and 9 deletions

View File

@ -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()

View File

@ -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,

View File

@ -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,
],
}

View File

@ -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"
]
}