How to use @pnpm/default-resolver - 4 common examples

To help you get started, we’ve selected a few @pnpm/default-resolver examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pnpm / pnpm / test / utils / testDefaults.ts View on Github external
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 {
  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: true, // temporarily. Till the lifecycle hooks performance issue is solved
      metaCache: new Map(),
      rawNpmConfig,
      store,
      strictSsl: true,
      ...retryOpts,
      ...resolveOpts,
    }),
    createFetcher({
      alwaysAuth: true,
      rawNpmConfig,
      registry,
      ...retryOpts,
      ...fetchOpts,
    }) as {},
    {
github pnpm / pnpm / packages / cli-utils / src / createLatestManifestGetter.ts View on Github external
httpsProxy?: string,
    key?: string,
    localAddress?: string,
    lockfileDir: string,
    offline?: boolean,
    dir: string,
    proxy?: string,
    rawConfig: object,
    registries: Registries,
    storeDir: string,
    strictSsl?: boolean,
    userAgent?: string,
    verifyStoreIntegrity?: boolean,
  },
): (packageName: string) => Promise {
  const resolve = createResolver(Object.assign(opts, {
    fullMetadata: true,
    metaCache: new LRU({
      max: 10000,
      maxAge: 120 * 1000, // 2 minutes
    }) as any, // tslint:disable-line:no-any
  }))
  return mem(getLatestManifest.bind(null, resolve, opts))
}
github pnpm / pnpm / test / utils / testDefaults.ts View on Github external
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 {
  let store = opts && opts.store || tempy.directory()
  store = await storePath(opts && opts.prefix || process.cwd(), store)
  const rawNpmConfig = {registry}
  const storeController = await createStore(
    createResolver({
      metaCache: new Map(),
      rawNpmConfig,
      store,
      strictSsl: true,
      ...retryOpts,
      ...resolveOpts,
    }),
    createFetcher({
      alwaysAuth: true,
      rawNpmConfig,
      registry,
      ...retryOpts,
      ...fetchOpts,
    }) as {},
    {
      locks: path.join(store, '_locks'),
github pnpm / pnpm / packages / store-connection-manager / src / createResolver.ts View on Github external
export default function (
  opts: CreateResolverOptions,
) {
  return createResolver(Object.assign(opts, {
    fullMetadata: false,
    metaCache: new LRU({
      max: 10000,
      maxAge: 120 * 1000, // 2 minutes
    }) as any, // tslint:disable-line:no-any
  }))
}

@pnpm/default-resolver

pnpm's default package resolver

MIT
Latest version published 20 days ago

Package Health Score

61 / 100
Full package analysis

Popular @pnpm/default-resolver functions