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

  • 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<[]>

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 ALLOWS_NON_FILE_PARENT

ALLOWS_NON_FILE_PARENT: boolean = major > 18 || (major === 18 && minor >= 1) || (major === 16 && minor >= 17)

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 === 20 && minor < 6) || (major === 19 && minor >= 3)

Const HAS_LOADERS_AFFECTING_LOADERS

HAS_LOADERS_AFFECTING_LOADERS: boolean = major > 19 || (major === 19 && minor >= 6)

Const HAS_UNFLAGGED_JSON_MODULES

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

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 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,libzip: () => getLibzipSync(),maxOpenFiles: 80,readOnlyArchives: true,}),})

Const defaultPnpapiResolution

defaultPnpapiResolution: string = __filename

Const defaultRuntimeState

defaultRuntimeState: object = $$SETUP_STATE(hydrateRuntimeState)

Type declaration

Const dynamicFsLayer

dynamicFsLayer: DynamicFS = new DynamicFS()

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

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)

Const pathRegExp

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

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

applyPatch

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

  • generateSplitScript(settings: PnpSettings & object): object

generateSplitSetup

  • generateSplitSetup(dataLocation: string): 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

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

Const isBuiltinModule

  • isBuiltinModule(request: string): 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

readPackage

readPackageScope

  • readPackageScope(checkPath: NativePath): false | object

reportRequiredFilesToWatchMode

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

resolve

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

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[]

tryParseURL

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

tryReadFile

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

tryReadFile

  • tryReadFile(filePath: string): undefined | string

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