Skip to content

Commit

Permalink
feat: npmrc environment variable fallback (#6358)
Browse files Browse the repository at this point in the history
close #6018
  • Loading branch information
zkochan committed Apr 4, 2023
1 parent 61b7919 commit fc8780c
Show file tree
Hide file tree
Showing 18 changed files with 610 additions and 581 deletions.
7 changes: 7 additions & 0 deletions .changeset/six-beds-arrive.md
@@ -0,0 +1,7 @@
---
"@pnpm/config": minor
"pnpm": minor
---

Allow env variables to be specified with default values in `.npmrc`. This is a convention used by Yarn too.
Using `${NAME-fallback}` will return `fallback` if `NAME` isn't set. `${NAME:-fallback}` will return `fallback` if `NAME` isn't set, or is an empty string [#6018](https://github.com/pnpm/pnpm/issues/6018).
2 changes: 1 addition & 1 deletion __utils__/assert-project/package.json
Expand Up @@ -19,7 +19,7 @@
"@pnpm/assert-project": "workspace:*",
"@types/is-windows": "^1.0.0",
"@types/isexe": "2.0.1",
"@types/node": "^14.18.37"
"@types/node": "^14.18.42"
},
"directories": {
"test": "test"
Expand Down
8 changes: 4 additions & 4 deletions __utils__/eslint-config/package.json
Expand Up @@ -23,12 +23,12 @@
"repository": "https://github.com/pnpm/pnpm/blob/master/utils/eslint-config",
"scripts": {},
"dependencies": {
"@typescript-eslint/eslint-plugin": "^5.56.0",
"@typescript-eslint/parser": "^5.56.0",
"eslint": "^8.36.0",
"@typescript-eslint/eslint-plugin": "^5.57.1",
"@typescript-eslint/parser": "^5.57.1",
"eslint": "^8.37.0",
"eslint-config-standard-with-typescript": "^34.0.1",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-n": "^15.6.1",
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^6.1.1",
"typescript": "5.0.2"
Expand Down
2 changes: 1 addition & 1 deletion __utils__/prepare/package.json
Expand Up @@ -13,7 +13,7 @@
},
"devDependencies": {
"@pnpm/prepare": "workspace:*",
"@types/node": "^14.18.37"
"@types/node": "^14.18.42"
},
"scripts": {
"lint": "eslint src/**/*.ts",
Expand Down
2 changes: 1 addition & 1 deletion __utils__/test-fixtures/package.json
Expand Up @@ -33,7 +33,7 @@
},
"dependencies": {
"@pnpm/prepare": "workspace:*",
"fs-extra": "^11.1.0"
"fs-extra": "^11.1.1"
},
"devDependencies": {
"@pnpm/test-fixtures": "workspace:*",
Expand Down
4 changes: 2 additions & 2 deletions config/config/package.json
Expand Up @@ -32,12 +32,12 @@
},
"homepage": "https://github.com/pnpm/pnpm/blob/main/config/config#readme",
"dependencies": {
"@pnpm/config.env-replace": "1.0.0",
"@pnpm/config.env-replace": "1.1.0",
"@pnpm/constants": "workspace:*",
"@pnpm/error": "workspace:*",
"@pnpm/git-utils": "workspace:*",
"@pnpm/matcher": "workspace:*",
"@pnpm/npm-conf": "2.0.4",
"@pnpm/npm-conf": "2.1.1",
"@pnpm/pnpmfile": "workspace:*",
"@pnpm/read-project-manifest": "workspace:*",
"@pnpm/types": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion exec/plugin-commands-rebuild/package.json
Expand Up @@ -45,7 +45,7 @@
"@types/sinon": "^10.0.13",
"execa": "npm:safe-execa@0.1.2",
"path-exists": "^4.0.0",
"sinon": "^15.0.2",
"sinon": "^15.0.3",
"write-yaml-file": "^4.2.0"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion fs/indexed-pkg-importer/package.json
Expand Up @@ -19,7 +19,7 @@
"@pnpm/graceful-fs": "workspace:*",
"@pnpm/store-controller-types": "workspace:*",
"@zkochan/rimraf": "^2.1.2",
"fs-extra": "^11.1.0",
"fs-extra": "^11.1.1",
"make-empty-dir": "^2.0.0",
"p-limit": "^3.1.0",
"path-exists": "^4.0.0",
Expand Down
18 changes: 9 additions & 9 deletions package.json
Expand Up @@ -28,24 +28,24 @@
"dev-setup": "pnpm -C=./pnpm/dev link -g"
},
"devDependencies": {
"@babel/core": "^7.21.0",
"@babel/core": "^7.21.4",
"@babel/plugin-proposal-dynamic-import": "^7.18.6",
"@babel/plugin-transform-modules-commonjs": "^7.21.2",
"@babel/preset-typescript": "^7.21.0",
"@babel/types": "^7.21.3",
"@changesets/cli": "^2.26.0",
"@commitlint/cli": "^17.4.4",
"@babel/preset-typescript": "^7.21.4",
"@babel/types": "^7.21.4",
"@changesets/cli": "^2.26.1",
"@commitlint/cli": "^17.5.1",
"@commitlint/config-conventional": "^17.4.4",
"@commitlint/prompt-cli": "^17.4.4",
"@commitlint/prompt-cli": "^17.5.0",
"@pnpm/eslint-config": "workspace:*",
"@pnpm/meta-updater": "0.2.2",
"@pnpm/registry-mock": "3.8.0",
"@pnpm/tsconfig": "workspace:*",
"@types/jest": "^29.4.0",
"@types/node": "^14.18.37",
"@types/jest": "^29.5.0",
"@types/node": "^14.18.42",
"c8": "^7.13.0",
"cross-env": "^7.0.3",
"eslint": "^8.36.0",
"eslint": "^8.37.0",
"husky": "^8.0.3",
"jest": "^29.5.0",
"keyv": "4.5.2",
Expand Down
2 changes: 1 addition & 1 deletion pkg-manager/core/package.json
Expand Up @@ -97,7 +97,7 @@
"path-name": "^1.0.0",
"read-yaml-file": "^2.1.0",
"resolve-link-target": "^2.0.0",
"sinon": "^15.0.2",
"sinon": "^15.0.3",
"symlink-dir": "^5.1.1",
"write-json-file": "^4.3.0",
"write-yaml-file": "^4.2.0"
Expand Down
2 changes: 1 addition & 1 deletion pkg-manager/headless/package.json
Expand Up @@ -32,7 +32,7 @@
"isexe": "2.0.0",
"load-json-file": "^6.2.0",
"npm-run-all": "^4.1.5",
"sinon": "^15.0.2",
"sinon": "^15.0.3",
"tempy": "^1.0.1",
"write-json-file": "^4.3.0"
},
Expand Down
2 changes: 1 addition & 1 deletion pkg-manager/link-bins/package.json
Expand Up @@ -52,7 +52,7 @@
"@pnpm/link-bins": "workspace:*",
"@pnpm/test-fixtures": "workspace:*",
"@types/is-windows": "^1.0.0",
"@types/node": "^14.18.37",
"@types/node": "^14.18.42",
"@types/normalize-path": "^3.0.0",
"@types/ramda": "0.28.20",
"cmd-extension": "^1.0.2",
Expand Down
2 changes: 1 addition & 1 deletion pkg-manager/package-bins/package.json
Expand Up @@ -37,7 +37,7 @@
},
"devDependencies": {
"@pnpm/package-bins": "workspace:*",
"@types/node": "^14.18.37"
"@types/node": "^14.18.42"
},
"funding": "https://opencollective.com/pnpm",
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion pkg-manager/plugin-commands-installation/package.json
Expand Up @@ -50,7 +50,7 @@
"path-name": "^1.0.0",
"proxyquire": "^2.1.3",
"read-yaml-file": "^2.1.0",
"sinon": "^15.0.2",
"sinon": "^15.0.3",
"symlink-dir": "^5.1.1",
"tempy": "^1.0.1",
"write-json-file": "^4.3.0",
Expand Down

0 comments on commit fc8780c

Please sign in to comment.