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

fix(publish): use package.json from --contents #2121

Closed
wants to merge 1 commit into from

Conversation

aleclarson
Copy link

Description

This PR lets any Command subclass intercept the Package loader by defining a redirectPackages method on itself. The publish command uses this to ensure --contents is respected when re-serializing any package.json modules before calling npm publish.

Motivation and Context

See here: #2113 (comment)

How Has This Been Tested?

I tested this manually on the monorepo for react-spring.

I don't have time to write any tests, currently.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@evocateur
Copy link
Member

The sheer number of test failures indicates that this is not the appropriate fix. There's not even a test to demonstrate the case you're trying to account for. I would expect most of the fix to be in and around packDirectory().

@aleclarson
Copy link
Author

aleclarson commented Jun 5, 2019

The failed tests are mostly to do with --canary (which I don't use or understand). The other failed tests are just checking the wrong package.json for changes.

Could you take over this PR for me? 😅 Or will it be much more involved than I expect?

@aleclarson
Copy link
Author

Note: I won't have time in the near future to properly finish this PR. I'm using patch-package in my monorepo for now.

@evocateur
Copy link
Member

Closing in favor of b922766

@evocateur evocateur closed this Jun 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants