Options
All
  • Public
  • Public/Protected
  • All
Menu

Package yarnpkg-pnp

Namespaces

Enumerations

Classes

Type aliases

Variables

Functions

Object literals

Type aliases

ApiMetadata

ApiMetadata: object

Type declaration

  • cache: typeof _cache
  • instance: PnpApi
  • lastRefreshCheck: number
  • stats: Stats

ApplyPatchOptions

ApplyPatchOptions: object

Type declaration

DependencyTarget

DependencyTarget: string | [] | null

HydrateRuntimeStateOptions

HydrateRuntimeStateOptions: object

Type declaration

  • basePath: string

LocationLengthData

LocationLengthData: Array<number>

MakeApiOptions

MakeApiOptions: object

Type declaration

  • Optional allowDebug?: undefined | false | true
  • Optional compatibilityMode?: undefined | false | true
  • fakeFs: FakeFS<PortablePath>
  • pnpapiResolution: NativePath

MakeManagerOptions

MakeManagerOptions: object

Type declaration

Manager

Manager: ReturnType<typeof makeManager>

PackageInformation

PackageInformation<P>: object

Type parameters

Type declaration

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

PackageInformationData

PackageInformationData<P>: object

Type parameters

Type declaration

  • Optional discardFromLookup?: undefined | false | true
  • linkType: LinkType
  • packageDependencies: Array<[]>
  • packageLocation: P
  • Optional packagePeers?: Array<string>

PackageLocator

PackageRegistry

PackageRegistry: Map<string | null, PackageStore>

PackageRegistryData

PackageRegistryData: Array<[]>

PackageStore

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

PackageStoreData

PackageStoreData: Array<[]>

PatchedModule

PatchedModule: Module & object

PhysicalPackageLocator

PhysicalPackageLocator: object

Type declaration

  • name: string
  • reference: string

PnpApi

PnpApi: object

Type declaration

PnpSettings

PnpSettings: object

Type declaration

PrettyJsonMachine

PrettyJsonMachine: object

Type declaration

ResolveContext

ResolveContext: object

Type declaration

  • conditions: Array<string>
  • parentURL: string | undefined

ResolveRequestOptions

ResolveToUnqualifiedOptions

ResolveToUnqualifiedOptions: object

Type declaration

  • Optional considerBuiltins?: undefined | false | true

ResolveUnqualifiedOptions

ResolveUnqualifiedOptions: object

Type declaration

  • Optional conditions?: Set<string>
  • Optional extensions?: Array<string>

RuntimeState

RuntimeState: object

Type declaration

SerializedState

SerializedState: object

Type declaration

  • __info: Array<string>
  • dependencyTreeRoots: Array<PhysicalPackageLocator>
  • enableTopLevelFallback: boolean
  • fallbackExclusionList: Array<[]>
  • fallbackPool: Array<[]>
  • ignorePatternData: string | null
  • packageRegistryData: PackageRegistryData

TopLevelPackageLocator

TopLevelPackageLocator: object

Type declaration

  • name: null
  • reference: null

Variables

$$SETUP_STATE

$$SETUP_STATE: function

Type declaration

Const ArrayIsArray

ArrayIsArray: isArray = Array.isArray

Const ERR_INVALID_MODULE_SPECIFIER

ERR_INVALID_MODULE_SPECIFIER: (Anonymous class) = createErrorType(`ERR_INVALID_MODULE_SPECIFIER`,(request, reason, base = undefined) => {return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ``}`;},TypeError)

Const ERR_INVALID_PACKAGE_CONFIG

ERR_INVALID_PACKAGE_CONFIG: (Anonymous class) = createErrorType(`ERR_INVALID_PACKAGE_CONFIG`,(path, base, message) => {return `Invalid package config ${path}${base ? ` while importing ${base}` : ``}${message ? `. ${message}` : ``}`;},Error)

Const ERR_INVALID_PACKAGE_TARGET

ERR_INVALID_PACKAGE_TARGET: (Anonymous class) = createErrorType(`ERR_INVALID_PACKAGE_TARGET`,(pkgPath, key, target, isImport = false, base = undefined) => {const relError =typeof target === `string` &&!isImport &&target.length &&!StringPrototypeStartsWith(target, `./`);if (key === `.`) {assert(isImport === false);return (`Invalid "exports" main target ${JSONStringify(target)} defined ` +`in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ``}${relError ? `; targets must start with "./"` : ``}`);}return `Invalid "${isImport ? `imports` : `exports`}" target ${JSONStringify(target)} defined for '${key}' in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ``}${relError ? `; targets must start with "./"` : ``}`;},Error)

Const ERR_PACKAGE_IMPORT_NOT_DEFINED

ERR_PACKAGE_IMPORT_NOT_DEFINED: (Anonymous class) = createErrorType(`ERR_PACKAGE_IMPORT_NOT_DEFINED`,(specifier, packagePath, base) => {return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath}package.json` : ``} imported from ${base}`;},TypeError)

Const ERR_PACKAGE_PATH_NOT_EXPORTED

ERR_PACKAGE_PATH_NOT_EXPORTED: (Anonymous class) = createErrorType('ERR_PACKAGE_PATH_NOT_EXPORTED',(pkgPath, subpath, base = undefined) => {if (subpath === '.')return `No "exports" main defined in ${pkgPath}package.json${base ? ` imported from ${base}` : ''}`;return `Package subpath '${subpath}' is not defined by "exports" in ${pkgPath}package.json${base ? ` imported from ${base}` : ''}`;},Error)

Const HAS_CONSOLIDATED_HOOKS

HAS_CONSOLIDATED_HOOKS: boolean = major > 16 || (major === 16 && minor >= 12)

Const HAS_JSON_IMPORT_ASSERTION_REQUIREMENT

HAS_JSON_IMPORT_ASSERTION_REQUIREMENT: boolean = major > 17 || (major === 17 && minor >= 1) || (major === 16 && minor > 14)

Const HAS_LAZY_LOADED_TRANSLATORS

HAS_LAZY_LOADED_TRANSLATORS: boolean = major > 19 || (major === 19 && minor >= 3)

Const HAS_UNFLAGGED_JSON_MODULES

HAS_UNFLAGGED_JSON_MODULES: boolean = major > 17 || (major === 17 && minor >= 5) || (major === 16 && minor >= 15)

Const JSONParse

JSONParse: parse = JSON.parse

Const JSONStringify

JSONStringify: stringify = JSON.stringify

Const MODULE_NOT_FOUND_ERRORS

MODULE_NOT_FOUND_ERRORS: Set<ErrorCode> = new Set([ErrorCode.BUILTIN_NODE_RESOLUTION_FAILED,ErrorCode.MISSING_DEPENDENCY,ErrorCode.MISSING_PEER_DEPENDENCY,ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED,ErrorCode.UNDECLARED_DEPENDENCY,])

Const ObjectGetOwnPropertyNames

ObjectGetOwnPropertyNames: getOwnPropertyNames = Object.getOwnPropertyNames

Const SafeMap

SafeMap: MapConstructor = Map

Const WATCH_MODE_MESSAGE_USES_ARRAYS

WATCH_MODE_MESSAGE_USES_ARRAYS: boolean = major > 19 || (major === 19 && minor >= 2) || (major === 18 && minor >= 13)

Const builtinModules

builtinModules: Set<string> = new Set(Module.builtinModules || Object.keys(process.binding(`natives`)))

Const defaultApi

defaultApi: object & object = Object.assign(makeApi(defaultRuntimeState, {fakeFs: dynamicFsLayer,pnpapiResolution: defaultPnpapiResolution,}), {/*** Can be used to generate a different API than the default one (for example* to map it on `/` rather than the local directory path, or to use a* different FS layer than the default one).*/makeApi: ({basePath = undefined,fakeFs = dynamicFsLayer,pnpapiResolution = defaultPnpapiResolution,...rest}: Partial<MakeApiOptions> & {basePath?: NativePath}) => {const apiRuntimeState = typeof basePath !== `undefined`? $$SETUP_STATE(hydrateRuntimeState, basePath): defaultRuntimeState;return makeApi(apiRuntimeState, {fakeFs,pnpapiResolution,...rest,});},/*** Will inject the specified API into the environment, monkey-patching FS. Is* automatically called when the hook is loaded through `--require`.*/setup: (api?: PnpApi) => {applyPatch(api || defaultApi, {fakeFs: defaultFsLayer,manager,});// Now that the `fs` module is patched we can swap the `baseFs` to// a NodeFS with a live `fs` binding to pick up changes to the `fs`// module allowing users to patch itdynamicFsLayer.baseFs = new NodeFS(fs);},})

Const defaultFsLayer

defaultFsLayer: FakeFS<PortablePath> = new VirtualFS({baseFs: new ZipOpenFS({baseFs: nodeFs,maxOpenFiles: 80,readOnlyArchives: true,}),})

Const defaultPnpapiResolution

defaultPnpapiResolution: string = __filename

Const defaultRuntimeState

defaultRuntimeState: object = $$SETUP_STATE(hydrateRuntimeState)

Type declaration

Const dynamicFsLayer

dynamicFsLayer: DynamicFS = new DynamicFS()

Const emittedPackageWarnings

emittedPackageWarnings: Set<any> = new Set()

Let entrypointPath

entrypointPath: NativePath | null = null

Const getFormat

getFormat: undefined | getFormat = HAS_CONSOLIDATED_HOOKS ? undefined : getFormatHook

Const getSource

getSource: undefined | getSource = HAS_CONSOLIDATED_HOOKS ? undefined : getSourceHook

Let hook

hook: any

Let hook

hook: any

Const invalidSegmentRegEx

invalidSegmentRegEx: RegExp = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i

Const isRelativeRegexp

isRelativeRegexp: RegExp = /^\.{0,2}\//

Const load

load: undefined | load = HAS_CONSOLIDATED_HOOKS ? loadHook : undefined

major

major: number

Let manager

manager: Manager

minor

minor: number

Const nodeFs

nodeFs: NodeFS = new NodeFS(localFs)

Let options

options: any

Const packageJSONCache

packageJSONCache: Map<any, any> = new SafeMap()

Const pathRegExp

pathRegExp: RegExp = /^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:node:)?(?:@[^/]+\/)?[^/]+)\/*(.*|)$/

Const patternRegEx

patternRegEx: RegExp = /\*/g

Const projectRoot

projectRoot: string & object = `/path/to/project` as PortablePath

Const resolve

resolve: resolve = resolveHook

Functions

ERR_REQUIRE_ESM

  • ERR_REQUIRE_ESM(filename: string, parentPath?: string | null): Error & object

Const ObjectPrototypeHasOwnProperty

  • ObjectPrototypeHasOwnProperty(obj: any, prop: any): boolean

ParseNodeOptionsEnvVar

  • ParseNodeOptionsEnvVar(node_options: any, errors: any): any[]

Const RegExpPrototypeExec

  • RegExpPrototypeExec(obj: any, string: any): null | RegExpExecArray

Const RegExpPrototypeSymbolReplace

  • RegExpPrototypeSymbolReplace(obj: any, ...rest: any[]): string

Const StringPrototypeEndsWith

  • StringPrototypeEndsWith(str: any, ...rest: any[]): boolean

Const StringPrototypeIncludes

  • StringPrototypeIncludes(str: any, ...rest: any[]): boolean

Const StringPrototypeIndexOf

  • StringPrototypeIndexOf(str: any, ...rest: any[]): number

Const StringPrototypeLastIndexOf

  • StringPrototypeLastIndexOf(str: any, ...rest: any[]): number

Const StringPrototypeReplace

  • StringPrototypeReplace(str: any, ...rest: any[]): string

Const StringPrototypeSlice

  • StringPrototypeSlice(str: any, ...rest: any[]): string

Const StringPrototypeStartsWith

  • StringPrototypeStartsWith(str: any, ...rest: any[]): boolean

applyPatch

createErrorType

  • createErrorType(code: any, messageCreator: any, errorType: any): (Anonymous class)

emitTrailingSlashPatternDeprecation

  • emitTrailingSlashPatternDeprecation(match: any, pjsonUrl: any, base: any): void

filterOwnProperties

  • filterOwnProperties(source: any, keys: any): any

generate

generateCollapsedArray

  • generateCollapsedArray(data: Array<any>, state: PrettyJsonState, indent: string): string

generateCollapsedObject

  • generateCollapsedObject(data: object, state: PrettyJsonState, indent: string): string

generateExpandedArray

  • generateExpandedArray(data: Array<any>, state: PrettyJsonState, indent: string): string

generateExpandedObject

  • generateExpandedObject(data: object, state: PrettyJsonState, indent: string): string

generateFallbackExclusionList

  • generateFallbackExclusionList(settings: PnpSettings): Array<[]>

generateFallbackPoolData

  • generateFallbackPoolData(settings: PnpSettings): Array<[]>

generateInlinedScript

generateInlinedSetup

generateJsonString

generateLoader

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

generateNext

  • generateNext(key: string, data: any, state: PrettyJsonState, indent: string): string

generatePackageRegistryData

generatePrettyJson

  • generatePrettyJson(data: any): string

generateSerializedState

generateSplitScript

generateSplitSetup

  • generateSplitSetup(): string

generateStringLiteral

  • generateStringLiteral(value: string): string

getFileFormat

  • getFileFormat(filepath: string): string | null

getFormat

  • getFormat(resolved: string, context: object, defaultGetFormat: typeof getFormat): Promise<object>

getIssuerModule

  • getIssuerModule(parent: NodeModule | null | undefined): NodeModule | null

getNodeOptionsEnvArgv

  • getNodeOptionsEnvArgv(): any[]

getOptionValue

  • getOptionValue(opt: any): any

getPackageConfig

  • getPackageConfig(path: any, specifier: any, base: any, readFileSyncFn: any): any

getPackageScopeConfig

  • getPackageScopeConfig(resolved: any, readFileSyncFn: any): any

getPathForDisplay

  • getPathForDisplay(p: Path): string & object

getSource

  • getSource(urlString: string, context: object, defaultGetSource: typeof getSource): Promise<object>

hydratePnpFile

  • hydratePnpFile(location: PortablePath, __namedParameters: object): Promise<object>

hydratePnpSource

  • hydratePnpSource(source: string, __namedParameters: object): object

hydrateRuntimeState

isArrayIndex

  • isArrayIndex(key: any): boolean

Const isBuiltinModule

  • isBuiltinModule(request: string): boolean

isConditionalExportsMainSugar

  • isConditionalExportsMainSugar(exports: any, packageJSONUrl: any, base: any): boolean

load

  • load(urlString: string, context: object, nextLoad: typeof load): Promise<object>

makeApi

makeError

  • makeError(pnpCode: ErrorCode, message: string, data?: Record<string, any>, code?: undefined | string): Error & object

makeManager

Const makeRuntimeApi

packageExportsResolve

  • packageExportsResolve(__namedParameters: object): any

packageImportsResolve

  • packageImportsResolve(__namedParameters: object): any

parseArgv

  • parseArgv(argv: any): object & object

parseOptions

  • parseOptions(): void

patternKeyCompare

  • patternKeyCompare(a: any, b: any): 0 | 1 | -1

readPackage

readPackageScope

  • readPackageScope(checkPath: NativePath): false | object

reportRequiredFilesToWatchMode

  • reportRequiredFilesToWatchMode(files: Array<NativePath>): void

resolve

  • resolve(originalSpecifier: string, context: ResolveContext, nextResolve: typeof resolve): Promise<object>

resolvePackageTarget

  • resolvePackageTarget(packageJSONUrl: any, target: any, subpath: any, packageSubpath: any, base: any, pattern: any, internal: any, conditions: any): any

resolvePackageTargetString

  • resolvePackageTargetString(target: any, subpath: any, match: any, packageJSONUrl: any, base: any, pattern: any, internal: any, conditions: any): any

resolvePrivateRequest

  • resolvePrivateRequest(specifier: string, issuer: string, context: ResolveContext, nextResolve: typeof resolve): Promise<object>

setEntrypointPath

sortMap

  • sortMap<T>(values: Iterable<T>, mappers: function | Array<function>): T[]

throwExportsNotFound

  • throwExportsNotFound(subpath: any, packageJSONUrl: any, base: any): void

throwImportNotDefined

  • throwImportNotDefined(specifier: any, packageJSONUrl: any, base: any): void

throwInvalidPackageTarget

  • throwInvalidPackageTarget(subpath: any, target: any, packageJSONUrl: any, internal: any, base: any): void

throwInvalidSubpath

  • throwInvalidSubpath(subpath: any, packageJSONUrl: any, internal: any, base: any): void

tryParseURL

  • tryParseURL(str: string, base?: string | URL | undefined): null | URL

tryReadFile

  • tryReadFile(path: NativePath): Promise<string | null>

tryReadFile

  • tryReadFile(filePath: string): undefined | string

wrapOutput

  • wrapOutput(): object

Object literals

Const localFs

localFs: object

Const prettyJsonMachine

prettyJsonMachine: object

__computed

__computed: object

collapsed

collapsed: true = true

next

next: object

*

*: DEFAULT = PrettyJsonState.DEFAULT

fallbackExclusionList

fallbackExclusionList: FALLBACK_EXCLUSION_LIST = PrettyJsonState.FALLBACK_EXCLUSION_LIST

packageDependencies

packageDependencies: PACKAGE_DEPENDENCIES = PrettyJsonState.PACKAGE_DEPENDENCIES

packageRegistryData

packageRegistryData: PACKAGE_REGISTRY_DATA = PrettyJsonState.PACKAGE_REGISTRY_DATA

Generated using TypeDoc