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

Respect publishConfig in package manifest #7829

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

zypA13510
Copy link

Summary

This pull request ensures that publishConfig in package.json is respected. In details:

  • publishConfig.access code refactored (shouldn't affect actual behavior), based on --registry should have higher priority over publishConfig.registry #6423.

  • Supports publishConfig["@scope:registry"], this is requested multiple times in yarn publish not respecting publishConfig in package.json  #5310. Precedence of configs has also changed. Before this change (from highest priority to lowest, same below):

    "name": "mypkg" "name": "@scope/mypkg"
    publishConfig.registry in package.json publishConfig.registry in package.json
    --registry flag
    @scope:registry in rc
    registry in rc registry in rc

    After this change:

    "name": "mypkg" "name": "@scope/mypkg"
    --registry flag --registry flag
    publishConfig["@scope:registry"] in package.json
    publishConfig.registry in package.json publishConfig.registry in package.json
    @scope:registry in rc
    registry in rc registry in rc
  • Supports publishConfig.tag, overridable by --tag flag.

Test plan

Tests added in __tests__/commands/publish.js.


Close: #4732
Close: #5310
Based on and conflict with: #6423
Related to: #5376

@buildsize
Copy link

buildsize bot commented Jan 22, 2020

File name Previous Size New Size Change
yarn-[version].noarch.rpm 1.18 MB 1.18 MB 129 bytes (0%)
yarn-[version].js 4.86 MB 4.86 MB 1.16 KB (0%)
yarn-legacy-[version].js 5.05 MB 5.05 MB 1.15 KB (0%)
yarn-v[version].tar.gz 1.19 MB 1.19 MB 1.05 KB (0%)
yarn_[version]all.deb 870.06 KB 870.44 KB 392 bytes (0%)

@zypA13510
Copy link
Author

One thing: I haven't figure out how to document @scope:registry in flowtype (src/types.js). I'm no expert in this, but from what I can find, flowtype cannot match object keys to regular expression. This should match any valid key names:

/^@[0-9a-z-~][0-9a-z-_.~]{0,210}:registry$/.test(key)

Fil referenced this pull request in d3/d3-selection Jul 23, 2020
@JustinPlute
Copy link

Any traction on this?

@yordis
Copy link

yordis commented Dec 18, 2020

Hey @arcanis sorry for ping you directly, I just notice that you are active merging stuff.

Could you help us to move this ticket forward? We are dealing with a GitLab NPM Registry issue https://gitlab.com/gitlab-org/gitlab/-/issues/121668 and we need this feature.

Thanks in advance.

@nfriend
Copy link

nfriend commented Apr 30, 2021

Hi @rally25rs 👋

You mentioned in another thread you were interested in a community fix for this issue:

I guess it hasn't been enough of a pain-point for anyone to submit a PR to fix it. If you are willing to write up a fix, we'd love the additional support from the community! 😸

Any chance a review of this PR can be prioritized? 🙏

@tleef

This comment has been minimized.

@yordis
Copy link

yordis commented Jul 21, 2021

As mentioned in a few places, new features only land in Yarn 2.x (and soon 3.x), with 1.x only receiving critical security fixes and migration-related improvements.

From: @arcanis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants