Skip to main content

@yarnpkg/core

Index

Functions

parseMessageName

stringifyMessageName

  • stringifyMessageName(name: number): string
  • Parameters

    • name: number

    Returns string

References

CommandContext

Re-exports CommandContext

Type Aliases

AllDependencies

AllDependencies: dependencies | devDependencies | peerDependencies

BuildDirective

BuildDirective: { script: string; type: BuildDirectiveType }

Type declaration

BuildRequest

BuildRequest: { directives: BuildDirective[]; skipped: false } | { explain: (report: Report) => void; skipped: true }

ConfigurationDefinitionMap

ConfigurationDefinitionMap<V>: { [ K in keyof V ]: DefinitionForType<V[K]> }

Type parameters

DescriptorHash

DescriptorHash: string & { __descriptorHash: string }

Unique hash of a package descriptor. Used as key in various places so that two descriptors can be quickly compared.

FetchOptions

FetchOptions: MinimalFetchOptions & { cache: Cache; cacheOptions?: CacheOptions; checksums: Map<LocatorHash, string | null>; report: Report }

FetchResult

FetchResult: { checksum?: string | null; discardFromLookup?: boolean; localPath?: PortablePath | null; packageFs: FakeFS<PortablePath>; prefixPath: PortablePath; releaseFs?: () => void }

Type declaration

  • optionalchecksum?: string | null

    The checksum for the fetch result.

  • optionaldiscardFromLookup?: boolean

    If true, the package location won't be considered for package lookups (so for example with can use this flag to indicate that the link: protocol should be resolvable, but should never be used to detect the package that owns a path).

  • optionallocalPath?: PortablePath | null

    The "true" place where we can find the sources. We use that in order to compute the file: and link: relative paths.

  • packageFs: FakeFS<PortablePath>
  • prefixPath: PortablePath

    The path where the package can be found within the packageFs. This is typically the node_modules/<scope>/<name> path.

  • optionalreleaseFs?: () => void

    If set, this function will be called once the fetch result isn't needed anymore. Typically used to release the ZipFS memory.

      • (): void
      • If set, this function will be called once the fetch result isn't needed anymore. Typically used to release the ZipFS memory.


        Returns void

FinalizeInstallStatus

FinalizeInstallStatus: { buildLocations: PortablePath[]; buildRequest: BuildRequest; locator: Locator }

Type declaration

FormatType

FormatType: formatUtils.Type
@deprecated

HardDependencies

HardDependencies: dependencies | devDependencies

IdentHash

IdentHash: string & { __identHash: string }

Unique hash of a package descriptor. Used as key in various places so that two descriptors can be quickly compared.

InstallPackageExtraApi

InstallPackageExtraApi: { holdFetchResult: (promise: Promise<void>) => void }

Type declaration

  • holdFetchResult: (promise: Promise<void>) => void

    The core reclaims the virtual filesystem by default when the installPackage function returns. This may be annoying when working on parallel installers, since installPackage are guaranteed to work sequentially (and thus no two packages could be installed at the same time, since one's fs would be closed as soon as the second would start).

    To avoid that, you can call the holdFetchResult function from this extra API to indicate to the core that it shouldn't reclaim the filesystem until the API passed in parameter as finished executing. Note that this may lead to higher memory consumption (since multiple packages may be kept in memory), so you'll need to implement an upper bound to the number of concurrent package installs.

      • (promise: Promise<void>): void
      • The core reclaims the virtual filesystem by default when the installPackage function returns. This may be annoying when working on parallel installers, since installPackage are guaranteed to work sequentially (and thus no two packages could be installed at the same time, since one's fs would be closed as soon as the second would start).

        To avoid that, you can call the holdFetchResult function from this extra API to indicate to the core that it shouldn't reclaim the filesystem until the API passed in parameter as finished executing. Note that this may lead to higher memory consumption (since multiple packages may be kept in memory), so you'll need to implement an upper bound to the number of concurrent package installs.


        Parameters

        • promise: Promise<void>

        Returns void

InstallStatus

InstallStatus: { buildRequest: BuildRequest | null; installPromise?: Promise<void>; packageLocation: PortablePath | null }

Type declaration

LinkOptions

LinkOptions: MinimalLinkOptions & { report: Report }

LocatorHash

LocatorHash: string & { __locatorHash: string }

Unique hash of a package locator. Used as key in various places so that two locators can be quickly compared.

MinimalFetchOptions

MinimalFetchOptions: { fetcher: Fetcher; project: Project }

Type declaration

MinimalLinkOptions

MinimalLinkOptions: { project: Project }

Type declaration

MinimalResolveOptions

MinimalResolveOptions: { project: Project; resolver: Resolver }

Type declaration

PackageExtension

PackageExtension: ({ descriptor: Descriptor; type: PackageExtensionType.Dependency } | { descriptor: Descriptor; type: PackageExtensionType.PeerDependency } | { key: keyof PeerDependencyMeta; selector: string; type: PackageExtensionType.PeerDependencyMeta; value: any }) & { parentDescriptor: Descriptor; status: PackageExtensionStatus; userProvided: boolean }

PackageExtensionData

PackageExtensions

PackageExtensions: Map<IdentHash, [string, PackageExtension[]][]>

PeerRequirement

PeerRequirement: { allRequesters: LocatorHash[]; requested: Ident; rootRequester: LocatorHash; subject: LocatorHash }

Type declaration

PeerWarning

PeerWarning: { hash: string; requested: Ident; requester: Ident; subject: Locator; type: PeerWarningType.NotProvided } | { hash: string; requested: Ident; requester: Ident; requirementCount: number; subject: Locator; type: PeerWarningType.NotCompatible; version: string } | { hash: string; node: PeerRequirementNode; type: PeerWarningType.NodeNotProvided } | { hash: string; node: PeerRequirementNode; range: string | null; type: PeerWarningType.NodeNotCompatible }

Plugin

Plugin<PluginHooks>: { commands?: CommandClass<CommandContext>[]; configuration?: Partial<ConfigurationDefinitionMap>; fetchers?: FetcherPlugin[]; hooks?: PluginHooks; linkers?: LinkerPlugin[]; resolvers?: ResolverPlugin[] }

Type parameters

  • PluginHooks = any

Type declaration

  • optionalcommands?: CommandClass<CommandContext>[]
  • optionalconfiguration?: Partial<ConfigurationDefinitionMap>
  • optionalfetchers?: FetcherPlugin[]
  • optionalhooks?: PluginHooks
  • optionallinkers?: LinkerPlugin[]
  • optionalresolvers?: ResolverPlugin[]

PluginConfiguration

PluginConfiguration: { modules: Map<string, any>; plugins: Set<string> }

Type declaration

  • modules: Map<string, any>
  • plugins: Set<string>

ResolveOptions

ResolveOptions: MinimalResolveOptions & { fetchOptions?: FetchOptions | null; report: Report }

SettingsDefinition

SettingsDefinition: MapSettingsDefinition | ShapeSettingsDefinition | SimpleSettingsDefinition

WrapNetworkRequestInfo

WrapNetworkRequestInfo: httpUtils.Options & { body: httpUtils.Body; target: string | URL }

Variables

constCACHE_CHECKPOINT

CACHE_CHECKPOINT: number = ...

If value defines the minimal cache version we can read files from. We need to bump this value every time we fix a bug in the cache implementation that causes the archived content to change.

constCACHE_VERSION

CACHE_VERSION: number = ...

The cache version, on the other hand, is meant to be bumped every time we change the archives in any way (for example when upgrading the libzip or zlib implementations in ways that would change the exact bytes). This way we can avoid refetching the archives when their content hasn't actually changed in a significant way.

constDEFAULT_RC_FILENAME

DEFAULT_RC_FILENAME: Filename = ...

FormatType

FormatType: { ADDED: ADDED; CODE: CODE; DEPENDENT: DEPENDENT; DESCRIPTOR: DESCRIPTOR; DURATION: DURATION; ID: ID; IDENT: IDENT; INSPECT: INSPECT; LOCATOR: LOCATOR; MARKDOWN: MARKDOWN; MARKDOWN_INLINE: MARKDOWN_INLINE; NAME: NAME; NO_HINT: NO_HINT; NULL: NULL; NUMBER: NUMBER; PACKAGE_EXTENSION: PACKAGE_EXTENSION; PATH: PATH; RANGE: RANGE; REFERENCE: REFERENCE; REMOVED: REMOVED; RESOLUTION: RESOLUTION; SCOPE: SCOPE; SETTING: SETTING; SIZE: SIZE; SIZE_DIFF: SIZE_DIFF; URL: URL }
@deprecated

Type declaration

  • readonlyADDED: ADDED
  • readonlyCODE: CODE
  • readonlyDEPENDENT: DEPENDENT
  • readonlyDESCRIPTOR: DESCRIPTOR
  • readonlyDURATION: DURATION
  • readonlyID: ID
  • readonlyIDENT: IDENT
  • readonlyINSPECT: INSPECT
  • readonlyLOCATOR: LOCATOR
  • readonlyMARKDOWN: MARKDOWN
  • readonlyMARKDOWN_INLINE: MARKDOWN_INLINE
  • readonlyNAME: NAME
  • readonlyNO_HINT: NO_HINT
  • readonlyNULL: NULL
  • readonlyNUMBER: NUMBER
  • readonlyPACKAGE_EXTENSION: PACKAGE_EXTENSION
  • readonlyPATH: PATH
  • readonlyRANGE: RANGE
  • readonlyREFERENCE: REFERENCE
  • readonlyREMOVED: REMOVED
  • readonlyRESOLUTION: RESOLUTION
  • readonlySCOPE: SCOPE
  • readonlySETTING: SETTING
  • readonlySIZE: SIZE
  • readonlySIZE_DIFF: SIZE_DIFF
  • readonlyURL: URL

constLEGACY_PLUGINS

LEGACY_PLUGINS: Set<string> = ...

constLOCKFILE_VERSION

LOCKFILE_VERSION: number = ...

constTAG_REGEXP

TAG_REGEXP: RegExp = ...

constYarnVersion

YarnVersion: null | string = ...