Skip to content

Commit

Permalink
Merge branch 'master' into mf/upgrade-typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
mfedderly authored Aug 22, 2024
2 parents 445159f + 099bf3c commit f1fc333
Show file tree
Hide file tree
Showing 146 changed files with 1,118 additions and 637 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ jobs:
with:
fetch-depth: 0

- uses: pnpm/action-setup@v2.4.0
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 8
run_install: false

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ jobs:
with:
fetch-depth: 0

- uses: pnpm/action-setup@v2.4.0
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 8
run_install: false

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
Expand Down
2 changes: 1 addition & 1 deletion .monorepolint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ export default {
requireDependency({
options: {
dependencies: {
"@types/geojson": "^7946.0.0",
"@types/geojson": "^7946.0.10",
},
},
includePackages: [MAIN_PACKAGE, ...TS_PACKAGES, ...JS_PACKAGES],
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ node_modules

# is actually output
packages/turf/turf.min.js
packages/turf/test.example.js

pnpm-lock.yaml

Expand Down
62 changes: 35 additions & 27 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,13 @@ A turf release is initiated from your local computer, and then built and publish
To make a release as a core contributor, you will need:
- Turf repository write permission
- Turf npm organization publish permission
- A local copy of the Turf Github repository (not a fork!). Starting with a fresh clone will ensure it's clean.
- `git clone git@github.com:Turfjs/turf.git turf-release`
- A clean local copy of the Turf Github repository (not a fork!). Starting with a fresh clone will ensure it's clean.
- Depending on your auth method
- `git clone git@github.com:Turfjs/turf.git turf-release`
- or `git clone https://github.com/Turfjs/turf.git turf-release`
- `cd turf-release` - start at the top-level of the repo
- `pnpm install`
- `pnpm test` - make sure everything is passing

- If you choose to clean up an existing copy instead, be very careful:
- `git remote -v` - verify your remote origin points to `https://github.com/Turfjs/turf.git`
Expand All @@ -205,39 +208,44 @@ To make a release as a core contributor, you will need:
Before release:
- If necessary, make and merge a PR with any last minute housekeeping items.
- Turf's documentation (README.md files) should already be up to date as it is generated automatically on commit from JSDoc comments in source files.
- Review PR's and decide the new version number to be published (for example 7.0.1 or 7.1.0).
- If there are breaking changes, then it should be a major version bump, e.g. 7.x.x to 8.0.0. This project follows [semantic versioning](https://semver.org/).
- Review PR's and decide the new version number to be published. See [semantic versioning](https://semver.org/).

Run the release commands, replace `7.0.0` with your version number
- fetch the latest code from remote origin
- `git fetch origin`
Run the following release commands, replacing `7.0.0` with your version number:

- create a release branch, replace mf with your initials to make it clear whose branch it is.
- `git checkout origin/master -b mf/release-7.0.0`
- create a release branch, replacing `xx` with your initials to make it clear who created the branch.
- `git checkout origin/master -b xx/release-7.0.0`

- increment the version number of all packages, without pushing to origin. This will also create a release tag.
- increment the version number of all packages, and create a local commit, without pushing to origin. This will also create a release tag.
- `pnpm lerna version --no-commit-hooks --no-push 7.0.0`

- stage any files changed by the version command.
- `git add packages/*/package.json`
- `git add lerna.json`
`

- create new commit on the release branch
- `git commit -m "Release v7.0.0"`

- Push the release branch and the release tag.
- `git push origin mf/release-7.0.0 --follow-tags`
- The tag will trigger the Github [release](https://github.com/Turfjs/turf/blob/master/.github/workflows/release.yml) action which you can view the status of at - https://github.com/Turfjs/turf/actions. If successful, a new [version](https://www.npmjs.com/package/@turf/turf?activeTab=versions) of all turf packages will have been published on NPM.

- If the release action was successful, now create a Pull Request for the release and then merge it.
- A link to create the PR should be in the output of the push command
- Use the version number for the PR title (e.g. v7.0.0).
- If a link isn't provided, just create a PR that merges your release branch to master. Here is an example - https://github.com/Turfjs/turf/pull/2615.
- Don't forget to merge your release PR!
- `git push origin xx/release-7.0.0 --follow-tags`
- Pushing the tag will trigger the Github [release](https://github.com/Turfjs/turf/blob/master/.github/workflows/release.yml) action which you can view the status of at - https://github.com/Turfjs/turf/actions. If successful, a new [version](https://www.npmjs.com/package/@turf/turf?activeTab=versions) of all turf packages will have been published on NPM.

- If the release action was not successful
- commit any changes to master to fix it.
- Make a [prerelease](#prerelease) if helpful to make sure the release action is successful.
- Then reset by deleting your tag and branch locally and remotely.
- `git push --delete origin v7.1.0`
- `git tag --delete v7.1.0`
- `git push -d origin xx/release-7.0.0`
- `git branch -d xx/release-7.0.0`
- Now redo the steps above starting with creating "A clean local copy of the Turf Github repository"

- If the release action was successful, now create a Pull Request for the release to update master.
- You may be given a link in the output of the branch/tag push command to create the PR.
- If you don't get this message, just go to https://github.com/Turfjs/turf/pulls and you should be prompted at the top to create a PR for this new branch you just pushed.
- If that prompt doesn't appear, then just create a new pull request from the PR page and make sure the title is the version number e.g. `v7.0.0` and that it is merging your release branch -> to master.
- Here is an example PR - https://github.com/Turfjs/turf/pull/2615.
- Get approval for the release PR and merge it!

#### Follow-on steps
- As part of the release action, a draft Github release will have been created at https://github.com/Turfjs/turf/releases with an auto-generated changelog. Edit and add to the release notes for readability and completeness, specifically noting any breaking changes. Use past releases as a guide. Be sure to "Save draft" each time, then ask for a review from other contributors. Once ready, click `Publish release`. This will make the release notes publicly accessible and notify all watchers of the project.
- As part of the release action, a draft Github release will have been created at https://github.com/Turfjs/turf/releases with an auto-generated changelog.
- Edit and add to the release notes for readability and completeness, specifically noting any breaking changes. Use past releases as a guide.
- Be sure to "Save draft" each time, then ask for a review or edits from other contributors.
- Try not to leave the notes unpublished more than a day, people rely on these notes for upgrading.
- Once ready, click `Publish release`. This will make the release notes publicly accessible and notify all watchers of the project.
- You can edit and republish your release notes after this, but that will likely notify followers, so best to get it right the first time.
- Release a new version of the [API docs](https://github.com/Turfjs/turf-www/blob/master/CONTRIBUTING.md) for the https://turfjs.org website.

## Documentation
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"npmClient": "pnpm",
"version": "7.0.0",
"version": "7.1.0",
"command": {
"publish": {
"registry": "https://registry.npmjs.org"
Expand Down
4 changes: 2 additions & 2 deletions packages/turf-along/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@turf/along",
"version": "7.0.0",
"version": "7.1.0",
"description": "turf along module",
"author": "Turf Authors",
"license": "MIT",
Expand Down Expand Up @@ -68,7 +68,7 @@
"@turf/distance": "workspace:^",
"@turf/helpers": "workspace:^",
"@turf/invariant": "workspace:^",
"@types/geojson": "^7946.0.0",
"@types/geojson": "^7946.0.10",
"tslib": "^2.6.2"
}
}
4 changes: 2 additions & 2 deletions packages/turf-angle/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@turf/angle",
"version": "7.0.0",
"version": "7.1.0",
"description": "turf angle module",
"author": "Turf Authors",
"contributors": [
Expand Down Expand Up @@ -72,7 +72,7 @@
"@turf/helpers": "workspace:^",
"@turf/invariant": "workspace:^",
"@turf/rhumb-bearing": "workspace:^",
"@types/geojson": "^7946.0.0",
"@types/geojson": "^7946.0.10",
"tslib": "^2.6.2"
}
}
14 changes: 10 additions & 4 deletions packages/turf-area/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

## area

Takes one or more features and returns their area in square meters.
Calculates the geodesic area in square meters of one or more polygons.

### Parameters

* `geojson` **[GeoJSON][1]** input GeoJSON feature(s)
* `geojson` **[GeoJSON][1]** input polygon(s) as [Geometry][2], [Feature][3], or [FeatureCollection][4]

### Examples

Expand All @@ -22,11 +22,17 @@ var addToMap = [polygon]
polygon.properties.area = area
```

Returns **[number][2]** area in square meters
Returns **[number][5]** area in square meters

[1]: https://tools.ietf.org/html/rfc7946#section-3

[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
[2]: https://tools.ietf.org/html/rfc7946#section-3.1

[3]: https://tools.ietf.org/html/rfc7946#section-3.2

[4]: https://tools.ietf.org/html/rfc7946#section-3.3

[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number

<!-- This file is automatically generated. Please don't edit it directly. If you find an error, edit the source file of the module in question (likely index.js or index.ts), and re-run "yarn docs" from the root of the turf project. -->

Expand Down
4 changes: 2 additions & 2 deletions packages/turf-area/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { earthRadius } from "@turf/helpers";
import { geomReduce } from "@turf/meta";

/**
* Takes one or more features and returns their area in square meters.
* Calculates the geodesic area in square meters of one or more polygons.
*
* @name area
* @param {GeoJSON} geojson input GeoJSON feature(s)
* @param {GeoJSON} geojson input polygon(s) as {@link Geometry}, {@link Feature}, or {@link FeatureCollection}
* @returns {number} area in square meters
* @example
* var polygon = turf.polygon([[[125, -15], [113, -22], [154, -27], [144, -15], [125, -15]]]);
Expand Down
4 changes: 2 additions & 2 deletions packages/turf-area/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@turf/area",
"version": "7.0.0",
"version": "7.1.0",
"description": "turf area module",
"author": "Turf Authors",
"license": "MIT",
Expand Down Expand Up @@ -65,7 +65,7 @@
"dependencies": {
"@turf/helpers": "workspace:^",
"@turf/meta": "workspace:^",
"@types/geojson": "^7946.0.0",
"@types/geojson": "^7946.0.10",
"tslib": "^2.6.2"
}
}
4 changes: 2 additions & 2 deletions packages/turf-bbox-clip/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@turf/bbox-clip",
"version": "7.0.0",
"version": "7.1.0",
"description": "turf bbox-clip module",
"author": "Turf Authors",
"contributors": [
Expand Down Expand Up @@ -72,7 +72,7 @@
"dependencies": {
"@turf/helpers": "workspace:^",
"@turf/invariant": "workspace:^",
"@types/geojson": "^7946.0.0",
"@types/geojson": "^7946.0.10",
"tslib": "^2.6.2"
}
}
4 changes: 2 additions & 2 deletions packages/turf-bbox-polygon/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@turf/bbox-polygon",
"version": "7.0.0",
"version": "7.1.0",
"description": "turf bbox-polygon module",
"author": "Turf Authors",
"license": "MIT",
Expand Down Expand Up @@ -63,7 +63,7 @@
},
"dependencies": {
"@turf/helpers": "workspace:^",
"@types/geojson": "^7946.0.0",
"@types/geojson": "^7946.0.10",
"tslib": "^2.6.2"
}
}
4 changes: 2 additions & 2 deletions packages/turf-bbox/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@turf/bbox",
"version": "7.0.0",
"version": "7.1.0",
"description": "turf bbox module",
"author": "Turf Authors",
"license": "MIT",
Expand Down Expand Up @@ -65,7 +65,7 @@
"dependencies": {
"@turf/helpers": "workspace:^",
"@turf/meta": "workspace:^",
"@types/geojson": "^7946.0.0",
"@types/geojson": "^7946.0.10",
"tslib": "^2.6.2"
}
}
4 changes: 2 additions & 2 deletions packages/turf-bearing/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@turf/bearing",
"version": "7.0.0",
"version": "7.1.0",
"description": "turf bearing module",
"author": "Turf Authors",
"license": "MIT",
Expand Down Expand Up @@ -63,7 +63,7 @@
"dependencies": {
"@turf/helpers": "workspace:^",
"@turf/invariant": "workspace:^",
"@types/geojson": "^7946.0.0",
"@types/geojson": "^7946.0.10",
"tslib": "^2.6.2"
}
}
4 changes: 2 additions & 2 deletions packages/turf-bezier-spline/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@turf/bezier-spline",
"version": "7.0.0",
"version": "7.1.0",
"description": "turf bezier-spline module",
"author": "Turf Authors",
"license": "MIT",
Expand Down Expand Up @@ -66,7 +66,7 @@
"dependencies": {
"@turf/helpers": "workspace:^",
"@turf/invariant": "workspace:^",
"@types/geojson": "^7946.0.0",
"@types/geojson": "^7946.0.10",
"tslib": "^2.6.2"
}
}
4 changes: 2 additions & 2 deletions packages/turf-boolean-clockwise/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@turf/boolean-clockwise",
"version": "7.0.0",
"version": "7.1.0",
"description": "turf boolean-clockwise module",
"author": "Turf Authors",
"contributors": [
Expand Down Expand Up @@ -70,7 +70,7 @@
"dependencies": {
"@turf/helpers": "workspace:^",
"@turf/invariant": "workspace:^",
"@types/geojson": "^7946.0.0",
"@types/geojson": "^7946.0.10",
"tslib": "^2.6.2"
}
}
4 changes: 2 additions & 2 deletions packages/turf-boolean-concave/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@turf/boolean-concave",
"version": "7.0.0",
"version": "7.1.0",
"description": "turf boolean-concave module",
"author": "Turf Authors",
"contributors": [
Expand Down Expand Up @@ -69,7 +69,7 @@
"dependencies": {
"@turf/helpers": "workspace:^",
"@turf/invariant": "workspace:^",
"@types/geojson": "^7946.0.0",
"@types/geojson": "^7946.0.10",
"tslib": "^2.6.2"
}
}
4 changes: 2 additions & 2 deletions packages/turf-boolean-contains/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@turf/boolean-contains",
"version": "7.0.0",
"version": "7.1.0",
"description": "turf boolean-contains module",
"author": "Turf Authors",
"contributors": [
Expand Down Expand Up @@ -74,7 +74,7 @@
"@turf/boolean-point-on-line": "workspace:^",
"@turf/helpers": "workspace:^",
"@turf/invariant": "workspace:^",
"@types/geojson": "^7946.0.0",
"@types/geojson": "^7946.0.10",
"tslib": "^2.6.2"
}
}
4 changes: 2 additions & 2 deletions packages/turf-boolean-crosses/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@turf/boolean-crosses",
"version": "7.0.0",
"version": "7.1.0",
"description": "turf boolean-crosses module",
"author": "Turf Authors",
"contributors": [
Expand Down Expand Up @@ -73,7 +73,7 @@
"@turf/invariant": "workspace:^",
"@turf/line-intersect": "workspace:^",
"@turf/polygon-to-line": "workspace:^",
"@types/geojson": "^7946.0.0",
"@types/geojson": "^7946.0.10",
"tslib": "^2.6.2"
}
}
Loading

0 comments on commit f1fc333

Please sign in to comment.