forked from extern/nushell
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  ### 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)
This commit is contained in:
committed by
GitHub
parent
b14bdd865f
commit
46eebc644c
@ -1,10 +1,16 @@
|
||||
use nu_command::create_default_context;
|
||||
use nu_protocol::{engine::StateWorkingSet, Category, Span};
|
||||
use nu_protocol::{
|
||||
engine::{EngineState, StateWorkingSet},
|
||||
Category, Span,
|
||||
};
|
||||
use quickcheck_macros::quickcheck;
|
||||
|
||||
mod commands;
|
||||
mod format_conversions;
|
||||
|
||||
fn create_default_context() -> EngineState {
|
||||
nu_command::add_shell_command_context(nu_cmd_lang::create_default_context())
|
||||
}
|
||||
|
||||
#[quickcheck]
|
||||
fn quickcheck_parse(data: String) -> bool {
|
||||
let (tokens, err) = nu_parser::lex(data.as_bytes(), 0, b"", b"", true);
|
||||
@ -24,7 +30,7 @@ fn quickcheck_parse(data: String) -> bool {
|
||||
|
||||
#[test]
|
||||
fn signature_name_matches_command_name() {
|
||||
let ctx = crate::create_default_context();
|
||||
let ctx = create_default_context();
|
||||
let decls = ctx.get_decls_sorted(true);
|
||||
let mut failures = Vec::new();
|
||||
|
||||
@ -50,7 +56,7 @@ fn signature_name_matches_command_name() {
|
||||
|
||||
#[test]
|
||||
fn commands_declare_input_output_types() {
|
||||
let ctx = crate::create_default_context();
|
||||
let ctx = create_default_context();
|
||||
let decls = ctx.get_decls_sorted(true);
|
||||
let mut failures = Vec::new();
|
||||
|
||||
|
Reference in New Issue
Block a user