diff --git a/.monorepolint.config.mjs b/.monorepolint.config.mjs index c3bf85e24..63dbad501 100644 --- a/.monorepolint.config.mjs +++ b/.monorepolint.config.mjs @@ -77,6 +77,7 @@ export default { "scripts", "husky", "lint-staged", + "packageManager", "devDependencies", "dependencies", ], diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 05a7eed16..53e168cac 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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. @@ -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 @@ -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. @@ -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/center@5.0.4 docs /Users/mac/Github/turf/packages/turf-center > node ../../scripts/generate-readmes @@ -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 @@ -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 diff --git a/package.json b/package.json index 7074ca63d..87572435d 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ ], "**/*": "prettier --write --ignore-unknown" }, + "packageManager": "pnpm@8.15.8+sha512.d1a029e1a447ad90bc96cd58b0fad486d2993d531856396f7babf2d83eb1823bb83c5a3d0fc18f675b2d10321d49eb161fece36fe8134aa5823ecd215feed392", "devDependencies": { "@monorepolint/cli": "0.5.0-alpha.132", "@monorepolint/config": "0.5.0-alpha.132",