From 121ec4b61f9e778d7905de4b7059ecbf38febbad Mon Sep 17 00:00:00 2001 From: Luis Alvarez Date: Thu, 25 Feb 2021 16:39:01 -0500 Subject: [PATCH] Updated the commerce config structure --- commerce.config.json | 6 ++++++ .../bigcommerce/{config.json => commerce.config.json} | 1 + framework/bigcommerce/next.config.js | 7 ++----- framework/shopify/{config.json => commerce.config.json} | 1 + framework/shopify/next.config.js | 7 ++----- next.config.js | 4 +++- tsconfig.json | 4 ++-- 7 files changed, 17 insertions(+), 13 deletions(-) create mode 100644 commerce.config.json rename framework/bigcommerce/{config.json => commerce.config.json} (60%) rename framework/shopify/{config.json => commerce.config.json} (64%) diff --git a/commerce.config.json b/commerce.config.json new file mode 100644 index 000000000..1c14a53f5 --- /dev/null +++ b/commerce.config.json @@ -0,0 +1,6 @@ +{ + "provider": "bigcommerce", + "features": { + "wishlist": false + } +} diff --git a/framework/bigcommerce/config.json b/framework/bigcommerce/commerce.config.json similarity index 60% rename from framework/bigcommerce/config.json rename to framework/bigcommerce/commerce.config.json index a0e7afc5d..3a8738f47 100644 --- a/framework/bigcommerce/config.json +++ b/framework/bigcommerce/commerce.config.json @@ -1,4 +1,5 @@ { + "provider": "bigcommerce", "features": { "wishlist": true } diff --git a/framework/bigcommerce/next.config.js b/framework/bigcommerce/next.config.js index 5703f2343..f33b16630 100644 --- a/framework/bigcommerce/next.config.js +++ b/framework/bigcommerce/next.config.js @@ -1,10 +1,7 @@ -const providerConfig = require('./config.json') +const commerce = require('./commerce.config.json') module.exports = { - commerce: { - provider: 'bigcommerce', - ...providerConfig, - }, + commerce, images: { domains: ['cdn11.bigcommerce.com'], }, diff --git a/framework/shopify/config.json b/framework/shopify/commerce.config.json similarity index 64% rename from framework/shopify/config.json rename to framework/shopify/commerce.config.json index 17ef37e25..b30ab39d9 100644 --- a/framework/shopify/config.json +++ b/framework/shopify/commerce.config.json @@ -1,4 +1,5 @@ { + "provider": "shopify", "features": { "wishlist": false } diff --git a/framework/shopify/next.config.js b/framework/shopify/next.config.js index 0f9bc31ff..e9d48c02c 100644 --- a/framework/shopify/next.config.js +++ b/framework/shopify/next.config.js @@ -1,10 +1,7 @@ -const providerConfig = require('./config.json') +const commerce = require('./commerce.config.json') module.exports = { - commerce: { - provider: 'shopify', - ...providerConfig, - }, + commerce, images: { domains: ['cdn.shopify.com'], }, diff --git a/next.config.js b/next.config.js index 742a0690e..046ba2aa1 100644 --- a/next.config.js +++ b/next.config.js @@ -1,6 +1,6 @@ +const commerce = require('./commerce.config.json') const withCommerceConfig = require('./framework/commerce/with-config') -const commerce = { provider: 'shopify' } const isBC = commerce.provider === 'bigcommerce' const isShopify = commerce.provider === 'shopify' @@ -39,3 +39,5 @@ module.exports = withCommerceConfig({ ].filter((x) => x) }, }) + +console.log('configs', module.exports) diff --git a/tsconfig.json b/tsconfig.json index e20f37099..9e712fb18 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -22,8 +22,8 @@ "@components/*": ["components/*"], "@commerce": ["framework/commerce"], "@commerce/*": ["framework/commerce/*"], - "@framework": ["framework/shopify"], - "@framework/*": ["framework/shopify/*"] + "@framework": ["framework/bigcommerce"], + "@framework/*": ["framework/bigcommerce/*"] } }, "include": ["next-env.d.ts", "**/*.d.ts", "**/*.ts", "**/*.tsx", "**/*.js"],