id = "yarn" name = "Yarn" homepage = "https://yarnpkg.com" description = "A package manager that doubles down as project manager." icon = "SimpleIcons:yarn" # Yarn 1 installs a `yarnpkg` alias alongside `yarn`, because Debian's cmdtest # already owned the shorter name. executables = ["yarn", "yarnpkg"] [dotfiles] # Yarn 2+ (Berry): Configuration.find() reads the rc file of the home folder, # `ppath.join(folderUtils.getHomeFolder(), Filename.rc)` with # DEFAULT_RC_FILENAME = `.yarnrc.yml` # (packages/yarnpkg-core/sources/Configuration.ts). # Yarn 1: YarnRegistry's constructor sets # `this.homeConfigLoc = path.join(userHome, '.yarnrc')` # (src/registries/yarn-registry.js), which is what `yarn config set` writes. # Both are listed: a consumer skips whichever the machine does not have. # ~/.npmrc is npm's file and belongs to the npm entry, even though Yarn 1 # reads registry auth out of it. paths = [ "~/.yarnrc.yml", "~/.yarnrc", ] # https://yarnpkg.com/configuration/yarnrc — globalFolder defaults to # ${HOME}/.yarn/berry and holds the global cache and install state. exclude = ["~/.yarn/berry/"] # Neither rc file is a whole-file credential: registries, linker choice and # plugin lists are worth syncing. Only the auth fields are lifted out. secret = [] # Read at startup by a process that then exits. side_effect = false # cacheFolder and globalFolder name directories on this machine's disk # (https://yarnpkg.com/configuration/yarnrc). Everything else in a home # .yarnrc.yml — nodeLinker, npmRegistryServer, plugins — is a preference. # Yarn picks the defaults itself, so a line here is the user having moved them: # kept for rebuilding this machine, applied to no other. [[dotfiles.machine_lines]] file = "~/.yarnrc.yml" match = { key_path = ["cacheFolder", "globalFolder"] } scope = "backup" # https://classic.yarnpkg.com/lang/en/docs/yarnrc/ — `yarn-path` points at a # Yarn release on this disk, and CLI flag defaults are written as `--flag` # lines, of which `--cache-folder` is an absolute local path. # Both are locations on this disk the user wrote out, so they are kept for # rebuilding this machine and applied to no other. [[dotfiles.machine_lines]] file = "~/.yarnrc" match = { prefix = ["yarn-path", "--cache-folder"] } scope = "backup" # https://yarnpkg.com/configuration/yarnrc — npmAuthToken and npmAuthIdent are # the top-level defaults, and npmRegistries / npmScopes each take their own # copy of both. All six shapes are listed: a token under any of them is a # registry credential. [[dotfiles.secret_paths]] file = "~/.yarnrc.yml" match = { key_path = [ "npmAuthToken", "npmAuthIdent", "npmRegistries.*.npmAuthToken", "npmRegistries.*.npmAuthIdent", "npmScopes.*.npmAuthToken", "npmScopes.*.npmAuthIdent", ] } [commands] format = 1 label = "Yarn (classic)" description = "Install or add packages with Yarn 1.x. Registry, proxy, cache and mutex options are left out." quality = "ai-draft" base = "fig:yarn" parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false } [[commands.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/yarn.ts" license = "MIT" [[commands.subcommand]] path = ["add"] label = "Add packages" [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/yarn.ts" license = "MIT" [[commands.subcommand.field]] id = "packages" label = "Packages" type = "string" position = 0 multiple = true min = 1 sources = ["fig"] [[commands.subcommand.field]] id = "dev" label = "Save to devDependencies" type = "boolean" option = ["--dev", "-D"] sources = ["fig"] [[commands.subcommand.field]] id = "peer" label = "Save to peerDependencies" type = "boolean" option = ["--peer", "-P"] sources = ["fig"] [[commands.subcommand.field]] id = "optional" label = "Save to optionalDependencies" type = "boolean" option = ["--optional", "-O"] sources = ["fig"] [[commands.subcommand.field]] id = "exact" label = "Install exact version" type = "boolean" option = ["--exact", "-E"] sources = ["fig"] [[commands.subcommand.field]] id = "tilde" label = "Same minor version (tilde)" type = "boolean" option = ["--tilde", "-T"] sources = ["fig"] [[commands.subcommand.field]] id = "ignore_scripts" label = "Skip lifecycle scripts" type = "boolean" option = ["--ignore-scripts"] sources = ["fig"] [[commands.subcommand.field]] id = "ignore_workspace_root" label = "Allow in workspace root" type = "boolean" option = ["--ignore-workspace-root-check", "-W"] sources = ["fig"] [[commands.subcommand.task]] id = "add" label = "Add dependency" fields = ["packages", "exact", "ignore_scripts"] required = ["packages"] [[commands.subcommand.task]] id = "add-dev" label = "Add dev dependency" set = { dev = [true] } lock = ["dev"] fields = ["packages", "exact", "ignore_scripts"] required = ["packages"] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["packages", "dev", "peer", "optional", "exact", "tilde"] [[commands.subcommand.group]] id = "advanced" label = "Advanced" fields = ["ignore_scripts", "ignore_workspace_root"] [[commands.subcommand]] path = ["install"] label = "Install dependencies" [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/yarn.ts" license = "MIT" [[commands.subcommand.field]] id = "frozen" label = "Fail if lockfile needs update" type = "boolean" option = ["--frozen-lockfile"] sources = ["fig"] [[commands.subcommand.field]] id = "prod" label = "Production only" type = "boolean" option = ["--production", "--prod"] sources = ["fig"] [[commands.subcommand.field]] id = "force" label = "Force reinstall" type = "boolean" option = ["--force"] effect = "overwrite" sources = ["fig"] [[commands.subcommand.field]] id = "ignore_scripts" label = "Skip lifecycle scripts" type = "boolean" option = ["--ignore-scripts"] sources = ["fig"] [[commands.subcommand.field]] id = "offline" label = "Offline (cache only)" type = "boolean" option = ["--offline"] sources = ["fig"] [[commands.subcommand.field]] id = "no_lockfile" label = "Do not read or write lockfile" type = "boolean" option = ["--no-lockfile"] sources = ["fig"] [[commands.subcommand.field]] id = "check_files" label = "Verify file tree" type = "boolean" option = ["--check-files"] sources = ["fig"] [[commands.subcommand.task]] id = "install" label = "Install from package.json" fields = ["frozen", "prod", "ignore_scripts"] required = [] [[commands.subcommand.task]] id = "ci" label = "Reproducible (CI) install" set = { frozen = [true] } lock = ["frozen"] fields = ["frozen", "prod", "ignore_scripts"] required = [] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["frozen", "prod", "ignore_scripts"] [[commands.subcommand.group]] id = "advanced" label = "Advanced" fields = ["force", "offline", "no_lockfile", "check_files"]