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(core): allow tasks to run with a substring of project name #29552

Merged
merged 4 commits into from
Jan 9, 2025

Conversation

jaysoo
Copy link
Member

@jaysoo jaysoo commented Jan 8, 2025

When projects use only package.json and not project.json, we need to set the simple name in the nx property of package.json. This isn't ideal because it's yet another Nx-specific thing that needs to be configured when our goal is to reduce boilerplate.

This PR allows users to pass a substring that matches exactly one project when running a task.

For example, if @acme/foo is the name in package.json, then running nx build foo will match it.

If more than one projects match, then an error is thrown showing all the matched projects, and the user has to be more specific or type in the fully qualified name.

Current Behavior

Users need to pass exact matches for project names when running tasks.

Expected Behavior

User can pass a substring matching the project name.

Related Issue(s)

Fixes #

@jaysoo jaysoo requested a review from a team as a code owner January 8, 2025 17:27
@jaysoo jaysoo requested a review from AgentEnder January 8, 2025 17:27
Copy link

vercel bot commented Jan 8, 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 9, 2025 4:55pm

Copy link

nx-cloud bot commented Jan 8, 2025

View your CI Pipeline Execution ↗ for commit c847c4d.

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

☁️ Nx Cloud last updated this comment at 2025-01-09 17:36:44 UTC

@jaysoo jaysoo force-pushed the feat/run-project-with-substring branch 4 times, most recently from c2d9663 to c5a0e0f Compare January 8, 2025 20:42
@jaysoo jaysoo force-pushed the feat/run-project-with-substring branch 2 times, most recently from a38f510 to 90c8349 Compare January 9, 2025 13:44
@jaysoo jaysoo force-pushed the feat/run-project-with-substring branch from 90c8349 to 06374bd Compare January 9, 2025 16:49
@jaysoo jaysoo force-pushed the feat/run-project-with-substring branch from 06374bd to c847c4d Compare January 9, 2025 16:53
@jaysoo jaysoo requested a review from FrozenPandaz January 9, 2025 17:58
@FrozenPandaz FrozenPandaz merged commit c6cb024 into master Jan 9, 2025
6 checks passed
@FrozenPandaz FrozenPandaz deleted the feat/run-project-with-substring branch January 9, 2025 18:39
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