-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Commerce Layer Provider #517
Conversation
@BolajiAyodeji is attempting to deploy a commit to the Vercel Solutions Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
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 :)
components/auth/LoginView.tsx
Outdated
@@ -1,6 +1,6 @@ | |||
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' |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
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. |
You can check now @goncy, thanks. |
@@ -0,0 +1,36 @@ | |||
import type { CheckoutEndpoint } from '.' | |||
import getCredentials from '@framework/api/utils/getCredentials' |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
I'm not sure what file that is. Where did you encounter that error, please? |
No |
Okay, I have fixed that. |
There was a problem hiding this comment.
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.
framework/commercelayer/index.tsx
Outdated
import { CommercelayerProvider } from './provider' | ||
import { | ||
CommerceConfig, | ||
CommerceProvider as CoreCommerceProvider, |
There was a problem hiding this comment.
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
Alright, I'll fix that. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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! |
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:
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!