forked from extern/nushell
# 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  ### after  # 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)
35 lines
827 B
Rust
35 lines
827 B
Rust
mod eager;
|
|
mod expressions;
|
|
mod lazy;
|
|
mod series;
|
|
mod utils;
|
|
mod values;
|
|
|
|
pub use eager::add_eager_decls;
|
|
pub use expressions::add_expressions;
|
|
pub use lazy::add_lazy_decls;
|
|
pub use series::add_series_decls;
|
|
|
|
use nu_protocol::engine::{EngineState, StateWorkingSet};
|
|
|
|
pub fn add_dataframe_context(mut engine_state: EngineState) -> EngineState {
|
|
let delta = {
|
|
let mut working_set = StateWorkingSet::new(&engine_state);
|
|
add_series_decls(&mut working_set);
|
|
add_eager_decls(&mut working_set);
|
|
add_expressions(&mut working_set);
|
|
add_lazy_decls(&mut working_set);
|
|
|
|
working_set.render()
|
|
};
|
|
|
|
if let Err(err) = engine_state.merge_delta(delta) {
|
|
eprintln!("Error creating dataframe command context: {err:?}");
|
|
}
|
|
|
|
engine_state
|
|
}
|
|
|
|
#[cfg(test)]
|
|
mod test_dataframe;
|