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

Add package configuration instruction to readme #188

Merged
merged 4 commits into from
Oct 13, 2022
Merged
Changes from 3 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
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ We do acknowledge the irony and overhead of using npm to install Corepack, which

## Usage

### When Building Packages

Just use your package managers as you usually would. Run `yarn install` in Yarn projects, `pnpm install` in pnpm projects, and `npm` in npm projects. Corepack will catch these calls, and depending on the situation:

- **If the local project is configured for the package manager you're using**, Corepack will silently download and cache the latest compatible version.
Expand All @@ -44,6 +46,18 @@ Just use your package managers as you usually would. Run `yarn install` in Yarn

- **If the local project isn't configured for any package manager**, Corepack will assume that you know what you're doing, and will use whatever package manager version has been pinned as "known good release". Check the relevant section for more details.

### When Authoring Packages

Set your package's manager with the `packageManager` field in `package.json`:

```json
{
"packageManager": "[email protected]+sha224.953c8233f7a92884eee2de69a1b92d1f2ec1655e66d08071ba9a02fa"
}
```

Here, `yarn` executable is specified at version `3.2.3`, along with the `sha224` hash of this version for validation. `[email protected]` is required. The sha is optional but strongly recommended as a security practice. Permitted values for the executable are `yarn`, `npm`, and `pnpm`.
NiloCK marked this conversation as resolved.
Show resolved Hide resolved

## Known Good Releases

When running Corepack within projects that don't list a supported package
Expand Down