Skip to content

Commit

Permalink
fix(npm-conf): Update defaults & types to npm v6.5.0+
Browse files Browse the repository at this point in the history
  • Loading branch information
evocateur committed Dec 19, 2018
1 parent db4522b commit 6a8aa83
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
10 changes: 8 additions & 2 deletions utils/npm-conf/lib/defaults.js
Expand Up @@ -60,6 +60,8 @@ Object.defineProperty(exports, "defaults", {
"allow-same-version": false,
"always-auth": false,
also: null,
audit: true,
"audit-level": "low",
"auth-type": "legacy",
"bin-links": true,
browser: null,
Expand Down Expand Up @@ -128,11 +130,12 @@ Object.defineProperty(exports, "defaults", {
"prefer-offline": false,
"prefer-online": false,
prefix: globalPrefix,
preid: "",
production: process.env.NODE_ENV === "production",
progress: !process.env.TRAVIS && !process.env.CI,
proxy: null,
"https-proxy": null,
"no-proxy": null,
noproxy: null,
"user-agent": "npm/{npm-version} " + "node/{node-version} " + "{platform} " + "{arch}",
"read-only": false,
"rebuild-bundle": true,
Expand All @@ -155,6 +158,7 @@ Object.defineProperty(exports, "defaults", {
"send-metrics": false,
shell: osenv.shell(),
shrinkwrap: true,
"sign-git-commit": false,
"sign-git-tag": false,
"sso-poll-frequency": 500,
"sso-type": "oauth",
Expand All @@ -169,15 +173,17 @@ Object.defineProperty(exports, "defaults", {
process.platform === "cygwin" ||
!(process.getuid && process.setuid && process.getgid && process.setgid) ||
process.getuid() !== 0,
"update-notifier": true,
usage: false,
user: process.platform === "win32" ? 0 : "nobody",
user: process.platform === "win32" || os.type() === "OS400" ? 0 : "nobody",
userconfig: path.resolve(home, ".npmrc"),
umask: process.umask ? process.umask() : umask.fromString("022"),
version: false,
versions: false,
viewer: process.platform === "win32" ? "browser" : "man",
_exit: true,
};

return defaults;
},
});
13 changes: 8 additions & 5 deletions utils/npm-conf/lib/types.js
Expand Up @@ -16,6 +16,8 @@ exports.types = {
"allow-same-version": Boolean,
"always-auth": Boolean,
also: [null, "dev", "development"],
audit: Boolean,
"audit-level": ["low", "moderate", "high", "critical"],
"auth-type": ["legacy", "sso", "saml", "oauth"],
"bin-links": Boolean,
browser: [null, String],
Expand Down Expand Up @@ -65,8 +67,6 @@ exports.types = {
key: [null, String],
"legacy-bundling": Boolean,
link: Boolean,
// local-address must be listed as an IP for a local network interface
// must be IPv4 due to node bug
"local-address": getLocalAddresses(),
loglevel: ["silent", "error", "warn", "notice", "http", "timing", "info", "verbose", "silly"],
logstream: Stream,
Expand All @@ -77,22 +77,23 @@ exports.types = {
"metrics-registry": [null, String],
"node-options": [null, String],
"node-version": [null, semver],
"no-proxy": [null, String, Array],
noproxy: [null, String, Array],
offline: Boolean,
"onload-script": [null, String],
only: [null, "dev", "development", "prod", "production"],
optional: Boolean,
"package-lock": Boolean,
otp: Number,
otp: [null, String],
"package-lock-only": Boolean,
parseable: Boolean,
"prefer-offline": Boolean,
"prefer-online": Boolean,
prefix: path,
preid: String,
production: Boolean,
progress: Boolean,
proxy: [null, false, url],
// allow proxy to be disabled explicitly
proxy: [null, false, url],
"read-only": Boolean,
"rebuild-bundle": Boolean,
registry: [null, url],
Expand All @@ -114,6 +115,7 @@ exports.types = {
"send-metrics": Boolean,
shell: String,
shrinkwrap: Boolean,
"sign-git-commit": Boolean,
"sign-git-tag": Boolean,
"sso-poll-frequency": Number,
"sso-type": [null, "oauth", "saml"],
Expand All @@ -123,6 +125,7 @@ exports.types = {
tmp: path,
unicode: Boolean,
"unsafe-perm": Boolean,
"update-notifier": Boolean,
usage: Boolean,
user: [Number, String],
userconfig: path,
Expand Down

0 comments on commit 6a8aa83

Please sign in to comment.