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

feat(js): remove nx property from generated package.json files #29705

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jaysoo
Copy link
Member

@jaysoo jaysoo commented Jan 21, 2025

This PR updates our generators to no longer generate with nx in package.json by default. The only times it is needed is if you pass add tags or implicitDependencies to the project config.

This PR replaces our projectType checks to use the getProjectType util from @nx/js to prefer the project config, but otherwise will check for our conventions (e.g. using exports for libs, tsconfig.lib.json vs tsconfig.app.json).

Copy link

vercel bot commented Jan 21, 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 22, 2025 6:05pm

@jaysoo jaysoo force-pushed the feat/remove-nx-from-package-json branch from 7836fb2 to 8ae3480 Compare January 21, 2025 19:53
Copy link

nx-cloud bot commented Jan 21, 2025

View your CI Pipeline Execution ↗ for commit 204a537.

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ⏳ In Progress ... View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 1m 2s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 3s View ↗
nx-cloud record -- nx format:check --base=a055f... ✅ Succeeded 24s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 20s View ↗
nx documentation --no-dte ✅ Succeeded 48s View ↗

☁️ Nx Cloud last updated this comment at 2025-01-22 18:12:46 UTC

@jaysoo jaysoo force-pushed the feat/remove-nx-from-package-json branch 2 times, most recently from 79c94ef to 59b78b0 Compare January 21, 2025 21:58
FrozenPandaz pushed a commit that referenced this pull request Jan 21, 2025
…+ skip writing empty nx property to pacakge.json for non-root projects (#29707)

This PR is a prerequisite to removing `nx` property from `package.json`
files in the new TS setup. It fixes two issues:

1. We always write `nx` property in `package.json` even if it is empty.
This should be done for root projects.
2. Adding an entry to `pnpm-workspace.yaml` is not picked up because
`readProjectConfiguration` only reads the file from disk, not from
virtual `Tree`

This is the next PR to remove the property:
#29705
@jaysoo jaysoo force-pushed the feat/remove-nx-from-package-json branch 14 times, most recently from 83afc73 to f265df1 Compare January 22, 2025 17:47
@jaysoo jaysoo force-pushed the feat/remove-nx-from-package-json branch from f265df1 to 204a537 Compare January 22, 2025 17:56
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