mirror of
https://github.com/pnpm/pnpm.git
synced 2026-03-24 10:01:48 -04:00
PR #1597 * feat: "recursive rebuild" supports "shared-workspace-shrinkwarp" close #1596 * fix: recursive rebuild + independen-leaves and shared shrinkwrap * fix: build workspace package in correct order during r-ve install * test: always create the store in the current test's temp folder * style: sort imports in tests * test: correct order of workspace package builds * feat: build workspace packages concurrently during headless install * refactor: use run-groups * test: stages should run in correct order
58 lines
1.4 KiB
TypeScript
58 lines
1.4 KiB
TypeScript
import createFetcher from '@pnpm/default-fetcher'
|
|
import createResolver from '@pnpm/default-resolver'
|
|
import createStore from '@pnpm/package-store'
|
|
import storePath from '@pnpm/store-path'
|
|
import path = require('path')
|
|
import { InstallOptions } from 'supi'
|
|
|
|
const registry = 'http://localhost:4873/'
|
|
|
|
const retryOpts = {
|
|
fetchRetries: 2,
|
|
fetchRetryFactor: 10,
|
|
fetchRetryMaxtimeout: 60_000,
|
|
fetchRetryMintimeout: 10_000,
|
|
}
|
|
|
|
export default async function testDefaults (
|
|
opts?: any, // tslint:disable-line
|
|
resolveOpts?: any, // tslint:disable-line
|
|
fetchOpts?: any, // tslint:disable-line
|
|
storeOpts?: any, // tslint:disable-line
|
|
): Promise<InstallOptions & {globalPrefix: string, globalBin: string}> {
|
|
let store = opts && opts.store || path.resolve('.store')
|
|
store = await storePath(opts && opts.prefix || process.cwd(), store)
|
|
const rawNpmConfig = { registry }
|
|
const storeController = await createStore(
|
|
createResolver({
|
|
fullMetadata: false,
|
|
metaCache: new Map(),
|
|
rawNpmConfig,
|
|
store,
|
|
strictSsl: true,
|
|
...retryOpts,
|
|
...resolveOpts,
|
|
}),
|
|
createFetcher({
|
|
alwaysAuth: true,
|
|
rawNpmConfig,
|
|
registry,
|
|
...retryOpts,
|
|
...fetchOpts,
|
|
}) as {},
|
|
{
|
|
locks: path.join(store, '_locks'),
|
|
store,
|
|
...storeOpts,
|
|
},
|
|
)
|
|
return {
|
|
registries: {
|
|
default: registry,
|
|
},
|
|
store,
|
|
storeController,
|
|
...opts,
|
|
}
|
|
}
|