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(misc): improve package.json scripts handling when running "nx init" and "nx add" #22168

Merged

Conversation

leosvelperez
Copy link
Member

@leosvelperez leosvelperez commented Mar 5, 2024

Updates the package.json scripts handling to:

  • nx init:
    • not replacing scripts => set includedScripts to []
    • replacing scripts => set includedScripts to []
  • nx add:
    • not replacing scripts (--updatePackageScripts=false) => don't set/touch includedScripts
    • replacing scripts (default) =>
      • if includedScripts is not set => set includedScripts with all scripts except the ones that match an inferred target that was used to replace a script
      • if includedScripts is already set => exclude scripts that match inferred targets that were used to replace a script

Current Behavior

Expected Behavior

Related Issue(s)

Fixes #

@leosvelperez leosvelperez self-assigned this Mar 5, 2024
@leosvelperez leosvelperez requested review from a team as code owners March 5, 2024 17:36
Copy link

vercel bot commented Mar 5, 2024

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

1 Ignored Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Mar 6, 2024 11:59am

@leosvelperez leosvelperez force-pushed the misc/consolidate-included-scripts branch from 9450e06 to 04df244 Compare March 6, 2024 08:39
@leosvelperez leosvelperez force-pushed the misc/consolidate-included-scripts branch from 04df244 to b0c0f9d Compare March 6, 2024 11:58
@FrozenPandaz FrozenPandaz merged commit 876bc94 into nrwl:master Mar 6, 2024
6 checks passed
@leosvelperez leosvelperez deleted the misc/consolidate-included-scripts branch March 6, 2024 14:46
FrozenPandaz pushed a commit that referenced this pull request Mar 8, 2024
Copy link

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 Mar 12, 2024
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.

None yet

2 participants