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

fix: normalize path before consuming it while loading models #8194

Merged
merged 9 commits into from
Jul 21, 2024

Conversation

adrien2p
Copy link
Member

@adrien2p adrien2p commented Jul 19, 2024

What
Normalize path before consuming them while auto loading the models to build the joiner config. Makes it run on any os.

Also, now as part of the Module util usage, if no joiner config are provided, the custom one built on the fly will only include the config based on the models used in the medusa service just like we do for the linkable in order to prevent discrepency

Copy link

vercel bot commented Jul 19, 2024

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

Name Status Preview Comments Updated (UTC)
medusa-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 19, 2024 2:28pm
6 Skipped Deployments
Name Status Preview Comments Updated (UTC)
api-reference ⬜️ Ignored (Inspect) Jul 19, 2024 2:28pm
api-reference-v2 ⬜️ Ignored (Inspect) Visit Preview Jul 19, 2024 2:28pm
docs-ui ⬜️ Ignored (Inspect) Visit Preview Jul 19, 2024 2:28pm
docs-v2 ⬜️ Ignored (Inspect) Visit Preview Jul 19, 2024 2:28pm
medusa-docs ⬜️ Ignored (Inspect) Visit Preview Jul 19, 2024 2:28pm
resources-docs ⬜️ Ignored (Inspect) Visit Preview Jul 19, 2024 2:28pm

Copy link

changeset-bot bot commented Jul 19, 2024

⚠️ No Changeset found

Latest commit: c24abb7

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 @shahednasser

@adrien2p adrien2p marked this pull request as ready for review July 19, 2024 08:03
@adrien2p adrien2p requested a review from a team as a code owner July 19, 2024 08:03
@adrien2p
Copy link
Member Author

/snapshot-this

Copy link
Contributor

🚀 A snapshot release has been made for this PR

Test the snapshots by updating your package.json with the newly published versions:

yarn add @medusajs/admin-sdk@0.0.2-snapshot-20240719080828
yarn add @medusajs/admin-shared@0.0.2-snapshot-20240719080828
yarn add @medusajs/admin-vite-plugin@0.0.2-snapshot-20240719080828
yarn add @medusajs/dashboard@0.0.2-snapshot-20240719080828
yarn add create-medusa-app@1.2.9-snapshot-20240719080828
yarn add @medusajs/medusa-cli@1.3.23-snapshot-20240719080828
yarn add medusa-dev-cli@0.0.33-snapshot-20240719080828
yarn add @medusajs/medusa-oas-cli@1.0.0-snapshot-20240719080828
yarn add @medusajs/core-flows@0.0.10-snapshot-20240719080828
yarn add @medusajs/js-sdk@0.0.2-snapshot-20240719080828
yarn add medusa-test-utils@1.1.45-snapshot-20240719080828
yarn add @medusajs/modules-sdk@1.13.0-snapshot-20240719080828
yarn add @medusajs/orchestration@0.5.8-snapshot-20240719080828
yarn add @medusajs/types@1.12.0-snapshot-20240719080828
yarn add @medusajs/utils@1.12.0-snapshot-20240719080828
yarn add @medusajs/workflows-sdk@0.1.7-snapshot-20240719080828
yarn add @medusajs/icons@1.2.2-snapshot-20240719080828
yarn add @medusajs/ui@3.0.1-snapshot-20240719080828
yarn add @medusajs/ui-preset@1.1.4-snapshot-20240719080828
yarn add @medusajs/medusa@1.20.6-snapshot-20240719080828
yarn add medusa-telemetry@0.0.18-snapshot-20240719080828
yarn add @medusajs/api-key@0.1.3-snapshot-20240719080828
yarn add @medusajs/auth@0.0.4-snapshot-20240719080828
yarn add @medusajs/cache-inmemory@1.8.11-snapshot-20240719080828
yarn add @medusajs/cache-redis@1.9.2-snapshot-20240719080828
yarn add @medusajs/cart@0.0.4-snapshot-20240719080828
yarn add @medusajs/currency@0.1.3-snapshot-20240719080828
yarn add @medusajs/customer@0.0.4-snapshot-20240719080828
yarn add @medusajs/event-bus-local@1.9.9-snapshot-20240719080828
yarn add @medusajs/event-bus-redis@1.8.14-snapshot-20240719080828
yarn add @medusajs/file@0.0.2-snapshot-20240719080828
yarn add @medusajs/fulfillment@0.1.3-snapshot-20240719080828
yarn add @medusajs/inventory-next@0.0.4-snapshot-20240719080828
yarn add @medusajs/link-modules@0.2.12-snapshot-20240719080828
yarn add @medusajs/notification@0.1.3-snapshot-20240719080828
yarn add @medusajs/order@0.1.3-snapshot-20240719080828
yarn add @medusajs/payment@0.0.4-snapshot-20240719080828
yarn add @medusajs/pricing@0.1.13-snapshot-20240719080828
yarn add @medusajs/product@0.3.13-snapshot-20240719080828
yarn add @medusajs/promotion@0.0.5-snapshot-20240719080828
yarn add @medusajs/auth-emailpass@0.0.2-snapshot-20240719080828
yarn add @medusajs/auth-google@0.0.2-snapshot-20240719080828
yarn add @medusajs/file-local-next@0.0.3-snapshot-20240719080828
yarn add @medusajs/file-s3@0.0.3-snapshot-20240719080828
yarn add @medusajs/fulfillment-manual@0.0.3-snapshot-20240719080828
yarn add @medusajs/notification-local@0.0.2-snapshot-20240719080828
yarn add @medusajs/notification-sendgrid@0.0.2-snapshot-20240719080828
yarn add @medusajs/payment-stripe@0.0.3-snapshot-20240719080828
yarn add @medusajs/region@0.1.2-snapshot-20240719080828
yarn add @medusajs/sales-channel@0.1.2-snapshot-20240719080828
yarn add @medusajs/stock-location-next@0.0.4-snapshot-20240719080828
yarn add @medusajs/store@0.1.2-snapshot-20240719080828
yarn add @medusajs/tax@0.1.2-snapshot-20240719080828
yarn add @medusajs/user@0.0.4-snapshot-20240719080828
yarn add @medusajs/workflow-engine-inmemory@0.0.5-snapshot-20240719080828
yarn add @medusajs/workflow-engine-redis@0.0.5-snapshot-20240719080828

Latest commit: 78b8a3c

@adrien2p
Copy link
Member Author

adrien2p commented Jul 19, 2024

@olivermrbl wdyt if instead of loading models magically we now rely on the ones stored on the medusa service when run in the context of the Module util? It wouldn't change the magical discovery of the defineJoinerConfig when consume inside a module which can still auto discover the models. Ill wait for your response before acting on anything

@adrien2p
Copy link
Member Author

/snapshot-this

Copy link
Contributor

🚀 A snapshot release has been made for this PR

Test the snapshots by updating your package.json with the newly published versions:

yarn add @medusajs/admin-sdk@0.0.2-snapshot-20240719133408
yarn add @medusajs/admin-shared@0.0.2-snapshot-20240719133408
yarn add @medusajs/admin-vite-plugin@0.0.2-snapshot-20240719133408
yarn add @medusajs/dashboard@0.0.2-snapshot-20240719133408
yarn add create-medusa-app@1.2.9-snapshot-20240719133408
yarn add @medusajs/medusa-cli@1.3.23-snapshot-20240719133408
yarn add medusa-dev-cli@0.0.33-snapshot-20240719133408
yarn add @medusajs/medusa-oas-cli@1.0.0-snapshot-20240719133408
yarn add @medusajs/core-flows@0.0.10-snapshot-20240719133408
yarn add @medusajs/js-sdk@0.0.2-snapshot-20240719133408
yarn add medusa-test-utils@1.1.45-snapshot-20240719133408
yarn add @medusajs/modules-sdk@1.13.0-snapshot-20240719133408
yarn add @medusajs/orchestration@0.5.8-snapshot-20240719133408
yarn add @medusajs/types@1.12.0-snapshot-20240719133408
yarn add @medusajs/utils@1.12.0-snapshot-20240719133408
yarn add @medusajs/workflows-sdk@0.1.7-snapshot-20240719133408
yarn add @medusajs/icons@1.2.2-snapshot-20240719133408
yarn add @medusajs/ui@3.0.1-snapshot-20240719133408
yarn add @medusajs/ui-preset@1.1.4-snapshot-20240719133408
yarn add @medusajs/medusa@1.20.6-snapshot-20240719133408
yarn add medusa-telemetry@0.0.18-snapshot-20240719133408
yarn add @medusajs/api-key@0.1.3-snapshot-20240719133408
yarn add @medusajs/auth@0.0.4-snapshot-20240719133408
yarn add @medusajs/cache-inmemory@1.8.11-snapshot-20240719133408
yarn add @medusajs/cache-redis@1.9.2-snapshot-20240719133408
yarn add @medusajs/cart@0.0.4-snapshot-20240719133408
yarn add @medusajs/currency@0.1.3-snapshot-20240719133408
yarn add @medusajs/customer@0.0.4-snapshot-20240719133408
yarn add @medusajs/event-bus-local@1.9.9-snapshot-20240719133408
yarn add @medusajs/event-bus-redis@1.8.14-snapshot-20240719133408
yarn add @medusajs/file@0.0.2-snapshot-20240719133408
yarn add @medusajs/fulfillment@0.1.3-snapshot-20240719133408
yarn add @medusajs/inventory-next@0.0.4-snapshot-20240719133408
yarn add @medusajs/link-modules@0.2.12-snapshot-20240719133408
yarn add @medusajs/notification@0.1.3-snapshot-20240719133408
yarn add @medusajs/order@0.1.3-snapshot-20240719133408
yarn add @medusajs/payment@0.0.4-snapshot-20240719133408
yarn add @medusajs/pricing@0.1.13-snapshot-20240719133408
yarn add @medusajs/product@0.3.13-snapshot-20240719133408
yarn add @medusajs/promotion@0.0.5-snapshot-20240719133408
yarn add @medusajs/auth-emailpass@0.0.2-snapshot-20240719133408
yarn add @medusajs/auth-google@0.0.2-snapshot-20240719133408
yarn add @medusajs/file-local-next@0.0.3-snapshot-20240719133408
yarn add @medusajs/file-s3@0.0.3-snapshot-20240719133408
yarn add @medusajs/fulfillment-manual@0.0.3-snapshot-20240719133408
yarn add @medusajs/notification-local@0.0.2-snapshot-20240719133408
yarn add @medusajs/notification-sendgrid@0.0.2-snapshot-20240719133408
yarn add @medusajs/payment-stripe@0.0.3-snapshot-20240719133408
yarn add @medusajs/region@0.1.2-snapshot-20240719133408
yarn add @medusajs/sales-channel@0.1.2-snapshot-20240719133408
yarn add @medusajs/stock-location-next@0.0.4-snapshot-20240719133408
yarn add @medusajs/store@0.1.2-snapshot-20240719133408
yarn add @medusajs/tax@0.1.2-snapshot-20240719133408
yarn add @medusajs/user@0.0.4-snapshot-20240719133408
yarn add @medusajs/workflow-engine-inmemory@0.0.5-snapshot-20240719133408
yarn add @medusajs/workflow-engine-redis@0.0.5-snapshot-20240719133408

Latest commit: 4ef268d

@olivermrbl olivermrbl merged commit 566300d into develop Jul 21, 2024
23 checks passed
@olivermrbl olivermrbl deleted the fix/auto-models-discovery-joiner-config branch July 21, 2024 19:21
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.

2 participants