nx icon indicating copy to clipboard operation
nx copied to clipboard

feat(core): allow optional configuration in infix run command

Open akwodkiewicz opened this issue 4 months ago • 5 comments

It looks as if the current shape of args.target that is parsed by the run infix version and passed to the command handler makes the configuration unrecognizable. It's probably because the "regular" run invocation parses target and configuration separately, and passes them as 2 distinct properties, while the infix version of the command contains the concatenated target:configuration in the target argument.

As explained in the linked issue, I couldn't leverage yargs positional arguments syntax in the command template, because the configuration is an optional argument in the middle of the invocation. Custom parsing in the handler must be used. Thankfully it's just about splitting the argument on the first :.

I do not know if it won't break any existing behaviours, for example the ability to run NPM scripts that contain colons in their names.

Current Behavior

Infix notation does not allow passing target configuration.

Expected Behavior

Infix notation allows passing target configuration.

Related Issue(s)

Duplicate of #28348 that got closed by mistake. Fixes #28335.

akwodkiewicz avatar Oct 09 '24 07:10 akwodkiewicz