Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Configuration

Hierarchy

  • Configuration

Constructors

Private constructor

Properties

invalid

invalid: Map<string, string> = new Map()

limits

limits: Map<string, Limit> = new Map()

packageExtensions

packageExtensions: Map<IdentHash, Array<[]>> = new Map()

plugins

plugins: Map<string, Plugin> = new Map()

projectCwd

projectCwd: PortablePath | null = null

settings

settings: Map<string, SettingsDefinition> = new Map()

sources

sources: Map<string, string> = new Map()

startingCwd

startingCwd: PortablePath

values

values: Map<string, any> = new Map()

Static deleteProperty

deleteProperty: symbol = Symbol()

Static telemetry

telemetry: TelemetryManager | null = null

Methods

activatePlugin

  • activatePlugin(name: string, plugin: Plugin): void

firstHook

  • firstHook<U, V, HooksDefinition>(get: function, ...args: U): Promise<Exclude<V, void> | null>
  • Type parameters

    • U: Array<any>

    • V

    • HooksDefinition

    Parameters

    • get: function
        • (hooks: HooksDefinition): function | undefined
        • Parameters

          • hooks: HooksDefinition

          Returns function | undefined

    • Rest ...args: U

    Returns Promise<Exclude<V, void> | null>

get

  • get<K>(key: K): ConfigurationValueMap[K]
  • get(key: string): unknown

getLimit

  • getLimit<K>(key: K): Limit

getLinkers

getSpecial

  • getSpecial<T>(key: string, __namedParameters: object): T

getSubprocessStreams

  • getSubprocessStreams(logFile: PortablePath, __namedParameters: object): object

getSupportedArchitectures

  • getSupportedArchitectures(): nodeUtils.ArchitectureSet

Private importSettings

  • importSettings(definitions: object): void

makeFetcher

makeResolver

normalizeDependency

normalizeDependencyMap

normalizeLocator

normalizePackage

reduceHook

  • reduceHook<U, V, HooksDefinition>(get: function, initialValue: V, ...args: U): Promise<V>
  • Type parameters

    • U: Array<any>

    • V

    • HooksDefinition

    Parameters

    • get: function
        • (hooks: HooksDefinition): function | undefined
        • Parameters

          • hooks: HooksDefinition

          Returns function | undefined

    • initialValue: V
    • Rest ...args: U

    Returns Promise<V>

refreshPackageExtensions

  • refreshPackageExtensions(): Promise<void>

triggerHook

  • triggerHook<U, V, HooksDefinition>(get: function, ...args: U): Promise<void>
  • Type parameters

    • U: Array<any>

    • V

    • HooksDefinition

    Parameters

    • get: function
        • (hooks: HooksDefinition): function | undefined
        • Parameters

          • hooks: HooksDefinition

          Returns function | undefined

    • Rest ...args: U

    Returns Promise<void>

triggerMultipleHooks

  • triggerMultipleHooks<U, V, HooksDefinition>(get: function, argsList: Array<U>): Promise<void>
  • Type parameters

    • U: Array<any>

    • V

    • HooksDefinition

    Parameters

    • get: function
        • (hooks: HooksDefinition): function | undefined
        • Parameters

          • hooks: HooksDefinition

          Returns function | undefined

    • argsList: Array<U>

    Returns Promise<void>

use

  • use(source: string, data: object, folder: PortablePath, __namedParameters?: object): void

useWithSource

  • useWithSource(source: string, data: object, folder: PortablePath, opts?: undefined | object): void

Static addPlugin

Static create

Static find

  • Instantiate a new configuration object exposing the configuration obtained from reading the various rc files and the environment settings.

    The pluginConfiguration parameter is expected to indicate:

    1. which modules should be made available to plugins when they require a package (this is the dynamic linking part - for example we want all the plugins to use the exact same version of @yarnpkg/core, which also is the version used by the running Yarn instance).

    2. which of those modules are actually plugins that need to be injected within the configuration.

    Note that some extra plugins will be automatically added based on the content of the rc files - with the rc plugins taking precedence over the other ones.

    One particularity: the plugin initialization order is quite strict, with plugins listed in /foo/bar/.yarnrc.yml taking precedence over plugins listed in /foo/.yarnrc.yml and /.yarnrc.yml. Additionally, while plugins can depend on one another, they can only depend on plugins that have been instantiated before them (so a plugin listed in /foo/.yarnrc.yml can depend on another one listed on /foo/bar/.yarnrc.yml, but not the other way around).

    The pluginConfiguration parameter is expected to indicate:

    1. which modules should be made available to plugins when they require a package (this is the dynamic linking part - for example we want all the plugins to use the exact same version of @yarnpkg/core, which also is the version used by the running Yarn instance).

    2. which of those modules are actually plugins that need to be injected within the configuration.

    Note that some extra plugins will be automatically added based on the content of the rc files - with the rc plugins taking precedence over the other ones.

    One particularity: the plugin initialization order is quite strict, with plugins listed in /foo/bar/.yarnrc.yml taking precedence over plugins listed in /foo/.yarnrc.yml and /.yarnrc.yml. Additionally, while plugins can depend on one another, they can only depend on plugins that have been instantiated before them (so a plugin listed in /foo/.yarnrc.yml can depend on another one listed on /foo/bar/.yarnrc.yml, but not the other way around).

    Parameters

    Returns Promise<Configuration>

Static findHomeRcFile

  • findHomeRcFile(): Promise<null | object>

Static findProjectCwd

  • findProjectCwd(startingCwd: PortablePath, lockfileFilename: Filename | null): Promise<null | string & object>

Static findRcFiles

Static updateConfiguration

  • updateConfiguration(cwd: PortablePath, patch: object | function): Promise<void>

Static updateHomeConfiguration

  • updateHomeConfiguration(patch: object | function): Promise<void>

Generated using TypeDoc