14 | ```
15 |
--------------------------------------------------------------------------------
/lang/en/docs/_ci/solano.md:
--------------------------------------------------------------------------------
1 | Yarn is pre-installed on [SolanoCI](https://www.solanolabs.com/). You can quickly get up and running by following their
2 | [Yarn documentation](http://docs.solanolabs.com/ConfiguringLanguage/nodejs/#configuration). For an example configuration file,
3 | check out one of [their sample configuration files](https://github.com/solanolabs/express/blob/master/solano.yml).
4 |
--------------------------------------------------------------------------------
/lang/en/docs/_ci/travis.md:
--------------------------------------------------------------------------------
1 | [Travis CI](https://travis-ci.org/) detects the use of Yarn by the presence of `yarn.lock` in the repository root.
2 | If it is available, Travis CI will install `yarn` if necessary, and execute `yarn` as the default install command.
3 |
4 | If your install phase requires more, it is necessary to install Yarn yourself until it is pre-installed on build images.
5 |
6 | ```yml
7 | before_install: # if "install" is overridden
8 | # Repo for Yarn
9 | - sudo apt-key adv --fetch-keys http://dl.yarnpkg.com/debian/pubkey.gpg
10 | - echo "deb http://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
11 | - sudo apt-get update -qq
12 | - sudo apt-get install -y -qq yarn
13 | cache:
14 | yarn: true
15 | ```
16 |
17 |
18 | {% include_relative _ci/deb-specific-version.md %}
19 |
--------------------------------------------------------------------------------
/lang/en/docs/_installations/alpine.md:
--------------------------------------------------------------------------------
1 |
2 | On Alpine Linux (3.6+), you can install Yarn with apk.
3 | ```sh
4 | apk add yarn
5 | ```
6 |
7 |
8 |
9 | Currently, there are no Alpine packages available for RC or nightly builds of Yarn. Please use the tarball:
10 | {% include_relative _installations/tarball.md %}
11 |
12 |
13 | ### Path Setup
14 |
15 |
16 | {% include_relative _installations/unix_path_setup.md %}
17 |
--------------------------------------------------------------------------------
/lang/en/docs/_installations/alternatives.md:
--------------------------------------------------------------------------------
1 | If you are using another OS or one of the other options specific to your OS
2 | will not work for you, there are a couple of alternatives. You will need to
3 | [install Node.js](https://nodejs.org/) if you don't already have it installed.
4 |
5 | On common Linux distributions such as Debian, Ubuntu and CentOS, it is
6 | recommended to install Yarn via our packages instead.
7 |
8 |
9 | {% include_relative _installations/tarball.md %}
10 |
11 | ### Path Setup
12 |
13 | #### Unix/Linux/macOS
14 |
15 |
16 | {% include_relative _installations/unix_path_setup.md %}
17 |
18 | #### Windows
19 |
20 |
21 | {% include_relative _installations/windows_path_setup.md %}
22 |
--------------------------------------------------------------------------------
/lang/en/docs/_installations/arch.md:
--------------------------------------------------------------------------------
1 |
2 | On Arch Linux, Yarn can be installed through the official package manager.
3 |
4 | ```sh
5 | pacman -S yarn
6 | ```
7 |
8 |
9 |
10 |
11 | Currently, there are no Arch packages available for RC or nightly builds of Yarn. Please use the tarball:
12 | {% include_relative _installations/tarball.md %}
13 |
14 |
15 | ### Path Setup
16 |
17 |
18 | {% include_relative _installations/unix_path_setup.md %}
19 |
--------------------------------------------------------------------------------
/lang/en/docs/_installations/centos.md:
--------------------------------------------------------------------------------
1 |
2 | On CentOS, Fedora and RHEL, you can install Yarn via our RPM package repository.
3 | ```sh
4 | curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
5 | ```
6 |
7 | If you do not already have Node.js installed, you should also configure
8 | [the NodeSource repository](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora):
9 |
10 | ```sh
11 | curl --silent --location https://rpm.nodesource.com/setup_12.x | sudo bash -
12 | ```
13 |
14 | Then you can simply:
15 |
16 | ```sh
17 | sudo yum install yarn
18 | ## OR ##
19 | sudo dnf install yarn
20 | ```
21 |
22 |
23 |
24 |
25 | Currently, there are no RPM packages available for RC or nightly builds of Yarn. Please use the tarball:
26 | {% include_relative _installations/tarball.md %}
27 |
28 |
29 | ### Path Setup
30 |
31 |
32 | {% include_relative _installations/unix_path_setup.md %}
33 |
--------------------------------------------------------------------------------
/lang/en/docs/_installations/debian.md:
--------------------------------------------------------------------------------
1 | On Debian or Ubuntu Linux, you can install Yarn via our Debian package
2 | repository. You will first need to configure the repository:
3 |
4 |
5 | ```sh
6 | curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
7 | echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
8 | ```
9 |
10 |
11 | ```sh
12 | curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
13 | echo "deb https://dl.yarnpkg.com/debian/ rc main" | sudo tee /etc/apt/sources.list.d/yarn.list
14 | ```
15 |
16 |
17 | ```sh
18 | curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
19 | echo "deb https://nightly.yarnpkg.com/debian/ nightly main" | sudo tee /etc/apt/sources.list.d/yarn.list
20 | ```
21 |
22 |
23 | On Ubuntu 16.04 or below and Debian Stable, you will also need to configure [the NodeSource repository](https://github.com/nodesource/distributions/blob/master/README.md#deb) to get a new enough version of Node.js.
24 |
25 | Then you can simply:
26 |
27 | ```sh
28 | sudo apt update && sudo apt install yarn
29 | ```
30 |
31 | **Note**: Ubuntu 17.04 comes with `cmdtest` installed by default. If you're getting errors from installing `yarn`, you may want to run `sudo apt remove cmdtest` first. Refer to [this](https://github.com/yarnpkg/yarn/issues/2821) for more information.
32 |
33 | If using `nvm` you can avoid the `node` installation by doing:
34 |
35 | ```sh
36 | sudo apt update && sudo apt install --no-install-recommends yarn
37 | ```
38 |
39 | **Note**: Due to the use of `nodejs` instead of `node` name in some distros, `yarn` might complain about `node` not being installed. A workaround for this is to add an alias in your `.bashrc` file, like so: `alias node=nodejs`. This will point `yarn` to whatever version of `node` you decide to use.
40 |
41 | ### Path Setup
42 |
43 |
44 | {% include_relative _installations/unix_path_setup.md %}
45 |
--------------------------------------------------------------------------------
/lang/en/docs/_installations/gentoo.md:
--------------------------------------------------------------------------------
1 |
2 | On Gentoo Linux, you can install Yarn with portage.
3 | ```sh
4 | sudo emerge --ask sys-apps/yarn
5 | ```
6 |
7 |
8 |
9 | Currently, there are no Gentoo packages available for RC or nightly builds of Yarn. Please use the tarball:
10 | {% include_relative _installations/tarball.md %}
11 |
12 |
13 | ### Path Setup
14 |
15 |
16 | {% include_relative _installations/unix_path_setup.md %}
17 |
--------------------------------------------------------------------------------
/lang/en/docs/_installations/mac.md:
--------------------------------------------------------------------------------
1 |
2 | #### Homebrew
3 |
4 | You can install Yarn through the [Homebrew package manager](http://brew.sh/).
5 | This will also install Node.js if it is not already installed.
6 |
7 | ```sh
8 | brew install yarn
9 | ```
10 |
11 | If you use [nvm](https://github.com/creationix/nvm) or similar, you should ensure that your `PATH` lists nvm's shims before the version of Node.js installed by Homebrew.
12 |
13 | #### MacPorts
14 |
15 | You can install Yarn through [MacPorts](https://www.macports.org/).
16 | This will also install Node.js if it is not already installed.
17 |
18 | ```sh
19 | sudo port install yarn
20 | ```
21 |
22 | {% include_relative _installations/tarball.md %}
23 |
24 |
25 |
26 |
27 | Currently, there are no Homebrew or MacPorts packages available for RC or nightly builds of Yarn. Please use the tarball:
28 | {% include_relative _installations/tarball.md %}
29 |
30 |
31 | #### Path Setup
32 |
33 |
34 | {% include_relative _installations/unix_path_setup.md %}
35 |
36 | #### Upgrade Yarn
37 |
38 | Yarn will warn you if a new version is available.
39 | To upgrade Yarn, you can do so with Homebrew.
40 |
41 | ```sh
42 | brew upgrade yarn
43 | ```
44 |
--------------------------------------------------------------------------------
/lang/en/docs/_installations/nightly.md:
--------------------------------------------------------------------------------
1 | {{i18n.install_nightly_intro}}
2 |
3 | The easiest way of installing a nightly build is via our shell script:
4 |
5 | ```sh
6 | curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --nightly
7 | ```
8 |
9 | An Ubuntu/Debian repository of the nightly builds is also available. To enable it, run the following commands:
10 |
11 | ```sh
12 | sudo apt-key adv --fetch-keys http://dl.yarnpkg.com/debian/pubkey.gpg
13 | echo "deb http://nightly.yarnpkg.com/debian/ nightly main" | sudo tee /etc/apt/sources.list.d/yarn-nightly.list
14 | sudo apt update && sudo apt install yarn
15 | ```
16 |
17 | On Windows, the [Windows installer](https://nightly.yarnpkg.com/latest.msi) can be used.
18 |
--------------------------------------------------------------------------------
/lang/en/docs/_installations/npm.md:
--------------------------------------------------------------------------------
1 | ## Install via npm
2 |
3 | It is recommended to install Yarn through the [npm package manager](http://npmjs.org/), which comes bundled with [Node.js](https://nodejs.org/) when you install it on your system.
4 |
5 | Once you have npm installed you can run the following both to **install** and **upgrade** Yarn:
6 |
7 | ```sh
8 | npm install --global yarn
9 | ```
10 |
--------------------------------------------------------------------------------
/lang/en/docs/_installations/opensuse.md:
--------------------------------------------------------------------------------
1 |
2 | On openSUSE, you can install Yarn via our RPM package repository.
3 |
4 | ```
5 | sudo rpm --import https://dl.yarnpkg.com/rpm/pubkey.gpg
6 | sudo zypper ar -f https://dl.yarnpkg.com/rpm/ Yarn
7 | sudo zypper in yarn
8 | ```
9 |
10 |
11 |
12 |
13 | Currently, there are no openSUSE packages available for RC or nightly builds of Yarn. Please use the tarball:
14 | {% include_relative _installations/tarball.md %}
15 |
16 |
17 | ### Path Setup
18 |
19 |
20 | {% include_relative _installations/unix_path_setup.md %}
21 |
--------------------------------------------------------------------------------
/lang/en/docs/_installations/solus.md:
--------------------------------------------------------------------------------
1 |
2 | On Solus, you can install yarn via the Solus repository.
3 | ```sh
4 | sudo eopkg install yarn
5 | ```
6 |
7 |
8 |
9 | Currently, there are no Solus packages available for RC or nightly builds of Yarn. Please use the tarball:
10 | {% include_relative _installations/tarball.md %}
11 |
12 |
13 | ### Path Setup
14 |
15 |
16 | {% include_relative _installations/unix_path_setup.md %}
17 |
--------------------------------------------------------------------------------
/lang/en/docs/_installations/unix_path_setup.md:
--------------------------------------------------------------------------------
1 | If Yarn is not found in your PATH, follow these steps to add it and allow it to be run from anywhere.
2 |
3 | Note: your profile may be in your `.profile`, `.bash_profile`, `.bashrc`, `.zshrc`, etc.
4 |
5 | 1. Add this to your profile: `export PATH="$PATH:/opt/yarn-[version]/bin"` (the path may vary depending on where you extracted Yarn to)
6 | 1. In the terminal, log in and log out for the changes to take effect
7 |
8 | To have access to Yarn's executables globally, you will need to set up the `PATH` environment variable in your terminal. To do this, add `` export PATH="$PATH:`yarn global bin`" `` to your profile, or if you use Fish shell, simply run the command `` set -U fish_user_paths (yarn global bin) $fish_user_paths ``
9 |
--------------------------------------------------------------------------------
/lang/en/docs/_installations/windows.md:
--------------------------------------------------------------------------------
1 |
2 | There are three options for installing Yarn on Windows.
3 |
4 |
5 | #### Download the installer
6 |
7 | This will give you a `.msi` file that when run will walk you through installing
8 | Yarn on Windows.
9 |
10 | If you use the installer you will first need to install
11 | [Node.js](https://nodejs.org/).
12 |
13 | Download Installer
14 | Download Installer (RC)
15 | Download Installer (Nightly)
16 |
17 |
18 | #### Install via Chocolatey
19 |
20 | [Chocolatey](https://chocolatey.org/) is a package manager for Windows.
21 | You can install Chocolatey by following
22 | [these instructions](https://chocolatey.org/install).
23 |
24 | Once you have Chocolatey installed, you may install yarn by running the
25 | following code in your console:
26 |
27 | ```sh
28 | choco install yarn
29 | ```
30 |
31 | This will also ensure that you have [Node.js](https://nodejs.org/) installed.
32 |
33 | #### Install via Scoop
34 |
35 | [Scoop](http://scoop.sh) is a command-line installer for Windows.
36 | You can install Scoop by following
37 | [these instructions](https://github.com/lukesampson/scoop/wiki/Quick-Start).
38 |
39 | Once you have Scoop installed, you may install yarn by running the
40 | following code in your console:
41 |
42 | ```sh
43 | scoop install yarn
44 | ```
45 |
46 | If [Node.js](https://nodejs.org/) is not installed, scoop will give you a suggestion to install it.
47 | Example:
48 |
49 | ```sh
50 | scoop install nodejs
51 | ```
52 |
53 |
54 |
55 | #### Notice
56 |
57 | Please whitelist your project folder and the Yarn cache directory (%LocalAppData%\Yarn) in your antivirus software, otherwise installing packages will be significantly slower as every single file will be scanned as it's written to disk.
58 |
--------------------------------------------------------------------------------
/lang/en/docs/_installations/windows_path_setup.md:
--------------------------------------------------------------------------------
1 | You will need to set up the `PATH` environment variable in your terminal to have access to Yarn's binaries globally.
2 |
3 | Add `set PATH=%PATH%;C:\.yarn\bin` to your shell environment.
4 |
--------------------------------------------------------------------------------
/lang/en/docs/cli/bin.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_cli_bin
3 | guide: docs_cli
4 | layout: guide
5 | ---
6 |
7 | {% include vars.html %}
8 |
9 | Displays the location of the yarn `bin` folder.
10 |
11 | ##### `yarn bin []`
12 |
13 | - `yarn bin` will print the folder where yarn will install executable files for your package. An example of an executable may be a script that you have defined for your package that can be executed via [`yarn run`]({{url_base}}/docs/cli/run).
14 |
15 | Example:
16 |
17 | ```sh
18 | $ yarn bin
19 | /home/emillumine/Code/Funkwhale/funkwhale/front/node_modules/.bin
20 | ```
21 |
22 | - `yarn bin ` will print the path to the executable file.
23 |
24 | Example:
25 |
26 | ```sh
27 | $ yarn bin gettext-compile
28 | /home/emillumine/Code/Funkwhale/funkwhale/front/node_modules/.bin/gettext-compile
29 | ```
30 |
--------------------------------------------------------------------------------
/lang/en/docs/cli/cache.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_cli_cache
3 | guide: docs_cli
4 | layout: guide
5 | ---
6 |
7 | ##### `yarn cache list [--pattern]`
8 |
9 | Yarn stores every package in a global cache in your user directory on the file
10 | system. `yarn cache list` will print out every cached package.
11 |
12 | `yarn cache list --pattern ` will print out every cached package that matches the pattern provided.
13 |
14 | Examples:
15 |
16 | ```sh
17 | yarn cache list --pattern gulp
18 | yarn cache list --pattern "gulp|grunt"
19 | yarn cache list --pattern "gulp-(match|newer)"
20 | ```
21 |
22 | ##### `yarn cache dir`
23 |
24 | Running `yarn cache dir` will print out the path where yarn's global cache is currently stored.
25 |
26 | ##### `yarn cache clean []`
27 |
28 | Running this command will clear the global cache. It will be populated again the
29 | next time `yarn` or `yarn install` is run. Additionally, you can specify one or more packages that you want to clean.
30 |
31 | ### Change the cache path for yarn
32 |
33 | Set `cache-folder` config value to configure the cache directory.
34 |
35 | ```sh
36 | yarn config set cache-folder
37 | ```
38 |
39 | You can also specify the cache directory by flag `--cache-folder`:
40 |
41 | ```sh
42 | yarn --cache-folder
43 | ```
44 |
45 | You can also specify the cache directory by environment variable `YARN_CACHE_FOLDER`:
46 |
47 | ```sh
48 | YARN_CACHE_FOLDER= yarn
49 | ```
50 |
51 | Yarn will also respect `cache=` in `.npmrc` for compatibility with npm.
52 |
--------------------------------------------------------------------------------
/lang/en/docs/cli/check.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_cli_check
3 | guide: docs_cli
4 | layout: guide
5 | ---
6 |
7 | ##### `yarn check`
8 |
9 | Verifies that versions of the package dependencies in the current project's `package.json` match those in yarn's lock file.
10 |
11 | **NOTE**: The command `yarn check` has been historically buggy and undermaintained and, as such, [has been deprecated and will be removed in Yarn 2.0](https://github.com/yarnpkg/rfcs/pull/106). You should use `yarn install --check-files` instead.
12 |
13 | The switches `--integrity` and `--verify-tree` are mutually exclusive.
14 |
15 | ##### `yarn check --integrity`
16 |
17 | Verifies that versions and hashed values of the package contents in the project's `package.json` match those in yarn's lock file. This helps to verify that the package dependencies have not been altered.
18 |
19 | ##### `yarn check --verify-tree`
20 |
21 | Recursively verifies that the dependencies in `package.json` are present in `node_modules` and have the right version. This check does not consider `yarn.lock`.
22 |
--------------------------------------------------------------------------------
/lang/en/docs/cli/config.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_cli_config
3 | guide: docs_cli
4 | layout: guide
5 | ---
6 |
7 | Manages the yarn configuration files.
8 |
9 | ##### `yarn config set [-g|--global]`
10 |
11 | Sets the config `key` to a certain `value`.
12 |
13 | Example:
14 |
15 | ```sh
16 | $ yarn config set init-license BSD-2-Clause
17 | yarn config vx.x.x
18 | success Set "init-license" to "BSD-2-Clause".
19 | ✨ Done in 0.05s.
20 | ```
21 |
22 | ##### `yarn config get `
23 |
24 | Echoes the value for a given `key` to `stdout`.
25 |
26 | Example:
27 |
28 | ```sh
29 | $ yarn config get init-license
30 | BSD-2-Clause
31 | ```
32 |
33 | ##### `yarn config delete `
34 |
35 | Deletes a given `key` from the config.
36 |
37 | Example:
38 |
39 | ```sh
40 | $ yarn config delete test-key
41 | yarn config vx.x.x
42 | success Deleted "test-key".
43 | ✨ Done in 0.06s.
44 | ```
45 |
46 | ##### `yarn config list`
47 |
48 | Displays the current configuration.
49 |
50 | Example:
51 |
52 | ```sh
53 | $ yarn config list
54 | yarn config vx.x.x
55 | info yarn config
56 | { 'version-tag-prefix': 'v',
57 | 'version-git-tag': true,
58 | 'version-git-sign': false,
59 | 'version-git-message': 'v%s',
60 | 'init-version': '1.0.0',
61 | 'init-license': 'MIT',
62 | 'save-prefix': '^',
63 | 'ignore-scripts': false,
64 | 'ignore-optional': true,
65 | registry: 'https://registry.yarnpkg.com',
66 | 'user-agent': 'yarn/0.15.0 npm/? node/v6.2.1 darwin x64' }
67 | info npm config
68 | { registry: 'https://registry.npmjs.org/',
69 | '//localhost:4873/:_authToken': 'some-auth-token' }
70 | ✨ Done in 0.05s.
71 | ```
72 |
--------------------------------------------------------------------------------
/lang/en/docs/cli/create.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_cli_create
3 | guide: docs_cli
4 | layout: guide
5 | ---
6 |
7 | {% include vars.html %}
8 |
9 | Creates new projects from any create-*
starter kits.
10 |
11 | ##### `yarn create []`
12 |
13 | This command is a shorthand that helps you do two things at once:
14 |
15 | - Install `create-` globally, or update the package to the
16 | latest version if it already exists
17 | - Run the `create-` executable located in the `bin` field of the starter kit’s `package.json`,
18 | forwarding any `` to it
19 |
20 | For example, `yarn create react-app my-app` is equivalent to:
21 |
22 | ```sh
23 | $ yarn global add create-react-app
24 | $ create-react-app my-app
25 | ```
26 |
27 | For more information, check out the [relevant blog entry](https://yarnpkg.com/blog/2017/05/12/introducing-yarn/).
28 |
--------------------------------------------------------------------------------
/lang/en/docs/cli/dedupe.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_cli_dedupe
3 | guide: docs_cli
4 | layout: guide
5 | ---
6 |
7 | {% include vars.html %}
8 |
9 | The dedupe command isn't necessary. `yarn install` will already dedupe.
10 |
--------------------------------------------------------------------------------
/lang/en/docs/cli/exec.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_cli_exec
3 | guide: docs_cli
4 | layout: guide
5 | ---
6 |
7 | {% include vars.html %}
8 |
9 | Executes a shell script.
10 |
11 | ##### `yarn exec`
12 |
13 | This command executes a shell script.
14 |
15 | ```sh
16 | $ yarn exec echo test message
17 | test message
18 | ```
19 |
--------------------------------------------------------------------------------
/lang/en/docs/cli/generate-lock-entry.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_cli_generate_lock_entry
3 | guide: docs_cli
4 | layout: guide
5 | ---
6 |
7 | Generates a lock file entry.
8 |
9 | ##### `yarn generate-lock-entry`
10 |
11 | _Note: This command is considered for advanced use-cases and tooling only. It generates a lock file entry given the current `package.json` manifest file._
12 |
13 | ```sh
14 | $ yarn generate-lock-entry
15 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
16 | # yarn lockfile v1
17 | yarnpkg@0.14.0:
18 | version "0.14.0"
19 | dependencies:
20 | babel-plugin-transform-inline-imports-commonjs "^1.0.0"
21 | babel-runtime "^6.0.0"
22 | bytes "^2.4.0"
23 | [...]
24 | ```
25 |
--------------------------------------------------------------------------------
/lang/en/docs/cli/help.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_cli_help
3 | guide: docs_cli
4 | layout: guide
5 | ---
6 |
7 | {% include vars.html %}
8 |
9 | Displays help information.
10 |
11 | ##### `yarn help`
12 |
13 | This command shows a list of available commands and flags, each with a brief
14 | explanation on what it does.
15 |
--------------------------------------------------------------------------------
/lang/en/docs/cli/licenses.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_cli_licenses
3 | guide: docs_cli
4 | layout: guide
5 | ---
6 |
7 | List licenses for installed packages.
8 |
9 | ##### `yarn licenses list`
10 |
11 | Running this command will list, in alphabetical order all of the packages that
12 | were installed by `yarn` or `yarn install`, and give you the license (and URL
13 | to the source code) associated with each package.
14 |
15 | ```sh
16 | yarn licenses list
17 | ```
18 |
19 | ```
20 | yarn licenses v0.14.0
21 | ├─ abab@1.0.3
22 | │ ├─ License: ISC
23 | │ └─ URL: git+https://github.com/jsdom/abab.git
24 | ├─ abbrev@1.0.9
25 | │ ├─ License: ISC
26 | │ └─ URL: http://github.com/isaacs/abbrev-js
27 | ├─ acorn-globals@1.0.9
28 | │ ├─ License: MIT
29 | │ └─ URL: https://github.com/ForbesLindesay/acorn-globals.git
30 | ├─ acorn@2.7.0
31 | │ ├─ License: MIT
32 | │ └─ URL: https://github.com/ternjs/acorn.git
33 | ├─ align-text@0.1.4
34 | │ ├─ License: MIT
35 | │ └─ URL: git://github.com/jonschlinkert/align-text.git
36 | ├─ amdefine@1.0.0
37 | │ ├─ License: BSD-3-Clause AND MIT
38 | │ └─ URL: https://github.com/jrburke/amdefine.git
39 | ├─ ansi-escapes@1.4.0
40 | │ ├─ License: MIT
41 | │ └─ URL: https://github.com/sindresorhus/ansi-escapes.git
42 | ├─ ansi-regex@2.0.0
43 | │ ├─ License: MIT
44 | │ └─ URL: https://github.com/sindresorhus/ansi-regex.git
45 | ...
46 | ```
47 |
48 | ##### `yarn licenses generate-disclaimer`
49 |
50 | Running this command will return a sorted list of licenses from all the
51 | packages you have installed to the `stdout`.
52 |
53 | ```sh
54 | yarn licenses generate-disclaimer
55 | ```
56 |
57 | ```
58 | The following software may be included in this product: package-1. This software contains the following license and notice below:
59 |
60 | [[LICENSE TEXT]]
61 |
62 | -----
63 |
64 | The following software may be included in this product: package-2. This software contains the following license and notice below:
65 |
66 | [[LICENSE TEXT]]
67 | ```
68 |
--------------------------------------------------------------------------------
/lang/en/docs/cli/list.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_cli_list
3 | guide: docs_cli
4 | layout: guide
5 | ---
6 |
7 | List installed packages.
8 |
9 | ##### `yarn list`
10 |
11 | ```sh
12 | yarn list
13 | ```
14 |
15 | The `yarn list` command mimics the expected Unix behavior of listing. In Yarn, the `list`
16 | command lists all dependencies for the current working directory by referencing all
17 | package manager meta data files, which includes a project's dependencies.
18 |
19 | ```
20 | yarn list vx.x.x
21 | ├─ package-1@1.3.3
22 | ├─ package-2@5.0.9
23 | │ └─ package-3@^2.1.0
24 | └─ package-3@2.7.0
25 | ```
26 |
27 | ##### `yarn list [--depth] [--pattern]`
28 |
29 | By default, all packages and their dependencies will be displayed. To restrict the depth of the
30 | dependencies, you can add a flag, `--depth`, along with the desired level to the `list` command.
31 |
32 | ```
33 | yarn list --depth=0
34 | ```
35 |
36 | Keep in mind, levels are zero-indexed.
37 |
38 | `yarn list --pattern ` will filter the list of dependencies by the pattern flag.
39 |
40 | Examples:
41 |
42 | ```sh
43 | yarn list --pattern gulp
44 | yarn list --pattern "gulp|grunt"
45 | yarn list --pattern "gulp|grunt" --depth=1
46 | ```
47 |
--------------------------------------------------------------------------------
/lang/en/docs/cli/lockfile.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_cli_lockfile
3 | guide: docs_cli
4 | layout: guide
5 | ---
6 |
7 | {% include vars.html %}
8 |
9 | The lockfile command isn't necessary. `yarn install` will produce a lockfile.
10 |
--------------------------------------------------------------------------------
/lang/en/docs/cli/login.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_cli_login
3 | guide: docs_cli
4 | layout: guide
5 | ---
6 |
7 | {% include vars.html %}
8 |
9 | Store registry username and email.
10 |
11 | ##### `yarn login`
12 |
13 | Running this command will prompt you for your username and email for the
14 | [npm registry](https://www.npmjs.com/). It will **not** ask for your password.
15 | Later when you run a command that requires authentication such as
16 | [`yarn publish`]({{url_base}}/docs/cli/publish), you will have to enter your
17 | password to do so.
18 |
19 | ```sh
20 | yarn login
21 | ```
22 |
23 | ```sh
24 | yarn login vx.x.x
25 | question npm username: my-username
26 | question npm email: my-username@example.com
27 | ✨ Done in 6.03s.
28 | ```
29 |
30 | Using [`yarn logout`]({{url_base}}/docs/cli/logout) you can delete your
31 | username and email.
32 |
--------------------------------------------------------------------------------
/lang/en/docs/cli/logout.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_cli_logout
3 | guide: docs_cli
4 | layout: guide
5 | ---
6 |
7 | {% include vars.html %}
8 |
9 | Clear registry username and email.
10 |
11 | ##### `yarn logout`
12 |
13 | This will remove your stored username and email for the
14 | [npm registry](https://www.npmjs.com/) as setup by
15 | [`yarn login`]({{url_base}}/docs/cli/login). You do need to run this to de-authenticate, registry
16 | actions are individually authenticated.
17 |
--------------------------------------------------------------------------------
/lang/en/docs/cli/outdated.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_cli_outdated
3 | guide: docs_cli
4 | layout: guide
5 | ---
6 |
7 | Checks for outdated package dependencies.
8 |
9 | ##### `yarn outdated`
10 |
11 | Lists version information for all package dependencies. This information
12 | includes the currently installed version, the desired version based on semver,
13 | and the latest available version.
14 |
15 | For example, say your `package.json` has the following dependencies listed:
16 |
17 | ```js
18 | {
19 | "dependencies": {
20 | "underscore": "~1.6.0"
21 | },
22 | "devDependencies": {
23 | "lodash": "4.15.0"
24 | }
25 | }
26 | ```
27 |
28 | The command run should look something like this:
29 |
30 | ```sh
31 | yarn outdated
32 | ```
33 |
34 | ```
35 | Package Current Wanted Latest Package Type URL
36 | lodash 4.15.0 4.15.0 4.16.4 devDependencies https://github.com/lodash/lodash#readme
37 | underscore 1.6.0 1.6.0 1.8.3 dependencies https://github.com/jashkenas/underscore#readme
38 | ✨ Done in 0.72s.
39 | ```
40 |
41 | ##### `yarn outdated [package...]`
42 |
43 | Lists version information for one or more package dependencies.
44 |
45 | For the example `package.json` shown previously, you should see the following
46 | output when checking one of the dependencies:
47 |
48 | ```sh
49 | yarn outdated lodash
50 | ```
51 |
52 | ```
53 | Package Current Wanted Latest Package Type URL
54 | lodash 4.15.0 4.15.0 4.16.4 devDependencies https://github.com/lodash/lodash#readme
55 | ✨ Done in 1.04s.
56 | ```
57 |
--------------------------------------------------------------------------------
/lang/en/docs/cli/owner.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_cli_owner
3 | guide: docs_cli
4 | layout: guide
5 | ---
6 |
7 | Manage package owners.
8 |
9 | ### What is a package owner?
10 |
11 | A package "owner" in the registry is a user that has access to make changes to
12 | a package. A single package can have as many owners as you want.
13 |
14 | Owners have permission to do the following tasks:
15 |
16 | 1. Publish new versions of the package
17 | 2. Add or remove other owners of the package
18 | 3. Change metadata for a package
19 |
20 | ### Caveats
21 |
22 | There aren't any other levels of access at this time. All users can either
23 | modify a package or they cannot. In the future, there may be more types of
24 | roles, but not at this time.
25 |
26 | ### Commands
27 |
28 | ##### `yarn owner list `
29 |
30 | Lists all of the owners of a ``.
31 |
32 | ##### `yarn owner add `
33 |
34 | Adds the `` as an owner of the ``. You must already be an owner
35 | of the `` in order to run this command.
36 |
37 | ##### `yarn owner remove `
38 |
39 | Removes the `` as an owner of the ``. You must already be an
40 | owner of the `` in order to run this command.
41 |
--------------------------------------------------------------------------------
/lang/en/docs/cli/pack.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_cli_pack
3 | guide: docs_cli
4 | layout: guide
5 | ---
6 |
7 | ##### `yarn pack`
8 |
9 | Creates a compressed gzip archive of package dependencies.
10 |
11 | ##### `yarn pack --filename `
12 |
13 | Creates a compressed gzip archive of package dependencies and names the file _filename_.
14 |
--------------------------------------------------------------------------------
/lang/en/docs/cli/prune.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_cli_prune
3 | guide: docs_cli
4 | layout: guide
5 | ---
6 |
7 | {% include vars.html %}
8 |
9 | The prune command isn't necessary. `yarn install` will prune extraneous packages.
10 |
--------------------------------------------------------------------------------
/lang/en/docs/cli/publish.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_cli_publish
3 | guide: docs_cli
4 | layout: guide
5 | ---
6 |
7 | Publishes a package to the npm registry.
8 |
9 | Once a package is published, you can never modify that specific version, so
10 | take care before publishing.
11 |
12 | ##### `yarn publish`
13 |
14 | Publishes the package defined by the `package.json` in the current directory.
15 |
16 | ##### `yarn publish [tarball]`
17 |
18 | Publishes the package defined by a `.tgz` gzipped tarball.
19 |
20 | ##### `yarn publish [folder]`
21 |
22 | Publishes the package contained in the specified folder.
23 | `/package.json` should specify the package details.
24 |
25 | ##### `yarn publish --new-version `
26 |
27 | Skips the prompt for new version by using the value of `version` instead.
28 |
29 | ##### `yarn publish --tag `
30 |
31 | Providing a tag to `yarn publish` lets you publish packages with a specific tag.
32 | For example, if you do a `yarn publish --tag beta`, and your package is named
33 | `blorp`, then someone else can install that package with `yarn add blorp@beta`.
34 |
35 | ##### `yarn publish --access `
36 |
37 | The `--access` flag controls whether the npm registry publishes this package as
38 | a public package, or restricted.
39 |
--------------------------------------------------------------------------------
/lang/en/docs/cli/remove.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_cli_remove
3 | guide: docs_cli
4 | layout: guide
5 | ---
6 |
7 | ##### `yarn remove `
8 |
9 | Running `yarn remove foo` will remove the package named `foo` from your direct
10 | dependencies updating your `package.json` and `yarn.lock` files in the process.
11 |
12 | Other developers working on the project can run `yarn install` to sync their
13 | own `node_modules` directories with the updated set of dependencies.
14 |
15 | When you remove a package, it is removed from all types of dependencies:
16 | `dependencies`, `devDependencies`, etc.
17 |
18 | > **Note**: `yarn remove` will always update your `package.json` and
19 | > `yarn.lock`. This ensures that different developers on the same project get
20 | > the same set of dependencies. It is not possible to disable this behavior.
21 |
22 | > **Note**: `yarn remove --` uses the same `flag`s as `yarn install` command.
23 |
--------------------------------------------------------------------------------
/lang/en/docs/cli/self-update.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_cli_self_update
3 | guide: docs_cli
4 | layout: guide
5 | ---
6 |
7 | Updates Yarn to the latest version.
8 |
9 | ##### `yarn self-update`
10 |
11 | _**Important**: `self-update` is not available. See [policies](https://yarnpkg.com/lang/en/docs/cli/policies/#toc-policies-set-version) for enforcing versions within a project_
12 |
13 | In order to update your version of Yarn, you can run one of the following commands:
14 |
15 | - `npm install --global yarn` - if you've installed Yarn via npm (recommended)
16 | - `curl --compressed -o- -L https://yarnpkg.com/install.sh | bash` if you're on Unix
17 | - otherwise, check the docs of the installer you've used to install Yarn
18 |
--------------------------------------------------------------------------------
/lang/en/docs/cli/team.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_cli_team
3 | guide: docs_cli
4 | layout: guide
5 | ---
6 |
7 | Maintain team memberships
8 |
9 | ##### `yarn team`
10 |
11 | Manage teams in organizations, and change team memberships.
12 |
13 | ### Commands
14 |
15 | ##### `yarn team create `
16 |
17 | Create a new team.
18 |
19 | ##### `yarn team destroy `
20 |
21 | Destroys an existing team.
22 |
23 | ##### `yarn team add `
24 |
25 | Add a user to an existing team.
26 |
27 | ##### `yarn team remove `
28 |
29 | Remove a user from a team they belong to.
30 |
31 | ##### `yarn team list |`
32 |
33 | If performed on an organization name, will return a list of existing teams under that organization. If performed on a team, it will instead return a list of all users belonging to that particular team.
34 |
35 | ### Details
36 |
37 | yarn team always operates directly on the current registry, configurable from the command line using `--registry=`.
38 |
39 | In order to create teams and manage team membership, you _must be a team admin_ under the given organization. Listing teams and team memberships may be done by any member of the organizations.
40 |
41 | Organization creation and management of team admins and organization members is done through the npm website, not the CLI.
42 |
43 | To use teams to manage permissions on packages belonging to your organization, use the yarn access command to grant or revoke the appropriate permissions.
44 |
--------------------------------------------------------------------------------
/lang/en/docs/cli/test.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_cli_test
3 | guide: docs_cli
4 | layout: guide
5 | ---
6 |
7 | Runs the test script defined by the package.
8 |
9 | ##### `yarn test`
10 |
11 | If you have defined a `scripts` object in your package, this command will run
12 | the specified `test` script.
13 |
14 | For example, if you have a bash script in your package, `scripts/test`:
15 |
16 | ```sh
17 | #!/bin/bash
18 |
19 | echo "Hello, world!"
20 | ```
21 |
22 | and the following in your `package.json`:
23 |
24 | ```json
25 | {
26 | "name": "my-tribute-package",
27 | "version": "1.0.0",
28 | "description":
29 | "This is not the best package in the world, this is just a tribute.",
30 | "main": "index.js",
31 | "author": "Yarn Contributor",
32 | "license": "MIT",
33 | "scripts": {
34 | "test": "scripts/test"
35 | }
36 | }
37 | ```
38 |
39 | then running `yarn test` would yield:
40 |
41 | ```sh
42 | $ yarn test
43 | yarn test v0.15.1
44 | $ "./scripts/test"
45 | Hello, world!
46 | ✨ Done in 0.17s.
47 | ```
48 |
49 | ##### `yarn run test`
50 |
51 | `yarn test` is also a shortcut for `yarn run test`.
52 |
--------------------------------------------------------------------------------
/lang/en/docs/cli/unlink.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_cli_unlink
3 | guide: docs_cli
4 | layout: guide
5 | ---
6 |
7 | {% include vars.html %}
8 |
9 | Unlink a previously created symlink for a package.
10 |
11 | To remove a symlinked package created with [`yarn link`]({{url_base}}/docs/cli/link), `yarn unlink` can be used.
12 |
13 | ##### `yarn unlink`
14 |
15 | Run `yarn unlink` in the folder that was previously used to create a link.
16 |
17 | ##### `yarn unlink [package]`
18 |
19 | To unlink a package that was symlinked during development in your project, simply
20 | run `yarn unlink [package]`. You will need to run `yarn install --check-files` to re-install
21 | the package that was linked, for more info [see issue 1957](https://github.com/yarnpkg/yarn/issues/1957).
22 |
23 | Continued example from the [`yarn link`]({{url_base}}/docs/cli/link) documentation: assume two folders
24 | `react` and `react-relay` that are located next to each other with `react` linked
25 | into the `react-relay` project:
26 |
27 | ```sh
28 | $ cd react
29 | $ yarn unlink
30 | yarn link vx.x.x
31 | success Unregistered "react".
32 | ```
33 |
34 | ```sh
35 | $ cd ../react-relay
36 | $ yarn unlink react
37 | yarn link vx.x.x
38 | success Unregistered "react".
39 | ```
40 |
41 | Also see:
42 |
43 | - [`yarn link`]({{url_base}}/docs/cli/link): symlink a package for local development.
44 |
--------------------------------------------------------------------------------
/lang/en/docs/cli/upgrade-interactive.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_cli_upgrade_interactive
3 | guide: docs_cli
4 | layout: guide
5 | additional_reading_tags: ["cli-add", "cli-tag", "dependencies-versions", "cli-upgrade"]
6 | ---
7 |
8 | {% include vars.html %}
9 |
10 | This is similar to npm-check interactive update mode. It provides an easy way to update outdated packages.
11 |
12 | ##### `yarn upgrade-interactive [--latest]`
13 |
14 | The `upgrade-interactive` command takes the same parameters as, and functions the same as the base `upgrade` command.
15 | This command will display the outdated packages before performing any upgrade, allowing the user to select which packages to upgrade.
16 | Yarn will respect the version ranges in `package.json` when determining the version to upgrade to.
17 |
18 | You can think of `yarn upgrade-interactive` as a combination of the `yarn outdated` and `yarn upgrade [package...]` commands.
19 | Where `yarn outdated` displays the list of outdated packages and `yarn upgrade [package...]` can then be used to upgrade desired packages,
20 | `yarn upgrade-interactive` displays the same outdated package list and lets you immediately choose which to upgrade.
21 |
22 | `--latest` : This flag tells yarn to ignore the specified version ranges in `package.json` and instead use the version tagged `latest`
23 | in the registry.
24 |
25 | ```
26 | [1/? Choose which packages to update. (Press to select, to toggle all, to inverse s
27 | election)
28 | devDependencies
29 | ❯◯ autoprefixer 6.7.7 ❯ 7.0.0 https://github.com/postcss/autoprefixer#readme
30 | ◯ webpack 2.4.1 ❯ 2.5.1 https://github.com/webpack/webpack
31 |
32 | dependencies
33 | ◯ bull 2.2.6 ❯ 3.0.0-alpha.3 https://github.com/OptimalBits/bull#readme
34 | ◯ fs-extra 3.0.0 ❯ 3.0.1 https://github.com/jprichardson/node-fs-extra
35 | ◯ socket.io 1.7.3 ❯ 1.7.4 https://github.com/socketio/socket.io#readme
36 | ◯ socket.io-client 1.7.3 ❯ 1.7.4 https://github.com/Automattic/socket.io-client#readme
37 | ```
38 |
--------------------------------------------------------------------------------
/lang/en/docs/cli/versions.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_cli_versions
3 | guide: docs_cli
4 | layout: guide
5 | ---
6 |
7 | {% include vars.html %}
8 |
9 | Displays version information of the currently installed Yarn, Node.js, and its dependencies.
10 |
11 | ##### `yarn versions`
12 |
13 | ```sh
14 | yarn versions
15 | ```
16 |
17 | ```
18 | yarn versions v0.24.5
19 | { http_parser: '2.7.0',
20 | node: '7.10.0',
21 | v8: '5.5.372.43',
22 | uv: '1.11.0',
23 | zlib: '1.2.11',
24 | ares: '1.10.1-DEV',
25 | modules: '51',
26 | openssl: '1.0.2k',
27 | icu: '58.2',
28 | unicode: '9.0',
29 | cldr: '30.0.3',
30 | tz: '2016j' }
31 | ✨ Done in 0.04s.
32 | ```
33 |
--------------------------------------------------------------------------------
/lang/en/docs/cli/why.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_cli_why
3 | guide: docs_cli
4 | layout: guide
5 | ---
6 |
7 | Show information about why a package is installed.
8 |
9 | ##### `yarn why `
10 |
11 | This command will identify why a package has been installed, detailing which
12 | other packages depend upon it, for example, or whether it was explicitly marked
13 | as a dependency in the `package.json` manifest.
14 |
15 | ```sh
16 | yarn why jest
17 | ```
18 |
19 | ```
20 | yarn why vx.x.x
21 | [1/4] 🤔 Why do we have the module "jest"...?
22 | [2/4] 🚚 Initializing dependency graph...
23 | [3/4] 🔍 Finding dependency...
24 | [4/4] 🚡 Calculating file sizes...
25 | info Has been hoisted to "jest"
26 | info This module exists because it's specified in "devDependencies".
27 | info Disk size without dependencies: "1.29kB"
28 | info Disk size with unique dependencies: "101.31kB"
29 | info Disk size with transitive dependencies: "20.35MB"
30 | info Amount of shared dependencies: 125
31 | ```
32 |
33 | ### Query argument
34 |
35 | The mandatory query argument for `yarn why` can be any of:
36 |
37 | - a package name (as in the above example)
38 | - a package folder; eg: `yarn why node_modules/once`
39 | - a file within a package folder; eg: `yarn why node_modules/once/once.js`
40 |
41 | The file locations can also be absolute.
42 |
--------------------------------------------------------------------------------
/lang/en/docs/cli/workspace.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_cli_workspace
3 | guide: docs_cli
4 | layout: guide
5 | ---
6 |
7 | To learn more about workspaces, check these links:
8 |
9 | - [Workspaces in Yarn](https://yarnpkg.com/blog/2017/08/02/introducing-workspaces)
10 | - [Workspaces](https://yarnpkg.com/en/docs/workspaces)
11 |
12 | ##### `yarn workspace `
13 |
14 | This will run the chosen Yarn command in the selected workspace.
15 |
16 | Example:
17 |
18 | ```sh
19 | yarn workspace awesome-package add react react-dom --dev
20 | ```
21 |
22 | This will add `react` and `react-dom` as `devDependencies` in your `packages/awesome-package/package.json`.
23 |
24 | If you want to remove a package:
25 |
26 | ```sh
27 | yarn workspace web-project remove some-package
28 | ```
29 |
30 | The example above would remove `some-package` from `packages/web-project/package.json`.
31 |
--------------------------------------------------------------------------------
/lang/en/docs/cli/workspaces.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_cli_workspaces
3 | guide: docs_cli
4 | layout: guide
5 | ---
6 |
7 | Show information about your workspaces.
8 |
9 | ### What is a workspace?
10 |
11 | To learn more about workspaces, check these links:
12 |
13 | - [Workspaces in Yarn]({{url_base}}/blog/2017/08/02/introducing-workspaces)
14 | - [Workspaces]({{url_base}}/docs/workspaces)
15 |
16 | ### Commands
17 |
18 | ##### `yarn workspaces info [--json]`
19 |
20 | This command will display the workspace dependency tree of your current project.
21 |
22 | ```sh
23 | yarn workspaces info
24 | ```
25 |
26 | ```
27 | yarn workspaces vx.x.x
28 | { "create-subscription": {
29 | "location": "packages/create-subscription",
30 | "workspaceDependencies": [],
31 | "mismatchedWorkspaceDependencies": []
32 | },
33 | ...
34 | "react-noop-renderer": {
35 | "location": "packages/react-noop-renderer",
36 | "workspaceDependencies": [
37 | "react-reconciler"
38 | ],
39 | "mismatchedWorkspaceDependencies": []
40 | },
41 | "react-reconciler": {
42 | "location": "packages/react-reconciler",
43 | "workspaceDependencies": [],
44 | "mismatchedWorkspaceDependencies": []
45 | }, ... }
46 | ```
47 |
48 | ##### `yarn workspaces run `
49 |
50 | This will run the chosen Yarn command in each workspace.
51 |
52 | ```sh
53 | yarn workspaces run test
54 | ```
55 |
56 | This will invoke the test script for each workspace.
57 |
58 | This will also pass forward flags and can be useful for CI processes.
59 |
60 | ```sh
61 | yarn workspaces run test --ci
62 | ```
63 |
--------------------------------------------------------------------------------
/lang/en/docs/configuration.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_configuration_index
3 | guide: docs_configuration
4 | layout: guide
5 | ---
6 |
7 |
8 |
9 | ## Configuring your package
10 |
11 | Yarn looks for `package.json` files to identify each package and configure the behavior of yarn while running inside that package.
12 |
13 | An example configuration for the `pet-kitten` package, which would be found at `pet-kitten/package.json`:
14 |
15 | ```
16 | {
17 | "name": "pet-kitten",
18 | "version": "0.1.0",
19 | "main": "pet.js",
20 | "dependencies": {
21 | "hand": "1.0.0"
22 | }
23 | }
24 | ```
25 |
26 | ## Use `yarn.lock` to pin your dependencies
27 |
28 | Yarn also uses a `yarn.lock` file in the root of your project to make dependency resolution fast and reliable. You never need to touch this file, yarn owns it and will change it when managing dependencies.
29 |
30 | To make sure your app works consistently, **you should always save the `yarn.lock` file in your code repository.**
31 |
--------------------------------------------------------------------------------
/lang/en/docs/creating-a-project.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_creating_a_project
3 | guide: docs_yarn_workflow
4 | layout: guide
5 | ---
6 |
7 | It doesn't matter if you have an existing repository/directory of code, or if
8 | you are starting a completely new project, adding Yarn works the same way every
9 | time.
10 |
11 | In your terminal/console in the directory that you want to add Yarn (which
12 | should almost always be the root of your project), run the following command:
13 |
14 | ```sh
15 | yarn init
16 | ```
17 |
18 | This will open up an interactive form for creating a new yarn project with the
19 | following questions:
20 |
21 | ```
22 | name (your-project):
23 | version (1.0.0):
24 | description:
25 | entry point (index.js):
26 | git repository:
27 | author:
28 | license (MIT):
29 | ```
30 |
31 | You can type answers for each of these or you can just hit enter/return to use
32 | the default or leave it blank.
33 |
34 | ### `package.json`
35 |
36 | Now you should have a `package.json` that looks similar to this:
37 |
38 | ```json
39 | {
40 | "name": "my-new-project",
41 | "version": "1.0.0",
42 | "description": "My New Project description.",
43 | "main": "index.js",
44 | "repository": {
45 | "url": "https://example.com/your-username/my-new-project",
46 | "type": "git"
47 | },
48 | "author": "Your Name ",
49 | "license": "MIT"
50 | }
51 | ```
52 |
53 | When you run `yarn init`, all it is doing is creating this file. Nothing
54 | happens in the background. You can feel free to edit this file as much as you
55 | want.
56 |
57 | Your `package.json` is used to store info about your project. This includes the
58 | name of your project, the maintainers, where the source code lives, but most
59 | importantly what dependencies are needed to be installed for the project.
60 |
--------------------------------------------------------------------------------
/lang/en/docs/dependencies.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_dependencies
3 | guide: docs_dependencies
4 | layout: guide
5 | additional_reading_tags: ["package-json", "yarn-lock"]
6 | ---
7 |
8 | Package dependencies are critical to the success of a package. When you develop the functionality of your package, you will very likely use existing code defined in other packages. Those packages then become dependencies to your project.
9 |
10 | Your `package.json` file is the home for the declaration of all your dependencies, from development to production to optional. You will specify both the package name and minimum version information for each dependency.
11 |
12 | Your `yarn.lock` file ensures that your package is consistent across installations by storing the versions of which dependencies are installed with your package.
13 |
--------------------------------------------------------------------------------
/lang/en/docs/envvars.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_configuration_envvars
3 | guide: docs_configuration
4 | layout: guide
5 | ---
6 |
7 | {% include vars.html %}
8 |
9 | Environment variables defined in `process.env` allow you to configure additional Yarn features.
10 |
11 | ### `CHILD_CONCURRENCY`
12 |
13 | ```javascript
14 | process.env.CHILD_CONCURRENCY=#number#
15 | ```
16 |
17 | Controls the number of child processes run in parallel to build node modules.
18 |
19 | Setting this number to 1 will cause the node modules to be built sequentially which can avoid linker errors on windows with node-gyp.
20 |
21 | ### `npm_config`
22 |
23 | For backward compatibility with `npm`, Yarn allows passing down `npm` configuration via environment variables. For instance, the `--build-from-source` `npm` CLI flag becomes: `npm_config_build_from_source=true`. For more information on configuring `npm`, refer to the [npm-config](https://docs.npmjs.com/misc/config) page.
24 |
--------------------------------------------------------------------------------
/lang/en/docs/getting-started.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_getting_started
3 | guide: docs_getting_started
4 | layout: guide
5 | ---
6 |
7 | Yarn is a package manager for your code. It allows you to use and share (e.g. JavaScript) code
8 | with other developers from around the world. Yarn does this quickly, securely,
9 | and reliably so you don't ever have to worry.
10 |
11 | Yarn allows you to use other developers' solutions to different problems,
12 | making it easier for you to develop your software. If you have problems, you
13 | can report issues or contribute back, and when the problem is fixed, you can
14 | use Yarn to keep it all up to date.
15 |
16 | Code is shared through something called a **package** (sometimes referred to as
17 | a **module**). A package contains all the code being shared as well as a
18 | `package.json` file which describes the package.
19 |
--------------------------------------------------------------------------------
/lang/en/docs/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_index
3 | layout: pages/docs
4 | stylesheets: https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.css
5 | ---
6 |
--------------------------------------------------------------------------------
/lang/en/docs/install-ci.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_install_ci
3 | guide: docs_yarn_workflow
4 | layout: pages/install-ci
5 | ---
6 |
--------------------------------------------------------------------------------
/lang/en/docs/install.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_install
3 | guide: docs_getting_started
4 | layout: pages/install
5 | ---
6 |
--------------------------------------------------------------------------------
/lang/en/docs/installing-dependencies.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_installing_dependencies
3 | guide: docs_yarn_workflow
4 | layout: guide
5 | additional_reading_tags: ["dependencies", "package-json", "yarn-lock", "cli-install"]
6 | ---
7 |
8 | {% include vars.html %}
9 |
10 | If you have just checked out a package from [version control]({{url_base}}/docs/version-control), you will need to install those dependencies.
11 |
12 | > If you are [adding dependencies]({{url_base}}/docs/managing-dependencies#toc-adding-a-dependency) for your project, then those dependencies are automatically installed during that process.
13 |
14 | ### Installing Dependencies
15 |
16 | [`yarn install`]({{url_base}}/docs/cli/install) is used to install all dependencies for a project. The dependencies are retrieved from your project's `package.json` file, and stored in the `yarn.lock` file.
17 |
18 | When developing a package, installing dependencies is most commonly done after:
19 |
20 | 1. You have just checked out code for a project that needs these dependencies to function.
21 | 1. Another developer on the project has added a new dependency that you need to pick up.
22 |
23 | ### Installing Options
24 |
25 | There are many options for installing dependencies, including:
26 |
27 | 1. Installing all dependencies: `yarn` or `yarn install`
28 | 1. Installing one and only one version of a package: `yarn install --flat`
29 | 1. Forcing a re-download of all packages: `yarn install --force`
30 | 1. Installing only production dependencies: `yarn install --production`
31 |
32 | See [the full list]({{url_base}}/docs/cli/install) of flags you can pass to `yarn install`.
33 |
--------------------------------------------------------------------------------
/lang/en/docs/nightly.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_nightly
3 | guide: docs_getting_started
4 | layout: pages/nightly
5 | ---
6 |
--------------------------------------------------------------------------------
/lang/en/docs/offline-mirror.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_offline_mirror
3 | guide: docs_offline_mirror
4 | layout: guide
5 | ---
6 |
7 | {% include vars.html %}
8 |
9 | Follow [this blog post](https://yarnpkg.com/blog/2016/11/24/offline-mirror/) to
10 | configure an offline mirror.
11 |
--------------------------------------------------------------------------------
/lang/en/docs/prune-offline-mirror.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_prune_offline_mirror
3 | guide: docs_offline_mirror
4 | layout: guide
5 | ---
6 |
7 | After you configure your offline mirror, Yarn will automatically add new
8 | package tarballs to the mirror. However, it does not automatically remove
9 | tarballs that are no longer referenced in `yarn.lock`. For example, if you `$ yarn remove` a dependency, the tarball will remain in the mirror, even if no
10 | other dependencies have it as a sub-dependency. This behavior can be desirable
11 | in a setting where many projects share the same mirror, but when that is not
12 | the case, you may want to have Yarn remove unnecessary tarballs.
13 |
14 | To turn on automating pruning, set `yarn-offline-mirror-pruning` to `true` in
15 | your `.yarnrc`:
16 |
17 | `$ yarn config set yarn-offline-mirror-pruning true`
18 |
19 | Now, tarballs will be removed when appropriate. The end result is that
20 | `package.json`, `node_modules`, `yarn.lock`, and the offline mirror should all
21 | remain perfectly in sync whenever you change your project's dependencies.
22 |
--------------------------------------------------------------------------------
/lang/en/docs/usage.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_usage
3 | guide: docs_getting_started
4 | layout: guide
5 | additional_reading_tags: ["basics", "cli"]
6 | ---
7 |
8 | {% include vars.html %}
9 |
10 | Now that you have Yarn [installed]({{url_base}}/docs/install), you can start
11 | using Yarn. Here are some of the most common commands you'll need.
12 |
13 | **Starting a new project**
14 |
15 | ```sh
16 | yarn init
17 | ```
18 |
19 | **Adding a dependency**
20 |
21 | ```sh
22 | yarn add [package]
23 | yarn add [package]@[version]
24 | yarn add [package]@[tag]
25 | ```
26 |
27 | **Adding a dependency to different categories of dependencies**
28 |
29 | Add to `devDependencies`, `peerDependencies`, and `optionalDependencies` respectively:
30 |
31 | ```sh
32 | yarn add [package] --dev
33 | yarn add [package] --peer
34 | yarn add [package] --optional
35 | ```
36 |
37 | **Upgrading a dependency**
38 |
39 | ```sh
40 | yarn upgrade [package]
41 | yarn upgrade [package]@[version]
42 | yarn upgrade [package]@[tag]
43 | ```
44 |
45 | **Removing a dependency**
46 |
47 | ```sh
48 | yarn remove [package]
49 | ```
50 |
51 | **Installing all the dependencies of project**
52 |
53 | ```sh
54 | yarn
55 | ```
56 |
57 | or
58 |
59 | ```sh
60 | yarn install
61 | ```
62 |
--------------------------------------------------------------------------------
/lang/en/docs/version-control.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_version_control
3 | guide: docs_yarn_workflow
4 | layout: guide
5 | additional_reading_tags: ["dependencies", "package-json", "yarn-lock"]
6 | ---
7 |
8 | To have people successfully develop or use your package, you need to ensure that all the necessary files are checked into your source control system.
9 |
10 | ### Required Files
11 |
12 | The following files must be checked into source control for anyone to be able to manage your package:
13 |
14 | - `package.json`: This has all the current dependencies for your package.
15 | - `yarn.lock`: This stores the exact versions of each dependency for your package.
16 | - The actual source code that provides the functionality for your package.
17 |
18 | > Check out the [Yarn Example Package](https://github.com/yarnpkg/example-yarn-package) for the minimum requirements necessary for a Yarn package.
19 |
--------------------------------------------------------------------------------
/lang/en/docs/yarn-workflow.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: docs_yarn_workflow
3 | guide: docs_yarn_workflow
4 | layout: guide
5 | ---
6 |
7 | Introducing a package manager into your project introduces a new workflow
8 | around dependencies. Yarn tries its best to stay out of your way and make each
9 | step of this workflow simple to understand.
10 |
11 | There are a few things you should know about the basic workflow:
12 |
13 | 1. Creating a new project
14 | 2. Adding/updating/removing dependencies
15 | 3. Installing/reinstalling your dependencies
16 | 4. Working with version control (e.g. git)
17 | 5. Continuous Integration
18 |
--------------------------------------------------------------------------------
/lang/en/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: pages/homepage
3 | ---
4 |
--------------------------------------------------------------------------------
/lang/en/org/governance.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: governance
3 | guide: yarn_organization
4 | layout: guide
5 | ---
6 |
7 | This is currently being discussed in
8 | [yarnpkg/yarn#274](https://github.com/yarnpkg/yarn/issues/274).
9 |
--------------------------------------------------------------------------------
/lang/en/org/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: organization
3 | guide: yarn_organization
4 | layout: guide
5 | ---
6 |
7 | {% include vars.html %}
8 |
9 |
10 | Rules, guidelines, and documentation on Yarn contribution, processes, and
11 | community.
12 |
13 |
14 | Yarn is a community run project with sponsored contributions from a number of
15 | companies. Anyone can get involved and contribute to Yarn, and we're committed
16 | to creating an open and inclusive community for everyone.
17 |
18 | Every member of the community that wishes to contribute either through code,
19 | documentation, support, or any other form of contribution must read and follow
20 | our [Code of Conduct]({{url_base}}/org/code-of-conduct).
21 |
--------------------------------------------------------------------------------
/lang/en/org/translations.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: translations
3 | guide: yarn_organization
4 | layout: guide
5 | ---
6 |
7 | Documentation is written in English through the repository on GitHub.
8 | Translations are managed through [Crowdin](https://crowdin.com/).
9 |
10 | If would like to contribute to translations you can
11 | [join our team here](http://i18n.yarnpkg.com/project/yarn/invite).
12 |
13 | Once you sign up for an account you can click on your language and start
14 | writing translations.
15 |
16 | Remember that the [code of conduct]({{url_base}}/org/code-of-conduct) also
17 | applies to anything that happens on Crowdin.
18 |
--------------------------------------------------------------------------------
/lang/en/packages.html:
--------------------------------------------------------------------------------
1 | ---
2 | id: packages
3 | layout: page
4 | scripts:
5 | - "/js/build/packages.js"
6 | title: Yarn packages
7 | ---
8 |
23 |
--------------------------------------------------------------------------------
/lang/en/users.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: users
3 | layout: pages/users
4 | ---
5 |
--------------------------------------------------------------------------------
/latest-rc-version:
--------------------------------------------------------------------------------
1 | ---
2 | layout: null
3 | ---
4 | {{site.latest_rc_version}}
5 |
--------------------------------------------------------------------------------
/latest-version:
--------------------------------------------------------------------------------
1 | ---
2 | layout: null
3 | ---
4 | {{site.latest_version}}
--------------------------------------------------------------------------------
/opensearch.xml:
--------------------------------------------------------------------------------
1 |
2 | Yarn
3 | Package Search
4 |
5 | UTF-8
6 | https://classic.yarnpkg.com/favicon.ico
7 |
8 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "yarn-website",
3 | "version": "1.0.0",
4 | "devDependencies": {
5 | "algolia-sitemap": "^2.1.1",
6 | "babel-core": "^6.26.3",
7 | "babel-loader": "^7.1.4",
8 | "babel-plugin-transform-react-constant-elements": "^6.23.0",
9 | "babel-plugin-transform-react-inline-elements": "^6.22.0",
10 | "babel-preset-env": "1.7.0",
11 | "babel-preset-react": "^6.24.1",
12 | "babel-preset-stage-2": "^6.24.1",
13 | "happypack": "^4.0.1",
14 | "lint-staged": "9.0.0",
15 | "pre-commit": "^1.2.2",
16 | "prettier": "^1.13.4",
17 | "webpack": "^3.5.5",
18 | "webpack-bundle-analyzer": "^3.3.2",
19 | "webpack-manifest-plugin": "^1.3.1"
20 | },
21 | "scripts": {
22 | "build": "webpack",
23 | "build:sitemaps": "./scripts/sitemaps.js",
24 | "build:production": "npm run build && npm run build:sitemaps",
25 | "start": "webpack --watch",
26 | "lint:staged": "lint-staged",
27 | "format": "yarn prettier --write '**/*.{js,md,scss}'"
28 | },
29 | "lint-staged": {
30 | "*.{js,md,scss}": [
31 | "prettier --write",
32 | "git add"
33 | ]
34 | },
35 | "pre-commit": "lint:staged",
36 | "repository": {
37 | "type": "git",
38 | "url": "https://github.com/yarnpkg/website.git"
39 | },
40 | "private": true,
41 | "dependencies": {
42 | "@haroenv/react-sparklines": "^1.7.1",
43 | "algoliasearch": "^3.27.1",
44 | "bootstrap": "^4.0.0-alpha.5",
45 | "bytes": "^3.0.0",
46 | "date-fns": "^2.0.0-alpha.7",
47 | "docsearch.js": "^2.5.2",
48 | "jquery": "^3.4.0",
49 | "marked": "^0.4.0",
50 | "popper.js": "^1.14.3",
51 | "prop-types": "^15.6.1",
52 | "qs": "^6.5.2",
53 | "react": "^16.4.0",
54 | "react-dom": "^16.4.2",
55 | "react-instantsearch-dom": "^5.2.0-beta.2",
56 | "react-transition-group": "^1.2.1",
57 | "unescape-html": "^1.0.0",
58 | "unfetch": "^3.0.0",
59 | "xss": "^1.0.3"
60 | },
61 | "resolutions": {
62 | "algoliasearch": "3.27.1"
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Disallow: /-debug/
3 | Disallow: /page*/
4 | Disallow: /*/packages/
5 |
6 | Sitemap: http://sitemap.yarnpkg.com/sitemap-index.xml
7 |
--------------------------------------------------------------------------------
/scripts/normalize-translations.rb:
--------------------------------------------------------------------------------
1 | puts "Normalizing toc..."
2 |
3 | # frontmatterSourceRegex = %r!\A(---\s*\n.*?\n?)^((---|\.\.\.)\s*$\n?)!m
4 | # frontmatterTargetRegex = %r!\A(\* \* \*\s*\n.*?\n?)^((\* \* \*|\.\.\.)\s*$\n?)!m
5 |
6 | frontmatterSourceRegex = /^---.*?---/m
7 | frontmatterTargetRegex = /^\* \* \*.*?\* \* \*/m
8 |
9 | tocRegex = /\[\]\(#toc-(.*?)\)\{#toc-.*?\}/
10 |
11 | langsDir = File.join('.', 'lang')
12 | langs = Dir.entries(langsDir).reject {|lang| lang == 'en' || lang == "." || lang == ".."}
13 |
14 | # Build up a hashmap with all of the source front-matters
15 | # { relativePath => frontMatter }
16 | englishFiles = Dir.glob(File.join(langsDir, 'en', '**', '*.*'))
17 | english = {}
18 | englishFiles.each {|file|
19 | path = file.sub(File.join(langsDir, 'en'), '')
20 | contents = IO.read file
21 | contents = contents.unicode_normalize
22 | result = contents.match frontmatterSourceRegex
23 | english[path] = result
24 | }
25 |
26 | langs.each {|lang|
27 | files = Dir.glob(File.join(langsDir, lang, '**', '*.*'))
28 |
29 | files.each {|file|
30 | # puts "- Replacing #{file}"
31 |
32 | path = file.sub(File.join(langsDir, lang), '')
33 | contents = IO.read file
34 | frontmatter = english[path]
35 |
36 | result = contents
37 | result = result.unicode_normalize
38 | result = result.gsub /\r\n?/, "\n"
39 | result = result + "\n"
40 | result = result.gsub(tocRegex, '')
41 | result = result.gsub(frontmatterTargetRegex) {|c| frontmatter } if frontmatter
42 |
43 | File.write(file, result)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/scripts/remove-unused-languages.rb:
--------------------------------------------------------------------------------
1 | require "yaml"
2 |
3 | puts "Removing unused languages..."
4 |
5 | languagesFile = File.join('.', '_data', 'languages.yml')
6 | languages = YAML.load_file(languagesFile)
7 |
8 | languagesEnabledHash = {}
9 | languages.each {|language|
10 | if language['enabled']
11 | languagesEnabledHash[ language['tag'] ] = true
12 | end
13 | }
14 |
15 | langDirectory = File.join('.', 'lang')
16 |
17 | langs = Dir.entries(langDirectory).select { |entry|
18 | File.directory? File.join(langDirectory, entry) and !(entry == '.' || entry == '..')
19 | }
20 |
21 | langs.each {|lang|
22 | if languagesEnabledHash[lang]
23 | # puts "- Leaving #{lang}"
24 | else
25 | # puts "- Removing #{lang}..."
26 | system "rm _data/i18n/#{lang}.yml"
27 | system "rm -r lang/#{lang}"
28 | end
29 | }
30 |
--------------------------------------------------------------------------------
/scripts/set-version.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Sets the Yarn version number in _config.yml
3 | set -ex
4 |
5 | if [ -z "$YARN_VERSION" -o -z "$YARN_RC" ]; then
6 | echo 'Please provide YARN_VERSION and YARN_RC environment variables.'
7 | echo 'YARN_RC should be "true" to release an RC build.'
8 | exit 1
9 | fi
10 |
11 | configFile=`dirname $0`/../_config.yml
12 |
13 | if [ "$YARN_RC" = "true" ]; then
14 | sed -i -e "s/latest_rc_version:.\+/latest_rc_version: $YARN_VERSION/" "$configFile"
15 | sed -i -e 's/show_rc:.\+/show_rc: true/' "$configFile"
16 | else
17 | sed -i -e "s/latest_version:.\+/latest_version: $YARN_VERSION/" "$configFile"
18 |
19 | # If the stable version is newer than the latest RC, we should hide the RC
20 | latestRCVersion=`grep -oP 'latest_rc_version: \K([0-9\.]+)' "$configFile"`
21 | ! dpkg --compare-versions $latestRCVersion le $YARN_VERSION
22 | if [ $? -ne 0 ]; then
23 | sed -i -e 's/show_rc:.\+/show_rc: false/' "$configFile"
24 | fi;
25 | fi
26 |
--------------------------------------------------------------------------------
/scripts/sitemaps.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | if (
4 | process.env.CONTEXT === 'production' &&
5 | process.env.BUILD_SITEMAP !== 'false'
6 | ) {
7 | const algoliaSitemap = require('algolia-sitemap');
8 | const { mkdirSync, existsSync } = require('fs');
9 |
10 | const algoliaConfig = {
11 | appId: 'OFCNCOG2CU',
12 | apiKey: process.env.ALGOLIA_BROWSE_KEY,
13 | indexName: 'npm-search',
14 | };
15 |
16 | function hitToParams(hit) {
17 | const url = ({ lang, name }) =>
18 | `https://yarnpkg.com/${lang}/package/${name}`;
19 | const loc = url({ lang: 'en', name: hit.name });
20 | const lastmod = new Date(hit.modified).toISOString();
21 | const priority = hit.downloadsRatio || 0.5;
22 | return {
23 | loc,
24 | lastmod,
25 | priority,
26 | alternates: {
27 | languages: ['fr', 'pt-BR', 'zh-Hans'],
28 | hitToURL: lang => url({ lang, name: hit.name }),
29 | },
30 | };
31 | }
32 |
33 | const path = `${__dirname}/../sitemaps`;
34 |
35 | if (!existsSync(path)) {
36 | mkdirSync(path);
37 | }
38 |
39 | algoliaSitemap({
40 | algoliaConfig,
41 | sitemapLoc: 'https://yarnpkg.com/sitemaps',
42 | outputFolder: path,
43 | hitToParams,
44 | })
45 | .then(() => console.log('Sitemap generated successfully'))
46 | .catch(e => {
47 | console.log(e);
48 | process.exit(1);
49 | });
50 | } else {
51 | console.log('sitemap generation skipped');
52 | }
53 |
--------------------------------------------------------------------------------
/scripts/validate-translations.rb:
--------------------------------------------------------------------------------
1 | puts "Validating translations..."
2 |
3 | mdFiles = Dir.glob(File.join('.', '_site', 'lang', '**', '*.md'))
4 |
5 | if mdFiles.size > 0
6 | puts "Error: Found translations still in markdown"
7 | puts mdFiles
8 | exit 1
9 | else
10 | puts "Valid."
11 | exit 0
12 | end
13 |
--------------------------------------------------------------------------------