Skip to content

Commit

Permalink
Incorporating some suggestions from @favna on being more explicit wit…
Browse files Browse the repository at this point in the history
…h d.ts entries. Turfjs#2307 (comment)  Specifying overall module type as commonjs explicitly.
  • Loading branch information
smallsaucepan committed Dec 16, 2023
1 parent effc083 commit faa15c8
Show file tree
Hide file tree
Showing 118 changed files with 1,523 additions and 576 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"lint:eslint": "eslint packages",
"lint:prettier": "prettier --check .",
"lintDISABLED:mrl": "mrl check",
"lint:escheck-cjs": "es-check es8 packages/*/dist/index.js packages/turf/turf.min.js",
"lint:escheck-esm": "es-check --module es8 packages/*/dist/index.mjs",
"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.mjs",
"lint:escheck-web": "es-check es5 packages/turf/turf.min.js",
"lint:docs": "documentation lint packages/turf-*/index.js packages/turf-*/index.mjs",
"preinstall": "npx only-allow pnpm",
Expand Down Expand Up @@ -61,6 +61,7 @@
"progress": "^2.0.3",
"rollup": "^2.79.1",
"ts-node": "^9.0.0",
"tsup": "^8.0.1",
"tsx": "^4.6.2",
"typescript": "^5.2.2",
"yamljs": "^0.3.0"
Expand Down
18 changes: 13 additions & 5 deletions packages/turf-along/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,21 @@
"turf",
"distance"
],
"main": "dist/index.js",
"module": "dist/index.mjs",
"type": "commonjs",
"main": "dist/cjs/index.cjs",
"module": "dist/esm/index.mjs",
"types": "dist/cjs/index.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs"
"import": {
"types": "./dist/esm/index.d.mts",
"default": "./dist/esm/index.mjs"
},
"require": {
"types": "./dist/cjs/index.d.ts",
"default": "./dist/cjs/index.cjs"
}
}
},
"sideEffects": false,
Expand All @@ -38,7 +46,7 @@
],
"scripts": {
"bench": "tsx bench.ts",
"build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting",
"build": "tsup --config ../../tsup.config.ts",
"docs": "tsx ../../scripts/generate-readmes.ts",
"test": "npm-run-all --npm-path npm test:*",
"test:tape": "tsx test.ts"
Expand Down
18 changes: 13 additions & 5 deletions packages/turf-angle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,21 @@
"turf",
"angle"
],
"main": "dist/index.js",
"module": "dist/index.mjs",
"type": "commonjs",
"main": "dist/cjs/index.cjs",
"module": "dist/esm/index.mjs",
"types": "dist/cjs/index.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs"
"import": {
"types": "./dist/esm/index.d.mts",
"default": "./dist/esm/index.mjs"
},
"require": {
"types": "./dist/cjs/index.d.ts",
"default": "./dist/cjs/index.cjs"
}
}
},
"sideEffects": false,
Expand All @@ -38,7 +46,7 @@
],
"scripts": {
"bench": "tsx bench.ts",
"build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting",
"build": "tsup --config ../../tsup.config.ts",
"docs": "tsx ../../scripts/generate-readmes.ts",
"test": "npm-run-all --npm-path npm test:*",
"test:tape": "tsx test.ts"
Expand Down
18 changes: 13 additions & 5 deletions packages/turf-area/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,21 @@
"polygon",
"multipolygon"
],
"main": "dist/index.js",
"module": "dist/index.mjs",
"type": "commonjs",
"main": "dist/cjs/index.cjs",
"module": "dist/esm/index.mjs",
"types": "dist/cjs/index.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs"
"import": {
"types": "./dist/esm/index.d.mts",
"default": "./dist/esm/index.mjs"
},
"require": {
"types": "./dist/cjs/index.d.ts",
"default": "./dist/cjs/index.cjs"
}
}
},
"sideEffects": false,
Expand All @@ -37,7 +45,7 @@
],
"scripts": {
"bench": "tsx bench.ts",
"build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting",
"build": "tsup --config ../../tsup.config.ts",
"docs": "tsx ../../scripts/generate-readmes.ts",
"test": "npm-run-all --npm-path npm test:*",
"test:tape": "tsx test.ts"
Expand Down
18 changes: 13 additions & 5 deletions packages/turf-bbox-clip/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,21 @@
"bbox",
"clip"
],
"main": "dist/index.js",
"module": "dist/index.mjs",
"type": "commonjs",
"main": "dist/cjs/index.cjs",
"module": "dist/esm/index.mjs",
"types": "dist/cjs/index.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs"
"import": {
"types": "./dist/esm/index.d.mts",
"default": "./dist/esm/index.mjs"
},
"require": {
"types": "./dist/cjs/index.d.ts",
"default": "./dist/cjs/index.cjs"
}
}
},
"sideEffects": false,
Expand All @@ -43,7 +51,7 @@
],
"scripts": {
"bench": "tsx bench.ts",
"build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting",
"build": "tsup --config ../../tsup.config.ts",
"docs": "tsx ../../scripts/generate-readmes.ts",
"test": "npm-run-all --npm-path npm test:*",
"test:tape": "tsx test.ts"
Expand Down
18 changes: 13 additions & 5 deletions packages/turf-bbox-polygon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,21 @@
"extent",
"bbox"
],
"main": "dist/index.js",
"module": "dist/index.mjs",
"type": "commonjs",
"main": "dist/cjs/index.cjs",
"module": "dist/esm/index.mjs",
"types": "dist/cjs/index.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs"
"import": {
"types": "./dist/esm/index.d.mts",
"default": "./dist/esm/index.mjs"
},
"require": {
"types": "./dist/cjs/index.d.ts",
"default": "./dist/cjs/index.cjs"
}
}
},
"sideEffects": false,
Expand All @@ -38,7 +46,7 @@
],
"scripts": {
"bench": "tsx bench.ts",
"build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting",
"build": "tsup --config ../../tsup.config.ts",
"docs": "tsx ../../scripts/generate-readmes.ts",
"test": "npm-run-all --npm-path npm test:*",
"test:tape": "tsx test.ts"
Expand Down
18 changes: 13 additions & 5 deletions packages/turf-bbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,21 @@
"featurecollection",
"geojson"
],
"main": "dist/index.js",
"module": "dist/index.mjs",
"type": "commonjs",
"main": "dist/cjs/index.cjs",
"module": "dist/esm/index.mjs",
"types": "dist/cjs/index.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs"
"import": {
"types": "./dist/esm/index.d.mts",
"default": "./dist/esm/index.mjs"
},
"require": {
"types": "./dist/cjs/index.d.ts",
"default": "./dist/cjs/index.cjs"
}
}
},
"sideEffects": false,
Expand All @@ -39,7 +47,7 @@
],
"scripts": {
"bench": "tsx bench.ts",
"build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting",
"build": "tsup --config ../../tsup.config.ts",
"docs": "tsx ../../scripts/generate-readmes.ts",
"test": "npm-run-all --npm-path npm test:*",
"test:tape": "tsx test.ts"
Expand Down
18 changes: 13 additions & 5 deletions packages/turf-bearing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,21 @@
"turf",
"bearing"
],
"main": "dist/index.js",
"module": "dist/index.mjs",
"type": "commonjs",
"main": "dist/cjs/index.cjs",
"module": "dist/esm/index.mjs",
"types": "dist/cjs/index.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs"
"import": {
"types": "./dist/esm/index.d.mts",
"default": "./dist/esm/index.mjs"
},
"require": {
"types": "./dist/cjs/index.d.ts",
"default": "./dist/cjs/index.cjs"
}
}
},
"sideEffects": false,
Expand All @@ -35,7 +43,7 @@
],
"scripts": {
"bench": "tsx bench.ts",
"build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting",
"build": "tsup --config ../../tsup.config.ts",
"docs": "tsx ../../scripts/generate-readmes.ts",
"test": "npm-run-all --npm-path npm test:*",
"test:tape": "tsx test.ts"
Expand Down
18 changes: 13 additions & 5 deletions packages/turf-bezier-spline/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,21 @@
"curve",
"linestring"
],
"main": "dist/index.js",
"module": "dist/index.mjs",
"type": "commonjs",
"main": "dist/cjs/index.cjs",
"module": "dist/esm/index.mjs",
"types": "dist/cjs/index.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs"
"import": {
"types": "./dist/esm/index.d.mts",
"default": "./dist/esm/index.mjs"
},
"require": {
"types": "./dist/cjs/index.d.ts",
"default": "./dist/cjs/index.cjs"
}
}
},
"sideEffects": false,
Expand All @@ -38,7 +46,7 @@
],
"scripts": {
"bench": "tsx bench.ts",
"build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting",
"build": "tsup --config ../../tsup.config.ts",
"docs": "tsx ../../scripts/generate-readmes.ts",
"test": "npm-run-all --npm-path npm test:*",
"test:tape": "tsx test.ts"
Expand Down
18 changes: 13 additions & 5 deletions packages/turf-boolean-clockwise/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,21 @@
"clockwise",
"boolean"
],
"main": "dist/index.js",
"module": "dist/index.mjs",
"type": "commonjs",
"main": "dist/cjs/index.cjs",
"module": "dist/esm/index.mjs",
"types": "dist/cjs/index.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs"
"import": {
"types": "./dist/esm/index.d.mts",
"default": "./dist/esm/index.mjs"
},
"require": {
"types": "./dist/cjs/index.d.ts",
"default": "./dist/cjs/index.cjs"
}
}
},
"sideEffects": false,
Expand All @@ -42,7 +50,7 @@
],
"scripts": {
"bench": "tsx bench.ts",
"build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting",
"build": "tsup --config ../../tsup.config.ts",
"docs": "tsx ../../scripts/generate-readmes.ts",
"test": "npm-run-all --npm-path npm test:*",
"test:tape": "tsx test.ts"
Expand Down
18 changes: 13 additions & 5 deletions packages/turf-boolean-concave/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,21 @@
"convex",
"boolean"
],
"main": "dist/index.js",
"module": "dist/index.mjs",
"type": "commonjs",
"main": "dist/cjs/index.cjs",
"module": "dist/esm/index.mjs",
"types": "dist/cjs/index.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs"
"import": {
"types": "./dist/esm/index.d.mts",
"default": "./dist/esm/index.mjs"
},
"require": {
"types": "./dist/cjs/index.d.ts",
"default": "./dist/cjs/index.cjs"
}
}
},
"sideEffects": false,
Expand All @@ -41,7 +49,7 @@
],
"scripts": {
"bench": "tsx bench.ts",
"build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting",
"build": "tsup --config ../../tsup.config.ts",
"docs": "tsx ../../scripts/generate-readmes.ts",
"test": "npm-run-all --npm-path npm test:*",
"test:tape": "tsx test.ts"
Expand Down
Loading

0 comments on commit faa15c8

Please sign in to comment.