From 0e81c4a243d29576cd7f8b2d905b55fcac578287 Mon Sep 17 00:00:00 2001 From: ylemkimon Date: Mon, 13 Sep 2021 00:50:58 +0900 Subject: [PATCH 1/3] docs(private-packages): add an example for Yarn 2+ --- docs/usage/getting-started/private-packages.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/usage/getting-started/private-packages.md b/docs/usage/getting-started/private-packages.md index f5e70f05a989aa..e45d25a82e63c5 100644 --- a/docs/usage/getting-started/private-packages.md +++ b/docs/usage/getting-started/private-packages.md @@ -265,6 +265,18 @@ Renovate doesn't support reading `npmRegistries` and `npmScopes` from `.yarnrc.y Renovate updates `npmRegistries` in `.yarnrc.yml` with resolved `hostRules` before running Yarn. For Renovate to overwrite existing `npmRegistries` entry, the key should match the `matchHost` without the protocol (`http:` or `https:`) and with the trailing slash. +For example, Renovate configuration above this section will update `.yarnrc.yml` as following: + +```yaml +npmRegistries: + //npm.pkg.github.com/: + npmAuthToken: + //npm.pkg.github.com: + # this will not be overwritten + https://npm.pkg.github.com/: + # this will not be overwritten +``` + ### nuget For each known NuGet registry, Renovate searches for `hostRules` with `hostType=nuget` and matching host. From a1627e68947bea5c8fdd1bee1e3881e40391499f Mon Sep 17 00:00:00 2001 From: ylemkimon Date: Mon, 13 Sep 2021 02:05:31 +0900 Subject: [PATCH 2/3] Update private-packages.md --- .../usage/getting-started/private-packages.md | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/docs/usage/getting-started/private-packages.md b/docs/usage/getting-started/private-packages.md index e45d25a82e63c5..39ffa4d734f3b3 100644 --- a/docs/usage/getting-started/private-packages.md +++ b/docs/usage/getting-started/private-packages.md @@ -265,16 +265,32 @@ Renovate doesn't support reading `npmRegistries` and `npmScopes` from `.yarnrc.y Renovate updates `npmRegistries` in `.yarnrc.yml` with resolved `hostRules` before running Yarn. For Renovate to overwrite existing `npmRegistries` entry, the key should match the `matchHost` without the protocol (`http:` or `https:`) and with the trailing slash. -For example, Renovate configuration above this section will update `.yarnrc.yml` as following: +For example, the Renovate configuration: + +```json +{ + "hostRules": [ + { + "matchHost": "https://npm.pkg.github.com/", + "hostType": "npm", + "encrypted": { + "token": "" + } + } + ] +} +``` + +will update `.yarnrc.yml` as following: ```yaml npmRegistries: //npm.pkg.github.com/: npmAuthToken: //npm.pkg.github.com: - # this will not be overwritten + # this will not be overwritten and may conflict https://npm.pkg.github.com/: - # this will not be overwritten + # this will not be overwritten and may conflict ``` ### nuget From 3bd0255b99f7b35d9b5b1a2381ebe5d2e48e6e04 Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Mon, 13 Sep 2021 09:18:51 +0200 Subject: [PATCH 3/3] Update docs/usage/getting-started/private-packages.md Co-authored-by: ylemkimon --- docs/usage/getting-started/private-packages.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/getting-started/private-packages.md b/docs/usage/getting-started/private-packages.md index 39ffa4d734f3b3..7114345ddea139 100644 --- a/docs/usage/getting-started/private-packages.md +++ b/docs/usage/getting-started/private-packages.md @@ -263,7 +263,7 @@ However be aware that if your `.npmrc` is too big to encrypt then the above comm Renovate doesn't support reading `npmRegistries` and `npmScopes` from `.yarnrc.yml`, so `hostRules` (or `npmToken`) and `npmrc` should be configured like above. Renovate updates `npmRegistries` in `.yarnrc.yml` with resolved `hostRules` before running Yarn. -For Renovate to overwrite existing `npmRegistries` entry, the key should match the `matchHost` without the protocol (`http:` or `https:`) and with the trailing slash. +For Renovate to overwrite existing `npmRegistries` entry, the key should match the `matchHost` minus the protocol (`http:` or `https:`) plus the trailing slash. For example, the Renovate configuration: