mirror of
https://github.com/vercel/commerce.git
synced 2025-05-18 07:26:59 +00:00
Saleor was not in the providers list
This commit is contained in:
parent
a17e0f8309
commit
55f3a432b8
@ -4,7 +4,7 @@ import fetch from './fetch'
|
|||||||
import { API_URL } from '../../const'
|
import { API_URL } from '../../const'
|
||||||
import { getError } from '../../utils/handle-fetch-response'
|
import { getError } from '../../utils/handle-fetch-response'
|
||||||
import { getCommerceApi } from '..'
|
import { getCommerceApi } from '..'
|
||||||
import { getToken } from '@framework/utils'
|
import { getToken } from '../../utils/index'
|
||||||
|
|
||||||
const fetchGraphqlApi: GraphQLFetcher = async (query: string, { variables } = {}, fetchOptions) => {
|
const fetchGraphqlApi: GraphQLFetcher = async (query: string, { variables } = {}, fetchOptions) => {
|
||||||
const config = getCommerceApi().getConfig()
|
const config = getCommerceApi().getConfig()
|
||||||
|
@ -9,6 +9,7 @@ import { Layout } from '@components/common'
|
|||||||
import getSlug from '@lib/get-slug'
|
import getSlug from '@lib/get-slug'
|
||||||
import { missingLocaleInPages } from '@lib/usage-warns'
|
import { missingLocaleInPages } from '@lib/usage-warns'
|
||||||
import type { Page } from '@commerce/types/page'
|
import type { Page } from '@commerce/types/page'
|
||||||
|
import { useRouter } from 'next/router'
|
||||||
|
|
||||||
export async function getStaticProps({
|
export async function getStaticProps({
|
||||||
preview,
|
preview,
|
||||||
|
11
tsconfig.js
11
tsconfig.js
@ -1,4 +1,4 @@
|
|||||||
const PROVIDERS = ['bigcommerce', 'shopify', 'swell', 'vendure']
|
const PROVIDERS = ['bigcommerce', 'shopify', 'swell', 'vendure', 'saleor']
|
||||||
|
|
||||||
function getProviderName() {
|
function getProviderName() {
|
||||||
return (
|
return (
|
||||||
@ -14,6 +14,9 @@ function getProviderName() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const name = getProviderName()
|
const name = getProviderName()
|
||||||
|
const EXCLUDED_PROVIDERS = PROVIDERS.filter((p) => p !== name).map(
|
||||||
|
(p) => `./framework/${p}`
|
||||||
|
)
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
compilerOptions: {
|
compilerOptions: {
|
||||||
@ -47,10 +50,8 @@ module.exports = {
|
|||||||
include: ['next-env.d.ts', '**/*.d.ts', '**/*.ts', '**/*.tsx', '**/*.js'],
|
include: ['next-env.d.ts', '**/*.d.ts', '**/*.ts', '**/*.tsx', '**/*.js'],
|
||||||
exclude: [
|
exclude: [
|
||||||
'node_modules',
|
'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
|
// from TS checking
|
||||||
...(process.env.VERCEL
|
...EXCLUDED_PROVIDERS,
|
||||||
? PROVIDERS.filter((p) => p !== name).map((p) => `framework/${p}`)
|
|
||||||
: []),
|
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
@ -22,10 +22,16 @@
|
|||||||
"@components/*": ["components/*"],
|
"@components/*": ["components/*"],
|
||||||
"@commerce": ["framework/commerce"],
|
"@commerce": ["framework/commerce"],
|
||||||
"@commerce/*": ["framework/commerce/*"],
|
"@commerce/*": ["framework/commerce/*"],
|
||||||
"@framework": ["framework/local"],
|
"@framework": ["framework/shopify"],
|
||||||
"@framework/*": ["framework/local/*"]
|
"@framework/*": ["framework/shopify/*"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"include": ["next-env.d.ts", "**/*.d.ts", "**/*.ts", "**/*.tsx", "**/*.js"],
|
"include": ["next-env.d.ts", "**/*.d.ts", "**/*.ts", "**/*.tsx", "**/*.js"],
|
||||||
"exclude": ["node_modules"]
|
"exclude": [
|
||||||
|
"node_modules",
|
||||||
|
"./framework/bigcommerce",
|
||||||
|
"./framework/swell",
|
||||||
|
"./framework/vendure",
|
||||||
|
"./framework/saleor"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user