#plugin #signature #nu

nu-plugin

Functionality for building Nushell plugins

39 breaking releases

Uses new Rust 2021

0.62.0 May 3, 2022
0.60.0 Mar 22, 2022
0.42.0 Dec 28, 2021
0.40.0 Nov 16, 2021
0.12.0 Mar 31, 2020
Download history 355/week @ 2022-01-28 580/week @ 2022-02-04 455/week @ 2022-02-11 388/week @ 2022-02-18 309/week @ 2022-02-25 277/week @ 2022-03-04 416/week @ 2022-03-11 1340/week @ 2022-03-18 714/week @ 2022-03-25 499/week @ 2022-04-01 630/week @ 2022-04-08 659/week @ 2022-04-15 643/week @ 2022-04-22 984/week @ 2022-04-29 819/week @ 2022-05-06 1125/week @ 2022-05-13

3,695 downloads per month
Used in 36 crates (34 directly)

MIT and maybe CC-PDDC

235KB
6K SLoC

nu-plugin

Updating Cap'n Proto schema

When modifying a protocol's struct that is used in plugins (such as Signature), you need to update the capnproto schema file and recompile it into the Rust source code. The steps are as follows:

  1. Change src/serializers/capnp/schema/plugin.capnp as necessary
  2. Install capnp tool (it's a C++ binary, commonly available in package managers)
  3. Install Rust support for capnp called capnpc-rust:
    1. git clone https://github.com/capnproto/capnproto-rust somewhere
    2. cd capnproto-rust/capnpc
    3. cargo install --path=.
  4. Then, call capnp compile -orust plugin.capnp (change path as necessary)
  5. The result should be plugin_capnp.rs file: Use it to replace the old src/plugin_capnp.rs.
  6. It needs to be autoformatted (cargo fmt --all)
  7. Modify the serialize/deserialize functions. Check the following PRs for details:

Dependencies

~8–11MB
~248K SLoC