Skip to content

Commit efba4db

Browse files
committed
docs: add private registry setup guide with env var override
- Create .env.example with placeholder URLs showing how to configure a private npm registry via YARN_NPM_REGISTRY_SERVER env var - Add 'Private Registry' section to CONTRIBUTING.md explaining the mechanism without exposing any real corporate URLs - No .yarnrc.yml modification needed — env vars take precedence
1 parent 08a45a4 commit efba4db

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

.env.example

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# ============================================================
2+
# Yarn Berry — Registry Override (optional)
3+
# ============================================================
4+
# By default, this repo uses the public npm registry (registry.npmjs.org).
5+
# If your organization uses a private registry (e.g. JFrog Artifactory,
6+
# Nexus, GitHub Packages, etc.), set these environment variables.
7+
#
8+
# How to use:
9+
# 1. Copy these lines to your ~/.zshrc (or ~/.bashrc)
10+
# 2. Replace the placeholder URL with your organization's registry
11+
# 3. Run: source ~/.zshrc
12+
# 4. Run: yarn install
13+
#
14+
# This override applies globally to ALL Yarn Berry projects.
15+
# No need to modify .yarnrc.yml — the env vars take precedence.
16+
# ============================================================
17+
18+
# Uncomment and configure with your private registry URL:
19+
# export YARN_NPM_REGISTRY_SERVER="https://your-org.example.com/artifactory/api/npm/npm-public/"
20+
# export YARN_NPM_ALWAYS_AUTH=true
21+
# export YARN_ENABLE_STRICT_SSL=false

CONTRIBUTING.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,33 @@ node --version # Should show v22.x.x
446446
yarn --version # Should show 4.x.x
447447
```
448448

449+
### Private Registry (optional)
450+
451+
This repo uses the public npm registry by default. If your organization requires a **private registry** (JFrog Artifactory, Nexus, GitHub Packages, etc.), you can override it globally via environment variables — no need to modify any files.
452+
453+
1. Add to your `~/.zshrc` (or `~/.bashrc`):
454+
455+
```sh
456+
export YARN_NPM_REGISTRY_SERVER="https://your-org.example.com/your-npm-registry/"
457+
export YARN_NPM_ALWAYS_AUTH=true
458+
export YARN_ENABLE_STRICT_SSL=false
459+
```
460+
461+
2. Reload your shell:
462+
463+
```sh
464+
source ~/.zshrc
465+
```
466+
467+
3. Verify:
468+
469+
```sh
470+
yarn config get npmRegistryServer
471+
# Should show your private registry URL
472+
```
473+
474+
This applies globally to all Yarn Berry projects. See `.env.example` for reference.
475+
449476
---
450477

451478
## Important Notes for Contributors

0 commit comments

Comments
 (0)