turf icon indicating copy to clipboard operation
turf copied to clipboard

Inline last-checks into @turf/turf's test script

Open mfedderly opened this issue 1 year ago • 6 comments

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

mfedderly avatar Aug 08 '24 17:08 mfedderly

@twelch and @mfedderly, can we have a time out before merging this change?

Looking at last-checks many of the tests seem to overlap with monorepo linting. Additionally they depend on the built JS files in dist/ which i'm hoping we can avoid generating for local and CI builds.

There may be benefits to keeping them in a separate step for the time being.

smallsaucepan avatar Aug 09 '24 12:08 smallsaucepan

@smallsaucepan yeah we can definitely hold this one, I'm curious how you will avoid building on CI and still get typescript type checking done. The weird testing format in @turf/turf has always been somewhat overlapping with the capabilities of monorepolint, it predated when I brought in monorepolint to get things standardized across all of the packages years ago and never fully reconciled it all.

mfedderly avatar Aug 09 '24 13:08 mfedderly

Thanks for that.

how you will avoid building on CI and still get typescript type checking done

The test:types target in each package runs a tsc --noEmit which should uncover any compile time TS errors. We can run that directly on the types.ts or index.ts file in each directory.

smallsaucepan avatar Aug 10 '24 12:08 smallsaucepan

To be clear I'm not deep enough in the build workings to be able to contribute much to the discussion yet other than learn. I've been trying to only approve smaller build related PRs that don't seem to affect the larger deliberation you've both been having. Just to keep things incrementally improving. If this PR is more than that I apologize.

twelch avatar Aug 10 '24 15:08 twelch

test:types target

That's actually really cool! My only two flags would be making sure that test:types exists everywhere, and that it really does trigger errors on build errors for itself and any packages it depends on if we need that behavior (I worry about something like skipLibCheck causing an issue).

mfedderly avatar Aug 12 '24 16:08 mfedderly

@mfedderly,

  1. making sure that test:types exists everywhere
  2. it really does trigger errors on build errors for itself and any packages it depends on

Done, and done. Check out PR #2702

smallsaucepan avatar Aug 16 '24 06:08 smallsaucepan