feat: support read scoped registry from package json#1470
feat: support read scoped registry from package json#1470Andarist merged 7 commits intochangesets:mainfrom JounQin:feat/scope-registry
Conversation
🦋 Changeset detectedLatest commit: fdf8084 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1470 +/- ##
==========================================
- Coverage 81.16% 80.66% -0.51%
==========================================
Files 54 54
Lines 2241 2255 +14
Branches 674 681 +7
==========================================
Hits 1819 1819
- Misses 417 431 +14
Partials 5 5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Not sure how to add related test cases. cc @Andarist |
|
@Andarist Any time to review this PR? |
|
Alo, just checking when can we merge this as this is an issue for us since we are using |
|
friendly ping @Andarist |
Andarist
left a comment
There was a problem hiding this comment.
Overall looks good but I left some comments that have to be addressed before we land this.
|
@Andarist Any further review? |
| ? "https://registry.npmjs.org" | ||
| : registry; | ||
| return { | ||
| scope: undefined, |
There was a problem hiding this comment.
| scope: undefined, |
Given it's optional, we can omit this.
False positive, so make it happy
.changeset/eleven-panthers-talk.md
Outdated
| "@changesets/cli": minor | ||
| --- | ||
|
|
||
| Support scoped registries configured using `package.json#publishConfig` and environment variables |
There was a problem hiding this comment.
I think we should mention more specifically what's the format in case that's really not well known, maybe linking to the @npm/cli or #1469 would be better.
| const scope = packageName.split("/")[0]; | ||
| const scopedRegistry = | ||
| packageJson!.publishConfig?.[`${scope}:registry`] || | ||
| process.env[`npm_config_${scope}:registry`]; |
There was a problem hiding this comment.
last check before merging this - have you tried using this env variable? I know for sure it works with packageJson.publichConfig but I have not tested this with the env variable path
There was a problem hiding this comment.
@Andarist It's impossible to set the env directly via cli or envrc or export, because the environment name contains @ and :, but it's possible to set it with exec#env override.
close #1469