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

fix(js): infer outputs correctly when both rootDir and outDir are set for tsconfig #29531

Merged
merged 2 commits into from
Jan 7, 2025

Conversation

jaysoo
Copy link
Member

@jaysoo jaysoo commented Jan 6, 2025

When the tsconfig has rootDir and outDir both defined, then the *.tsbuildinfo file is not cached. This makes incremental tsc not work through distribution (e.g. agents).

For example, given this tsconfig.lib.json file:

{
  "compilerOptions": {
    "outDir": "out-tsc/lib-1",
    "rootDir": "src"
  }
}

The outputs (e.g. *.d.ts files) are under {projectRoot}/out-tsc/lib-1, but the tsbuild info file is under {projectRoot}/out-tsc/tsconfig.lib.tsbuildinfo.

Current Behavior

tsbuildinfo file is not cached

Expected Behavior

tsbuildinfo file is cached

Related Issue(s)

Fixes #

@jaysoo jaysoo requested a review from a team as a code owner January 6, 2025 22:04
@jaysoo jaysoo requested a review from FrozenPandaz January 6, 2025 22:04
Copy link

vercel bot commented Jan 6, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Jan 7, 2025 2:21pm

Copy link

nx-cloud bot commented Jan 6, 2025

View your CI Pipeline Execution ↗ for commit 98feea3.

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 36m 20s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 18s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 1s View ↗
nx-cloud record -- nx format:check --base=cb4a9... ✅ Succeeded 1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗
nx documentation --no-dte ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2025-01-07 15:00:46 UTC

@jaysoo jaysoo force-pushed the fix/tsbuildinfo-outputs branch from aa67977 to 98feea3 Compare January 7, 2025 14:19
@jaysoo jaysoo merged commit df27a97 into master Jan 7, 2025
6 checks passed
@jaysoo jaysoo deleted the fix/tsbuildinfo-outputs branch January 7, 2025 16:17
FrozenPandaz pushed a commit that referenced this pull request Jan 7, 2025
… for tsconfig (#29531)

When the tsconfig has `rootDir` and `outDir` both defined, then the
`*.tsbuildinfo` file is not cached. This makes incremental tsc not work
through distribution (e.g. agents).

For example, given this `tsconfig.lib.json` file:

```json
{
  "compilerOptions": {
    "outDir": "out-tsc/lib-1",
    "rootDir": "src"
  }
}
```

The outputs (e.g. `*.d.ts` files) are under
`{projectRoot}/out-tsc/lib-1`, but the tsbuild info file is under
`{projectRoot}/out-tsc/tsconfig.lib.tsbuildinfo`.

## Current Behavior
tsbuildinfo file is not cached

## Expected Behavior
tsbuildinfo file is cached

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: Leosvel Pérez Espinosa <[email protected]>
(cherry picked from commit df27a97)
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