From 9458dc87b7285927a62bd435d63a6f0aeb270a30 Mon Sep 17 00:00:00 2001 From: okbel Date: Thu, 25 Feb 2021 19:27:59 -0300 Subject: [PATCH 1/6] Adding extra config --- commerce.config.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/commerce.config.json b/commerce.config.json index 1c14a53f5..fa2ea9a44 100644 --- a/commerce.config.json +++ b/commerce.config.json @@ -1,6 +1,3 @@ { - "provider": "bigcommerce", - "features": { - "wishlist": false - } + "provider": "bigcommerce" } From c87d02a7cdbfa380836fc2212d189b1187348828 Mon Sep 17 00:00:00 2001 From: Bel Curcio Date: Tue, 2 Mar 2021 11:20:24 -0300 Subject: [PATCH 2/6] Now colors work with lighter colors --- lib/colors.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/colors.ts b/lib/colors.ts index f9c0b5b0b..139cda23d 100644 --- a/lib/colors.ts +++ b/lib/colors.ts @@ -194,6 +194,7 @@ const colorMap: Record = { } export function isDark(color: string = ''): boolean { + color = color.toLowerCase() // Equation from http://24ways.org/2010/calculating-color-contrast let rgb = colorMap[color] ? hexToRgb(colorMap[color]) : hexToRgb(color) const res = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000 From 02e15ae4815c1e8538404a413edb679c15eb934f Mon Sep 17 00:00:00 2001 From: Bel Curcio Date: Tue, 2 Mar 2021 11:24:00 -0300 Subject: [PATCH 3/6] Stable commerce.config.json --- commerce.config.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/commerce.config.json b/commerce.config.json index 01d7fa69e..bef7db222 100644 --- a/commerce.config.json +++ b/commerce.config.json @@ -1,3 +1,7 @@ { - "provider": "shopify" + "provider": "bigcommerce", + "features": { + "wishlist": true, + "customCheckout": false + } } From 8337fa1815d904097a0ee28f550a406266aa106c Mon Sep 17 00:00:00 2001 From: Bel Curcio Date: Wed, 3 Mar 2021 08:24:44 -0300 Subject: [PATCH 4/6] Readme changes --- README.md | 56 ++++++++++++++++++++++--------------------------------- 1 file changed, 22 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index cc181b411..885c95e85 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,8 @@ Start right now at [nextjs.org/commerce](https://nextjs.org/commerce) Demo live at: [demo.vercel.store](https://demo.vercel.store/) -This project is currently under development. +- Shopify Demo: https://shopify.demo.vercel.store/ +- BigCommerce Demo: https://bigcommerce.demo.vercel.store/ ## Features @@ -21,34 +22,22 @@ This project is currently under development. - Integrations - Integrate seamlessly with the most common ecommerce platforms. - Dark Mode Support -## Work in progress - -We're using Github Projects to keep track of issues in progress and todo's. Here is our [Board](https://github.com/vercel/commerce/projects/1) - ## Integrations Next.js Commerce integrates out-of-the-box with BigCommerce and Shopify. We plan to support all major ecommerce backends. -## Goals +## Considerations -- **Next.js Commerce** should have a completely data **agnostic** UI -- **Aware of schema**: should ship with the right data schemas and types. -- All providers should return the right data types and schemas to blend correctly with Next.js Commerce. -- `@framework` will be the alias utilized in commerce and it will map to the ecommerce provider of preference- e.g BigCommerce, Shopify, Swell. All providers should expose the same standardized functions. _Note that the same applies for recipes using a CMS + an ecommerce provider._ +- `framework/commerce` contains all types, helpers and functions to be used as base to build a new **provider**. +- **Providers** live under `framework`'s root folder and they will extend Next.js Commerce types and functionality. +- **Features API** is to ensure feature parity between the UI and the Provider. The UI should update accordingly and no extra code should be bundled. All extra configuration for features will live under `features` in `commerce.config.json` and if needed it can also be accessed programatically. +- Each **provider** should add its corresponding `next.config.js` and `commerce.config.json` adding specific data related to the provider. For example in case of BigCommerce, the images CDN and additional API routes. +- **Providers don't depend on anything that's specific to the application they're used in**. They only depend on `framework/commerce`, on their own framework folder and on some dependencies included in `package.json` +- We recommend that each **provider** ships with an `env.template` file and a `[readme.md](http://readme.md)` file. -There is a `framework` folder in the root folder that will contain multiple ecommerce providers. +## Provider Structure -Additionally, we need to ensure feature parity (not all providers have e.g. wishlist) so we also have a feature API to disable/enable features in the UI. - -People actively working on this project: @okbel & @lfades. - -## Framework - -Framework is where the data comes from. It contains mostly hook handlers and functions. - -## Structure - -Main folder and its exposed functions +Next.js Commerce provides a set of utilities and functions to create new providers. This is how a provider structure looks like. - `product` - usePrice @@ -68,22 +57,15 @@ Main folder and its exposed functions - getCustomerId - getCustomerWistlist - `cart` - - useCart - useAddItem - useRemoveItem - useUpdateItem - -- `config.json` -- README.md - -#### Example of correct usage of the Commerce Framework - -```js -import { useUI } from '@components/ui' -import { useCustomer } from '@framework/customer' -import { useWishlist, useAddItem, useRemoveItem } from '@framework/wishlist' -``` +- `env.template` +- `provider.ts` +- `commerce.config.json` +- `next.config.js` +- `README.md` ## Configuration @@ -136,6 +118,12 @@ We'd recommend to duplicate a provider folder and push your providers SDK. If you succeeded building a provider, submit a PR so we can all enjoy it. +## Work in progress + +We're using Github Projects to keep track of issues in progress and todo's. Here is our [Board](https://github.com/vercel/commerce/projects/1) + +People actively working on this project: @okbel & @lfades. + ## Contribute Our commitment to Open Source can be found [here](https://vercel.com/oss). From 3682e64cfde053bf5491a38b2e72ddf3a7bb40f3 Mon Sep 17 00:00:00 2001 From: Bel Curcio Date: Wed, 3 Mar 2021 08:32:58 -0300 Subject: [PATCH 5/6] Default to bigcommerce --- framework/commerce/with-config.js | 1 + tsconfig.json | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/framework/commerce/with-config.js b/framework/commerce/with-config.js index da6705cef..1eb1acc19 100644 --- a/framework/commerce/with-config.js +++ b/framework/commerce/with-config.js @@ -7,6 +7,7 @@ const merge = require('deepmerge') const PROVIDERS = ['bigcommerce', 'shopify'] function getProviderName() { + // TODO: OSOT. return process.env.BIGCOMMERCE_STOREFRONT_API_URL ? 'bigcommerce' : null } 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"], From 09500d4edc83b1fe2047d7568453ca9993f52a2d Mon Sep 17 00:00:00 2001 From: okbel Date: Wed, 3 Mar 2021 12:05:12 -0300 Subject: [PATCH 6/6] og config --- config/seo.json | 14 ++++++++++++-- public/card.png | Bin 0 -> 6286 bytes 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 public/card.png diff --git a/config/seo.json b/config/seo.json index 0d0c3d37d..82520cf9b 100644 --- a/config/seo.json +++ b/config/seo.json @@ -1,12 +1,22 @@ { "title": "ACME Storefront | Powered by Next.js Commerce", "titleTemplate": "%s - ACME Storefront", - "description": "Next.js Commerce -> https://www.nextjs.org/commerce", + "description": "Next.js Commerce - https://www.nextjs.org/commerce", "openGraph": { + "title": "ACME Storefront | Powered by Next.js Commerce", + "description": "Next.js Commerce - https://www.nextjs.org/commerce", "type": "website", "locale": "en_IE", "url": "https://nextjs.org/commerce", - "site_name": "Next.js Commerce" + "site_name": "Next.js Commerce", + "images": [ + { + "url": "/card.png", + "width": 800, + "height": 600, + "alt": "Next.js Commerce" + } + ] }, "twitter": { "handle": "@nextjs", diff --git a/public/card.png b/public/card.png new file mode 100644 index 0000000000000000000000000000000000000000..40fcf42d109045944da9f2ac1583fac6c379ff75 GIT binary patch literal 6286 zcmeI1`#%%<|G<}2M~ZGIA#{#Yx^1E)#JZAuA!>^e(hSR;&4xOqj*#Sj>$o0iZrPU0 zjC|x4V`Cd*qugd@r|e>8^Krg^!uN;o_m}g-`}KajU+-Vuuh;u^c|P9n7dM@3cJI{M z2><|g+upe50strl0RUSr{j_~kvt|Dg(dMM`=*Hb}06=yBKVu6Zui(%>d*LoNR{%AG zhq;>z<$%kMmjQtKG}U#VZ2-U_ecNl7-D0-zCuNy4)|1<(&L?do{`68M0jiX+|ICF% zyiS6laze)z<}*N+Jpg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