-
Notifications
You must be signed in to change notification settings - Fork 525
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
Infra: Switch monorepo tooling to wireit and pnpm #2345
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good so far! So excited about the initial results.
Excellent idea to automate the wireit
config!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well I did a spot-check of several of the --watch
workflows, and I'm thrilled!
It's awesome how we can just jump into packages/victory-line
and run pnpm run jest
and it just works! Pulls from all previous cache's. Detects changes instantly, and reruns very fast.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is AWESOME. 🎈
This PR is a big infrastructure overhaul to switch us from lerna + yarn to wireit + pnpm.
Why?
Our existing setup of yarn + lerna has the following undesirable things:
So, let's welcome PNPM + Wireit!
pnpm run jest
all the other things that need to happen magically happen, (2) caches sub-tasks so things that don't have changed file inputs don't re-run, and (3) has full GH actions CI support!To get a sense of how much faster our build has become take a look at the CI times for this branch in https://github.com/FormidableLabs/victory/actions?query=branch%3Ainfra%2Fpnpm-wireit++ -- when no input files change our CI times are about 1 minute. When some things change, a couple minutes. When all things (or our base scripts) change, we take the full hit of a comparable existing Victory CI time of like 15-16 mins.
For the average Victory developer, if you're working in just one package, you can just run the project-level
pnpm run check
and have like a full build and everything work reasonably fast without needing to know more or run subtasks!Check it out
Implementation notes
High level:
pnpm run jest
and don't need to worry about "what else needs to be built?" before that.Demos: The demos originally had imports from
victory*/src/index
(source) which wasn't efficient or consistent because the transitive deps on other victory packages was on built files. I refactored these to be normalvictory(-<NAME>)
imports using built files.src
:Configs:
resolve.alias
: Since we no longer hoist victory packages to root, we now add aliases for our webpack configs and storybook (which uses webpack) programatically.Incremental caching:
Remaining work in this PR
Big tasks:
start*
check
build
: Might combine with check (?)All the rest:
pnpm-lock.yaml
asfiles
field for some tasks.yarn
lerna
nps
(direct uses)TODO(wireit)
TODO(pnpm)
Remaining work (ticketed)
Incremental caching: Investigate opportunities for tool-level incremental caching. #2375
build:dist:*
: See https://webpack.js.org/configuration/cache/format
: Need to update tov2.7
. https://prettier.io/blog/2022/06/14/2.7.0.htmltypes
jest
Various things
check:ci
and upload to CodeCov. Infra: Add coverage reporting to CI #2348start
andstart:ts
. Infra: Review how wireit watches are working. #2374