Skip to content

ci(nx.json): add '^compile' dependsOn to 'test:types' target#10519

Merged
sukvvon merged 2 commits intomainfrom
ci/nx-test-types-depends-on-compile
Apr 19, 2026
Merged

ci(nx.json): add '^compile' dependsOn to 'test:types' target#10519
sukvvon merged 2 commits intomainfrom
ci/nx-test-types-depends-on-compile

Conversation

@sukvvon
Copy link
Copy Markdown
Collaborator

@sukvvon sukvvon commented Apr 19, 2026

🎯 Changes

Add "dependsOn": ["^compile"] to the test:types target in nx.json.

Why

test:types tasks reference declaration files from dependent packages via TypeScript project references. For example:

// packages/solid-query/tsconfig.legacy.json
{
  "references": [{ "path": "../query-core" }]
}

Without "dependsOn": ["^compile"], Nx can schedule test:types in parallel with the dependency's compile task, leading to race conditions where the dependency's dist-ts is not yet generated. This produces intermittent CI failures such as:

error TS2305: Module '"@tanstack/query-core"' has no exported member 'DefaultError'

These failures typically disappear on CI re-run because the previous run's cached dist-ts is available via Nx Cloud.

Scope

This affects nearly all packages in the monorepo. Any package that declares references in its tsconfig benefits from this fix, including all query adapters (react-query, preact-query, vue-query, solid-query, svelte-query), all devtools, all persist-client packages, and others.

Consistency

Other targets that depend on types (test:eslint, test:lib) already declare "dependsOn": ["^compile"]. This change brings test:types in line with that pattern.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 19, 2026

📝 Walkthrough

Walkthrough

A task dependency was added to the test:types target in the Nx configuration, requiring upstream compile tasks to execute first. This modifies the execution order while maintaining existing caching and input configurations.

Changes

Cohort / File(s) Summary
Nx Configuration
nx.json
Added dependsOn: ["^compile"] to the test:types task, establishing a dependency relationship that ensures compile tasks run before type tests.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A single line, so neat and small,
Dependencies dance in proper call,
Compile first, then types must play,
Order matters in the CI way! 🚀

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding a dependency to the test:types target in nx.json with concise, technical language.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description is well-structured, follows the template, and provides comprehensive context for the change.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/nx-test-types-depends-on-compile

Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link
Copy Markdown

nx-cloud bot commented Apr 19, 2026

View your CI Pipeline Execution ↗ for commit 772b0d6

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 1m 7s View ↗

☁️ Nx Cloud last updated this comment at 2026-04-19 15:04:24 UTC

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 19, 2026

🚀 Changeset Version Preview

No changeset entries found. Merging this PR will not cause a version bump for any packages.

@sukvvon sukvvon self-assigned this Apr 19, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 19, 2026

More templates

@tanstack/angular-query-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-experimental@10519

@tanstack/eslint-plugin-query

npm i https://pkg.pr.new/@tanstack/eslint-plugin-query@10519

@tanstack/preact-query

npm i https://pkg.pr.new/@tanstack/preact-query@10519

@tanstack/preact-query-devtools

npm i https://pkg.pr.new/@tanstack/preact-query-devtools@10519

@tanstack/preact-query-persist-client

npm i https://pkg.pr.new/@tanstack/preact-query-persist-client@10519

@tanstack/query-async-storage-persister

npm i https://pkg.pr.new/@tanstack/query-async-storage-persister@10519

@tanstack/query-broadcast-client-experimental

npm i https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@10519

@tanstack/query-core

npm i https://pkg.pr.new/@tanstack/query-core@10519

@tanstack/query-devtools

npm i https://pkg.pr.new/@tanstack/query-devtools@10519

@tanstack/query-persist-client-core

npm i https://pkg.pr.new/@tanstack/query-persist-client-core@10519

@tanstack/query-sync-storage-persister

npm i https://pkg.pr.new/@tanstack/query-sync-storage-persister@10519

@tanstack/react-query

npm i https://pkg.pr.new/@tanstack/react-query@10519

@tanstack/react-query-devtools

npm i https://pkg.pr.new/@tanstack/react-query-devtools@10519

@tanstack/react-query-next-experimental

npm i https://pkg.pr.new/@tanstack/react-query-next-experimental@10519

@tanstack/react-query-persist-client

npm i https://pkg.pr.new/@tanstack/react-query-persist-client@10519

@tanstack/solid-query

npm i https://pkg.pr.new/@tanstack/solid-query@10519

@tanstack/solid-query-devtools

npm i https://pkg.pr.new/@tanstack/solid-query-devtools@10519

@tanstack/solid-query-persist-client

npm i https://pkg.pr.new/@tanstack/solid-query-persist-client@10519

@tanstack/svelte-query

npm i https://pkg.pr.new/@tanstack/svelte-query@10519

@tanstack/svelte-query-devtools

npm i https://pkg.pr.new/@tanstack/svelte-query-devtools@10519

@tanstack/svelte-query-persist-client

npm i https://pkg.pr.new/@tanstack/svelte-query-persist-client@10519

@tanstack/vue-query

npm i https://pkg.pr.new/@tanstack/vue-query@10519

@tanstack/vue-query-devtools

npm i https://pkg.pr.new/@tanstack/vue-query-devtools@10519

commit: 772b0d6

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 19, 2026

size-limit report 📦

Path Size
react full 11.99 KB (0%)
react minimal 9.02 KB (0%)

@sukvvon sukvvon marked this pull request as draft April 19, 2026 10:29
@sukvvon sukvvon marked this pull request as ready for review April 19, 2026 15:11
@sukvvon sukvvon merged commit 5b5d1db into main Apr 19, 2026
11 of 12 checks passed
@sukvvon sukvvon deleted the ci/nx-test-types-depends-on-compile branch April 19, 2026 15:13
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.

1 participant