-
Notifications
You must be signed in to change notification settings - Fork 142
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
[RUMF-1357] Add a peer dependency between rum and logs packages #1668
[RUMF-1357] Add a peer dependency between rum and logs packages #1668
Conversation
Thank you for your PR! Could you make those peer dependencies "optional" with As you guessed, lerna will be an issue for that. They intentionally removed support for it, and closed a feature request asking for an option to bump them on publish. I think we'll need to tweak our You can try it yourself with something like |
81517cc
to
2bf4c5e
Compare
@BenoitZugmeyer good call, I just added Additionally, after reading some of the comments in lerna/lerna#1575, I do want to confirm that this is the correct usage of |
2bf4c5e
to
b443795
Compare
Thank you!
Mmh I was thinking about a simple "find and replace" script (ex: with const pkg = JSON.parse(fs.readFileSync('package.json'))
pkg.peerDependencies["@browser-logs"] = pkg.version
fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2)) But don't worry about that, we can take over your PR to make the final adjustments 🙂
I agree that it still makes sense for us. I think arguments are a bit outdated, for example “ |
b443795
to
e78d3f9
Compare
@BenoitZugmeyer ah got it, that makes sense! I've enabled maintainer editing access on my branch, which hopefully is what you need to finalize the |
@BenoitZugmeyer love it! |
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.
Nice work!
// This script updates the peer dependency versions between rum and logs packages to match the new | ||
// version during a release. | ||
// | ||
// Lerna [intentionally removed support for it][1], and [closed a feature request asking for an | ||
// option to bump them on publish][2], but we still want to make sure this version is updated as | ||
// well to warn users who use different versions of RUM and Logs packages. | ||
// | ||
// [1]: https://github.com/lerna/lerna/commit/bdbfc62966e5351abfeac77830f9d47b6d69f1b1 | ||
// [2]: https://github.com/lerna/lerna/issues/1575 |
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.
should we use JSDoc?
Thank you again for your contribution @agrobbin , this will be released shortly. |
Awesome, thanks @BenoitZugmeyer! |
Well, looks like I was wrong about Dependabot bumping these together. 😢 |
Motivation
I suggested this, so made the PR too! This closes #1666.
Changes
The RUM docs (here and here) state that it is recommended to match versions, so this seems like a beneficial addition!
I also believe (though I'm having a hard time fully parsing the Dependabot source to be sure) it will force Dependabot to update both @datadog/rum and @datadog/logs in tandem if both are included dependencies of a project.
Testing
My primary concern from a "testing" perspective is whether Lerna will know to update these when a new version is released. I'm not familiar w/ Lerna, or the configuration for it, but hopefully this is a starting point!