Type aliases
ApiMetadata
ApiMetadata: object
Type declaration
-
cache: typeof _cache
-
-
lastRefreshCheck: number
-
stats: Stats
ApplyPatchOptions
ApplyPatchOptions: object
DependencyTarget
DependencyTarget: string | [] | null
HydrateRuntimeStateOptions
HydrateRuntimeStateOptions: object
LocationLengthData
LocationLengthData: Array<number>
MakeApiOptions
MakeApiOptions: object
Type declaration
-
Optional allowDebug?: undefined | false | true
-
Optional compatibilityMode?: undefined | false | true
-
-
MakeManagerOptions
MakeManagerOptions: object
Manager
Manager: ReturnType<typeof makeManager>
PackageInformation
PackageInformation<P>: object
Type parameters
Type declaration
-
discardFromLookup: boolean
-
-
packageDependencies: Map<string, DependencyTarget>
-
packageLocation: P
-
packagePeers: Set<string>
PackageInformationData
PackageInformationData<P>: object
Type parameters
Type declaration
-
Optional discardFromLookup?: undefined | false | true
-
-
packageDependencies: Array<[]>
-
packageLocation: P
-
Optional packagePeers?: Array<string>
PackageRegistryData
PackageRegistryData: Array<[]>
PackageStoreData
PackageStoreData: Array<[]>
PatchedModule
PatchedModule: Module & object
PhysicalPackageLocator
PhysicalPackageLocator: object
Type declaration
-
name: string
-
reference: string
PnpApi
PnpApi: object
Type declaration
-
VERSIONS: object
-
[key: string]: number
-
std: number
-
findPackageLocator: function
-
Optional getAllLocators?: undefined | function
-
getDependencyTreeRoots: function
-
getLocator: function
-
-
Parameters
-
name: string
-
referencish: string | []
-
getPackageInformation: function
-
resolveRequest: function
-
resolveToUnqualified: function
-
resolveUnqualified: function
-
Optional resolveVirtual?: undefined | function
-
topLevel: object
-
name: null
-
reference: null
PnpSettings
PnpSettings: object
Type declaration
-
-
Optional enableTopLevelFallback?: undefined | false | true
-
-
Optional fallbackPool?: Map<string, DependencyTarget>
-
Optional ignorePattern?: string | null
-
-
Optional shebang?: string | null
PrettyJsonMachine
PrettyJsonMachine: object
Type declaration
-
[key: string]: object
-
collapsed: boolean
-
next: object
ResolveContext
ResolveContext: object
Type declaration
-
conditions: Array<string>
-
parentURL: string | undefined
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
-
-
-
enableTopLevelFallback: boolean
-
fallbackExclusionList: Map<string, Set<string>>
-
-
ignorePattern: RegExp | null
-
packageLocatorsByLocations: Map<PortablePath, object>
-
SerializedState
SerializedState: object
Type declaration
-
__info: Array<string>
-
-
enableTopLevelFallback: boolean
-
fallbackExclusionList: Array<[]>
-
fallbackPool: Array<[]>
-
ignorePatternData: string | null
-
TopLevelPackageLocator
TopLevelPackageLocator: object
Type declaration
-
name: null
-
reference: null
Variables
$$SETUP_STATE
$$SETUP_STATE: function
Type declaration
-
-
Parameters
-
hrs: typeof hydrateRuntimeState
-
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
default
FsLayer: 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
-
-
-
enableTopLevelFallback: boolean
-
fallbackExclusionList: Map<string, Set<string>>
-
-
ignorePattern: RegExp | null
-
packageLocatorsByLocations: Map<PortablePath, object>
-
Const emittedPackageWarnings
emittedPackageWarnings: Set<any> = new Set()
Const getFormat
get
Format: undefined | getFormat = HAS_CONSOLIDATED_HOOKS ? undefined : getFormatHook
Const getSource
get
Source: undefined | getSource = HAS_CONSOLIDATED_HOOKS ? undefined : getSourceHook
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
Const nodeFs
node
Fs: NodeFS = new NodeFS(localFs)
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
Returns the module that should be used to resolve require calls. It's usually the direct parent, except if we're inside an eval expression.