nushell/crates/nu-command/src/lib.rs
Stefan Holderbach 46eebc644c
Break up interdependencies of command crates (#9429)
# Description
Make sure that our different crates that contain commands can be
compiled in parallel.
This can under certain circumstances accelerate the compilation with
sufficient multithreading available.

## Details
- Move `help` commands from `nu-cmd-lang` back to `nu-command`
- This also makes sense as the commands are implemented in an
ANSI-terminal specific way
- Make `nu-cmd-lang` only a dev dependency for `nu-command`
- Change context creation helpers for `nu-cmd-extra` and
`nu-cmd-dataframe` to have a consistent api used in
`src/main.rs`:`get_engine_state()`
- `nu-command` now indepedent from `nu-cmd-extra` and `nu-cmd-dataframe`
that are now dependencies of `nu` directly. (change to internal
features)
- Fix tests that previously used `nu-command::create_default_context()`
with replacement functions

## From scratch compilation times:

just debug (dev) build and default features
```
cargo clean --profile dev && cargo build --timings
```

### before

![grafik](https://github.com/nushell/nushell/assets/15833959/e49f1f42-2e53-4a6c-bc23-625b686af1bc)

### after

![grafik](https://github.com/nushell/nushell/assets/15833959/8dec4723-e625-4a86-b91e-e6e808f64726)

# User-Facing Changes
None direct, only change to compilation on multithreaded jobs expected.

# Tests + Formatting
Tests that previously chose to use `nu-command` for their scope will
still use `nu-cmd-lang` + `nu-command` (command list in the granularity
at the time)
2023-06-14 23:12:55 +02:00

69 lines
1.1 KiB
Rust

mod bytes;
mod charting;
mod conversions;
mod date;
mod debug;
mod default_context;
mod deprecated;
mod env;
mod example_test;
mod experimental;
mod filesystem;
mod filters;
mod formats;
mod generators;
mod hash;
mod help;
pub mod hook;
mod input_handler;
mod math;
mod misc;
mod network;
mod path;
mod platform;
mod progress_bar;
mod random;
mod shells;
mod sort_utils;
mod strings;
mod system;
pub mod util;
mod viewers;
pub use bytes::*;
pub use charting::*;
pub use conversions::*;
pub use date::*;
pub use debug::*;
pub use default_context::*;
pub use deprecated::*;
pub use env::*;
#[cfg(test)]
pub use example_test::test_examples;
pub use experimental::*;
pub use filesystem::*;
pub use filters::*;
pub use formats::*;
pub use generators::*;
pub use hash::*;
pub use help::*;
pub use hook::*;
pub use math::*;
pub use misc::*;
pub use network::*;
pub use path::*;
pub use platform::*;
pub use random::*;
pub use shells::*;
pub use sort_utils::*;
pub use strings::*;
pub use system::*;
pub use util::*;
pub use viewers::*;
#[cfg(feature = "sqlite")]
mod database;
#[cfg(feature = "sqlite")]
pub use database::*;