Skip to content

Commit

Permalink
Inline last-checks into @turf/turf's test script
Browse files Browse the repository at this point in the history
Instead of having this be its own step, we can just run it as part of the tests
turf-mask had an unused mkdirp dependency that it looked like we wanted to get rid of at some point
@turf/turf wasn't reexporting @turf/directional-mean so I added that
  • Loading branch information
mfedderly committed Aug 8, 2024
1 parent c8f24e0 commit d599052
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 21 deletions.
4 changes: 2 additions & 2 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
"dependsOn": ["build"],
"cache": true
},
"last-checks": {
"inputs": ["default", "{projectRoot}/test.ts"],
"@turf/turf:test": {
"inputs": ["default", "{projectRoot}/test.ts", "{projectRoot}/index.ts"],
"dependsOn": ["build", "^last-checks"],
"cache": true
}
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 .",
"preinstall": "npx only-allow pnpm",
"prepare": "husky && lerna run build",
"test": "pnpm run lint && lerna run test && lerna run --scope @turf/turf last-checks"
"test": "pnpm run lint && lerna run test"
},
"lint-staged": {
"package.json": [
Expand Down
1 change: 0 additions & 1 deletion packages/turf-mask/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
"@types/tape": "^4.2.32",
"benchmark": "^2.1.4",
"load-json-file": "^7.0.1",
"mkdirp": "^3.0.1",
"npm-run-all": "^4.1.5",
"tape": "^5.7.2",
"tsup": "^8.0.1",
Expand Down
1 change: 1 addition & 0 deletions packages/turf/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export { concave } from "@turf/concave";
export { convex } from "@turf/convex";
export { destination } from "@turf/destination";
export { difference } from "@turf/difference"; // JSTS Module
export { directionalMean } from "@turf/directional-mean";
export { dissolve } from "@turf/dissolve"; // JSTS Sub-Model
export { distance } from "@turf/distance";
export { distanceWeight } from "@turf/distance-weight";
Expand Down
8 changes: 4 additions & 4 deletions packages/turf/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,9 @@
],
"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'"
"test": "npm-run-all test:testjs test:example",
"test:example": "tsx test.example.js",
"test:testjs": "tsx test.ts"
},
"devDependencies": {
"@babel/core": "^7.23.2",
Expand Down Expand Up @@ -132,6 +131,7 @@
"@turf/convex": "workspace:^",
"@turf/destination": "workspace:^",
"@turf/difference": "workspace:^",
"@turf/directional-mean": "workspace:^",
"@turf/dissolve": "workspace:^",
"@turf/distance": "workspace:^",
"@turf/distance-weight": "workspace:^",
Expand Down
4 changes: 0 additions & 4 deletions packages/turf/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ test("turf -- invalid dependencies", (t) => {
t.fail(
`${name} @turf/helpers should be located in Dependencies instead of DevDependencies`
);
// if (devDependencies['mkdirp']) t.fail(`${name} tests should not have to create folders`);
}
t.skip('remove "mkdirp" from testing');
t.end();
});

Expand Down Expand Up @@ -164,8 +162,6 @@ test("turf -- pre-defined attributes in package.json", (t) => {
for (const { name, pckg } of modules) {
if (pckg.author !== "Turf Authors")
t.fail(name + ' (author) should be "Turf Authors"');
// if (pckg.main !== 'main.js') t.skip(`${name} (main) must be "main.js" in package.json`);
// if (pckg.module !== 'main.es.js') t.skip(`${name} (module) must be "main.es.js" in package.json`);
if (pckg["jsnext:main"])
t.fail(
`${name} (jsnext:main) is no longer required in favor of using (module) in package.json`
Expand Down
12 changes: 3 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d599052

Please sign in to comment.