"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const globalBinPath = require("global-bin-path");
const path = require("path");
const pnpm_logger_1 = require("pnpm-logger");
const expandTilde_1 = require("../fs/expandTilde");
const DEFAULT_GLOBAL_PATH = path.join(globalBinPath(), 'pnpm-global');
const DEFAULT_LOCAL_REGISTRY = expandTilde_1.default('~/.pnpm-registry');
const defaults = () => ({
    fetchRetries: 2,
    fetchRetryFactor: 10,
    fetchRetryMintimeout: 1e4,
    fetchRetryMaxtimeout: 6e4,
    storePath: '~/.pnpm-store',
    localRegistry: DEFAULT_LOCAL_REGISTRY,
    globalPath: DEFAULT_GLOBAL_PATH,
    ignoreScripts: false,
    strictSsl: true,
    tag: 'latest',
    production: process.env.NODE_ENV === 'production',
    cwd: process.cwd(),
    nodeVersion: process.version,
    force: false,
    depth: -1,
    engineStrict: false,
    metaCache: new Map(),
    networkConcurrency: 16,
    fetchingConcurrency: 16,
    lockStaleDuration: 60 * 1000,
    childConcurrency: 5,
});
exports.default = (opts) => {
    const extendedOpts = Object.assign({}, defaults(), opts);
    if (extendedOpts.force) {
        pnpm_logger_1.default.warn('using --force I sure hope you know what you are doing');
    }
    if (extendedOpts.localRegistry !== DEFAULT_LOCAL_REGISTRY) {
        extendedOpts.localRegistry = expandTilde_1.default(extendedOpts.localRegistry, extendedOpts.cwd);
    }
    return extendedOpts;
};
//# sourceMappingURL=extendOptions.js.map