Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the documentation for the ls command for the rename to list. #277

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions _data/guides.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@
- id: docs_cli_logout
path: /docs/cli/logout
tags: ["cli-logout"]
- id: docs_cli_ls
path: /docs/cli/ls
tags: ["cli-ls"]
- id: docs_cli_list
path: /docs/cli/list
tags: ["cli-list"]
Copy link

@charlierudolph charlierudolph Dec 23, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should reordered to be above login, logout in order to keep the commands in alpha order

- id: docs_cli_outdated
path: /docs/cli/outdated
tags: ["cli-outdated"]
Expand Down
2 changes: 1 addition & 1 deletion _data/i18n/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ docs_cli_licenses: yarn licenses
docs_cli_link: yarn link
docs_cli_login: yarn login
docs_cli_logout: yarn logout
docs_cli_ls: yarn ls
docs_cli_list: yarn list

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be moved above login / logout to retain alpha order.

docs_cli_outdated: yarn outdated
docs_cli_owner: yarn owner
docs_cli_pack: yarn pack
Expand Down
1 change: 1 addition & 0 deletions _redirects
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ layout: null
{% endif %}

/{{language.tag}}/docs/install_ci /{{language.tag}}/docs/install-ci 302
/{{language.tag}}/docs/cli/ls /{{language.tag}}/docs/cli/list 302
{% endif %}
{% endfor %}
4 changes: 2 additions & 2 deletions en/docs/cli/global.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ layout: guide

##### `yarn global` <a class="toc" id="toc-yarn-global" href="#toc-yarn-global"></a>

`yarn global` is a prefix used for a number of commands like `add`, `bin`, `ls` and `remove`. They behave identically to their normal versions except that they use a global directory to store packages. The `global` command makes binaries available to use on your operating system.
`yarn global` is a prefix used for a number of commands like `add`, `bin`, `list` and `remove`. They behave identically to their normal versions except that they use a global directory to store packages. The `global` command makes binaries available to use on your operating system.
Copy link

@namhong2001 namhong2001 Dec 28, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yarn global list is not valid yet. yarn global ls command remained. v0.18.1
I added an issue to yarn yarn#2354


This is useful for developer tooling that is not part of any individual project but instead is used for local commands. One such example is [create-react-app](https://github.com/facebookincubator/create-react-app) which can be installed globally like this:

Expand All @@ -24,6 +24,6 @@ Read more about the commands that can be used together with `yarn global`:

- [`yarn add`]({{url_base}}/docs/cli/add): add a package to use in your current package.
- [`yarn bin`]({{url_base}}/docs/cli/bin): displays the location of the yarn bin folder.
- [`yarn ls`]({{url_base}}/docs/cli/ls): list installed packages.
- [`yarn list`]({{url_base}}/docs/cli/list): list installed packages.
- [`yarn remove`]({{url_base}}/docs/cli/remove): remove a package that will no longer be used in your current package.
- [`yarn upgrade`]({{url_base}}/docs/cli/upgrade): upgrades packages to their latest version based on the specified range.
18 changes: 9 additions & 9 deletions en/docs/cli/ls.md → en/docs/cli/list.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
---
id: docs_cli_ls
id: docs_cli_list
guide: docs_cli
layout: guide
---

<p class="lead">List installed packages.</p>

##### `yarn ls` <a class="toc" id="toc-yarn-ls" href="#toc-yarn-ls"></a>
##### `yarn list` <a class="toc" id="toc-yarn-list" href="#toc-yarn-list"></a>

```sh
yarn ls
yarn list
```

The `yarn ls` command mimics the expected Unix behavior of listing. In Yarn, the `ls`
command lists all dependencies for the current working directory by referencing all
The `yarn list` command mimics the expected Unix behavior of listing. In Yarn, the `list`
command lists all dependencies for the current working directory by referencing all
package manager meta data files, which includes a project's dependencies.

```
yarn ls vx.x.x
yarn list vx.x.x
├─ package-1@1.3.3
├─ package-2@5.0.9
│ └─ package-3@^2.1.0
└─ package-3@2.7.0
```

##### `yarn ls [--depth]` <a class="toc" id="toc-yarn-ls-depth" href="#toc-yarn-ls-depth"></a>
##### `yarn list [--depth]` <a class="toc" id="toc-yarn-list-depth" href="#toc-yarn-list-depth"></a>

By default, all packages and their dependencies will be displayed. To restrict the depth of the
dependencies, you can add a flag, `--depth`, along with the desired level to the `ls` command.
dependencies, you can add a flag, `--depth`, along with the desired level to the `list` command.

```
yarn ls --depth=0
yarn list --depth=0
```
Keep in mind, levels are zero-indexed.