diff --git a/.monorepolint.config.mjs b/.monorepolint.config.mjs index b2c1ffcc3..932367f02 100644 --- a/.monorepolint.config.mjs +++ b/.monorepolint.config.mjs @@ -63,11 +63,14 @@ export default { `, }, includePackages: TS_PACKAGES.filter( - (elem) => !["@turf/isobands", "@turf/tesselate"].includes(elem) + (elem) => + !["@turf/isobands", "@turf/isolines", "@turf/tesselate"].includes( + elem + ) ), }), - // Special treatment for two packages with locally defined .d.ts files for + // Special treatment for three packages with locally defined .d.ts files for // untyped Javascript dependencies. Might be possible to remove should those // libraries be retired / types added to DefinitelyTyped. fileContents({ @@ -79,7 +82,7 @@ export default { } `, }, - includePackages: ["@turf/isobands"], + includePackages: ["@turf/isobands", "@turf/isolines"], }), fileContents({ options: { @@ -226,17 +229,7 @@ export default { build: "tsup --config ../../tsup.config.ts", }, }, - includePackages: [...TS_PACKAGES, ...JS_PACKAGES], - }), - - packageScript({ - options: { - scripts: { - build: - "tsup --config ../../tsup.config.ts && rollup -c rollup.config.js", - }, - }, - includePackages: [MAIN_PACKAGE], + includePackages: [MAIN_PACKAGE, ...TS_PACKAGES, ...JS_PACKAGES], }), packageScript({ diff --git a/package.json b/package.json index 2fe01652c..865d74ff7 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "lint:prettier": "prettier --check .", "postinstall": "husky install", "preinstall": "npx only-allow pnpm", - "prepublish": "lerna run build && lerna run --scope @turf/turf last-checks", + "prepublishOnly": "lerna run build && lerna run --scope @turf/turf cdnBundle", "test": "lerna run test" }, "lint-staged": { diff --git a/packages/turf-isolines/index.ts b/packages/turf-isolines/index.ts index bade82833..248732a17 100644 --- a/packages/turf-isolines/index.ts +++ b/packages/turf-isolines/index.ts @@ -2,7 +2,6 @@ import { bbox } from "@turf/bbox"; import { coordEach } from "@turf/meta"; import { collectionOf } from "@turf/invariant"; import { multiLineString, featureCollection, isObject } from "@turf/helpers"; -// @ts-expect-error Legacy JS library with no types defined import { isoContours } from "marchingsquares"; import { gridToMatrix } from "./lib/grid-to-matrix.js"; import { diff --git a/packages/turf-isolines/marchingsquares.d.ts b/packages/turf-isolines/marchingsquares.d.ts new file mode 100644 index 000000000..5e3233864 --- /dev/null +++ b/packages/turf-isolines/marchingsquares.d.ts @@ -0,0 +1 @@ +declare module "marchingsquares"; diff --git a/packages/turf-isolines/tsconfig.json b/packages/turf-isolines/tsconfig.json index 1ced55f82..dec1a231d 100644 --- a/packages/turf-isolines/tsconfig.json +++ b/packages/turf-isolines/tsconfig.json @@ -1,4 +1,4 @@ { "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "files": ["index.ts", "marchingsquares.d.ts"] } diff --git a/packages/turf/package.json b/packages/turf/package.json index 0624dedfe..fe7ff00fc 100644 --- a/packages/turf/package.json +++ b/packages/turf/package.json @@ -67,11 +67,11 @@ "turf.min.js" ], "scripts": { - "build": "tsup --config ../../tsup.config.ts && rollup -c rollup.config.js", - "last-checks": "npm-run-all last-checks:testjs last-checks:example", - "last-checks:example": "tsx test.example.js", - "last-checks:testjs": "tsx test.ts", - "test": "echo '@turf/turf tests run in the last-checks step'" + "build": "tsup --config ../../tsup.config.ts", + "cdnBundle": "npm-run-all cdnBundle:minify cdnBundle:checks", + "cdnBundle:checks": "tsx test.ts && tsx test.example.js && tsx test.ts", + "cdnBundle:minify": "rollup -c rollup.config.js", + "test": "echo '@turf/turf tests run in the cdnBundle:checks step'" }, "devDependencies": { "@babel/core": "^7.23.2",