Skip to content

Commit

Permalink
Remove references to geojsonhint and geojson-fixtures (#2571)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
mfedderly authored Jan 17, 2024
1 parent 1411d63 commit 08576cb
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 232 deletions.
1 change: 0 additions & 1 deletion packages/turf-centroid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
"@types/benchmark": "^2.1.5",
"@types/tape": "^4.2.32",
"benchmark": "^2.1.4",
"geojson-fixtures": "*",
"glob": "^10.3.10",
"load-json-file": "^7.0.1",
"npm-run-all": "^4.1.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/turf-circle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
},
"devDependencies": {
"@mapbox/geojsonhint": "^3.2.0",
"@placemarkio/check-geojson": "^0.1.12",
"@turf/truncate": "workspace:^",
"@types/benchmark": "^2.1.5",
"@types/tape": "^4.2.32",
Expand Down
9 changes: 7 additions & 2 deletions packages/turf-circle/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { loadJsonFileSync } from "load-json-file";
import { writeJsonFileSync } from "write-json-file";
import { truncate } from "@turf/truncate";
import { featureCollection } from "@turf/helpers";
import geojsonhint from "@mapbox/geojsonhint";
import { check } from "@placemarkio/check-geojson";
import { circle } from "./index";

const directories = {
Expand Down Expand Up @@ -43,6 +43,11 @@ test("turf-circle", (t) => {

test("turf-circle -- validate geojson", (t) => {
const C = circle([0, 0], 100);
geojsonhint.hint(C).forEach((hint) => t.fail(hint.message));
try {
check(JSON.stringify(C));
t.pass();
} catch (e) {
t.fail(e.message);
}
t.end();
});
2 changes: 1 addition & 1 deletion packages/turf-ellipse/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"test:tape": "tsx test.ts"
},
"devDependencies": {
"@mapbox/geojsonhint": "^3.2.0",
"@placemarkio/check-geojson": "^0.1.12",
"@turf/bbox-polygon": "workspace:^",
"@turf/circle": "workspace:^",
"@turf/destination": "workspace:^",
Expand Down
9 changes: 7 additions & 2 deletions packages/turf-ellipse/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { loadJsonFileSync } from "load-json-file";
import { writeJsonFileSync } from "write-json-file";
import { circle } from "@turf/circle";
import { truncate } from "@turf/truncate";
import geojsonhint from "@mapbox/geojsonhint";
import { check } from "@placemarkio/check-geojson";
import { bboxPolygon } from "@turf/bbox-polygon";
import { rhumbDestination } from "@turf/rhumb-destination";
// import { destination } from '@turf/destination';
Expand Down Expand Up @@ -132,7 +132,12 @@ test("turf-ellipse -- with coordinates", (t) => {

test("turf-ellipse -- validate geojson", (t) => {
const E = ellipse([0, 0], 10, 20);
geojsonhint.hint(E).forEach((hint) => t.fail(hint.message));
try {
check(JSON.stringify(E));
t.pass();
} catch (e) {
t.fail(e.message);
}
t.end();
});

Expand Down
1 change: 0 additions & 1 deletion packages/turf-explode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
"@types/benchmark": "^2.1.5",
"@types/tape": "^4.2.32",
"benchmark": "^2.1.4",
"geojson-fixtures": "*",
"load-json-file": "^7.0.1",
"npm-run-all": "^4.1.5",
"tape": "^5.7.2",
Expand Down
10 changes: 1 addition & 9 deletions packages/turf-explode/test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import fs from "fs";
import path from "path";
import tape from "tape";
import { all as fixtures } from "geojson-fixtures";
import { loadJsonFileSync } from "load-json-file";
import { writeJsonFileSync } from "write-json-file";
import { explode } from "./index";
Expand All @@ -11,14 +10,7 @@ const directories = {
out: path.join(__dirname, "test", "out") + path.sep,
};

// Save input fixtures
if (process.env.REGEN) {
Object.keys(fixtures).forEach((name) => {
writeJsonFileSync(directories.in + name + ".json", fixtures[name]);
});
}

tape("explode - geojson-fixtures", (t) => {
tape("explode - fixtures", (t) => {
fs.readdirSync(directories.in).forEach((filename) => {
const name = filename.replace(".json", "");
const features = loadJsonFileSync(directories.in + filename);
Expand Down
Loading

0 comments on commit 08576cb

Please sign in to comment.