-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
feat: remove dead code and refactor the logic of resolving plugins #10874
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
5 Skipped Deployments
|
🦋 Changeset detectedLatest commit: 34fe0c7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 65 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
export type PluginDetails = { | ||
resolve: string | ||
name: string | ||
id: string | ||
options: Record<string, unknown> | ||
version: string | ||
modules?: InputConfig["modules"] |
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.
Introduced the modules
property on the plugin detail . Later we will merge these modules with the main config top-level modules
* @param path | ||
* @param includeExtensionDirectoryPath should include src | dist for the resolved details | ||
*/ | ||
function loadPluginDetails({ |
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.
Merged the logic with resolvePlugin
method
if (!isAbsolute(pluginName)) { | ||
let resolvedPath = path.resolve(`./plugins/${pluginName}`) |
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.
When using require.resolve
, we shouldn't worry about absolute or relative paths separately.
/snapshot-this |
🚀 A snapshot release has been made for this PRTest the snapshots by updating your yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add [email protected] yarn add @medusajs/[email protected] yarn add [email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected]
|
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.
LGTM
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.
LGTM 🎉
Fixes: FRMW-2857
In this PR, I have cleaned up the existing logic of resolving plugins to support plugins imports from relative paths and npm packages.
Also, we expect plugins to have a
package.json
file and mimic the exact directory structure of a Medusa App.