Skip to content

Commit

Permalink
update current docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zkochan committed Apr 16, 2024
1 parent c0a5068 commit a3d5b64
Show file tree
Hide file tree
Showing 16 changed files with 77 additions and 142 deletions.
2 changes: 0 additions & 2 deletions docs/cli/cat-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ id: cat-file
title: "pnpm cat-file"
---

Added in: v8.13.1

Prints the contents of a file based on the hash value stored in the index file. For example:

```
Expand Down
2 changes: 0 additions & 2 deletions docs/cli/cat-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ id: cat-index
title: "pnpm cat-index"
---

Added in: v8.13.1

Prints the index file of a specific package from the store. The package is specified by its name and version:

```
Expand Down
2 changes: 0 additions & 2 deletions docs/cli/dedupe.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,4 @@ Perform an install removing older dependencies in the lockfile if a newer versio

### `--check`

Added in: v8.3.0

Check if running dedupe would result in changes without installing packages or editing the lockfile. Exits with a non-zero status code if changes are possible.
2 changes: 0 additions & 2 deletions docs/cli/env.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ pnpm env use --global argon

### add

Added in: v8.9.0

Installs the specified version(s) of Node.js without activating them as the current version.

Example:
Expand Down
2 changes: 0 additions & 2 deletions docs/cli/find-hash.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ id: find-hash
title: "pnpm find-hash"
---

Added in: v8.13.1

:::warning

This command is experimental
Expand Down
2 changes: 0 additions & 2 deletions docs/cli/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,4 @@ Filter currently does not work properly with v8 default config, you have to impl

### --resolution-only

Added in: v8.3.0

Re-runs resolution: useful for printing out peer dependency issues.
2 changes: 0 additions & 2 deletions docs/cli/pack.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ Directory in which `pnpm pack` will save tarballs. The default is the current wo

### --pack-gzip-level <level\>

Added in: v8.3.0

Specifying custom compression level.

## Life Cycle Scripts
Expand Down
2 changes: 0 additions & 2 deletions docs/cli/patch-remove.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ id: patch-remove
title: "pnpm patch-remove <pkg...>"
---

Added in: v8.5.0

Remove existing patch files and settings in `pnpm.patchedDependencies`.

```sh
Expand Down
2 changes: 1 addition & 1 deletion docs/cli/recursive.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pnpm -r publish

### --link-workspace-packages

* Default: **true**
* Default: **false**
* Type: **true, false, deep**

Link locally available packages in workspaces of a monorepo into `node_modules`
Expand Down
16 changes: 1 addition & 15 deletions docs/cli/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,6 @@ For workspaces, `<workspace root>/node_modules/.bin` is also added
to the `PATH`, so if a tool is installed in the workspace root, it may be called
in any workspace package's `scripts`.

## Differences with `npm run`

By default, pnpm doesn't run arbitrary `pre` and `post` hooks for user-defined
scripts (such as `prestart`). This behavior, inherited from npm, caused scripts
to be implicit rather than explicit, obfuscating the execution flow. It also led
to surprising executions with `pnpm serve` also running `pnpm preserve`.

If for some reason you need the pre/post scripts behavior of npm, use the
[`enable-pre-post-scripts`] option.

[`enable-pre-post-scripts`]: #enable-pre-post-scripts

## Environment

There are some environment variables that pnpm automatically creates for the executed scripts.
Expand Down Expand Up @@ -158,8 +146,6 @@ Possible values of `status` are: 'passed', 'queued', 'running'.

### --reporter-hide-prefix

Added in: v8.8.0

Hide workspace prefix from output from child processes that are run in parallel, and only print the raw output. This can be useful if you are running on CI and the output must be in a specific format without any prefixes (e.g. [GitHub Actions annotations](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message)). Only `--reporter=append-only` is supported.

### --filter &lt;package_selector\>
Expand All @@ -170,7 +156,7 @@ Hide workspace prefix from output from child processes that are run in parallel,

### enable-pre-post-scripts

* Default: **false**
* Default: **true**
* Type: **Boolean**

When `true`, pnpm will run any pre/post scripts automatically. So running `pnpm foo`
Expand Down
12 changes: 3 additions & 9 deletions docs/completion.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,11 @@ title: Command line tab-completion
Unlike other popular package managers, which usually require plugins, pnpm
supports command line tab-completion for Bash, Zsh, Fish, and similar shells.

To setup autocompletion, run:
To setup autocompletion for Bash, run:

```text
pnpm install-completion
```

The CLI will ask for which shell to generate the autocompletion script.
Alternatively, the target shell may be specified in the command line:

```text
pnpm install-completion zsh
pnpm completion bash > ~/completion-for-pnpm.bash
echo 'source ~/completion-for-pnpm.bash' >> ~/.bashrc
```

To see examples of completion, read [this article].
Expand Down
16 changes: 8 additions & 8 deletions docs/continuous-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cache:
- "~/.pnpm-store"
before_install:
- corepack enable
- corepack prepare pnpm@latest-8 --activate
- corepack prepare pnpm@latest-9 --activate
- pnpm config set store-dir ~/.pnpm-store
install:
- pnpm install
Expand All @@ -50,7 +50,7 @@ blocks:
- name: pnpm install
commands:
- corepack enable
- corepack prepare pnpm@latest-8 --activate
- corepack prepare pnpm@latest-9 --activate
- checkout
- cache restore node-$(checksum pnpm-lock.yaml)
- pnpm install
Expand All @@ -68,7 +68,7 @@ to your `appveyor.yml`:
install:
- ps: Install-Product node $env:nodejs_version
- corepack enable
- corepack prepare pnpm@latest-8 --activate
- corepack prepare pnpm@latest-9 --activate
- pnpm install
```

Expand Down Expand Up @@ -123,7 +123,7 @@ build:
image: node:18.17.1
before_script:
- corepack enable
- corepack prepare pnpm@latest-8 --activate
- corepack prepare pnpm@latest-9 --activate
- pnpm config set store-dir .pnpm-store
script:
- pnpm install # install dependencies
Expand Down Expand Up @@ -152,7 +152,7 @@ pipelines:
image: node:18.17.1
script:
- corepack enable
- corepack prepare pnpm@latest-8 --activate
- corepack prepare pnpm@latest-9 --activate
- pnpm install
- pnpm run build # Replace with your build/test…etc. commands
caches:
Expand All @@ -176,7 +176,7 @@ steps:

- script: |
corepack enable
corepack prepare pnpm@latest-8 --activate
corepack prepare pnpm@latest-9 --activate
pnpm config set store-dir $(pnpm_config_cache)
displayName: "Setup pnpm"
Expand Down Expand Up @@ -211,7 +211,7 @@ jobs:
name: Install pnpm package manager
command: |
corepack enable
corepack prepare pnpm@latest-8 --activate
corepack prepare pnpm@latest-9 --activate
pnpm config set store-dir .pnpm-store
- run:
name: Install Dependencies
Expand Down Expand Up @@ -240,7 +240,7 @@ pipeline {
stage('Build') {
steps {
sh 'corepack enable'
sh 'corepack prepare pnpm@latest-8 --activate'
sh 'corepack prepare pnpm@latest-9 --activate'
sh 'pnpm install'
}
}
Expand Down
4 changes: 1 addition & 3 deletions docs/filtering.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ run tests for all packages dependent on `foo`:
pnpm --filter "...^foo" test
```

### --filter ./&lt;glob>, --filter \{&lt;glob>\}
### --filter `./<glob>`, --filter `{<glob>}`

A glob pattern relative to the current working directory matching projects.

Expand Down Expand Up @@ -132,8 +132,6 @@ pnpm --filter "...[origin/master]" test

### --fail-if-no-match

Added in: v8.13.1

Use this flag if you want the CLI to fail if no packages have matched the filters.

## Excluding
Expand Down
85 changes: 13 additions & 72 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,19 @@ You may install pnpm even if you don't have Node.js installed, using the followi
Using PowerShell:

```powershell
$env:PNPM_VERSION = "8.15.7"; iwr https://get.pnpm.io/install.ps1 -useb | iex
iwr https://get.pnpm.io/install.ps1 -useb | iex
```

### On POSIX systems

```sh
curl -fsSL https://get.pnpm.io/install.sh | env PNPM_VERSION=8.15.7 sh -
curl -fsSL https://get.pnpm.io/install.sh | sh -
```

If you don't have curl installed, you would like to use wget:

```sh
wget -qO- https://get.pnpm.io/install.sh | env PNPM_VERSION=8.15.7 sh -
```

### In a Docker container

```sh
# bash
wget -qO- https://get.pnpm.io/install.sh | ENV="$HOME/.bashrc" SHELL="$(which bash)" bash -
# sh
wget -qO- https://get.pnpm.io/install.sh | ENV="$HOME/.shrc" SHELL="$(which sh)" sh -
# dash
wget -qO- https://get.pnpm.io/install.sh | ENV="$HOME/.dashrc" SHELL="$(which dash)" dash -
```

### Installing a specific version

Prior to running the install script, you may optionally set an env variable `PNPM_VERSION` to install a specific version of pnpm:

```sh
curl -fsSL https://get.pnpm.io/install.sh | env PNPM_VERSION=<version> sh -
wget -qO- https://get.pnpm.io/install.sh | sh -
```

:::tip
Expand Down Expand Up @@ -81,7 +62,7 @@ This will automatically install pnpm on your system.
You can pin the version of pnpm used on your project using the following command:

```
corepack use pnpm@latest-8
corepack use pnpm@latest
```

This will add a `"packageManager"` field in your local `package.json` which will instruct Corepack to always use a specific version on that project. This can be useful if you want reproducability, as all developers who are using Corepack will use the same version as you. When a new version of pnpm is released, you can re-run the above command.
Expand All @@ -95,53 +76,13 @@ We provide two packages of pnpm CLI, `pnpm` and `@pnpm/exe`.


```sh
npm install -g pnpm@latest-8
npm install -g pnpm
```

or

```sh
npm install -g @pnpm/exe@latest-8
```

## Using Homebrew

If you have the package manager installed, you can install pnpm using the following command:

```
brew install pnpm
```

## Using winget

If you have winget installed, you can install pnpm using the following command:

```
winget install pnpm
```

## Using Scoop

If you have Scoop installed, you can install pnpm using the following command:

```
scoop install nodejs-lts pnpm
```

## Using Choco

If you have Chocolatey installed, you can install pnpm using the following command:

```
choco install pnpm
```

## Using Volta

If you have Volta installed, you can install pnpm using the following command:

```
volta install pnpm
npm install -g @pnpm/exe
```

:::tip
Expand All @@ -154,13 +95,13 @@ Do you wanna use pnpm on CI servers? See: [Continuous Integration](./continuous-

Here is a list of past pnpm versions with respective Node.js version support.

| Node.js | pnpm 5 | pnpm 6 | pnpm 7 | pnpm 8 |
|------------|--------|--------|--------|--------|
| Node.js 12 | ✔️ | ✔️ |||
| Node.js 14 | ✔️ | ✔️ | ✔️ ||
| Node.js 16 | ?️ | ✔️ | ✔️ | ✔️ |
| Node.js 18 | ?️ | ✔️ | ✔️ | ✔️ |
| Node.js 20 | ?️ | ? | ✔️ | ✔️ |
| Node.js | pnpm 7 | pnpm 8 | pnpm 9 |
|------------|--------|--------|--------|
| Node.js 12 | |||
| Node.js 14 | ✔️ | ||
| Node.js 16 | ✔️ | ✔️ | |
| Node.js 18 | ✔️ | ✔️ | ✔️ |
| Node.js 20 | ✔️ | ✔️ | ✔️ |

## Troubleshooting

Expand Down

0 comments on commit a3d5b64

Please sign in to comment.