nushell/crates
Ian Manske c747ec75c9
Add command_prelude module (#12291)
# Description
When implementing a `Command`, one must also import all the types
present in the function signatures for `Command`. This makes it so that
we often import the same set of types in each command implementation
file. E.g., something like this:
```rust
use nu_protocol::ast::Call;
use nu_protocol::engine::{Command, EngineState, Stack};
use nu_protocol::{
    record, Category, Example, IntoInterruptiblePipelineData, IntoPipelineData, PipelineData,
    ShellError, Signature, Span, Type, Value,
};
```

This PR adds the `nu_engine::command_prelude` module which contains the
necessary and commonly used types to implement a `Command`:
```rust
// command_prelude.rs
pub use crate::CallExt;
pub use nu_protocol::{
    ast::{Call, CellPath},
    engine::{Command, EngineState, Stack},
    record, Category, Example, IntoInterruptiblePipelineData, IntoPipelineData, IntoSpanned,
    PipelineData, Record, ShellError, Signature, Span, Spanned, SyntaxShape, Type, Value,
};
```

This should reduce the boilerplate needed to implement a command and
also gives us a place to track the breadth of the `Command` API. I tried
to be conservative with what went into the prelude modules, since it
might be hard/annoying to remove items from the prelude in the future.
Let me know if something should be included or excluded.
2024-03-26 21:17:30 +00:00
..
nu_plugin_custom_values Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
nu_plugin_example Add example tests (nu-plugin-test-support) for plugins in repo (#12281) 2024-03-25 21:20:35 -05:00
nu_plugin_formats Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
nu_plugin_gstat Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
nu_plugin_inc Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
nu_plugin_python Improve the error message for a plugin version mismatch (#12122) 2024-03-08 06:04:22 -06:00
nu_plugin_query Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
nu-cli Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
nu-cmd-base Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
nu-cmd-dataframe Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
nu-cmd-extra Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
nu-cmd-lang Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
nu-color-config Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
nu-command Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
nu-engine Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
nu-explore Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
nu-glob Fix ignored clippy lints (#12160) 2024-03-11 19:46:04 +01:00
nu-json Move more dependencies to workspace level (#12270) 2024-03-23 18:46:02 -05:00
nu-lsp Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
nu-parser Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
nu-path ls, rm, cp, open, touch, mkdir: Don't expand tilde if input path is quoted string or a variable. (#12232) 2024-03-25 10:08:38 +08:00
nu-plugin Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
nu-plugin-test-support Add example tests (nu-plugin-test-support) for plugins in repo (#12281) 2024-03-25 21:20:35 -05:00
nu-pretty-hex nu-explore/ Use hex-dump for binary data (#12184) 2024-03-21 19:02:03 -05:00
nu-protocol Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
nu-std Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
nu-system Move more dependencies to workspace level (#12270) 2024-03-23 18:46:02 -05:00
nu-table Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
nu-term-grid Move more dependencies to workspace level (#12270) 2024-03-23 18:46:02 -05:00
nu-test-support Move more dependencies to workspace level (#12270) 2024-03-23 18:46:02 -05:00
nu-utils Move more dependencies to workspace level (#12270) 2024-03-23 18:46:02 -05:00
README.md Remove old nushell/merge engine-q 2022-02-07 14:54:06 -05:00

Nushell core libraries and plugins

These sub-crates form both the foundation for Nu and a set of plugins which extend Nu with additional functionality.

Foundational libraries are split into two kinds of crates:

  • Core crates - those crates that work together to build the Nushell language engine
  • Support crates - a set of crates that support the engine with additional features like JSON support, ANSI support, and more.

Plugins are likewise also split into two types:

  • Core plugins - plugins that provide part of the default experience of Nu, including access to the system properties, processes, and web-connectivity features.
  • Extra plugins - these plugins run a wide range of different capabilities like working with different file types, charting, viewing binary data, and more.