Skip to content

Commit 08576cb

Browse files
authored
Remove references to geojsonhint and geojson-fixtures (#2571)
* Remove references to geojsonhint and geojson-fixtures There were transitively bringing in a weird dependency to a specific git commit of gerhobbelt/nomnom and was breaking CI for dependabot. * Add some ^s to the deps * Forgot to pnpm install
1 parent 1411d63 commit 08576cb

File tree

8 files changed

+28
-232
lines changed

8 files changed

+28
-232
lines changed

packages/turf-centroid/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
"@types/benchmark": "^2.1.5",
5656
"@types/tape": "^4.2.32",
5757
"benchmark": "^2.1.4",
58-
"geojson-fixtures": "*",
5958
"glob": "^10.3.10",
6059
"load-json-file": "^7.0.1",
6160
"npm-run-all": "^4.1.5",

packages/turf-circle/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
5555
},
5656
"devDependencies": {
57-
"@mapbox/geojsonhint": "^3.2.0",
57+
"@placemarkio/check-geojson": "^0.1.12",
5858
"@turf/truncate": "workspace:^",
5959
"@types/benchmark": "^2.1.5",
6060
"@types/tape": "^4.2.32",

packages/turf-circle/test.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { loadJsonFileSync } from "load-json-file";
55
import { writeJsonFileSync } from "write-json-file";
66
import { truncate } from "@turf/truncate";
77
import { featureCollection } from "@turf/helpers";
8-
import geojsonhint from "@mapbox/geojsonhint";
8+
import { check } from "@placemarkio/check-geojson";
99
import { circle } from "./index";
1010

1111
const directories = {
@@ -43,6 +43,11 @@ test("turf-circle", (t) => {
4343

4444
test("turf-circle -- validate geojson", (t) => {
4545
const C = circle([0, 0], 100);
46-
geojsonhint.hint(C).forEach((hint) => t.fail(hint.message));
46+
try {
47+
check(JSON.stringify(C));
48+
t.pass();
49+
} catch (e) {
50+
t.fail(e.message);
51+
}
4752
t.end();
4853
});

packages/turf-ellipse/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"test:tape": "tsx test.ts"
5353
},
5454
"devDependencies": {
55-
"@mapbox/geojsonhint": "^3.2.0",
55+
"@placemarkio/check-geojson": "^0.1.12",
5656
"@turf/bbox-polygon": "workspace:^",
5757
"@turf/circle": "workspace:^",
5858
"@turf/destination": "workspace:^",

packages/turf-ellipse/test.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { loadJsonFileSync } from "load-json-file";
55
import { writeJsonFileSync } from "write-json-file";
66
import { circle } from "@turf/circle";
77
import { truncate } from "@turf/truncate";
8-
import geojsonhint from "@mapbox/geojsonhint";
8+
import { check } from "@placemarkio/check-geojson";
99
import { bboxPolygon } from "@turf/bbox-polygon";
1010
import { rhumbDestination } from "@turf/rhumb-destination";
1111
// import { destination } from '@turf/destination';
@@ -132,7 +132,12 @@ test("turf-ellipse -- with coordinates", (t) => {
132132

133133
test("turf-ellipse -- validate geojson", (t) => {
134134
const E = ellipse([0, 0], 10, 20);
135-
geojsonhint.hint(E).forEach((hint) => t.fail(hint.message));
135+
try {
136+
check(JSON.stringify(E));
137+
t.pass();
138+
} catch (e) {
139+
t.fail(e.message);
140+
}
136141
t.end();
137142
});
138143

packages/turf-explode/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
"@types/benchmark": "^2.1.5",
5555
"@types/tape": "^4.2.32",
5656
"benchmark": "^2.1.4",
57-
"geojson-fixtures": "*",
5857
"load-json-file": "^7.0.1",
5958
"npm-run-all": "^4.1.5",
6059
"tape": "^5.7.2",

packages/turf-explode/test.ts

+1-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import fs from "fs";
22
import path from "path";
33
import tape from "tape";
4-
import { all as fixtures } from "geojson-fixtures";
54
import { loadJsonFileSync } from "load-json-file";
65
import { writeJsonFileSync } from "write-json-file";
76
import { explode } from "./index";
@@ -11,14 +10,7 @@ const directories = {
1110
out: path.join(__dirname, "test", "out") + path.sep,
1211
};
1312

14-
// Save input fixtures
15-
if (process.env.REGEN) {
16-
Object.keys(fixtures).forEach((name) => {
17-
writeJsonFileSync(directories.in + name + ".json", fixtures[name]);
18-
});
19-
}
20-
21-
tape("explode - geojson-fixtures", (t) => {
13+
tape("explode - fixtures", (t) => {
2214
fs.readdirSync(directories.in).forEach((filename) => {
2315
const name = filename.replace(".json", "");
2416
const features = loadJsonFileSync(directories.in + filename);

0 commit comments

Comments
 (0)