-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
ci: Add TS version tests #7605
ci: Add TS version tests #7605
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 271b181. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 271b181:
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7605 +/- ##
=======================================
Coverage 43.88% 43.88%
=======================================
Files 184 184
Lines 7029 7029
Branches 1539 1535 -4
=======================================
Hits 3085 3085
Misses 3578 3578
Partials 366 366 |
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.
I think a better way would be to just have CI install a different version of typescript, like we do in router:
https://github.com/TanStack/router/blob/main/.github/workflows/pr.yml#L77-L80
then we add the TS_VERSION as input to nx to avoid cache hits: https://github.com/TanStack/router/blob/cb6c21150f9637cef5d48596a489ffd2e5366303/nx.json#L41
also: what's all the file moves about 😅 ?
Yeah I've seen that option too, I prefer how its been implemented for TanStack Form as it can be tested and debugged locally rather than needing to run in CI. It also all runs in a single GitHub Action job, making it easier to work out which task has failed (everything is in the Nx cloud report). As for the file moves, it makes it easier to target different files for different tsconfigs. The "main" TS version can check all files (src, tests, vite config, etc.), while the "legacy" TS versions only need to check src, which speeds up testing. The same thing can be achieved with slightly more annoying "include" and "exclude" config (actually now realising this would be less of a headache). EDIT: I'll tidy this up tomorrow! |
915361f
to
211ae97
Compare
Looks good, I like that this strategy allows us to check different versions of TS per package. For example the lowest version of Angular supported by angular-query is v16, which requires TS 4.9 or higher. So unlike react-query we wouldn't need to check either 4.7 or 4.8. |
Uses the strategy implemented in TanStack Form and Store to take full advantage of Nx.
This strategy can be tested and debugged locally rather than needing to run in CI (e.g. the matrix approach). It also all runs in a single GitHub Action job, making it easier to work out which task has failed (all logs are in the Nx cloud report).
Currently tests TS 5.0 to 5.3. Adding pre-5.0 tests is a bit more involved, but TanStack Form and Store have a workaround which I'll implement in a subsequent PR.