Skip to main content

@yarnpkg/pnp

Index

Functions

generateInlinedScript

generateLoader

  • generateLoader(shebang: undefined | null | string, loader: string): string
  • Parameters

    • shebang: undefined | null | string
    • loader: string

    Returns string

generatePrettyJson

  • generatePrettyJson(data: any): string
  • Parameters

    • data: any

    Returns string

generateSplitScript

  • generateSplitScript(settings: PnpSettings): { dataFile: string; loaderFile: string }
  • Parameters

    Returns { dataFile: string; loaderFile: string }

    • dataFile: string
    • loaderFile: string

getESMLoaderTemplate

  • getESMLoaderTemplate(): string
  • Returns string

hydratePnpFile

hydratePnpSource

  • hydratePnpSource(source: string, __namedParameters: { basePath: string; fakeFs: FakeFS<PortablePath>; pnpapiResolution: string }): PnpApi
  • Parameters

    • source: string
    • __namedParameters: { basePath: string; fakeFs: FakeFS<PortablePath>; pnpapiResolution: string }

    Returns PnpApi

makeRuntimeApi

Type Aliases

DependencyTarget

DependencyTarget: string | [string, string] | null

LocationLengthData

LocationLengthData: number[]

PackageInformation

PackageInformation<P>: { discardFromLookup: boolean; linkType: LinkType; packageDependencies: Map<string, DependencyTarget>; packageLocation: P; packagePeers: Set<string> }

Type parameters

Type declaration

  • discardFromLookup: boolean
  • linkType: LinkType
  • packageDependencies: Map<string, DependencyTarget>
  • packageLocation: P
  • packagePeers: Set<string>

PackageInformationData

PackageInformationData<P>: { discardFromLookup?: boolean; linkType: LinkType; packageDependencies: [string, DependencyTarget][]; packageLocation: P; packagePeers?: string[] }

Type parameters

Type declaration

  • optionaldiscardFromLookup?: boolean
  • linkType: LinkType
  • packageDependencies: [string, DependencyTarget][]
  • packageLocation: P
  • optionalpackagePeers?: string[]

PackageLocator

PackageRegistry

PackageRegistry: Map<string | null, PackageStore>

PackageRegistryData

PackageRegistryData: [string | null, PackageStoreData][]

PackageStore

PackageStore: Map<string | null, PackageInformation<PortablePath>>

PackageStoreData

PackageStoreData: [string | null, PackageInformationData<PortablePath>][]

PhysicalPackageLocator

PhysicalPackageLocator: { name: string; reference: string }

Type declaration

  • name: string
  • reference: string

PnpApi

PnpApi: { VERSIONS: { std: number }; findPackageLocator: (location: NativePath) => PhysicalPackageLocator | null; getAllLocators?: () => PhysicalPackageLocator[]; getDependencyTreeRoots: () => PhysicalPackageLocator[]; getLocator: (name: string, referencish: string | [string, string]) => PhysicalPackageLocator; getPackageInformation: (locator: PackageLocator) => PackageInformation<NativePath> | null; resolveRequest: (request: string, issuer: NativePath | null, opts?: ResolveRequestOptions) => NativePath | null; resolveToUnqualified: (request: string, issuer: NativePath | null, opts?: ResolveToUnqualifiedOptions) => NativePath | null; resolveUnqualified: (unqualified: NativePath, opts?: ResolveUnqualifiedOptions) => NativePath; resolveVirtual?: (p: NativePath) => NativePath | null; topLevel: { name: null; reference: null } }

Type declaration

PnpSettings

PnpSettings: { dependencyTreeRoots: PhysicalPackageLocator[]; enableTopLevelFallback?: boolean; fallbackExclusionList?: PhysicalPackageLocator[]; fallbackPool?: Map<string, DependencyTarget>; ignorePattern?: string | null; packageRegistry: PackageRegistry; shebang?: string | null }

Type declaration

ResolveRequestOptions

ResolveToUnqualifiedOptions

ResolveToUnqualifiedOptions: { considerBuiltins?: boolean }

Type declaration

  • optionalconsiderBuiltins?: boolean

ResolveUnqualifiedOptions

ResolveUnqualifiedOptions: { conditions?: Set<string>; extensions?: string[] }

Type declaration

  • optionalconditions?: Set<string>
  • optionalextensions?: string[]

RuntimeState

RuntimeState: { basePath: PortablePath; dependencyTreeRoots: PhysicalPackageLocator[]; enableTopLevelFallback: boolean; fallbackExclusionList: Map<string, Set<string>>; fallbackPool: Map<string, DependencyTarget>; ignorePattern: RegExp | null; packageLocatorsByLocations: Map<PortablePath, { discardFromLookup: boolean; locator: PhysicalPackageLocator }>; packageRegistry: PackageRegistry }

Type declaration

SerializedState

SerializedState: { __info: string[]; dependencyTreeRoots: PhysicalPackageLocator[]; enableTopLevelFallback: boolean; fallbackExclusionList: [string, string[]][]; fallbackPool: [string, DependencyTarget][]; ignorePatternData: string | null; packageRegistryData: PackageRegistryData }

Type declaration

TopLevelPackageLocator

TopLevelPackageLocator: { name: null; reference: null }

Type declaration

  • name: null
  • reference: null