@lerna/publish
Version:
Publish packages in the current project
195 lines (194 loc) • 6.84 kB
JavaScript
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var import_os = __toESM(require("os"));
var import_path = __toESM(require("path"));
const temp = import_os.default.tmpdir();
const uidOrPid = process.getuid ? process.getuid() : process.pid;
const hasUnicode = () => true;
const isWindows = process.platform === "win32";
const osenv = {
editor: () => process.env["EDITOR"] || process.env["VISUAL"] || (isWindows ? "notepad.exe" : "vi"),
shell: () => isWindows ? process.env["COMSPEC"] || "cmd.exe" : process.env["SHELL"] || "/bin/bash"
};
const umask = {
fromString: () => process.umask()
};
let home = import_os.default.homedir();
if (home) {
process.env["HOME"] = home;
} else {
home = import_path.default.resolve(temp, `npm-${uidOrPid}`);
}
const cacheExtra = process.platform === "win32" ? "npm-cache" : ".npm";
const cacheRoot = process.platform === "win32" && process.env["APPDATA"] || home;
const cache = import_path.default.resolve(cacheRoot, cacheExtra);
let defaults;
let globalPrefix;
Object.defineProperty(exports, "defaults", {
get() {
if (defaults) {
return defaults;
}
if (process.env["PREFIX"]) {
globalPrefix = process.env["PREFIX"];
} else if (process.platform === "win32") {
globalPrefix = import_path.default.dirname(process.execPath);
} else {
globalPrefix = import_path.default.dirname(import_path.default.dirname(process.execPath));
if (process.env["DESTDIR"]) {
globalPrefix = import_path.default.join(process.env["DESTDIR"], globalPrefix);
}
}
defaults = {
access: null,
"allow-same-version": false,
"always-auth": false,
also: null,
audit: true,
"audit-level": "low",
"auth-type": "legacy",
"bin-links": true,
browser: null,
ca: null,
cafile: null,
cache,
"cache-lock-stale": 6e4,
"cache-lock-retries": 10,
"cache-lock-wait": 1e4,
"cache-max": Infinity,
"cache-min": 10,
cert: null,
cidr: null,
color: process.env["NO_COLOR"] == null,
depth: Infinity,
description: true,
dev: false,
"dry-run": false,
editor: osenv.editor(),
"engine-strict": false,
force: false,
"fetch-retries": 2,
"fetch-retry-factor": 10,
"fetch-retry-mintimeout": 1e4,
"fetch-retry-maxtimeout": 6e4,
git: "git",
"git-tag-version": true,
"commit-hooks": true,
global: false,
globalconfig: import_path.default.resolve(globalPrefix, "etc", "npmrc"),
"global-style": false,
group: process.platform === "win32" ? 0 : process.env["SUDO_GID"] || process.getgid && process.getgid(),
"ham-it-up": false,
heading: "npm",
"if-present": false,
"ignore-prepublish": false,
"ignore-scripts": false,
"init-module": import_path.default.resolve(home, ".npm-init.js"),
"init-author-name": "",
"init-author-email": "",
"init-author-url": "",
"init-version": "1.0.0",
"init-license": "ISC",
json: false,
key: null,
"legacy-bundling": false,
link: false,
"local-address": void 0,
loglevel: "notice",
logstream: process.stderr,
"logs-max": 10,
long: false,
maxsockets: 50,
message: "%s",
"metrics-registry": null,
"node-options": null,
"node-version": process.version,
offline: false,
"onload-script": false,
only: null,
optional: true,
otp: void 0,
"package-lock": true,
"package-lock-only": false,
parseable: false,
"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,
noproxy: null,
"user-agent": "npm/{npm-version} node/{node-version} {platform} {arch}",
"read-only": false,
"rebuild-bundle": true,
registry: "https://registry.npmjs.org/",
rollback: true,
save: true,
"save-bundle": false,
"save-dev": false,
"save-exact": false,
"save-optional": false,
"save-prefix": "^",
"save-prod": false,
scope: "",
"script-shell": void 0,
"scripts-prepend-node-path": "warn-only",
searchopts: "",
searchexclude: null,
searchlimit: 20,
searchstaleness: 15 * 60,
"send-metrics": false,
shell: osenv.shell(),
shrinkwrap: true,
"sign-git-commit": false,
"sign-git-tag": false,
"sso-poll-frequency": 500,
"sso-type": "oauth",
"strict-ssl": true,
tag: "latest",
"tag-version-prefix": "v",
timing: false,
tmp: temp,
unicode: hasUnicode(),
"unsafe-perm": process.platform === "win32" || process.platform === "cygwin" || // TODO: refactor based on TS feedback
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
!(process.getuid && process.setuid && process.getgid && process.setgid) || process.getuid() !== 0,
"update-notifier": true,
usage: false,
user: process.platform === "win32" || import_os.default.type() === "OS400" ? 0 : "nobody",
userconfig: import_path.default.resolve(home, ".npmrc"),
// TODO: refactor based on TS feedback
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
umask: process.umask ? process.umask() : umask.fromString("022"),
version: false,
versions: false,
viewer: process.platform === "win32" ? "browser" : "man",
_exit: true
};
return defaults;
}
});