Options
All
  • Public
  • Public/Protected
  • All
Menu

Class UnplugCommand

Hierarchy

Properties

all

all: boolean = Option.Boolean(`-A,--all`, false, {description: `Unplug direct dependencies from the entire project`,})

cwd

cwd: undefined | string = Option.String(`--cwd`, {hidden: true})

json

json: boolean = Option.Boolean(`--json`, false, {description: `Format the output as an NDJSON stream`,})

patterns

patterns: string[] = Option.Rest()

recursive

recursive: boolean = Option.Boolean(`-R,--recursive`, false, {description: `Unplug both direct and transitive dependencies`,})

Static paths

paths: string[][] = [[`unplug`],]

Static usage

usage: Usage = Command.Usage({description: `force the unpacking of a list of packages`,details: `This command will add the selectors matching the specified patterns to the list of packages that must be unplugged when installed.A package being unplugged means that instead of being referenced directly through its archive, it will be unpacked at install time in the directory configured via \`pnpUnpluggedFolder\`. Note that unpacking packages this way is generally not recommended because it'll make it harder to store your packages within the repository. However, it's a good approach to quickly and safely debug some packages, and can even sometimes be required depending on the context (for example when the package contains shellscripts).Running the command will set a persistent flag inside your top-level \`package.json\`, in the \`dependenciesMeta\` field. As such, to undo its effects, you'll need to revert the changes made to the manifest and run \`yarn install\` to apply the modification.By default, only direct dependencies from the current workspace are affected. If \`-A,--all\` is set, direct dependencies from the entire project are affected. Using the \`-R,--recursive\` flag will affect transitive dependencies as well as direct ones.This command accepts glob patterns inside the scope and name components (not the range). Make sure to escape the patterns to prevent your own shell from trying to expand them.`,examples: [[`Unplug the lodash dependency from the active workspace`,`yarn unplug lodash`,], [`Unplug all instances of lodash referenced by any workspace`,`yarn unplug lodash -A`,], [`Unplug all instances of lodash referenced by the active workspace and its dependencies`,`yarn unplug lodash -R`,], [`Unplug all instances of lodash, anywhere`,`yarn unplug lodash -AR`,], [`Unplug one specific version of lodash`,`yarn unplug lodash@1.2.3`,], [`Unplug all packages with the \`@babel\` scope`,`yarn unplug '@babel/*'`,], [`Unplug all packages (only for testing, not recommended)`,`yarn unplug -R '*'`,]],})

Methods

execute

  • execute(): Promise<0 | 1>

Generated using TypeDoc