Options
All
  • Public
  • Public/Protected
  • All
Menu

Package plugin-pnp

@yarnpkg/plugin-pnp

This plugin adds support for installing packages according to the Plug'n'Play specification.

Install

This plugin is included by default in Yarn.

Type aliases

CustomPackageData

CustomPackageData: UnboxPromise<ReturnType<typeof extractCustomPackageData>>

ExtractBuildScriptDataRequirements

ExtractBuildScriptDataRequirements: object

Type declaration

  • manifest: Pick<Manifest, "scripts">
  • misc: object
    • hasBindingGyp: boolean

UnboxPromise

UnboxPromise<T>: T extends Promise<infer U> ? U : never

Type parameters

  • T: Promise<any>

Variables

Const FORCED_EXTRACT_FILETYPES

FORCED_EXTRACT_FILETYPES: Set<string> = new Set([// Windows can't execute exe files inside zip archives`.exe`,// The c/c++ compiler can't read files from zip archives`.h`, `.hh`, `.hpp`, `.c`, `.cc`, `.cpp`,// The java runtime can't read files from zip archives`.java`, `.jar`,// Node opens these through dlopen`.node`,])

Const FORCED_UNPLUG_PACKAGES

FORCED_UNPLUG_PACKAGES: Set<string & object> = new Set([// Contains native binariesstructUtils.makeIdent(null, `open`).identHash,structUtils.makeIdent(null, `opn`).identHash,])

Functions

checkAndReportManifestCompatibility

  • checkAndReportManifestCompatibility(pkg: Package, label: string, __namedParameters: object): boolean

checkManifestCompatibility

  • checkManifestCompatibility(pkg: Package): boolean

extractBuildScripts

extractCustomPackageData

  • extractCustomPackageData(fetchResult: FetchResult): Promise<object>

getExtractHint

Const getPnpPath

  • getPnpPath(project: Project): object

getUnpluggedPath

  • getUnpluggedPath(locator: Locator, __namedParameters: object): string & object

hasBindingGyp

normalizeDirectoryPath

populateYarnPaths

  • populateYarnPaths(project: Project, definePath: function): Promise<void>

Const quotePathIfNeeded

  • quotePathIfNeeded(path: string): string

setupScriptEnvironment

  • setupScriptEnvironment(project: Project, env: object, makePathWrapper: function): Promise<void>
  • Parameters

    • project: Project
    • env: object
      • [key: string]: string
    • makePathWrapper: function
        • (name: string, argv0: string, args: Array<string>): Promise<void>
        • Parameters

          • name: string
          • argv0: string
          • args: Array<string>

          Returns Promise<void>

    Returns Promise<void>

Object literals

Const plugin

plugin: object

commands

commands: UnplugCommand[] = [UnplugCommand,]

linkers

linkers: PnpLinker[] = [PnpLinker,]

configuration

configuration: object

nodeLinker

nodeLinker: object

default

default: string = `pnp`

description

description: string = `The linker used for installing Node packages, one of: "pnp", "node-modules"`

type

type: STRING = SettingsType.STRING

pnpEnableEsmLoader

pnpEnableEsmLoader: object

default

default: boolean = false

description

description: string = `If true, Yarn will generate an ESM loader (\`.pnp.loader.mjs\`). If this is not explicitly set Yarn tries to automatically detect whether ESM support is required.`

type

type: BOOLEAN = SettingsType.BOOLEAN

pnpEnableInlining

pnpEnableInlining: object

default

default: boolean = true

description

description: string = `If true, the PnP data will be inlined along with the generated loader`

type

type: BOOLEAN = SettingsType.BOOLEAN

pnpFallbackMode

pnpFallbackMode: object

default

default: string = `dependencies-only`

description

description: string = `If true, the generated PnP loader will follow the top-level fallback rule`

type

type: STRING = SettingsType.STRING

pnpIgnorePatterns

pnpIgnorePatterns: object

default

default: never[] = []

description

description: string = `Array of glob patterns; files matching them will use the classic resolution`

isArray

isArray: true = true

type

type: STRING = SettingsType.STRING

pnpMode

pnpMode: object

default

default: string = `strict`

description

description: string = `If 'strict', generates standard PnP maps. If 'loose', merges them with the n_m resolution.`

type

type: STRING = SettingsType.STRING

pnpShebang

pnpShebang: object

default

default: string = `#!/usr/bin/env node`

description

description: string = `String to prepend to the generated PnP script`

type

type: STRING = SettingsType.STRING

pnpUnpluggedFolder

pnpUnpluggedFolder: object

default

default: string = `./.yarn/unplugged`

description

description: string = `Folder where the unplugged packages must be stored`

type

type: ABSOLUTE_PATH = SettingsType.ABSOLUTE_PATH

winLinkType

winLinkType: object

default

default: WindowsLinkType = WindowsLinkType.JUNCTIONS

description

description: string = `Whether Yarn should use Windows Junctions or symlinks when creating links on Windows.`

type

type: STRING = SettingsType.STRING

values

values: WindowsLinkType[] = [WindowsLinkType.JUNCTIONS,WindowsLinkType.SYMLINKS,]

hooks

hooks: object

populateYarnPaths

populateYarnPaths: populateYarnPaths

setupScriptEnvironment

setupScriptEnvironment: setupScriptEnvironment

Generated using TypeDoc