Skip to content

fix(js): do not infer the project type in the @nx/js/typescript plugin#32421

Merged
leosvelperez merged 1 commit intomasterfrom
js/ts-plugin-do-not-set-project-type
Aug 20, 2025
Merged

fix(js): do not infer the project type in the @nx/js/typescript plugin#32421
leosvelperez merged 1 commit intomasterfrom
js/ts-plugin-do-not-set-project-type

Conversation

@leosvelperez
Copy link
Copy Markdown
Member

Current Behavior

The @nx/js/typescript plugin incorrectly infers that all projects are libraries. This is not correct, because apps also have tsconfig files which would be processed and targets will be inferred for them (e.g. typecheck). Depending on the order of the plugin execution, it can result in projects having the wrong type.

Expected Behavior

The @nx/js/typescript plugin should not infer the project type. The project type will be correctly derived later, when the project graph nodes are normalized.

@leosvelperez leosvelperez self-assigned this Aug 20, 2025
@leosvelperez leosvelperez requested a review from a team as a code owner August 20, 2025 10:10
@vercel
Copy link
Copy Markdown

vercel Bot commented Aug 20, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
nx-dev Ready Ready Preview Aug 20, 2025 10:27am

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented Aug 20, 2025

View your CI Pipeline Execution ↗ for commit 327d5fb

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 40m 51s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 2m 8s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 8s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 7s View ↗
nx documentation ✅ Succeeded 35s View ↗

☁️ Nx Cloud last updated this comment at 2025-08-20 10:58:22 UTC

@leosvelperez leosvelperez enabled auto-merge (squash) August 20, 2025 10:30
@leosvelperez leosvelperez merged commit 2788d91 into master Aug 20, 2025
6 checks passed
@leosvelperez leosvelperez deleted the js/ts-plugin-do-not-set-project-type branch August 20, 2025 10:58
FrozenPandaz pushed a commit that referenced this pull request Aug 22, 2025
…gin (#32421)

## Current Behavior

The `@nx/js/typescript` plugin incorrectly infers that all projects are
libraries. This is not correct, because apps also have tsconfig files
which would be processed and targets will be inferred for them (e.g.
`typecheck`). Depending on the order of the plugin execution, it can
result in projects having the wrong type.

## Expected Behavior

The `@nx/js/typescript` plugin should not infer the project type. The
project type will be correctly derived later, when the project graph
nodes are normalized.

(cherry picked from commit 2788d91)
@github-actions
Copy link
Copy Markdown
Contributor

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants