-
Notifications
You must be signed in to change notification settings - Fork 3
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
Try @guardian/source
package once more
#1435
Conversation
🦋 Changeset detectedLatest commit: e215f5b The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Tip Once this PR is ready to go, add the This saves us a lot of money by not running the tests before we need them. |
🐥 |
🐥 |
🐥 |
🐥 |
🐥 |
🐥 |
d628280
to
9c84458
Compare
@guardian/source
package once more
4e23cbb
to
6e5e802
Compare
Co-authored-by: Oliver Abrahams <ollie.abrahams@guardian.co.uk>
Co-authored-by: Oliver Abrahams <ollie.abrahams@guardian.co.uk>
Co-authored-by: Oliver Abrahams <ollie.abrahams@guardian.co.uk>
Co-authored-by: Alex Sanders <alex@sndrs.dev>
Co-authored-by: Alex Sanders <alex@sndrs.dev>
Co-authored-by: Alex Sanders <alex@sndrs.dev>
6e5e802
to
e215f5b
Compare
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.
📦📦→📦 🚀
What are you changing?
create a single
@guardian/source
package (again).Warning
This PR does not get rid of the old ones yet. They should still be what people use. This version could go away again pretty quickly.
Why?
managing
peerDeps
between tightly bound packages is hard, especially when they live in he same repo.ideally you want the code on the disk to be the code that runs i.e. if you change
source-foundations
you want to see that reflected insource-react-components
while developing.but that means keeping the
peerDep
range ofsource-react-components
in sync with the current version ofsource-foundations
.This in turn means releasing a major version of
source-react-components
everytime there's a new version ofsource-foundations
, even if it's a patch.This is the correct thing to do, but it's not desirable.
We concluded that was a smell coming from the package set up. The Source packages are tightly coupled, and the reason they are separate now is because we didn't understand properly how to support the old Node module resolution algorithm with sub-packages. We also didn't know about
peerDependenciesMeta
last time we looked at it.Using those, we can create a single Source package that maps:
@guardian/source-foundations
→@guardian/source/foundations
@guardian/source-react-components
→@guardian/source/react-components
We can also make React/emotion optional
peerDeps
for people not using the react components.Most package managers will install peerdeps anyway, so the optional flag just ensures that any version a consumer may also install matches the one we need.
Co-authored with @oliverabrahams