Skip to content

Commit

Permalink
Pin pnpm version using corepack (#2602)
Browse files Browse the repository at this point in the history
* Pin to pnpm 8 using corepack

* Update CONTRIBUTING.md guide to mention pnpm / corepack

---------

Co-authored-by: Tim Welch <[email protected]>
  • Loading branch information
RobinVdBroeck and twelch authored Jul 16, 2024
1 parent fbfb882 commit 3a6a035
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
1 change: 1 addition & 0 deletions .monorepolint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export default {
"scripts",
"husky",
"lint-staged",
"packageManager",
"devDependencies",
"dependencies",
],
Expand Down
23 changes: 12 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Once you've cloned a Turf repository, and have a terminal open and currenty in t
- enable pnpm as a package manager. Requires Node 16+. Alternatively just `npm install -g pnpm`.
- `pnpm install`
- install dependencies and build modules
- `npm test`
- `pnpm test`
- run all tests and linters

You're now ready to contribute.
Expand Down Expand Up @@ -79,16 +79,16 @@ it will create a new folder inside `packages` with a simple boilerplate for your
tests. We prefer dynamic testing built from GeoJSON files placed in
`./test/in` that are subsequently written to `./test/out` if your `REGEN`
[environment variable is set](https://askubuntu.com/a/58828) to `true`. If
`REGEN` is set to a different value, then running `npm t` will compare the
`REGEN` is set to a different value, then running `pnpm t` will compare the
output of the tests to the files already present in `./test/out`.
* `types.ts` - A file that tests the custom TypeScript types declared in
`index.d.ts`.
* `package.json` - The [node](http://nodejs.org) metadata container file.
Modules imported in `index.js` should be listed here under `dependencies`,
and modules used in `test.js` and/or `bench.js` should be listed under
`devDependencies`. `npm install` looks to this file to install dependencies
`devDependencies`. `pnpm install` looks to this file to install dependencies
in `./node_modules`.
* `README.md` - This README is generated _automatically_ by running `npm run
* `README.md` - This README is generated _automatically_ by running `pnpm run
docs` from the project root level. **DO NOT edit this file**.
* `LICENCE` - Like the README, this file should not be edited.
* `test/` - This directory holds the GeoJSON files that provide data for
Expand Down Expand Up @@ -244,7 +244,7 @@ Run the release commands, replace `7.0.0` with your version number

- API docs for each turf package are extracted from JSDoc comments in the source code into the top-level README.md files. README's are automatically updated on commit using via the pre-commit hook.

Should you want to generate new README files manually, use `npm run docs`:
Should you want to generate new README files manually, use `pnpm run docs`:
- **inside a module:** will generate the docs for that module.
- **main folder:** will generate docs for all modules.

Expand All @@ -254,7 +254,7 @@ Should you want to generate new README files manually, use `npm run docs`:

```bash
$ cd ./turf/packages/turf-center
$ npm run docs
$ pnpm run docs

> @turf/[email protected] docs /Users/mac/Github/turf/packages/turf-center
> node ../../scripts/generate-readmes
Expand All @@ -266,9 +266,9 @@ Building Docs: @turf/center

```bash
$ cd ./turf
$ npm run docs
> @5.0.0 docs /Users/mac/Github/turf
> node ./scripts/generate-readmes
$ pnpm run docs
> @ docs /Users/mac/Github/turf
> tsx ./scripts/generate-readmes

Building Docs: @turf/along
Building Docs: @turf/area
Expand All @@ -286,8 +286,9 @@ Building Docs: @turf/boolean-clockwise
The [turfjs.org](http://turfjs.org/) website is managed in a [separate repo](https://github.com/Turfjs/turf-www) with its own [contributing guide](https://github.com/Turfjs/turf-www/blob/master/CONTRIBUTING.md).

## Other Dependencies
- Turf uses [pnpm](https://pnpm.io/) and [lerna](https://lernajs.io/) during the testing, packaging and publishing process.
- Lerna and pnpm will be automatically installed when you run `npm install` in the root directory.
- Turf uses [pnpm 8](https://pnpm.io/8.x) and [lerna](https://lernajs.io/) during the testing, packaging and publishing process.
- Lerna will be automatically installed when you run `pnpm install` in the root directory.
- Pnpm will need to be installed on your computer, installers are available via the pnpm website. When using [corepack](https://nodejs.org/api/corepack.html), this is automatically installed when running `pnpm`.

## Financial contributions

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
],
"**/*": "prettier --write --ignore-unknown"
},
"packageManager": "[email protected]+sha512.d1a029e1a447ad90bc96cd58b0fad486d2993d531856396f7babf2d83eb1823bb83c5a3d0fc18f675b2d10321d49eb161fece36fe8134aa5823ecd215feed392",
"devDependencies": {
"@monorepolint/cli": "0.5.0-alpha.132",
"@monorepolint/config": "0.5.0-alpha.132",
Expand Down

0 comments on commit 3a6a035

Please sign in to comment.