Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Hooks

Hierarchy

  • Hooks

Properties

Optional afterAllInstalled

afterAllInstalled: undefined | function

Called after the install method from the Project class successfully completed.

Optional cleanGlobalArtifacts

cleanGlobalArtifacts: undefined | function

Called when the user requests to clean the global cache. Plugins should use this hook to remove their own global artifacts.

Optional globalHashGeneration

globalHashGeneration: undefined | function

Called before the build, to compute a global hash key that we will use to detect whether packages must be rebuilt (typically when the Node version changes).

Optional populateYarnPaths

populateYarnPaths: undefined | function

Used to notify the core of all the potential artifacts of the available linkers.

Optional reduceDependency

reduceDependency: undefined | function

Called during the resolution, once for each resolved package and each of their dependencies. By returning a new dependency descriptor you can replace the original one by a different range.

Note that when multiple plugins are registered on reduceDependency they will be executed in definition order. In that case, dependency will always refer to the dependency as it currently is, whereas initialDependency will be the descriptor before any plugin attempted to change it.

Note that when multiple plugins are registered on reduceDependency they will be executed in definition order. In that case, dependency will always refer to the dependency as it currently is, whereas initialDependency will be the descriptor before any plugin attempted to change it.

Optional registerPackageExtensions

registerPackageExtensions: undefined | function

Called when the package extensions are setup. Can be used to inject new ones. That's for example what the compat plugin uses to automatically fix packages with known flaws.

Optional setupScriptEnvironment

setupScriptEnvironment: undefined | function

Called before a script is executed. The hooks are allowed to modify the env object as they see fit, and any call to makePathWrapper will cause a binary of the given name to be injected somewhere within the PATH (we recommend you don't alter the PATH yourself unless required).

The keys you get in the env are guaranteed to be uppercase. We strongly suggest you adopt this convention for any new key added to the env (we might enforce it later on).

The keys you get in the env are guaranteed to be uppercase. We strongly suggest you adopt this convention for any new key added to the env (we might enforce it later on).

Optional validateProject

validateProject: undefined | function

Called during the Validation step of the install method from the Project class.

Optional validateWorkspace

validateWorkspace: undefined | function

Called during the Validation step of the install method from the Project class by the validateProject hook.

Optional wrapNetworkRequest

wrapNetworkRequest: undefined | function

Called when a network request is being made. The executor function parameter, when called, will trigger the network request. You can use this mechanism to wrap network requests, for example to run some validation or add some logging.

Optional wrapScriptExecution

wrapScriptExecution: undefined | function

Called as a script is getting executed. The executor function parameter, when called, will execute the script. You can use this mechanism to wrap script executions, for example to run some validation or add some performance monitoring.

Generated using TypeDoc