"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const default_fetcher_1 = require("@pnpm/default-fetcher");
const package_store_1 = require("@pnpm/package-store");
const fs = require("mz/fs");
const createResolver_1 = require("./createResolver");
exports.default = async (opts) => {
    const sopts = Object.assign(opts, {
        registry: opts.registry || 'https://registry.npmjs.org/',
    });
    const resolve = createResolver_1.default(sopts);
    await fs.mkdir(sopts.storeDir, { recursive: true });
    const fetchers = default_fetcher_1.default(sopts);
    return {
        ctrl: await package_store_1.default(resolve, fetchers, {
            ignoreFile: sopts.ignoreFile,
            networkConcurrency: sopts.networkConcurrency,
            packageImportMethod: sopts.packageImportMethod,
            storeDir: sopts.storeDir,
            verifyStoreIntegrity: typeof sopts.verifyStoreIntegrity === 'boolean' ?
                sopts.verifyStoreIntegrity : true,
        }),
        dir: sopts.storeDir,
    };
};
//# sourceMappingURL=createNewStoreController.js.map