Add support for extendedPublishConfig, apply to workspace resolver#2146
Merged
sgb-io merged 2 commits intojpmorganchase:mainfrom Sep 20, 2022
Merged
Conversation
🦋 Changeset detectedLatest commit: 11b3d0c The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
sgb-io
commented
Sep 16, 2022
| // | ||
| // It also removes `scripts` on the assumption none are needed when installing npm libraries. | ||
|
|
||
| const PACKAGES_TO_EXTEND = ['workspace-resolver']; |
Contributor
Author
There was a problem hiding this comment.
Technically this is directory names. I figured that having a hardcoded static list of packages to apply this to, is fine for the scope of this project.
Collaborator
cristiano-belloni
approved these changes
Sep 20, 2022
This was referenced Sep 20, 2022
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks @steveukx for providing prior art in git-js! My implementation is very similar, but I've come up with some alternative naming, let me know what you think.
extendedPublishConfigblock in thepackage.jsonof any packages in the project. The idea is that we can make changes to the project before publishing, very similar to the native publishConfig option, however, is not restricted to what fields we can change.extendedPublishConfigwill override fields of the same name at publish timescripts, since they are useless in published packages. This isn't required to achieve the desired result here, but could help avoid confusion should a user attempt to use scripts in the wrong wayextendedPublishConfigto the workspace resolver package. In this case, we have made themainandtypesfields change to the built versions at publish time.The end result is that developers no longer need to build the workspace resolver package in local dev - the dependency can be imported right away, and the types just work.