Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge turf:master into experimental dx branch #2682

Closed
wants to merge 7 commits into from

Conversation

smallsaucepan
Copy link
Member

@smallsaucepan smallsaucepan commented Aug 7, 2024

Closing this PR as it is unnecessary. This was just to pull the latest updates from master into my experimental branch. However could have just done that from master in my fork.

Will create another more traditional PR to review and pull changes from experimental branch into master.

…ckage, rather than specifying the arguments on the command line.
…o building to work. Simplifies things overall.
…lined in dist/esm/index.js files, greatly increasing their size.
…re causing problems in a previous build because skipNodeModulesBundle was true. That's now been removed and @turf/turf does build fine without them.
@mfedderly
Copy link
Collaborator

mfedderly commented Aug 7, 2024

Wow this is actually insanely fast

timings on an M1 pro (to run the @turf/difference tests)

# pnpm lerna run test --scope=@turf/difference
# master / no nx cache
12.04s user 1.22s system 175% cpu 7.545 total
# master / cache everything except test.ts file
1.93s user 0.40s system 87% cpu 2.675 total
# master / cache everything including tests
0.85s user 0.19s system 99% cpu 1.043 total

# this pr / no caching
pnpm test  0.85s user 0.14s system 102% cpu 0.969 total

@mfedderly
Copy link
Collaborator

I spent some time trying to get typescript project references to work, but I think there's some weird issue with rollup/tsup and project references that I don't fully understand.

This was referenced Aug 8, 2024
"prepare": "lerna run build && husky install",
"test": "pnpm run lint && lerna run test && lerna run --scope @turf/turf last-checks"
"prepublish": "lerna run build && lerna run --scope @turf/turf last-checks",
"test": "lerna run test"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple thoughts here:

  1. it dropped pnpm run lint
  2. I don't remember exactly why but I think last-checks depends on lerna run test?

What do you think about making a new script entry:
`"ci": "lerna run build && lerna run lint && lerna run test && lerna run --scope @turf/turf last-checks"

And then just calling this new script explicitly in the .github/*.yml files?
We could also break build / lint / (test & last checks) into 3 different scripts for more granular timings on CI. In general I think we can get away from some of the magic script names that make pnpm do things at certain lifecycle moments.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked into this some more and last-checks only depends on last-checks:testjs to run before last-checks:example and it doesn't actually depend on the other packages, so that seems safe to move. I'm not actually sure why it lives in its own step, I'll make a PR cleaning that up.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#2690 cleans up some last-checks

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'm leaning towards the following:

package.json scripts:

"build": "lerna run build",
"lint": "lerna run lint",
"test": "lerna run test"

github workflows:
run: pnpm build added after run: pnpm install --frozen-lockfile everywhere
run: pnpm lint added before run: pnpm test everywhere

This also will cause us to need to make changes in the CONTRIBUTING.md file

  • Local Setup no longer requires pnpm test
  • Development tips and Pull Request Checklist can probably also recommend running pnpm lint

@@ -28,7 +28,7 @@
"{projectRoot}/test/**",
"{projectRoot}/types.ts"
],
"dependsOn": ["build"],
"dependsOn": [],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will make a follow-up PR to sort out some caching issues. Unless you're executing tasks with pnpm lerna run test --scope=@turf/pkg this file doesn't come into play though, and CI doesn't cache anything so we're safe there as well.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#2685 is the change to the inputs to fix test caching. I intentionally didn't remove the build dependsOn entry because you're doing that here and I didn't want to conflict.

@smallsaucepan
Copy link
Member Author

Closing this PR as it is unnecessary. This was just to pull the latest updates from master into my experimental branch. However could have just done that from master in my fork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants