Releases: nxrs/cargo
Release 0.4.0
Ignore Nx configuration's targets key
Nx targets are configured in a project's configuration file like this:
{
...
"targets": {
"<target-name>": {
"executor": "<executor-name>",
...
}
...
}
}Previously, this plugin had been using that <target-name> to determine which type of command to execute. However, users should be permitted to assign whatever string they'd like to those keys without affecting the behavior of the invoked executor. This release reworks the parseArgs function to take a separate parameter for the cargo command to execute, which we determine solely by which of the plugin's executors was invoked.
Add a dedicated run executor
Inline with the above changes, a new @nxrs/cargo:run executor has been added to handle cargo run ... commands. This executor was actually the main motivator for the changes above — if the Nx config's target key is run, users can no longer use the shorthand form for invoking that target (i.e., nx <target> <project> instead of nx run <project>:<target>), because it collides with the built-in nx run command.
With these changes, the run executor can be configured like so:
{
...
"targets": {
"dev": {
"executor": "@nxrs/cargo:run",
...
}
...
}
}And users can invoke that target by running nx dev <project>.
The default output from this plugin's bin generator also now outputs the configuration above instead of using run as the target key, but users are welcome to change that key to whatever they'd like.
Additional changes to executor processing
- Support has been added for the
binargument, so you can specify a particular binary target when runningbuild,run, etc. - The
parseArgsfunction will now pass any unknown options it receives directly through tocargo, after prefixing them with--and converting them to kebab-case. This should help with future-proofing this plugin in the absence of specific updates to support additional arguments supported bycargoin the future.
Release 0.3.4
- Generators no longer enforce
snake_casefor generated projects - A
runtarget is now added to generated Binary projects (thanks, @alekangelov!) - A
buildtarget is now added to generated Library projects (thanks, @cdmistman!) - Large projects should no longer encounter errors due to oversized
node:child_processbuffers (thanks, @Equilibris!)
Release 0.3.3
- Added support for
targetoption
Release 0.3.2
- Upgraded to Nx 13
- Fixed app and lib generators failing when there isn't already a project in the workspace
Release 0.3.1
- Updated nx from 12.5.8 -> 12.7.2
- Fixed graph processor
Release 0.3.0
Changes
- Added project graph processor plugin to tell nx how to resolve Rust project dependencies
- Removed
buildtarget from library generation to avoid an issue with nx running targets unnecessarily - Fixed an issue where incorrect arguments were passed to
cargofor library build targets
Release 0.2.0
Changes
- Fixed an issue causing the
--dry-rungenerator flag to not be respected - Added
--editionoption for generators - Updated generators to add an empty
optionsobject and a defaultproductionconfiguration to the workspace entries they create
Release 0.1.2
Fixes issues with toolchain and outDir executor options
Release 0.1.1
Initial release