Closed gioragutt closed 8 months ago
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! 🙏
Not irrelevant yet, so would like to re-open
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.
Description
Docs: https://docs.gradle.org/current/userguide/command_line_interface.html#sec:name_abbreviation
From my past experience with Gradle, it was able to infer what command I'm trying to run based on initials (f.e:
gradle buildWebApp
could be written asgradle bWA
).This way, you could shorten cli invocations, so for example:
nx test web-app
could be shortened tonx t wa
. Of course, if you can't infer a single project:target combo (0 or >1 results), you'd throw an error.Motivation
Basically this is nice for some power users who like these micro-optimizations when working int eh CLI.
For example, I had recent project called
experiences-campaign
, for which I had aplayground
target.Having to write
nx playground experiences-campaign
ornx run experiences-campaign:playground
is pretty verbose, and I'm sure people have even worse cases, especially when there are huge workspaces with nested projects.If I could write
nx p eC/e-c
ornx run eC/e-c:p
that would save me a lot of time.Suggested Implementation
Basically there would have to be some transformation of
full name
->short name
.From gradle's docs linked above, there's an explanation about what it accepts:
Once you have this transformation, you could backtrack it to project:target pairs, perhaps with some regex or something.
This could perhaps be handled parseTargetString (especially as it has a reference to the project graph and can perform this search)
Alternate Implementations