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

refactor: move navigation plugin into npm #6118

Merged
merged 12 commits into from
Mar 11, 2020

Conversation

kieckhafer
Copy link
Member

@kieckhafer kieckhafer commented Feb 28, 2020

Resolves #6127

This PR removes the internal navigation plugin, and installs the new plugin-navigation as a replacement.

The code in that npm plugin is the same, so the expected outcome of this PR is seeing nothing different than how the app currently runs.

Running this query will show you the defaultNavigationTreeId, which has moved into the new package. If this query works, you should be good to go:

{
  primaryShop {
    defaultNavigationTreeId
  }
}

@willopez willopez changed the title [BLOCKED] refactor: move navigation plugin into npm refactor: move navigation plugin into npm Mar 3, 2020
willopez
willopez previously approved these changes Mar 3, 2020
Copy link
Member

@willopez willopez left a comment

Choose a reason for hiding this comment

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

LGTM

NavigationItem,
NavigationTree,
NavigationTreeItem
} from "@reactioncommerce/plugin-navigation/src/simpleSchemas.js";
Copy link
Member Author

@kieckhafer kieckhafer Mar 3, 2020

Choose a reason for hiding this comment

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

@aldeed this works, just wondering if this is how we want to import simpleSchemas from outside packages, or if there was something else in mind?

Copy link
Contributor

Choose a reason for hiding this comment

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

@kieckhafer This would be fine. I had kind of hoped that when we got to this we'd start moving the integration tests out of this repo and into their respective package repos, but we have some work to do yet before that can happen.

@kieckhafer
Copy link
Member Author

@aldeed does the failing GraphQL issue mean we need to move that part of the schema into the navigation plugin itself, or is there another way for that to work?

Signed-off-by: Erik Kieckhafer <[email protected]>
@aldeed
Copy link
Contributor

aldeed commented Mar 10, 2020

@kieckhafer Yes I think the correct solution in this case is to cut the following out of the shop schema file, and add it to the nav package schema file within extend type Shop { }.

"The default navigation tree for this shop"
  defaultNavigationTree(
    "Navigation tree language"
    language: String!,

    "Whether to include secondary navigation items"
    shouldIncludeSecondary: Boolean = false
  ): NavigationTree

  "The ID of the shop's default navigation tree"
  defaultNavigationTreeId: String

@aldeed
Copy link
Contributor

aldeed commented Mar 10, 2020

And move all related resolvers into that plugin package, too.

Copy link
Member

@willopez willopez left a comment

Choose a reason for hiding this comment

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

confirmed it still works

@kieckhafer
Copy link
Member Author

@spencern this is good to go, outside of the snyk issue. Once you figure out the deal there, can you please re-run snyk and merge this if it's good (or ping me and I can do it)

Copy link
Contributor

@spencern spencern left a comment

Choose a reason for hiding this comment

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

Override approval of license failure.

@@ -28,6 +28,7 @@
"@reactioncommerce/logger": "~1.1.2",
"@reactioncommerce/nodemailer": "~5.0.5",
"@reactioncommerce/plugin-authentication": "~1.0.0",
"@reactioncommerce/plugin-navigation": "~1.0.2",
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the plugin that is getting flagged by snyk's license check as GPLv3. We've kept the GPLv3 license that this code was originally licensed under after migrating it to it's own package. We'll need to merge this code anyway and then add an ignore to snyk for this particular package.

@spencern spencern merged commit 5503308 into trunk Mar 11, 2020
@spencern spencern deleted the refactor-kieckhafer-moveNavigationPlugin branch March 11, 2020 21:00
@kieckhafer kieckhafer mentioned this pull request Mar 19, 2020
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.

move navigation plugin to its own npm package, and install npm version Reaction
4 participants