Hooks
Index
Properties
optionalafterWorkspaceDependencyAddition
Type declaration
Called when a new dependency is added to a workspace. Note that this hook is only called by the CLI commands like
yarn add
- manually adding the dependencies into the manifest and runningyarn install
won't trigger it.Parameters
workspace: Workspace
target: Target
descriptor: Descriptor
strategies: Strategy[]
Returns Promise<void>
optionalafterWorkspaceDependencyRemoval
Called when a dependency range is removed from a workspace. Note that
this hook is only called by the CLI commands like yarn remove
- manually
removing the dependencies from the manifest and running yarn install
won't trigger it.
Type declaration
Called when a dependency range is removed from a workspace. Note that this hook is only called by the CLI commands like
yarn remove
- manually removing the dependencies from the manifest and runningyarn install
won't trigger it.Parameters
workspace: Workspace
target: Target
descriptor: Descriptor
Returns Promise<void>
optionalafterWorkspaceDependencyReplacement
Called when a dependency range is replaced inside a workspace. Note that
this hook is only called by the CLI commands like yarn add
- manually
updating the dependencies from the manifest and running yarn install
won't trigger it.
Type declaration
Called when a dependency range is replaced inside a workspace. Note that this hook is only called by the CLI commands like
yarn add
- manually updating the dependencies from the manifest and runningyarn install
won't trigger it.Parameters
workspace: Workspace
target: Target
fromDescriptor: Descriptor
toDescriptor: Descriptor
Returns Promise<void>
optionalfetchPackageInfo
Called by yarn info
. The extra
field is the set of parameters passed
to the -X,--extra
flag. Calling registerData
will add a new set of
data that will be added to the package information.
For instance, an "audit" plugin could check in extra
whether the user
requested audit information (via -X audit
), and call registerData
with those information (retrieved dynamically) if they did.
Type declaration
Called by
yarn info
. Theextra
field is the set of parameters passed to the-X,--extra
flag. CallingregisterData
will add a new set of data that will be added to the package information.For instance, an "audit" plugin could check in
extra
whether the user requested audit information (via-X audit
), and callregisterData
with those information (retrieved dynamically) if they did.Parameters
pkg: Package
extra: Set<string>
registerData: (namespace: string, data: Tuple<NO_HINT | ID | NULL | SCOPE | NAME | RANGE | REFERENCE | NUMBER | PATH | URL | ADDED | REMOVED | CODE | INSPECT | DURATION | SIZE | SIZE_DIFF | IDENT | DESCRIPTOR | LOCATOR | RESOLUTION | DEPENDENT | PACKAGE_EXTENSION | SETTING | MARKDOWN | MARKDOWN_INLINE>[] | {}) => void
Returns Promise<void>
Called when a new dependency is added to a workspace. Note that this hook is only called by the CLI commands like
yarn add
- manually adding the dependencies into the manifest and runningyarn install
won't trigger it.