How to use the @pnpm/package-is-installable function in @pnpm/package-is-installable

To help you get started, we’ve selected a few @pnpm/package-is-installable 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 / packages / filter-lockfile / src / filterLockfileByImportersAndEngine.ts View on Github external
}
    let installable!: boolean
    if (!parentIsInstallable) {
      installable = false
      if (!ctx.pickedPackages[relDepPath]) {
        opts.skipped.add(relDepPath)
      }
    } else {
      const pkg = {
        ...nameVerFromPkgSnapshot(relDepPath, pkgSnapshot),
        cpu: pkgSnapshot.cpu,
        engines: pkgSnapshot.engines,
        os: pkgSnapshot.os,
      }
      // TODO: relDepPath is not the package ID. Should be fixed
      installable = opts.includeIncompatiblePackages || packageIsInstallable(pkgSnapshot.id || relDepPath, pkg, {
        engineStrict: opts.engineStrict,
        lockfileDir: opts.lockfileDir,
        nodeVersion: opts.currentEngine.nodeVersion,
        optional: pkgSnapshot.optional === true,
        pnpmVersion: opts.currentEngine.pnpmVersion,
      }) !== false
      if (!installable) {
        if (!ctx.pickedPackages[relDepPath]) {
          opts.skipped.add(relDepPath)
        }
      } else {
        opts.skipped.delete(relDepPath)
        ctx.pickedPackages[relDepPath] = pkgSnapshot
      }
    }
    const nextRelDepPaths = R.toPairs(
github pnpm / pnpm / packages / resolve-dependencies / src / resolveDependencies.ts View on Github external
deprecationLogger.debug({
      deprecated: pkg.deprecated,
      depth: options.currentDepth,
      pkgId: pkgResponse.body.id,
      pkgName: pkg.name,
      pkgVersion: pkg.version,
      prefix: ctx.prefix,
    })
  }

  // using colon as it will never be used inside a package ID
  const nodeId = createNodeId(options.parentNodeId, pkgResponse.body.id)

  const currentIsInstallable = (
      ctx.force ||
      packageIsInstallable(pkgResponse.body.id, pkg, {
        engineStrict: ctx.engineStrict,
        lockfileDir: ctx.lockfileDir,
        nodeVersion: ctx.nodeVersion,
        optional: wantedDependency.optional,
        pnpmVersion: ctx.pnpmVersion,
      })
    )
  if (currentIsInstallable !== true || !parentIsInstallable) {
    ctx.skipped.add(pkgResponse.body.id)
  }
  const installable = parentIsInstallable && currentIsInstallable !== false
  const isNew = !ctx.resolvedPackagesByPackageId[pkgResponse.body.id]

  if (isNew) {
    progressLogger.debug({
      packageId: pkgResponse.body.id,

@pnpm/package-is-installable

Checks if a package is installable on the current system

MIT
Latest version published 8 days ago

Package Health Score

66 / 100
Full package analysis

Popular @pnpm/package-is-installable functions

Similar packages