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 modules providers configuration with 'identifier' and 'PROVIDER' #9636

Merged
merged 10 commits into from
Oct 18, 2024

Conversation

adrien2p
Copy link
Member

@adrien2p adrien2p commented Oct 17, 2024

What

  • standardize provider identifier static property. Now all providers must have a static property identifier which will be used to register the provider into the module container.
  • The id in the providers configuration can still be provided in the defineConfig if some provider can have multiple instances (e.g stripe per region)
  • All provider id have been fixed in all modules to be properly generated (e.g pp_stripe_the-given-id or pp_stripe instead of pp_stripe_ or pp_stripe_undefined

Breaking changes

  • The provide id in region_provider_id might be broken after the provider are reloaded since their id have been fixed. You might need to update those manually or regenerate those link
  • The auth module providers have been also aligned to the convention of having identifier and eventually an id and their generated id will following the same convention

Copy link

vercel bot commented Oct 17, 2024

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

Name Status Preview Comments Updated (UTC)
api-reference 🔄 Building (Inspect) Visit Preview 💬 Add feedback Oct 18, 2024 0:12am
medusa-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 18, 2024 0:12am
5 Skipped Deployments
Name Status Preview Comments Updated (UTC)
api-reference-v2 ⬜️ Ignored (Inspect) Visit Preview Oct 18, 2024 0:12am
docs-ui ⬜️ Ignored (Inspect) Visit Preview Oct 18, 2024 0:12am
docs-v2 ⬜️ Ignored (Inspect) Visit Preview Oct 18, 2024 0:12am
medusa-docs ⬜️ Ignored (Inspect) Visit Preview Oct 18, 2024 0:12am
resources-docs ⬜️ Ignored (Inspect) Visit Preview Oct 18, 2024 0:12am

Copy link

changeset-bot bot commented Oct 17, 2024

⚠️ No Changeset found

Latest commit: 6f2cf26

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@adrien2p
Copy link
Member Author

cc @sradevski @christiananese you might need to take a look at this one, we can discuss if you need any help for the changes

Copy link
Member

@sradevski sradevski left a comment

Choose a reason for hiding this comment

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

LGTM. This shouldn't affect us I believe, we don't have any custom providers implemented for now.

@adrien2p
Copy link
Member Author

LGTM. This shouldn't affect us I believe, we don't have any custom providers implemented for now.

It affect the core providers as well, the auth providers have been aligned as well, maybe that can impact you?

Copy link
Contributor

@olivermrbl olivermrbl left a comment

Choose a reason for hiding this comment

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

wonder if we should snake_case the IDs for consistency? It will be a breaking change regardless, so thought we might as well

@olivermrbl
Copy link
Contributor

I don't think this breaks the auth domain, because the ids specified in medusa-config.js in the platform project happen to be the same as the provider IDs.

@adrien2p
Copy link
Member Author

adrien2p commented Oct 17, 2024

I don't think this breaks the auth domain, because the ids specified in medusa-config.js in the platform project happen to be the same as the provider IDs.

-- In order to normalize and be consistent, now the auth also concatenate the identifier and id which was not the case before, that can be breaking too --

nvm the above, we didn't, but I thought we did 😂

Copy link
Contributor

@olivermrbl olivermrbl left a comment

Choose a reason for hiding this comment

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

LGTM

@olivermrbl olivermrbl merged commit 876d807 into develop Oct 18, 2024
23 checks passed
@olivermrbl olivermrbl deleted the chore/fix/provider-identifier-confusion branch October 18, 2024 07:24
420coupe pushed a commit to 420coupe/medusa that referenced this pull request Oct 18, 2024
…PROVIDER' (medusajs#9636)

* chore: Update modules providers configuration with 'identifier' and 'PROVIDER'

* update check

* fix tests

* type

* normalize auth provider

* emailpass

* providers

---------

Co-authored-by: Carlos R. L. Rodrigues <[email protected]>
Co-authored-by: Carlos R. L. Rodrigues <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants