Skip to content

Commit f1ced65

Browse files
committed
Merge remote-tracking branch 'origin/master' into HEAD
2 parents b0e0aad + ba6fc29 commit f1ced65

182 files changed

Lines changed: 3713 additions & 3621 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ jobs:
1818
runs-on: ubuntu-latest
1919

2020
strategy:
21+
fail-fast: false
2122
matrix:
22-
node-version: [18.x, 20.x, 22.x, 24.x]
23+
node-version: [18.x, 20.x, 22.x, 24.x, 26.x]
2324

2425
steps:
2526
- name: Checkout

.github/workflows/prerelease.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
fail-fast: true
1717
matrix:
1818
node:
19-
- 20
19+
- 26
2020
platform:
2121
- ubuntu-latest
2222
name: "${{matrix.platform}} / Node.js ${{ matrix.node }}"
@@ -36,21 +36,14 @@ jobs:
3636
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # 4.3.0
3737
with:
3838
node-version: ${{ matrix.node-version }}
39-
registry-url: "https://registry.npmjs.org"
4039
cache: "pnpm"
4140

42-
- run: npm whoami
43-
env:
44-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
45-
4641
- run: pnpm install --frozen-lockfile
4742

4843
- run: pnpm test
4944

5045
- name: run publish
51-
run: lerna publish from-package --ignore-scripts true --yes
52-
env:
53-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
46+
run: pnpm -r publish --no-git-checks --provenance --access public
5447

5548
- name: Create Github Release
5649
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # 2.2.1

.gitignore

Lines changed: 10 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,16 @@
1-
.rpt2_cache
1+
# our build directories
22
packages/*/dist
3-
main.js
4-
main.es.js
5-
main.mjs
6-
main.min.js
7-
index.mjs
8-
*.min.js
9-
*.es5.js
10-
.esm-cache
11-
package-lock.json
12-
env
13-
.nyc_output
14-
lib-cov
15-
*.seed
16-
*.log
17-
*.csv
18-
*.dat
19-
*.out
20-
*.pid
21-
.idea/*
22-
types.js
23-
.DS_Store
24-
types.d.ts
25-
26-
pids
27-
logs
28-
results
29-
30-
npm-debug.log*
313

4+
# pnpm-specific
325
node_modules
6+
pnpm-debug.log*
337

8+
# build caches
9+
.nx
10+
11+
# editor-specific
3412
.vscode
13+
.idea
3514

36-
.nx/
37-
.cursor/rules/nx-rules.mdc
38-
.github/instructions/nx.instructions.md
15+
# os-specific
16+
.DS_Store

.monorepolint.config.mjs

Lines changed: 38 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,49 @@
11
// @ts-check
22
import * as path from "node:path";
3-
import { glob } from "glob";
4-
import * as fs from "node:fs";
3+
import { existsSync } from "node:fs";
4+
import * as fs from "node:fs/promises";
55
import {
66
alphabeticalDependencies,
77
alphabeticalScripts,
88
packageOrder,
99
packageEntry,
1010
packageScript,
1111
requireDependency,
12+
REMOVE,
1213
} from "@monorepolint/rules";
1314

14-
const TS_PACKAGES = []; // projects that use typescript to build
15-
const JS_PACKAGES = []; // projects that use javascript/rollup to build
15+
const PACKAGES = []; // packages that aren't @turf/turf
1616
const MAIN_PACKAGE = "@turf/turf";
1717

18-
const TAPE_PACKAGES = []; // projects that have tape tests
19-
const TYPES_PACKAGES = []; // projects that have types tests
20-
const TSTYCHE_PACKAGES = []; // projects that use tstyche for type tests.
21-
const BENCH_PACKAGES = []; // projects that have benchmarks
18+
const TAPE_PACKAGES = []; // packages that have tape tests
19+
const TYPES_PACKAGES = []; // packages that have types tests
20+
const TSTYCHE_PACKAGES = []; // packages that use tstyche for type tests.
2221

2322
// iterate all the packages and figure out what buckets everything falls into
24-
const __dirname = new URL(".", import.meta.url).pathname;
25-
glob.sync(path.join(__dirname, "packages", "turf-*")).forEach((pk) => {
23+
const packagesPath = path.join(process.cwd(), "packages");
24+
for (const pk of await fs.readdir(packagesPath)) {
25+
if (pk === "turf") {
26+
continue;
27+
}
28+
2629
const name = JSON.parse(
27-
fs.readFileSync(path.join(pk, "package.json"), "utf8")
30+
await fs.readFile(path.join(packagesPath, pk, "package.json"), "utf8")
2831
).name;
2932

30-
if (fs.existsSync(path.join(pk, "index.ts"))) {
31-
TS_PACKAGES.push(name);
32-
} else {
33-
JS_PACKAGES.push(name);
34-
}
33+
PACKAGES.push(name);
3534

36-
if (fs.existsSync(path.join(pk, "test.js"))) {
35+
if (existsSync(path.join(pk, "test.js"))) {
3736
TAPE_PACKAGES.push(name);
3837
}
3938

40-
if (fs.existsSync(path.join(pk, "types.ts"))) {
39+
if (existsSync(path.join(packagesPath, pk, "types.ts"))) {
4140
TYPES_PACKAGES.push(name);
4241
}
4342

44-
if (fs.existsSync(path.join(pk, "test/types.tst.ts"))) {
43+
if (existsSync(path.join(packagesPath, pk, "test/types.tst.ts"))) {
4544
TSTYCHE_PACKAGES.push(name);
4645
}
47-
});
48-
49-
const TS_TAPE_PACKAGES = TAPE_PACKAGES.filter(
50-
(pkg) => -1 !== TS_PACKAGES.indexOf(pkg)
51-
);
52-
const JS_TAPE_PACKAGES = TAPE_PACKAGES.filter(
53-
(pkg) => -1 !== JS_PACKAGES.indexOf(pkg)
54-
);
46+
}
5547

5648
export default {
5749
rules: [
@@ -152,7 +144,7 @@ export default {
152144
},
153145
},
154146
},
155-
includePackages: [...TS_PACKAGES, ...JS_PACKAGES],
147+
includePackages: PACKAGES,
156148
}),
157149

158150
packageEntry({
@@ -161,7 +153,7 @@ export default {
161153
files: ["dist"],
162154
},
163155
},
164-
includePackages: [...TS_PACKAGES, ...JS_PACKAGES],
156+
includePackages: PACKAGES,
165157
}),
166158

167159
packageEntry({
@@ -175,7 +167,7 @@ export default {
175167
packageScript({
176168
options: {
177169
scripts: {
178-
docs: "tsx ../../scripts/generate-readmes.ts",
170+
docs: REMOVE,
179171
test: "pnpm run /test:.*/",
180172
},
181173
},
@@ -188,7 +180,7 @@ export default {
188180
build: "tsup --config ../../tsup.config.ts",
189181
},
190182
},
191-
includePackages: [...TS_PACKAGES, ...JS_PACKAGES],
183+
includePackages: PACKAGES,
192184
}),
193185

194186
packageScript({
@@ -208,7 +200,7 @@ export default {
208200
"test:tape": "tsx test.ts",
209201
},
210202
},
211-
includePackages: [...TS_TAPE_PACKAGES, ...JS_TAPE_PACKAGES],
203+
includePackages: TAPE_PACKAGES,
212204
}),
213205

214206
packageScript({
@@ -233,33 +225,34 @@ export default {
233225
requireDependency({
234226
options: {
235227
devDependencies: {
236-
benchmark: "^2.1.4",
237-
tape: "^5.9.0",
238-
tsup: "^8.4.0",
239-
tsx: "^4.19.4",
228+
benchmark: "catalog:",
229+
glob: REMOVE,
230+
tape: "catalog:",
231+
tsup: "catalog:",
232+
tsx: "catalog:",
240233
},
241234
},
242-
includePackages: [...TS_PACKAGES, ...JS_PACKAGES],
235+
includePackages: PACKAGES,
243236
}),
244237

245238
requireDependency({
246239
options: {
247240
dependencies: {
248-
tslib: "^2.8.1",
241+
tslib: "catalog:",
249242
},
250243
devDependencies: {
251-
"@types/benchmark": "^2.1.5",
252-
"@types/tape": "^5.8.1",
253-
typescript: "^5.8.3",
244+
"@types/benchmark": "catalog:",
245+
"@types/tape": "catalog:",
246+
typescript: "catalog:",
254247
},
255248
},
256-
includePackages: TS_PACKAGES,
249+
includePackages: PACKAGES,
257250
}),
258251

259252
requireDependency({
260253
options: {
261254
devDependencies: {
262-
tstyche: "^6.2.0",
255+
tstyche: "catalog:",
263256
},
264257
},
265258
includePackages: TSTYCHE_PACKAGES,
@@ -268,10 +261,10 @@ export default {
268261
requireDependency({
269262
options: {
270263
dependencies: {
271-
"@types/geojson": "^7946.0.10",
264+
"@types/geojson": "catalog:",
272265
},
273266
},
274-
includePackages: [MAIN_PACKAGE, ...TS_PACKAGES, ...JS_PACKAGES],
267+
includePackages: [MAIN_PACKAGE, ...PACKAGES],
275268
}),
276269
],
277270
};

docs/CONTRIBUTING.md

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ JSDoc comments are found in the top-level index file for each package (for examp
124124

125125
We have lots of tooling dedicated to ensuring consistent code. We use [Prettier](https://prettier.io/), [TypeScript](https://www.typescriptlang.org/), and [ESLint](https://eslint.org/) to help us deliver quality code. These are checked by the build system and should be enforced at commit time by [Husky](https://typicode.github.io/husky/#/).
126126

127-
Most packages are written in TypeScript, while a few plain Javascript still linger. You can generally use modern Javascript when modifying Turf itself as all exported code is transpiled to (currently es2017).
127+
Packages are written in TypeScript. You can generally use modern TypeScript when modifying Turf itself as all exported code is transpiled to a more compatible subset (currently es2017).
128128

129129
Code for consumption by browsers is transpiled by Babel as described in the README.
130130

@@ -140,25 +140,13 @@ Should you want to generate new README files manually, use `pnpm run docs`:
140140

141141
### Documentation - Examples
142142

143-
**Build docs for only `@turf/center`**
144-
145-
```bash
146-
$ cd ./turf/packages/turf-center
147-
$ pnpm run docs
148-
149-
> @turf/center@5.0.4 docs /Users/mac/Github/turf/packages/turf-center
150-
> node ../../scripts/generate-readmes
151-
152-
Building Docs: @turf/center
153-
```
154-
155143
**Builds docs for all packages**
156144

157145
```bash
158146
$ cd ./turf
159147
$ pnpm run docs
160148
> @ docs /Users/mac/Github/turf
161-
> tsx ./scripts/generate-readmes
149+
> node ./scripts/generate-readmes.mts
162150

163151
Building Docs: @turf/along
164152
Building Docs: @turf/area
@@ -171,6 +159,8 @@ Building Docs: @turf/boolean-clockwise
171159
....
172160
```
173161

162+
Note: This should be automatically executed with a pre-commit hook when necessary
163+
174164
### Public website
175165

176166
The [turfjs.org](https://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).

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
33
"npmClient": "pnpm",
4-
"version": "7.3.4",
4+
"version": "7.3.5",
55
"command": {
66
"publish": {
77
"registry": "https://registry.npmjs.org"

0 commit comments

Comments
 (0)