-
-
Notifications
You must be signed in to change notification settings - Fork 18
feat(npm): Add workspaces support #645
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
Conversation
Adds support for auto-expanding workspaces to avoid config bloat in monorepos like sentry-javascript
666d9b0 to
88d3667
Compare
Lms24
left a comment
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.
Just to confirm I understand the intention: We want to avoid that workspaces/monorepos like our JS SDK repo have to register each package as separate publishing targets?
My main question here is: Can we guarantee releasing in the correct dependency order? Right now, we maintain this list primarily to guarantee that we release the packages in correct order. So if publishing @sentry/browser fails, that's okay because didn't yet publish any packages depending on it (@sentry/react).
|
Ah, great yeah I think we can do that. Will update the patch accordingly |
Lms24
left a comment
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.
Thanks for adding this! Excited to give it a try.
Had some comments, mostly non-blocking low-prio stuff. Let's just clarify the publishConfig comment. After that, good to go from my end!
| expect(names.indexOf('@sentry/types')).toBeLessThan(names.indexOf('@sentry/core')); | ||
| expect(names.indexOf('@sentry/core')).toBeLessThan(names.indexOf('@sentry/browser')); | ||
| expect(names.indexOf('@sentry/core')).toBeLessThan(names.indexOf('@sentry/node')); | ||
| expect(names.indexOf('@sentry/browser')).toBeLessThan(names.indexOf('@sentry/integrations')); | ||
| expect(names.indexOf('@sentry/node')).toBeLessThan(names.indexOf('@sentry/integrations')); |
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.
this is a good test and depicts something like @sentry/nextjs really well that also depends on browser and node, thanks for adding!
L: Could we add @sentry/node-core as a dependency of @sentry/node (where node-core also depends on core)? Then we have a second "branch" in the graph.
Super-L: WDYT about checking against the names array directly? I think the indexOf is good enough but unless there's something that makes the ordering non-deterministic, the "equals array" (or inline snapshot, whatever you prefer) check makes it super easy to read the test.
(Only suggesting because this is probably the most crucial part to this change. Feel free to disregard)
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.
Added the node-core test. Will see for the other request :)
Adds support for auto-expanding workspaces to avoid config bloat in monorepos like sentry-javascript