Configuration
Index
Properties
Methods
- activatePlugin
- firstHook
- get
- getLimit
- getLinkers
- getPackageExtensions
- getSpecial
- getSubprocessStreams
- getSupportedArchitectures
- isInteractive
- makeFetcher
- makeResolver
- normalizeDependency
- normalizeDependencyMap
- normalizeLocator
- normalizePackage
- reduceHook
- triggerHook
- triggerMultipleHooks
- use
- useWithSource
- addPlugin
- create
- find
- findFolderRcFile
- findProjectCwd
- findRcFiles
- updateConfiguration
- updateHomeConfiguration
Properties
publicenv
publicinvalid
publicisCI
publiclimits
publicplugins
publicprojectCwd
publicsettings
publicsources
publicstartingCwd
publicvalues
publicstaticdeleteProperty
publicstatictelemetry
Methods
activatePlugin
Parameters
name: string
plugin: Plugin
Returns void
firstHook
Type parameters
- U: any[]
- V
- HooksDefinition = Hooks
Parameters
get: (hooks: HooksDefinition) => undefined | (...args: U) => Promise<V>
rest...args: U
Returns Promise<null | Exclude<V, void>>
get
Type parameters
- K: keyof ConfigurationValueMap
Parameters
key: K
Returns ConfigurationValueMap[K]
getLimit
Type parameters
- K: FilterKeys<ConfigurationValueMap, number>
Parameters
key: K
Returns Limit
getLinkers
Returns Linker[]
getPackageExtensions
Returns Promise<PackageExtensions>
getSpecial
Type parameters
- T = any
Parameters
key: string
__namedParameters: Partial<SettingTransforms>
Returns T
getSubprocessStreams
Parameters
logFile: PortablePath
__namedParameters: { header?: string; prefix: string; report: Report }
Returns { stderr: Writable; stdout: Writable }
stderr: Writable
stdout: Writable
getSupportedArchitectures
Returns ArchitectureSet
isInteractive
Parameters
__namedParameters: { interactive?: boolean; stdout: Writable }
Returns boolean
makeFetcher
Returns MultiFetcher
makeResolver
Returns MultiResolver
normalizeDependency
Parameters
dependency: Descriptor
Returns Descriptor
normalizeDependencyMap
Type parameters
- TKey
Parameters
dependencyMap: Map<TKey, Descriptor>
Returns Map<TKey, Descriptor>
normalizeLocator
normalizePackage
Parameters
original: Package
__namedParameters: { packageExtensions: PackageExtensions }
Returns Package
reduceHook
Type parameters
- U: any[]
- V
- HooksDefinition = Hooks
Parameters
get: (hooks: HooksDefinition) => undefined | (reduced: V, ...args: U) => Promise<V>
initialValue: V
rest...args: U
Returns Promise<V>
triggerHook
Type parameters
- U: any[]
- V
- HooksDefinition = Hooks
Parameters
get: (hooks: HooksDefinition) => undefined | (...args: U) => V
rest...args: U
Returns Promise<void>
triggerMultipleHooks
Type parameters
- U: any[]
- V
- HooksDefinition = Hooks
Parameters
get: (hooks: HooksDefinition) => undefined | (...args: U) => V
argsList: U[]
Returns Promise<void>
use
Parameters
source: string
data: {}
folder: PortablePath
__namedParameters: { overwrite?: boolean; strict?: boolean } = {}
Returns void
useWithSource
Parameters
source: string
data: {}
folder: PortablePath
optionalopts: { overwrite?: boolean; strict?: boolean }
Returns void
staticaddPlugin
Parameters
cwd: PortablePath
pluginMetaList: PluginMeta[]
Returns Promise<void>
staticcreate
Instantiate a new configuration object with the default values from the core. You typically don't want to use this, as it will ignore the values configured in the rc files. Instead, prefer to use
Configuration#find
.Parameters
startingCwd: PortablePath
optionalplugins: Map<string, Plugin>
Returns Configuration
staticfind
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:- 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).
- 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
startingCwd: PortablePath
pluginConfiguration: null | PluginConfiguration
__namedParameters: FindProjectOptions = {}
Returns Promise<Configuration>
staticfindFolderRcFile
Parameters
cwd: PortablePath
Returns Promise<null | RcFile>
staticfindProjectCwd
Parameters
startingCwd: PortablePath
Returns Promise<null | PortablePath>
staticfindRcFiles
Parameters
startingCwd: PortablePath
Returns Promise<{ cwd: PortablePath; data: any; path: PortablePath }[]>
staticupdateConfiguration
Parameters
cwd: PortablePath
patch: {} | (current: {}) => {}
opts: { immutable?: boolean } = {}
Returns Promise<boolean>
staticupdateHomeConfiguration
Parameters
patch: {} | (current: {}) => {}
Returns Promise<boolean>
Computes and caches the package extensions.