Skip to content

Releases: nxrs/cargo

Release 0.4.0

02 Oct 23:56
Compare
Choose a tag to compare

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 bin argument, so you can specify a particular binary target when running build, run, etc.
  • The parseArgs function will now pass any unknown options it receives directly through to cargo, 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 by cargo in the future.

Release 0.3.4

27 Sep 16:39
Compare
Choose a tag to compare
  • Generators no longer enforce snake_case for generated projects
  • A run target is now added to generated Binary projects (thanks, @alekangelov!)
  • A build target is now added to generated Library projects (thanks, @cdmistman!)
  • Large projects should no longer encounter errors due to oversized node:child_process buffers (thanks, @Equilibris!)

Release 0.3.3

25 May 02:57
dc7fcf4
Compare
Choose a tag to compare
  • Added support for target option

Release 0.3.2

10 Jan 21:50
Compare
Choose a tag to compare
  • Upgraded to Nx 13
  • Fixed app and lib generators failing when there isn't already a project in the workspace

Release 0.3.1

22 Aug 08:12
ee1dbc9
Compare
Choose a tag to compare
  • Updated nx from 12.5.8 -> 12.7.2
  • Fixed graph processor

Release 0.3.0

21 Jul 01:09
Compare
Choose a tag to compare

Changes

  • Added project graph processor plugin to tell nx how to resolve Rust project dependencies
  • Removed build target from library generation to avoid an issue with nx running targets unnecessarily
  • Fixed an issue where incorrect arguments were passed to cargo for library build targets

Release 0.2.0

10 Jul 03:17
Compare
Choose a tag to compare

Changes

  • Fixed an issue causing the --dry-run generator flag to not be respected
  • Added --edition option for generators
  • Updated generators to add an empty options object and a default production configuration to the workspace entries they create

Release 0.1.2

08 Jul 01:22
Compare
Choose a tag to compare

Fixes issues with toolchain and outDir executor options

Release 0.1.1

08 Jul 01:21
Compare
Choose a tag to compare

Initial release