Skip to content

Commit

Permalink
Refactoring "last-checks" into "bundleCdn" which seems more descripti…
Browse files Browse the repository at this point in the history
…ve. Adding empty marchingsquares d.ts to isolines (same as we've done for isobands) to retire a ts-expect-error. Also believe prepublishOnly better target to use than prepublish.
  • Loading branch information
smallsaucepan committed Aug 16, 2024
1 parent 88ce05a commit cd4b7d6
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 22 deletions.
21 changes: 7 additions & 14 deletions .monorepolint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -79,7 +82,7 @@ export default {
}
`,
},
includePackages: ["@turf/isobands"],
includePackages: ["@turf/isobands", "@turf/isolines"],
}),
fileContents({
options: {
Expand Down Expand Up @@ -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({
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
1 change: 0 additions & 1 deletion packages/turf-isolines/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions packages/turf-isolines/marchingsquares.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module "marchingsquares";
2 changes: 1 addition & 1 deletion packages/turf-isolines/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "../../tsconfig.shared.json",
"files": ["index.ts"]
"files": ["index.ts", "marchingsquares.d.ts"]
}
10 changes: 5 additions & 5 deletions packages/turf/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit cd4b7d6

Please sign in to comment.