Skip to content
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

Chore/update medusa sdk #50

Merged

Conversation

dimitrio-m
Copy link
Contributor

@dimitrio-m dimitrio-m commented Oct 30, 2024

Hello, I updated the module to use the new Javascript SDK. The new SDK docs are a bit challenging, so I had to verify in the code a lot of the functionality and the API. Please be aware of this and test the changes yourself too and let me know if I should modify something or maybe add more tests in the playground.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)

Description

This change is required due to the launch for Medusa 2.0. The new version also ships with a new Javascript SDK that replaces @medusa/medusajs.

The playground now works with a local instance of Medusa.

Please verify the module typing, I had some Typescript erros on the composable and server files so I made a cast in lines 10 and 15.

Resolves: #49

Checklist:

  • I have updated the documentation accordingly.
  • I have added tests to cover my changes (if the playground counts as a test)

Copy link

vercel bot commented Oct 30, 2024

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

Name Status Preview Comments Updated (UTC)
nuxt-medusa ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 30, 2024 8:53pm

@dimitrio-m
Copy link
Contributor Author

I just noticed that are still some references to the old syntax in the docs. I will fix them later.

@Baroshem
Copy link
Collaborator

Baroshem commented Nov 4, 2024

Hey Buddy,

Thanks for this amazing work! I will test it later this week and release a new major version :)

@dimitrio-m
Copy link
Contributor Author

Hey Jakub!

I'm glad to help. I imported the module locally in a project and it worked great.

We should check that the config options types are ok since I did a cast there, and also do the versioning and maybe bump some packages.

Feel free to let me know if there is something else to do. 😃

@docloulou
Copy link

docloulou commented Nov 7, 2024

hello,
in my project i have this warning message on each files on dev and build.
Wondering if its my TSconfig or something like that. but PR works great

.................

 WARN  node_modules/nuxt-medusa/node_modules/@medusajs/js-sdk/dist/esm/admin/workflow-execution.js (1:17): The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten                                                                                                                                                              10:10:10 AM


 WARN  node_modules/nuxt-medusa/node_modules/@medusajs/js-sdk/dist/esm/admin/workflow-execution.js (1:25): The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten                                                                                                                                                              10:10:10 AM


 WARN  node_modules/nuxt-medusa/node_modules/@medusajs/js-sdk/dist/esm/admin/upload.js (1:17): The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten                                                                                                                                                                          10:10:10 AM


 WARN  node_modules/nuxt-medusa/node_modules/@medusajs/js-sdk/dist/esm/admin/upload.js (1:25): The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten    
............

@@ -2,10 +2,7 @@ import { serverMedusaClient } from '#medusa/server'

export default eventHandler(async (event) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

question: Is this change intentional? Can we maybe have instead a new playground example of regions fetch instead of replacing the one that will fetch customer on the server side? :)

@Baroshem
Copy link
Collaborator

Baroshem commented Nov 8, 2024

Amazing job @dimitrio-m .I have left one comment and apart from that it looks good! The casting is ok :)

After the comment, I will proceed with releasing a new version soon.

@Baroshem
Copy link
Collaborator

Bump @dimitrio-m :)

@Hybes
Copy link

Hybes commented Nov 19, 2024

Hi @Baroshem, are we waiting on action with this still? Do you know when this may be available to the General Public through the module?

@Baroshem
Copy link
Collaborator

I was waiting for response from @dimitrio-m but I can also just do it myself and release it this week.

Stay tuned :)

@Baroshem Baroshem changed the base branch from main to chore/1.0.0-rc.1 November 20, 2024 07:30
@Baroshem Baroshem merged commit 5a9815b into nuxt-modules:chore/1.0.0-rc.1 Nov 20, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Does this module work with Medusa 2.0
4 participants