nushell/crates/nu-protocol/src
Devyn Cairns fac2f43aa4
Add an example Nushell plugin written in Nushell itself (#12574)
# Description

As suggested by @fdncred.

It's neat that this is possible, but the particularly useful part of
this is that we can actually
test it because it doesn't have any external dependencies, unlike the
python plugin.

Right now this just implements exactly the same behavior as the python
plugin, but we could have it
exercise a few more things.

Also fixes a couple of bugs:

- `.nu` plugins were not run with `nu --stdin`, so they couldn't take
input.
- `register` couldn't be called if `--no-config-file` was set, because
it would error on trying to
  update the plugin file.

# User-Facing Changes

- `nu_plugin_nu_example` plugin added.
- `register` now works in `--no-config-file` mode.

# Tests + Formatting
Tests added for `nu_plugin_nu_example`.

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

# After Submitting

- [ ] Add the version bump to the release script just like for python
2024-04-19 09:53:30 +03:00
..
ast Box ImportPattern in Expr (#12568) 2024-04-18 17:57:01 +02:00
config Copy-on-write for record values (#12305) 2024-04-14 01:42:03 +00:00
debugger Add ListItem type for Expr::List (#12529) 2024-04-18 13:21:05 +02:00
engine Add an example Nushell plugin written in Nushell itself (#12574) 2024-04-19 09:53:30 +03:00
errors Fix circular source causing Nushell to crash (#12262) 2024-04-19 09:38:08 +03:00
pipeline_data Rename IoStream to OutDest (#12433) 2024-04-09 16:48:32 +00:00
plugin Local socket mode and foreground terminal control for plugins (#12448) 2024-04-15 18:28:18 +00:00
value Impl FusedIterator for record iterators (#12542) 2024-04-17 00:34:16 +02:00
alias.rs IO and redirection overhaul (#11934) 2024-03-14 15:51:55 -05:00
did_you_mean.rs Improve case insensitivity consistency (#10884) 2023-11-08 23:58:54 +01:00
eval_base.rs Add ListItem type for Expr::List (#12529) 2024-04-18 13:21:05 +02:00
eval_const.rs Fix circular source causing Nushell to crash (#12262) 2024-04-19 09:38:08 +03:00
example.rs Fix build of nu-protocol without plugin feature enabled (#12323) 2024-03-28 22:39:57 +01:00
id.rs Add virtual path abstraction layer (#9245) 2023-05-23 23:48:50 +03:00
lev_distance.rs Suggest existing variables on not found (#8902) 2023-05-02 18:17:14 +03:00
lib.rs Restructure nu-protocol in more meaningful units (#11917) 2024-03-10 18:45:45 +01:00
module.rs Error on use path item1 item2, if item1 is not a module (#11183) 2023-12-05 11:38:45 +01:00
signature.rs Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
span.rs Make drop notification timing for plugin custom values more consistent (#12341) 2024-04-04 09:13:25 +02:00
syntax_shape.rs open, rm, umv, cp, rm and du: Don't globs if inputs are variables or string interpolation (#11886) 2024-02-23 09:17:09 +08:00
ty.rs Glob: don't allow implicit casting between glob and string (#11992) 2024-02-28 23:05:35 +08:00
util.rs Convert more ShellError variants to named fields (#11173) 2023-11-28 06:43:51 -06:00