move common tools from nu-command to nu-cmd-base#9455
Conversation
|
cc/ @stormasm i've used the following command to isolate the tool items used throughout the rg "^use crate" crates/nu-command/src/math/ | lines | parse "{file}:{match}" | get matchwhich gives, after removing the ❓ do we move them all to the new
|
|
I think to be on the safe side of things we should move those helper functions over as we need them... In other words the first one I would move in this PR is input_handler because the bytes command will need it... So input_handler will be our first command in nu-cmd-base and it will be up and "running" / landed then I will do the bytes command and then as we want to move more commands we move the helper commands first and then the actual commands... What do you think of this ? |
|
sounds good to me 👍 so let's move |
…ands-to-nu-cmd-base this should solve the `benches/` issue fixed in nushell#9454
|
all this PR is doing is moving input_handler to a new crate called nu-cmd-base |
have you had the time to gain some insights into this? 😋 |
|
@amtoine I went ahead and merged this as it was blocking me making forward progress on moving the bytes command to nu-cmd-extra... Now I should be able to land that PR as well.... |
|
And now that we have seen some other PRs fail in the exact same spot with Python virtualenv I was assured the issue is NOT related to this PR 😄 |
related to - nushell#9404 # Description to support our cratification effort and moving non-1.0 commands outside of the main focus, this PR - creates a new `nu-cmd-base` crate to hold the common structs, traits and functions used by all command-related crates - to start the transition, moves the `input_handler` module from `nu-command` to `nu-cmd-base` # User-Facing Changes ``` $nothing ``` # Tests + Formatting - 🟢 `toolkit fmt` - 🟢 `toolkit clippy` - ⚫ `toolkit test` - ⚫ `toolkit test stdlib` # After Submitting ``` $nothing ```
now that #9455 has landed we can move the bytes command to nu-cmd-extra in concert with moving nu_command::util to nu-cmd-base
requires - #9455 # ⚙️ Description in this PR i move the commands we've all agreed, in the core team, to move out of the core Nushell to the `extra` feature. > **Warning** > in the first commits here, i've > - moved the implementations to `nu-cmd-extra` > - removed the declaration of all the commands below from `nu-command` > - made sure the commands were not available anymore with `cargo run -- -n` ## the list of commands to move with the current command table downloaded as `commands.csv`, i've run ```bash let commands = ( open commands.csv | where is_plugin == "FALSE" and category != "deprecated" | select name category "approv. %" | rename name category approval | insert treated {|it| ( ($it.approval == 100) or # all the core team agreed on them ($it.name | str starts-with "bits") or # see #9241 ($it.name | str starts-with "dfr") # see #9327 )} ) ``` to preprocess them and then ```bash $commands | where {|it| (not $it.treated) and ($it.approval == 0)} ``` to get all untreated commands with no approval, which gives ``` ╭────┬───────────────┬─────────┬─────────────┬──────────╮ │ # │ name │ treated │ category │ approval │ ├────┼───────────────┼─────────┼─────────────┼──────────┤ │ 0 │ fmt │ false │ conversions │ 0 │ │ 1 │ each while │ false │ filters │ 0 │ │ 2 │ roll │ false │ filters │ 0 │ │ 3 │ roll down │ false │ filters │ 0 │ │ 4 │ roll left │ false │ filters │ 0 │ │ 5 │ roll right │ false │ filters │ 0 │ │ 6 │ roll up │ false │ filters │ 0 │ │ 7 │ rotate │ false │ filters │ 0 │ │ 8 │ update cells │ false │ filters │ 0 │ │ 9 │ decode hex │ false │ formats │ 0 │ │ 10 │ encode hex │ false │ formats │ 0 │ │ 11 │ from url │ false │ formats │ 0 │ │ 12 │ to html │ false │ formats │ 0 │ │ 13 │ ansi gradient │ false │ platform │ 0 │ │ 14 │ ansi link │ false │ platform │ 0 │ │ 15 │ format │ false │ strings │ 0 │ ╰────┴───────────────┴─────────┴─────────────┴──────────╯ ``` # 🖌️ User-Facing Changes ``` $nothing ``` # 🧪 Tests + Formatting - ⚫ `toolkit fmt` - ⚫ `toolkit clippy` - ⚫ `toolkit test` - ⚫ `toolkit test stdlib` # 📖 After Submitting ``` $nothing ``` # 🔍 For reviewers ```bash $commands | where {|it| (not $it.treated) and ($it.approval == 0)} | each {|command| try { help $command.name | ignore } catch {|e| $"($command.name): ($e.msg)" } } ``` should give no output in `cargo run --features extra -- -n` and a table with 16 lines in `cargo run -- -n`
related to
nu-cmd-extra#9404Description
to support our cratification effort and moving non-1.0 commands outside of the main focus, this PR
nu-cmd-basecrate to hold the common structs, traits and functions used by all command-related cratesinput_handlermodule fromnu-commandtonu-cmd-baseUser-Facing Changes
Tests + Formatting
toolkit fmttoolkit clippytoolkit testtoolkit test stdlibAfter Submitting