Skip to content

fix(js): check package.json for name when project.json exists but has no name #31887

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ZackDeRose
Copy link
Member

Current Behavior

When a project has a project.json file but no name field, the addBuildAndWatchDepsTargets function in packages/js/src/plugins/typescript/util.ts returns early without creating build and watch deps targets, even if the project has a valid name in its package.json.

Expected Behavior

The function should fall back to checking package.json for the project name when project.json exists but has no name field, allowing the build and watch deps targets to be created properly.

Related Issue(s)

This fixes an issue where projects with project.json files missing the name field would not get proper build and watch dependency targets generated.

🤖 Generated with Claude Code

@ZackDeRose ZackDeRose requested a review from a team as a code owner July 10, 2025 15:59
@ZackDeRose ZackDeRose requested a review from leosvelperez July 10, 2025 15:59
Copy link

vercel bot commented Jul 10, 2025

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

Name Status Preview Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview Jul 12, 2025 3:23am

Copy link
Contributor

nx-cloud bot commented Jul 10, 2025

🤖 Nx Cloud AI Fix

Update test snapshots for TypeScript plugin with new build targets

Fix generation completed, ready to apply • View Fix ↗


View your CI Pipeline Execution ↗ for commit b08e27a

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ❌ Failed 46m 20s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 15s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 3s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 2s View ↗
nx documentation ✅ Succeeded 2m 3s View ↗

☁️ Nx Cloud last updated this comment at 2025-07-12 04:05:23 UTC

@FrozenPandaz
Copy link
Collaborator

@claude fix the formatting in this PR

Copy link
Contributor

claude bot commented Jul 10, 2025

Claude encountered an error —— View job

Failed with exit code 128

I'll analyze this and get back to you.

@FrozenPandaz
Copy link
Collaborator

@claude please format these changes.

Copy link
Contributor

claude bot commented Jul 10, 2025

Claude encountered an error —— View job

Failed with exit code 128

I'll analyze this and get back to you.

… no name

When a project.json exists but has no name field, now falls back to
checking package.json for project name in build and watch deps targets.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
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.

3 participants