Skip to content
This repository was archived by the owner on Oct 20, 2026. It is now read-only.

Add Commerce Layer Provider - #517

Closed
BolajiAyodeji wants to merge 66 commits into
vercel:mainfrom
BolajiAyodeji:commercelayer-provider
Closed

BolajiAyodeji wants to merge 66 commits into
vercel:mainfrom
BolajiAyodeji:commercelayer-provider

Conversation

@BolajiAyodeji

@BolajiAyodeji BolajiAyodeji commented Oct 1, 2021 •

Copy link
Copy Markdown

This PR adds Commerce Layer to the list of supported providers with the required hooks. This is a work in progress and is almost ready for production. Here's a brief summary of what we have currently and WIP features:

  • API Endpoint - Checkout
  • API Operations - Get all pages
  • API Operations - Get all products path
  • API Operations - Get all products
  • API Operations - Get product
  • API Operations - Get customer wishlist
  • API Operations - Get page
  • API Operations - Get product
  • Feature - Cart
  • Feature - Search
  • Feature - Wishlist
  • Feature - Customer Auth
  • Feature - External Checkout
  • Feature - Categories
  • Feature - CMS integration
  • Provider documentation

We used the local provider as the base, and we're working on completing the pending issues and features. There will be a lot of conflicts which we will fix since we forked this some months ago. So I'll be creating this PR in draft mode, do take a look and leave comments so we know if we're in the right direction; cheers!

@vercel

vercel Bot commented Oct 1, 2021

Copy link
Copy Markdown
Contributor

@BolajiAyodeji is attempting to deploy a commit to the Vercel Solutions Team on Vercel.

A member of the Team first needs to authorize it.

@vercel

vercel Bot commented Oct 1, 2021 •

Copy link
Copy Markdown
Contributor

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

commerce-local – ./site

🔍 Inspect: https://vercel.com/vercel-solutions-vtest314/commerce-local/7vzbyThMtdpCM6QbBbReKgLAYqZb
✅ Preview: https://commerce-local-git-fork-bolaji-cd7116-vercel-solutions-vtest314.vercel.app

commerce-bigcommerce – ./

🔍 Inspect: https://vercel.com/vercel-solutions-vtest314/commerce-bigcommerce/G2T6efCU1D5QeH1PiimeWpzvGsPS
✅ Preview: Failed

commerce-commercejs – ./

🔍 Inspect: https://vercel.com/vercel-solutions-vtest314/commerce-commercejs/8sphdKo7nZsfViCwiR56TujcjQB8
✅ Preview: Failed

commerce-kibocommerce – ./

🔍 Inspect: https://vercel.com/vercel-solutions-vtest314/commerce-kibocommerce/BQqPYY4a3CU9TcrBeNvZMvz6j91b
✅ Preview: Failed

commerce-ordercloud – ./

🔍 Inspect: https://vercel.com/vercel-solutions-vtest314/commerce-ordercloud/Aec5LTEBr8uk24fKC36dx3SoNcqt
✅ Preview: Failed

commerce-saleor – ./

🔍 Inspect: https://vercel.com/vercel-solutions-vtest314/commerce-saleor/8sdT1St9K6q7xBrtjA7kHojJy1dm
✅ Preview: Failed

commerce-shopify – ./

🔍 Inspect: https://vercel.com/vercel-solutions-vtest314/commerce-shopify/9CAgDeYJDRHddB3aFHL4FMVEq9HF
✅ Preview: Failed

commerce-spree – ./

🔍 Inspect: https://vercel.com/vercel-solutions-vtest314/commerce-spree/exGq2yxNxc2hSyYeMp4Q5tTpAnX9
✅ Preview: Failed

commerce-swell – ./

🔍 Inspect: https://vercel.com/vercel-solutions-vtest314/commerce-swell/64RWPMnDwDunTohV3PDsrN3s8gyT
✅ Preview: Failed

commerce-vendure – ./

🔍 Inspect: https://vercel.com/vercel-solutions-vtest314/commerce-vendure/VT2cityobLc1tseibNARaP8FsDU5
✅ Preview: Failed

@vercel
vercel Bot temporarily deployed to Preview – commerce-local October 1, 2021 20:06 Inactive
@vercel
vercel Bot temporarily deployed to Preview – commerce-local October 12, 2021 14:33 Inactive
@vercel
vercel Bot temporarily deployed to Preview – commerce-local October 13, 2021 10:03 Inactive
@vercel
vercel Bot temporarily deployed to Preview – commerce-local October 14, 2021 16:28 Inactive
@vercel
vercel Bot temporarily deployed to Preview – commerce-local October 14, 2021 16:42 Inactive
@vercel
vercel Bot temporarily deployed to Preview – commerce-local October 15, 2021 09:25 Inactive

@goncy goncy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can first focus on remove the code from the core and we can iterate over the rest later :)

Comment thread .env.template Resolved
Comment thread components/auth/LoginView.tsx Outdated
import { FC, useEffect, useState, useCallback } from 'react'
import { Logo, Button, Input } from '@components/ui'
import useLogin from '@framework/auth/use-login'
import useLogin from '@commerce/auth/use-login'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No code should be added outside the provider, if something is missing on the core we can discuss it in an external PR. Also @framework reffers to the hook from the provider, where you can extend the one from @commerce

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, we'll submit a separate PR for the changes outside the provider, discuss the changes, and remove the changes from this PR.

@vercel
vercel Bot temporarily deployed to Preview – commerce-local November 23, 2021 18:19 Inactive
@vercel
vercel Bot temporarily deployed to Preview – commerce-local December 17, 2021 19:49 Inactive
@vercel
vercel Bot temporarily deployed to Preview – commerce-local December 20, 2021 05:07 Inactive
@vercel
vercel Bot temporarily deployed to Preview – commerce-local December 20, 2021 11:10 Inactive
@goncy

goncy commented Dec 20, 2021

Copy link
Copy Markdown
Contributor

Hey @BolajiAyodeji and @acasazza thanks for updating the provider! Can you please merge with main to resolve the conflicts? Thanks!

@BolajiAyodeji

Copy link
Copy Markdown
Author

Hey @BolajiAyodeji and @acasazza thanks for updating the provider! Can you please merge with main to resolve the conflicts? Thanks!

Sure, I'll do that shortly.

@BolajiAyodeji
BolajiAyodeji marked this pull request as ready for review December 20, 2021 19:26
@vercel
vercel Bot temporarily deployed to Preview – commerce-local December 20, 2021 19:38 Inactive
@vercel
vercel Bot temporarily deployed to Preview – commerce-local December 20, 2021 21:05 Inactive
@vercel
vercel Bot temporarily deployed to Preview – commerce-local December 20, 2021 21:13 Inactive
@BolajiAyodeji

Copy link
Copy Markdown
Author

You can check now @goncy, thanks.

@vercel
vercel Bot temporarily deployed to Preview – commerce-local December 21, 2021 09:56 Inactive
@@ -0,0 +1,36 @@
import type { CheckoutEndpoint } from '.'
import getCredentials from '@framework/api/utils/getCredentials'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You shouldn't import from framework inside the provider, just relative, otherwise it may break other providers

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, I'll fix that.

@goncy goncy left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change import from '@framework' to relative imports

Also looks like some file is missing
image

@vercel
vercel Bot temporarily deployed to Preview – commerce-local December 21, 2021 18:39 Inactive
@BolajiAyodeji

Copy link
Copy Markdown
Author

Change import from '@framework' to relative imports

I'm not sure what file that is. Where did you encounter that error, please?

@goncy

goncy commented Dec 22, 2021

Copy link
Copy Markdown
Contributor

Change import from '@framework' to relative imports

I'm not sure what file that is. Where did you encounter that error, please?

No @framework imports should be present inside commercelayer folder.

@vercel
vercel Bot temporarily deployed to Preview – commerce-local December 22, 2021 14:31 Inactive
@BolajiAyodeji

Copy link
Copy Markdown
Author

Change import from '@framework' to relative imports

I'm not sure what file that is. Where did you encounter that error, please?

No @framework imports should be present inside commercelayer folder.

Okay, I have fixed that.

@goncy goncy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some required files are missing, like checkout/use-checkout.tsx, customer/address/use-add-item and customer/use-add-item, you can get the empty files from other provider like bigcommerce.

Comment thread framework/commercelayer/index.tsx Outdated
import { CommercelayerProvider } from './provider'
import {
CommerceConfig,
CommerceProvider as CoreCommerceProvider,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CommerceProvider doesn't exist in @commerce, you want to import CoreCommerceProvider directly. Also it doesn't receive a config prop as passed below

@BolajiAyodeji

Copy link
Copy Markdown
Author

Some required files are missing, like checkout/use-checkout.tsx, customer/address/use-add-item and customer/use-add-item, you can get the empty files from other provider like bigcommerce.

Alright, I'll fix that.

@vercel
vercel Bot temporarily deployed to Preview – commerce-local February 28, 2022 15:18 Inactive
@vercel
vercel Bot temporarily deployed to Preview – commerce-local March 1, 2022 07:24 Inactive
@vercel

vercel Bot commented May 10, 2022 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
commerce-local ❌ Failed (Inspect) May 13, 2022 at 4:26PM (UTC)

@vercel
vercel Bot temporarily deployed to Preview – commerce-local May 10, 2022 16:58 Inactive
@vercel
vercel Bot temporarily deployed to Preview – commerce-local May 13, 2022 06:49 Inactive
@vercel
vercel Bot temporarily deployed to Preview – commerce-local May 13, 2022 07:23 Inactive
@vercel
vercel Bot temporarily deployed to Preview – commerce-local May 13, 2022 07:35 Inactive
@vercel
vercel Bot temporarily deployed to Preview – commerce-local May 13, 2022 08:55 Inactive
@vercel
vercel Bot temporarily deployed to Preview – commerce-local May 13, 2022 09:12 Inactive
@vercel
vercel Bot temporarily deployed to Preview – commerce-local May 13, 2022 16:18 Inactive
@BolajiAyodeji

Copy link
Copy Markdown
Author

Hi @goncy and @okbel, this PR is ready for another review now. Basically we have added the content as an external resource as discussed and updated our package and documentation accordingly. Please take a look and let us know the next steps. Thank you and have a great weekend!

@vercel
vercel Bot temporarily deployed to Preview – commerce-local May 13, 2022 16:26 Inactive
@BolajiAyodeji
BolajiAyodeji requested a review from goncy May 23, 2022 12:04
@okbel
okbel requested a review from GuiBibeau June 7, 2022 13:53
@leerob

leerob commented Apr 18, 2023

Copy link
Copy Markdown
Contributor

Hey there! Thank you for your contribution. We have decided to take Next.js Commerce in a new direction and will be closing out current PRs and issues due to this change. Please see this PR for more details: #966

Would love to see a Commerce LAyer version of v2!

@leerob leerob closed this Apr 18, 2023

This branch was previously deployed

10 inactive (9 outdated) deployments
Preview – commerce-local — 67f7a544 Deployed May 13, 2022 by vercel[bot]
Preview – commerce-vendure — 9f3a033c Deployed Jan 5, 2022 by vercel[bot]
Preview – commerce-swell — 9f3a033c Deployed Jan 5, 2022 by vercel[bot]
Preview – commerce-spree — 9f3a033c Deployed Jan 5, 2022 by vercel[bot]
Preview – commerce-shopify — 9f3a033c Deployed Jan 5, 2022 by vercel[bot]
Preview – commerce-saleor — 9f3a033c Deployed Jan 5, 2022 by vercel[bot]
Preview – commerce-ordercloud — 9f3a033c Deployed Jan 5, 2022 by vercel[bot]
Preview – commerce-kibocommerce — 9f3a033c Deployed Jan 5, 2022 by vercel[bot]
Preview – commerce-commercejs — 9f3a033c Deployed Jan 5, 2022 by vercel[bot]
Preview – commerce-bigcommerce — 9f3a033c Deployed Jan 5, 2022 by vercel[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants