nushell/crates/nu-protocol/src/engine
Devyn Cairns 2595f31541
Overhaul the plugin cache file with a new msgpack+brotli format (#12579)
# Description

- Plugin signatures are now saved to `plugin.msgpackz`, which is
brotli-compressed MessagePack.
- The file is updated incrementally, rather than writing all plugin
commands in the engine every time.
- The file always contains the result of the `Signature` call to the
plugin, even if commands were removed.
- Invalid data for a particular plugin just causes an error to be
reported, but the rest of the plugins can still be parsed

# User-Facing Changes

- The plugin file has a different filename, and it's not a nushell
script.
- The default `plugin.nu` file will be automatically migrated the first
time, but not other plugin config files.
- We don't currently provide any utilities that could help edit this
file, beyond `plugin add` and `plugin rm`
  - `from msgpackz`, `to msgpackz` could also help
- New commands: `plugin add`, `plugin rm`

# Tests + Formatting

Tests added for the format and for the invalid handling.

- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- 🟢 `toolkit test`
- 🟢 `toolkit test stdlib`

# After Submitting

- [ ] Check for documentation changes
- [ ] Definitely needs release notes
2024-04-21 07:36:26 -05:00
..
cached_file.rs Refactor source cache into CachedFile struct (#12240) 2024-03-20 19:43:50 +01:00
call_info.rs Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
capture_block.rs Remove the Value::Block case (#12582) 2024-04-21 07:03:33 +02:00
command.rs Rename IoStream to OutDest (#12433) 2024-04-09 16:48:32 +00:00
engine_state.rs Overhaul the plugin cache file with a new msgpack+brotli format (#12579) 2024-04-21 07:36:26 -05:00
mod.rs Rename IoStream to OutDest (#12433) 2024-04-09 16:48:32 +00:00
overlay.rs Style: move some Option if/else to method chains (#12285) 2024-03-26 08:35:51 +08:00
pattern_match.rs Boxes record for smaller Value enum. (#12252) 2024-03-26 17:17:44 +02:00
stack_out_dest.rs Rename IoStream to OutDest (#12433) 2024-04-09 16:48:32 +00:00
stack.rs Rename IoStream to OutDest (#12433) 2024-04-09 16:48:32 +00:00
state_delta.rs Overhaul the plugin cache file with a new msgpack+brotli format (#12579) 2024-04-21 07:36:26 -05:00
state_working_set.rs Overhaul the plugin cache file with a new msgpack+brotli format (#12579) 2024-04-21 07:36:26 -05:00
usage.rs Split up nu-protocol/src/engine/engine_state.rs (#10368) 2023-09-21 22:53:36 +02:00
variable.rs Restructure nu-protocol in more meaningful units (#11917) 2024-03-10 18:45:45 +01:00