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

feat: move framework packages to peerDependencies #6288

Merged
merged 2 commits into from
Sep 8, 2020

Conversation

bajtos
Copy link
Member

@bajtos bajtos commented Sep 7, 2020

As discussed several times in the past (most recently in #5927 (comment)), extensions should use framework modules from the target application via peerDependencies.

This PR is the last spin-off from #5959 which was too difficult to get landed because of merge conflicts. In this patch, I have updated dependencies in all extension/* packages.

Please read #5959 for the original discussion around this proposal. We have reached consensus to follow this new direction, so I hope we can get this PR landed quickly.

The first commit moves dependencies to peerDependencies. The second commit is a small cleanup to ensure all package/*/package.json files are using the same order of peerDependencies, dependencies and devDependencies.

Close #5959

BREAKING CHANGE

Components no longer install core framework packages as their own dependencies, they use the framework packages provided by the target application instead.

If you are getting npm install errors after upgrade, then make sure your project lists all dependencies required by the extensions you are using.

Checklist

  • DCO (Developer Certificate of Origin) signed in all commits
  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Documentation in /docs/site was updated
  • Affected artifact templates in packages/cli were updated
  • Affected example projects in examples/* were updated

👉 Check out how to submit a PR 👈

BREAKING CHANGE: components no longer install core framework packages as
their own dependencies, they use the framework packages provided by the
target application instead.

If you are getting `npm install` errors after upgrade, then make sure
your project lists all dependencies required by the extensions you are
using.

Signed-off-by: Miroslav Bajtoš <[email protected]>
Update `packages/*/package.json` to ensure consistent order of the
following metadata:
1. `peerDependencies`
2. `dependencies`
3. `devDependencies`

Signed-off-by: Miroslav Bajtoš <[email protected]>
Copy link
Contributor

@raymondfeng raymondfeng left a comment

Choose a reason for hiding this comment

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

Can you improve https://github.com/strongloop/loopback-next/blob/master/bin/check-package-metadata.js to make sure our extension packages always follow the same convention?

@bajtos
Copy link
Member Author

bajtos commented Sep 8, 2020

Can you improve https://github.com/strongloop/loopback-next/blob/master/bin/check-package-metadata.js to make sure our extension packages always follow the same convention?

That's a great idea! I'll open a new pull request for that, later this week or next week.

@bajtos bajtos merged commit ccae882 into master Sep 8, 2020
@bajtos bajtos deleted the feat/extension-peer-deps-3 branch September 8, 2020 07:38
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