Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

fix: adds tags as peerDependency #41

Closed
wants to merge 2 commits into from

Conversation

sujithvn
Copy link

@sujithvn sujithvn commented May 3, 2022

Signed-off-by: Sujith sujith@merchstack.com

Resolves #4
Impact: minor
Type: chore

Issue

Issue as mentioned in the ticket- Carts uses the TagSortByField and TagConnection type in GraphQL, which lives in the tags plugin. When work is done to move carts over here, we need to be sure to install api-plugin-tags as a peerDependency.

Solution

Just to ensure we are on same page, I am adding my understanding regarding peerDependency
An entry in peerDependency object of a plugin does NOT get installed by npm automatically. The entries has to be explicitly added as a dependency in the main package which is using the plugin and peerDependency gives out a warning if it is not done. Usually peerDependency is used in custom packages/plugins when a plugin works only with a specific version of a host package but if we are using a different version of the host package and add this plugin, then it generates a warning.

After updating the package.json, both "npm install" and "reaction develop" completed successfully.

Note

Noticed that the api-tags-plugin is using a function declared preStartup which is already declared in authorization-simple plugin.

Breaking changes

None.

Testing

After updating the package.json, pointed the cart-plugin to the updated version inside a new project and executed both "npm install" and "reaction develop". Both completed successfully.

Signed-off-by: Sujith <sujith@merchstack.com>
@sujithvn sujithvn requested a review from zenweasel May 3, 2022 07:30
package-lock.json was regenerated and pushed. Removed it from PR and retained only package.json
@sujithvn
Copy link
Author

sujithvn commented May 3, 2022

Accidentally removed the package-lock . Closing the PR and sending a fresh one.

@sujithvn sujithvn closed this May 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add peerDependency for Tags plugin
1 participant