Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
4bc86a0
Minimal changes required to have existing ESM+CJS build process compl…
smallsaucepan Dec 20, 2025
6da37b9
Added rules to monorepolint to generate per package tsconfig.json and…
smallsaucepan Dec 22, 2025
cfc3c7d
Split @turf/turf build into build and rollup, and moved rollup to the…
smallsaucepan Dec 22, 2025
8b9b2a4
Auto generated (by mrl) changes to existing tsconfig.json and package…
smallsaucepan Dec 22, 2025
26162d8
Auto generated (by mrl) NEW tsconfig.build.json, tsconfig.types.json,…
smallsaucepan Dec 22, 2025
9892d32
Removed now defunct (I think) seperate build tsconfig and tsup config…
smallsaucepan Dec 30, 2025
636eaf0
Merge branch 'Turfjs:master' into dev-without-build
smallsaucepan Dec 31, 2025
5caa61d
WIP.
smallsaucepan Jan 2, 2026
b3f2903
Merge remote-tracking branch 'refs/remotes/origin/dev-without-build' …
smallsaucepan Jan 2, 2026
02a8b4d
Merge branch 'master' into dev-without-build
smallsaucepan Jan 2, 2026
2f579b3
Migrate @turf/buffer to TypeScript, ignoring errors
mfedderly Jan 5, 2026
7c4b76f
Merge remote-tracking branch 'upstream/mf/buffer-ts-basic' into dev-w…
smallsaucepan Jan 11, 2026
7847682
Merge branch 'master' into dev-without-build
smallsaucepan Jan 11, 2026
1ae24d0
Retired tsup for JS generation. Instead using tsc with two configs in…
smallsaucepan Jan 12, 2026
c1e9d9f
Being explicit about when we are exporting types. Related to enabling…
smallsaucepan Jan 12, 2026
7ed0c48
Merge branch 'master' into dev-without-build
smallsaucepan Apr 29, 2026
c289319
Refactor build targets in normal packages to build (esm only) and pre…
smallsaucepan Apr 30, 2026
5acee45
Work in progress. Utilise eslint and prettier built in caching. Test …
smallsaucepan May 2, 2026
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
18 changes: 12 additions & 6 deletions .monorepolint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default {
file: "tsup.config.ts",
templateFile: "./templates/package/tsup.config.ts",
},
includePackages: TS_PACKAGES,
includePackages: [...TS_PACKAGES, MAIN_PACKAGE],
}),
fileContents({
options: {
Expand Down Expand Up @@ -214,14 +214,13 @@ export default {
build: "tsup",
},
},
includePackages: [...TS_PACKAGES, ...JS_PACKAGES],
includePackages: [...TS_PACKAGES, ...JS_PACKAGES, MAIN_PACKAGE],
}),

packageScript({
options: {
scripts: {
build:
"tsup --config ../../tsup.config.ts && rollup -c rollup.config.js",
rollup: "rollup -c rollup.config.js",
},
},
includePackages: [MAIN_PACKAGE],
Expand All @@ -240,13 +239,20 @@ export default {
packageScript({
options: {
scripts: {
"test:types":
"tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts",
"test:types": "tsc --project tsconfig.types.json",
},
},
includePackages: TYPES_PACKAGES,
}),

fileContents({
options: {
file: "tsconfig.types.json",
templateFile: "./templates/package/tsconfig.types.json",
},
includePackages: TYPES_PACKAGES,
}),

requireDependency({
options: {
devDependencies: {
Expand Down
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ pnpm-lock.yaml

/.nx/workspace-data

# Auto generated by mrl, which produces a slightly clashing format.
tsconfig.json
tsconfig.build.json
tsconfig.shared.json
tsconfig.types.json
Comment thread
mfedderly marked this conversation as resolved.
16 changes: 11 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,24 @@
"private": true,
"funding": "https://opencollective.com/turf",
"scripts": {
"build": "pnpx lerna run build",
"docs": "tsx ./scripts/generate-readmes.ts",
"escheck": "pnpm run /escheck:.*/",
"escheck:cjs": "es-check es8 packages/*/dist/cjs/index.cjs packages/turf/turf.min.js",
"escheck:esm": "es-check --module es8 packages/*/dist/esm/index.js",
"escheck:web": "es-check es5 packages/turf/turf.min.js",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lmao we're still shipping es5 turf.min.js. That should definitely get bumped way forward.
#2989

"lint": "pnpm run /lint:.*/",
"lint:docs": "documentation lint packages/turf-*/index.js",
"lint:escheck-cjs": "es-check es8 packages/*/dist/cjs/index.cjs packages/turf/turf.min.js",
"lint:escheck-esm": "es-check --module es8 packages/*/dist/esm/index.js",
"lint:escheck-web": "es-check es5 packages/turf/turf.min.js",
"lint:eslint": "eslint packages",
"lint:mrl": "mrl check",
"lint:prettier": "prettier --check .",
"preinstall": "npx only-allow pnpm",
"prepare": "husky && lerna run build",
"test": "pnpm run lint && lerna run test && lerna run --scope @turf/turf last-checks"
"prepare": "husky",
"prerelease": "pnpm run build && pnpm run rollup",
"release": "pnpm run test:release && pnpm publish -r",
"rollup": "lerna run --scope @turf/turf rollup",
"test": "pnpx lerna run test",
"test:release": "pnpm run lint && pnpm run escheck && lerna run --scope @turf/turf last-checks"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be in favor of just keeping this all one test script, instead of breaking it out differently for releases.
We can probably entirely get rid of the escheck step once we swap TypeScript to targeting esnext.

},
"lint-staged": {
"package.json": [
Expand Down
7 changes: 0 additions & 7 deletions packages/turf-kinks/lib/sweepline-intersections-export.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/turf-line-intersect/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
Polygon,
} from "geojson";
import type { Intersection } from "sweepline-intersections";
import { sweeplineIntersections as findIntersections } from "./lib/sweepline-intersections-export.js";
import findIntersections from "sweepline-intersections";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't realize this shim stuff was still around. 🧹


/**
* Takes any LineString or Polygon GeoJSON and returns the intersecting point(s).
Expand Down

This file was deleted.

9 changes: 0 additions & 9 deletions packages/turf-tesselate/earcut.d.ts

This file was deleted.

3 changes: 2 additions & 1 deletion packages/turf/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,11 @@
"turf.min.js"
],
"scripts": {
"build": "tsup --config ../../tsup.config.ts && rollup -c rollup.config.js",
"build": "tsup",
"last-checks": "pnpm run last-checks:testjs && pnpm run last-checks:example",
"last-checks:example": "tsx test.example.js",
"last-checks:testjs": "tsx test.ts",
"rollup": "rollup -c rollup.config.js",
"test": "echo '@turf/turf tests run in the last-checks step'"
},
"devDependencies": {
Expand Down
8 changes: 8 additions & 0 deletions templates/package/tsconfig.types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"composite": false,
"noEmit": true,
},
"include": ["types.ts"],
}
19 changes: 4 additions & 15 deletions tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineConfig, type Options } from "tsup";
import { type Options } from "tsup";

const baseOptions: Options = {
tsconfig: "./tsconfig.build.json",
Expand All @@ -7,22 +7,11 @@ const baseOptions: Options = {
sourcemap: true,
// treeshake: true, causes "chunk.default" warning, breaks CJS exports?
minify: false,
skipNodeModulesBundle: true,
cjsInterop: true,
splitting: true,
external: [
/^@turf\//, // Externalize all @turf workspace packages
],

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this required to basically reverse the paths changes when we're doing the tsup step?
They should be already excluded by default if I'm reading the docs right.

https://tsup.egoist.dev/#excluding-packages

};

export default [
defineConfig({
...baseOptions,
outDir: "dist/cjs",
format: "cjs",
}),
defineConfig({
...baseOptions,
outDir: "dist/esm",
format: "esm",
}),
];

export { baseOptions };