Move explore command out of nu-command deps (#9421)

# Description
For better parallel compilation, make sure that `nu-command` doesn't
depend on `nu-explore`.

Moves the `nu_protocol::Command` implementation into `nu-explore`. Adds
`nu_explore::add_explore_context()` which is used in `main.rs` to add
the `explore` command.

Minor improvement in compile time ~0.5 sec observed as `nu-command`
still blocks on `nu-cmd-lang` as well.

## `cargo build --timings` before


![grafik](https://github.com/nushell/nushell/assets/15833959/583aa56e-6a1e-47b9-ba00-6a86293a38db)

## `cargo build --timings` after


![grafik](https://github.com/nushell/nushell/assets/15833959/30687575-c1c8-4635-bcdd-7ce9488fcfff)


# User-Facing Changes
None
This commit is contained in:
Stefan Holderbach
2023-06-14 01:18:36 +02:00
committed by GitHub
parent 2b181bf69c
commit 604aadc938
9 changed files with 38 additions and 18 deletions

View File

@ -43,7 +43,8 @@ fn main() -> Result<()> {
// Get initial current working directory.
let init_cwd = get_init_cwd();
let mut engine_state = nu_cli::add_cli_context(create_default_context());
let mut engine_state =
nu_explore::add_explore_context(nu_cli::add_cli_context(create_default_context()));
// Custom additions
let delta = {