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(core): update package script logic to handle cli tool name as command #29617

Merged
merged 1 commit into from
Jan 14, 2025

Conversation

Coly010
Copy link
Contributor

@Coly010 Coly010 commented Jan 14, 2025

Current Behavior

When we have an inferred target command that matches the entry point of the cli tool, there is a chance we do not replace package scripts correctly

e.g.

{
  "dev": "vite",
  "build": "tsc -b && vite build",
  "preview": "vite preview"
}

this could result in package scripts being updated to

{
  "dev": "nx dev",
  "build": "tsc -b && nx vite:build",
  "preview": "nx dev preview"
}

Expected Behavior

We should update the package scripts correctly to match the desired inferred target

{
  "preview": "nx preview"
}

@Coly010 Coly010 requested a review from a team as a code owner January 14, 2025 14:11
@Coly010 Coly010 requested a review from JamesHenry January 14, 2025 14:11
@Coly010 Coly010 self-assigned this Jan 14, 2025
Copy link

vercel bot commented Jan 14, 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 14, 2025 3:00pm

Copy link

nx-cloud bot commented Jan 14, 2025

View your CI Pipeline Execution ↗ for commit e5fa7af.

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

☁️ Nx Cloud last updated this comment at 2025-01-14 15:40:05 UTC

@Coly010 Coly010 force-pushed the update-package-scripts-scoring-logic branch from 4a52244 to a6ddaa1 Compare January 14, 2025 14:54
@Coly010 Coly010 force-pushed the update-package-scripts-scoring-logic branch from a6ddaa1 to e5fa7af Compare January 14, 2025 14:57
@Coly010 Coly010 requested a review from JamesHenry January 14, 2025 15:42
@Coly010 Coly010 merged commit c2fa9a0 into master Jan 14, 2025
6 checks passed
@Coly010 Coly010 deleted the update-package-scripts-scoring-logic branch January 14, 2025 16:49
FrozenPandaz pushed a commit that referenced this pull request Jan 15, 2025
…mand (#29617)

## Current Behavior
When we have an inferred target command that matches the entry point of
the cli tool, there is a chance we do not replace package scripts
correctly

e.g.

```
{
  "dev": "vite",
  "build": "tsc -b && vite build",
  "preview": "vite preview"
}
```

this could result in package scripts being updated to

```
{
  "dev": "nx dev",
  "build": "tsc -b && nx vite:build",
  "preview": "nx dev preview"
}
```

## Expected Behavior
We should update the package scripts correctly to match the desired
inferred target

```
{
  "preview": "nx preview"
}
```

(cherry picked from commit c2fa9a0)
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 Jan 20, 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.

3 participants