Commit graph

1121 commits

Author SHA1 Message Date
dependabot[bot]
63e30899f7
Bump quick-xml from 0.28.2 to 0.29.0 (#9477) 2023-06-19 06:17:37 +00:00
dependabot[bot]
379260b110
Bump mockito from 1.0.2 to 1.1.0 (#9476) 2023-06-19 06:16:55 +00:00
dependabot[bot]
d2629293e8
Bump once_cell from 1.17.1 to 1.18.0 (#9474) 2023-06-19 06:16:00 +00:00
JT
6c730def4b
revert: move to ahash (#9464)
This PR reverts https://github.com/nushell/nushell/pull/9391

We try not to revert PRs like this, though after discussion with the
Nushell team, we decided to revert this one.

The main reason is that Nushell, as a codebase, isn't ready for these
kinds of optimisations. It's in the part of the development cycle where
our main focus should be on improving the algorithms inside of Nushell
itself. Once we have matured our algorithms, then we can look for
opportunities to switch out technologies we're using for alternate
forms.

Much of Nushell still has lots of opportunities for tuning the codebase,
paying down technical debt, and making the codebase generally cleaner
and more robust. This should be the focus. Performance improvements
should flow out of that work.

Said another, optimisation that isn't part of tuning the codebase is
premature at this stage. We need to focus on doing the hard work of
making the engine, parser, etc better.

# User-Facing Changes

Reverts the HashMap -> ahash change.

cc @FilipAndersson245
2023-06-18 15:27:57 +12:00
Stefan Holderbach
d371a78a0b
Drop unused nu-color-config in nu-cmd-lang (#9444)
# Description
Unneeded dependency as `help` moved back to `nu-command`.
Currently probably won't provide a compile time benefit.
2023-06-15 13:12:01 +02:00
Filip Andersson
2fd4a36c0d
Changes global allocator to mimalloc, improving performance. (#9415)
# Description
<!--
Thank you for improving Nushell. Please, check our [contributing
guide](../CONTRIBUTING.md) and talk to the core team before making major
changes.

Description of your pull request goes here. **Provide examples and/or
screenshots** if your changes affect the user experience.
-->

this PR makes nushell use mimalloc as the default allocator, this has
the benefit of reducing startup time on my machine. `17%` on linux and
`22%` on windows, when testing using hyperfine.
the overhead to compile seem to be quite small, aswell as the increase
of binary size quite small
on linux the binary went from `33.1mb` to `33.2mb`

linux

![image](https://github.com/nushell/nushell/assets/17986183/ba5379b4-2c08-483a-a9ff-a9d8524d2943)

windows 

![image](https://github.com/nushell/nushell/assets/17986183/fda5090f-96a9-48d1-ada4-617694b9d880)


# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect -A clippy::result_large_err` to check that
you're using the standard code style
- `cargo test --workspace` to check that all tests pass
- `cargo run -- crates/nu-std/tests/run.nu` to run the tests for the
standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
2023-06-14 17:27:12 -05:00
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
Stefan Holderbach
604aadc938
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
2023-06-14 01:18:36 +02:00
Darren Schroeder
2b181bf69c
update ini dependency (#9426)
# Description

This PR updates the ini dependency.

# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect -A clippy::result_large_err` to check that
you're using the standard code style
- `cargo test --workspace` to check that all tests pass
- `cargo run -- crates/nu-std/tests/run.nu` to run the tests for the
standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
2023-06-13 13:33:00 -05:00
Darren Schroeder
cdb7b9d9b2
update dfr to polars 0.30.0 (#9424)
# Description

Update the polars dependency for dataframes to stay on-version.

# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect -A clippy::result_large_err` to check that
you're using the standard code style
- `cargo test --workspace` to check that all tests pass
- `cargo run -- crates/nu-std/tests/run.nu` to run the tests for the
standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
2023-06-13 12:05:45 -05:00
dependabot[bot]
f152858d83
Bump dtparse from 1.4.0 to 1.5.0 (#9412) 2023-06-12 14:52:49 +00:00
dependabot[bot]
042f1dff01
Bump ctrlc from 3.3.1 to 3.4.0 (#9413) 2023-06-12 14:52:21 +00:00
Maxim Zhiburt
85fbacb197
nu-table: Bump tabled to 0.12.1 (#9341)
close #9335 

I am not sure whether the fix was better to be delived as a minor bump
but it is what is is.

Could you @fdncred test it somehow?
I did it by checking out back the the original commit before the PR
refered in the issue.

---------

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>
Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
2023-06-11 17:33:54 -05:00
Filip Andersson
1433f4a520
Changes HashMap to use aHash instead, giving a performance boost. (#9391)
# Description

see https://github.com/nushell/nushell/issues/9390
using `ahash` instead of the default hasher. this will not affect
compile time as we where already building `ahash`.


# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect -A clippy::result_large_err` to check that
you're using the standard code style
- `cargo test --workspace` to check that all tests pass
- `cargo run -- crates/nu-std/tests/run.nu` to run the tests for the
standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
2023-06-10 11:41:58 -05:00
WindSoilder
6e638ab381
disable bracketed paste during evaluation (#9399)
# Description
Fixes: #9218

When user execute some commands involve user input, currently if we
enable `bracketed_paste`, it will results strange behavior (Pasting `0~`
and `1~` around texts, e.g: `aaa` -> `0~aaa1~`) And this is why `gpg`
with paste failed.

Sorry that it's hard to make relative testing...

# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect -A clippy::result_large_err` to check that
you're using the standard code style
- `cargo test --workspace` to check that all tests pass
- `cargo run -- crates/nu-std/tests/run.nu` to run the tests for the
standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
2023-06-10 09:42:13 -05:00
dependabot[bot]
6fa05c12ff
Bump serial_test from 1.0.0 to 2.0.0 (#9358) 2023-06-07 13:59:49 +00:00
dependabot[bot]
bb3d88ac29
Bump criterion from 0.4.0 to 0.5.1 (#9361) 2023-06-07 13:29:54 +00:00
Stefan Holderbach
d15859dd86
Bump to 0.81.1 as development version (#9379)
# Description
Primarily used as a marker on issues and if necessary as a patch release
version.
2023-06-07 15:06:42 +02:00
JT
63cb01e83b
bump to 0.81 (#9374)
# Description
<!--
Thank you for improving Nushell. Please, check our [contributing
guide](../CONTRIBUTING.md) and talk to the core team before making major
changes.

Description of your pull request goes here. **Provide examples and/or
screenshots** if your changes affect the user experience.
-->

# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect -A clippy::result_large_err` to check that
you're using the standard code style
- `cargo test --workspace` to check that all tests pass
- `cargo run -- crates/nu-std/tests/run.nu` to run the tests for the
standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
2023-06-07 10:08:11 +12:00
Stefan Holderbach
ef38805ef9
Pin reedline to 0.20.0 release (#9370)
# Description
See release notes

https://github.com/nushell/reedline/releases/tag/v0.20.0
2023-06-06 13:16:18 +02:00
Michael Angerman
356e05177c
nu-cmd-extra crate infrastructure in place with the Bits command as the model for adding other commands (#9327)
I wanted to get the infrastructure in place for starters for our
*nu-cmd-extra* crate...

The plan is to put inside here the following commands...

* bits
* bytes
* math

I thought it would be easier to do one at a time as well as get the
nu-cmd-extra crate out there on crates.io
for this upcoming release...

Once this lands the infrastructure will be in place to move over the
other noted commands for now...
And then add other stuff we do NOT want to be in 1.0.
2023-06-01 10:46:16 -07:00
Darren Schroeder
5f92fd20e9
update most dependencies except where deeper code changes are needed (#9296)
# Description

This PR updates most dependencies and tries to get in sync with
reedline.

# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect -A clippy::result_large_err` to check that
you're using the standard code style
- `cargo test --workspace` to check that all tests pass
- `cargo run -- crates/nu-std/tests/run.nu` to run the tests for the
standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
2023-05-26 10:32:48 -05:00
JT
43108de547
move over to reedline git version (#9283)
# Description
Moves us over to dogfooding the git version of reedline ahead of the
next release.

# User-Facing Changes

With luck, you should see fewer bugs :D

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect -A clippy::result_large_err` to check that
you're using the standard code style
- `cargo test --workspace` to check that all tests pass
- `cargo run -- crates/nu-std/tests/run.nu` to run the tests for the
standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
2023-05-25 11:53:57 +12:00
Jakub Žádník
74724dee80
Add virtual path abstraction layer (#9245) 2023-05-23 23:48:50 +03:00
Michael Angerman
c55b5c0a55
move dataframe commands to nu-cmd-dataframe (#9241)
All of the dataframe commands ported over with no issues...

### 11 tests are commented out (for now)

So 100 of the original 111 tests are passing with only 11 tests being
ignored for now..

As per our conversation in the core team meeting on Wednesday
I took @jntrnr  suggestion and just commented out the tests dealing
with
[IntoDatetime](https://github.com/nushell/nushell/blob/main/crates/nu-command/src/conversions/into/mod.rs)

Later on we can move this functionality out of nu-command if we decide
it makes sense...

### The following tests were ignored...

```rust
modified:   crates/nu-cmd-dataframe/src/dataframe/series/date/get_day.rs
modified:   crates/nu-cmd-dataframe/src/dataframe/series/date/get_hour.rs
modified:   crates/nu-cmd-dataframe/src/dataframe/series/date/get_minute.rs

modified:   crates/nu-cmd-dataframe/src/dataframe/series/date/get_month.rs
modified:   crates/nu-cmd-dataframe/src/dataframe/series/date/get_nanosecond.rs
modified:   crates/nu-cmd-dataframe/src/dataframe/series/date/get_ordinal.rs

modified:   crates/nu-cmd-dataframe/src/dataframe/series/date/get_second.rs
modified:   crates/nu-cmd-dataframe/src/dataframe/series/date/get_week.rs
modified:   crates/nu-cmd-dataframe/src/dataframe/series/date/get_weekday.rs

modified:   crates/nu-cmd-dataframe/src/dataframe/series/date/get_year.rs
modified:   crates/nu-cmd-dataframe/src/dataframe/series/string/strftime.rs
```
2023-05-19 10:56:08 -07:00
Darren Schroeder
e752d8a964
remove unused dependencies (#9230)
# Description

This is a test PR to see if we can remove dependencies. The crates to
remove was generated from cargo machete. If ci works, I'll update the PR
to remove deps instead of comment them out.

# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect -A clippy::result_large_err` to check that
you're using the standard code style
- `cargo test --workspace` to check that all tests pass
- `cargo run -- crates/nu-std/tests/run.nu` to run the tests for the
standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
2023-05-18 11:37:20 -05:00
Darren Schroeder
b912d4c1ea
add cargo.lock file (#9223)
# Description

Missed adding this with the 0.80.1 change.

# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect -A clippy::result_large_err` to check that
you're using the standard code style
- `cargo test --workspace` to check that all tests pass
- `cargo run -- crates/nu-std/tests/run.nu` to run the tests for the
standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
2023-05-17 18:32:28 -05:00
Stefan Holderbach
8695b57584
Bump version for 0.80.0 release (#9212)
# Checklist

- [x] merged reedline PR
- [ ] release notes
2023-05-17 10:11:13 +12:00
Stefan Holderbach
c9652bce00
Pin reedline to 0.19.1 for 0.80 release (#9211)
# Description
This just includes the bracketed paste bugfix in nushell/reedline#577


# User-Facing Changes
None

# Tests + Formatting

# After Submitting
2023-05-17 10:05:24 +12:00
Hofer-Julian
5e8754bd85
Start to move to polars 0.29 (#9145)
This does part of the work of porting to polars 0.29.
However, I am not familiar enough with this part of the codebase to
finish it.

Things to be done:
- We match two times over `polars::Expr` but `Expr::Cache` isn't
handled. I don't know what should be done here
- `ArgExpr:::List` was renamed to `ArgExpr::Implode`. Does that mean
that `dfr list` should be renamed to `dfr implode`?

---------

Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
2023-05-12 07:44:35 -05:00
Hofer-Julian
d5ae979094
Update polars to 0.28 (#9136)
# Description
Update polars to 0.28.
Luckily, it didn't require major changes.

# User-Facing Changes
None.
(Apart from the fact that certain error messages will stop breaking
table formatting)
2023-05-08 10:42:53 -05:00
Mel Massadian
10d65b611f
adds a list subcommand to input (interactive selections) (#8963)
# Description
Adds a subcommand `list` to `input` (can be migrated wherever if needed)
that allows interactive single and multi selection from an input list.

![image](https://user-images.githubusercontent.com/7041726/236072161-5954dad9-8152-4752-ae3b-b21577711fd1.png)



https://user-images.githubusercontent.com/7041726/233747242-1ca6c44b-e32c-48f1-8fa8-ae50f813be16.mp4


In case it's not clear, only the results are captured (for now the
results are also printed to stderr next to the prompt)


https://user-images.githubusercontent.com/7041726/233785814-f2c8c584-9dd4-4b26-9ae9-c819ed6aa954.mp4


# User-Facing Changes
- Adds a new command `input list`
# Tests + Formatting
Not sure how we can test interactives any ideas?

---------

Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
2023-05-04 19:14:41 +02:00
WindSoilder
e4625acf24
support bracketed paste (#8907)
# Description

Relative: #8113, #7630
It works on non-windows system

This pr depends on https://github.com/nushell/reedline/pull/571
2023-05-03 23:08:47 +02:00
Jelle Besseling
4ca47258a0
Add --redirect-combine option to run-external (#8918)
# Description

Add option that combines both output streams to the `run-external`
command.

This allows you to do something like this:

```nushell
let res = do -i { run-external --redirect-combine <command that prints to stdout and stderr> } | complete

if $res.exit_code != 0 {
  # Only print output when command has failed.
  print "The command has failed, these are the logs:"
  print $res.stdout
}
```

# User-Facing Changes

No breaking changes, just an extra option.

# Tests + Formatting

Added a test that checks the new option

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->

Co-authored-by: Jelle Besseling <jelle@bigbridge.nl>
2023-04-28 07:55:48 -05:00
Maxim Zhiburt
8d8b011702
Bump tabled dependency to 0.11 (#8922)
close? #8060

Quite a bit of refactoring took place.
I believe a few improvements to collapse/expand were made.

I've tried to track any performance regressions and seems like it is
fine.

I've noticed something different now with default configuration path or
something in this regard?
So I might missed something while testing because of this.

Requires some oversight.

---------

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>
2023-04-26 13:56:10 -05:00
Darren Schroeder
4b8a259916
update ast to support output to json (#8962)
# Description
This PR changes the `ast` command to be able to output `--json` as well
as `nuon` (default) with "pretty" and "minified" output. I'm hoping this
functionality will be usable in the vscode extension for semantic
tokenization and highlighting.

# User-Facing Changes
There's a new `--json`/`-j` option. Prior version output of nuon is
maintained as default.

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect` to check that you're using the standard code
style
- `cargo test --workspace` to check that all tests pass
- `cargo run -- crates/nu-std/tests/run.nu` to run the tests for the
standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
2023-04-26 08:15:42 -05:00
Reilly Wood
f9049c4c6c
Move from winres to better-maintained winresource fork (#9001)
This MR closes #8986; big thanks to @WindSoilder for investigating this
and making the MR very easy.

I did manual testing to confirm that the icon etc. are still being set
correctly after this change. Also skimmed the `winresource` code, no
issues jumped out at me.
2023-04-26 14:14:55 +02:00
WindSoilder
503052b669
using ratatui instead of tui (#8952)
# Description

Refer to https://github.com/fdehau/tui-rs/issues/654, I found that tui
maybe un-maintained, instead, I'd suggest to use an actively fork
https://github.com/tui-rs-revival/ratatui

cc: @zhiburt 

# User-Facing Changes
NaN
2023-04-26 01:07:23 +02:00
Stefan Holderbach
7d6a32c5f8
Bump to 0.79.1 dev version (#8998)
# Description

For development or hotfixes
2023-04-26 01:05:23 +02:00
Stefan Holderbach
a1b7261121
Bump version for 0.79.0 release (#8980) 2023-04-25 23:06:17 +03:00
Stefan Holderbach
5a4b6f0f7f
Pin reedline to 0.19.0 release (#8996)
# Description
See release notes:

https://github.com/nushell/reedline/releases/tag/v0.19.0
2023-04-25 20:58:33 +02:00
sholderbach
78b227d1ef Pull the most recent reedline 2023-04-25 19:08:05 +02:00
Darren Schroeder
29256b161c
fix reedline breaking changes due to PR562 (#8921)
# Description
This PR fixes the breaking changes to the reedline API due to
https://github.com/nushell/reedline/pull/562. It does not implement any
new features but just gets nushell back to compiling again.

# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect` to check that you're using the standard code
style
- `cargo test --workspace` to check that all tests pass
- `cargo run -- crates/nu-std/tests/run.nu` to run the tests for the
standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
2023-04-18 08:35:10 -05:00
Reilly Wood
4ecec59224
Upgrade open crate to fix WSL bug (#8905)
This PR upgrades the [`open`](https://github.com/Byron/open-rs) crate
(used in the `start` command) from 4.0.1 to 4.0.2. This fixes a bug
where `open` doesn't always work properly on WSL:
https://github.com/Byron/open-rs/pull/71
2023-04-16 22:05:40 -07:00
WindSoilder
9b35d59023
Update crossterm version to 0.26 (#8623)
# Description

This pr is a companion to https://github.com/nushell/reedline/pull/560

Fortunally, we don't need to change too much nushell code.

## Additional note about lscolor dependency
https://github.com/sharkdp/lscolors/pull/58~~
lscolor is using 0.26 for now
2023-04-14 22:14:57 +02:00
Bob Hyman
8efbb48cb0
Pick up fix in dtparse for nanosec truncation noted at bottom of #8337 (#8805)
# Description

Pick up [enhancement in
`dtparse`](https://github.com/bspeice/dtparse/pull/41), to preserve
nanoseconds in string-to-date conversions.

# User-Facing Changes

An especially eagle-eyed user might notice that prior versions of
nushell were losing nanosecond precision when converting string format
date/time to datetime.

Before:
```nushell
〉'2023-03-02T01:02:03.987654321' | into datetime | date to-record
╭────────────┬───────────╮
│ year       │ 2023      │
│ month      │ 3         │
│ day        │ 2         │
│ hour       │ 1         │
│ minute     │ 2         │
│ second     │ 3         │
│ nanosecond │ 987654000 │
│ timezone   │ -04:00    │
╰────────────┴───────────╯
```
Now, it just works(tm)
```nushell
〉'2023-03-02T01:02:03.987654321' | into datetime | date to-record
╭────────────┬───────────╮
│ year       │ 2023      │
│ month      │ 3         │
│ day        │ 2         │
│ hour       │ 1         │
│ minute     │ 2         │
│ second     │ 3         │
│ nanosecond │ 987654321 │
│ timezone   │ -04:00    │
╰────────────┴───────────╯
```

# Tests + Formatting

Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- [x] `cargo fmt --all -- --check` to check standard code formatting
(`cargo fmt --all` applies these changes)
- [x] `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect` to check that you're using the standard code
style
- [x] `cargo test --workspace` to check that all tests pass  
Some (unrelated) tests did fail [^err]
- [x] `cargo run -- crates/nu-std/tests.nu` to run the tests for the
standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```

# After Submitting

If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.

# (Unrelated) test failures noted
[^err]: Several tests are failing, unrelated to this PR

```
failures:

---- modules::module_import_env_1 stdout ----
=== stderr
Error: nu:🐚:file_not_found

  × File not found
   ╭─[source:1:1]
 1 │ source-env main.nu; use main.nu foo; foo
   ·            ───┬───
   ·               ╰── file not found
   ╰────


thread 'modules::module_import_env_1' panicked at 'assertion failed: `(left == right)`
  left: `""`,
 right: `"foo"`', tests/modules/mod.rs:316:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- modules::module_import_env_2 stdout ----
=== stderr
Error: nu:🐚:file_not_found

  × File not found
   ╭─[source:1:1]
 1 │ source-env main.nu; $env.FOO
   ·            ───┬───
   ·               ╰── file not found
   ╰────


thread 'modules::module_import_env_2' panicked at 'assertion failed: `(left == right)`
  left: `""`,
 right: `"foo"`', tests/modules/mod.rs:341:9

---- overlays::overlay_use_do_cd_file_relative stdout ----
=== stderr

thread 'overlays::overlay_use_do_cd_file_relative' panicked at 'assertion failed: `(left == right)`
  left: `"nushell"`,
 right: `"test1"`', tests/overlays/mod.rs:919:9

---- overlays::overlay_use_dont_cd_overlay stdout ----
=== stderr
Error: nu:🐚:file_not_found

  × File not found
   ╭─[source:1:1]
 1 │ source-env test1/test2/spam.nu; $env.PWD | path basename
   ·            ─────────┬─────────
   ·                     ╰── file not found
   ╰────


thread 'overlays::overlay_use_dont_cd_overlay' panicked at 'assertion failed: `(left == right)`
  left: `""`,
 right: `"overlay_use_dont_cd_overlay"`', tests/overlays/mod.rs:946:9

---- parsing::parse_file_relative_to_parsed_file_dont_use_cwd_1 stdout ----
=== stderr
Error: nu:🐚:file_not_found

  × File not found
   ╭─[source:1:1]
 1 │ source-env lol/lol.nu; $env.FOO
   ·            ─────┬────
   ·                 ╰── file not found
   ╰────


thread 'parsing::parse_file_relative_to_parsed_file_dont_use_cwd_1' panicked at 'assertion failed: `(left == right)`
  left: `""`,
 right: `"good"`', tests/parsing/mod.rs:177:9

---- parsing::parse_file_relative_to_parsed_file_simple stdout ----
=== stderr
Error: nu:🐚:file_not_found

  × File not found
   ╭─[source:1:1]
 1 │ source-env lol/lol/lol.nu; $env.LOL
   ·            ───────┬──────
   ·                   ╰── file not found
   ╰────


thread 'parsing::parse_file_relative_to_parsed_file_simple' panicked at 'assertion failed: `(left == right)`
  left: `""`,
 right: `"lol"`', tests/parsing/mod.rs:99:9

---- shell::const_nu_lib_dirs_relative stdout ----
=== stderr
Error: nu:🐚:file_not_found

  × File not found
   ╭─[main.nu:1:1]
 1 │ const NU_LIB_DIRS = [ 'scripts' ]
 2 │ source-env foo.nu
   ·            ───┬──

thread 'shell::const_nu_lib_dirs_relative' panicked at 'assertion failed: outcome.err.is_empty()', tests/shell/mod.rs:166:9

---- shell::pipeline::commands::external::it_evaluation::takes_rows_of_nu_value_lines stdout ----
=== stderr

thread 'shell::pipeline::commands::external::it_evaluation::takes_rows_of_nu_value_lines' panicked at 'assertion failed: `(left == right)`
  left: `""`,
 right: `"AndrásWithKitKat"`', tests/shell/pipeline/commands/external.rs:198:13

---- shell::pipeline::commands::external::it_evaluation::takes_rows_of_nu_value_strings stdout ----
=== stderr

thread 'shell::pipeline::commands::external::it_evaluation::takes_rows_of_nu_value_strings' panicked at 'assertion failed: `(left == right)`
  left: `""`,
 right: `"jt_likes_cake.txt"`', tests/shell/pipeline/commands/external.rs:173:13


failures:
    modules::module_import_env_1
    modules::module_import_env_2
    overlays::overlay_use_do_cd_file_relative
    overlays::overlay_use_dont_cd_overlay
    parsing::parse_file_relative_to_parsed_file_dont_use_cwd_1
    parsing::parse_file_relative_to_parsed_file_simple
    shell::const_nu_lib_dirs_relative
    shell::pipeline::commands::external::it_evaluation::takes_rows_of_nu_value_lines
    shell::pipeline::commands::external::it_evaluation::takes_rows_of_nu_value_strings

test result: FAILED. 386 passed; 9 failed; 20 ignored; 0 measured; 0 filtered out; finished in 98.06s

error: test failed, to rerun pass `-p nu --test main`

failures:

---- modules::module_import_env_1 stdout ----
=== stderr
Error: nu:🐚:file_not_found

  × File not found
   ╭─[source:1:1]
 1 │ source-env main.nu; use main.nu foo; foo
   ·            ───┬───
   ·               ╰── file not found
   ╰────


thread 'modules::module_import_env_1' panicked at 'assertion failed: `(left == right)`
  left: `""`,
 right: `"foo"`', tests/modules/mod.rs:316:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- modules::module_import_env_2 stdout ----
=== stderr
Error: nu:🐚:file_not_found

  × File not found
   ╭─[source:1:1]
 1 │ source-env main.nu; $env.FOO
   ·            ───┬───
   ·               ╰── file not found
   ╰────


thread 'modules::module_import_env_2' panicked at 'assertion failed: `(left == right)`
  left: `""`,
 right: `"foo"`', tests/modules/mod.rs:341:9

---- overlays::overlay_use_do_cd_file_relative stdout ----
=== stderr

thread 'overlays::overlay_use_do_cd_file_relative' panicked at 'assertion failed: `(left == right)`
  left: `"nushell"`,
 right: `"test1"`', tests/overlays/mod.rs:919:9

---- overlays::overlay_use_dont_cd_overlay stdout ----
=== stderr
Error: nu:🐚:file_not_found

  × File not found
   ╭─[source:1:1]
 1 │ source-env test1/test2/spam.nu; $env.PWD | path basename
   ·            ─────────┬─────────
   ·                     ╰── file not found
   ╰────


thread 'overlays::overlay_use_dont_cd_overlay' panicked at 'assertion failed: `(left == right)`
  left: `""`,
 right: `"overlay_use_dont_cd_overlay"`', tests/overlays/mod.rs:946:9

---- parsing::parse_file_relative_to_parsed_file_dont_use_cwd_1 stdout ----
=== stderr
Error: nu:🐚:file_not_found

  × File not found
   ╭─[source:1:1]
 1 │ source-env lol/lol.nu; $env.FOO
   ·            ─────┬────
   ·                 ╰── file not found
   ╰────


thread 'parsing::parse_file_relative_to_parsed_file_dont_use_cwd_1' panicked at 'assertion failed: `(left == right)`
  left: `""`,
 right: `"good"`', tests/parsing/mod.rs:177:9

---- parsing::parse_file_relative_to_parsed_file_simple stdout ----
=== stderr
Error: nu:🐚:file_not_found

  × File not found
   ╭─[source:1:1]
 1 │ source-env lol/lol/lol.nu; $env.LOL
   ·            ───────┬──────
   ·                   ╰── file not found
   ╰────


thread 'parsing::parse_file_relative_to_parsed_file_simple' panicked at 'assertion failed: `(left == right)`
  left: `""`,
 right: `"lol"`', tests/parsing/mod.rs:99:9

---- shell::const_nu_lib_dirs_relative stdout ----
=== stderr
Error: nu:🐚:file_not_found

  × File not found
   ╭─[main.nu:1:1]
 1 │ const NU_LIB_DIRS = [ 'scripts' ]
 2 │ source-env foo.nu
   ·            ───┬──

thread 'shell::const_nu_lib_dirs_relative' panicked at 'assertion failed: outcome.err.is_empty()', tests/shell/mod.rs:166:9

---- shell::pipeline::commands::external::it_evaluation::takes_rows_of_nu_value_lines stdout ----
=== stderr

thread 'shell::pipeline::commands::external::it_evaluation::takes_rows_of_nu_value_lines' panicked at 'assertion failed: `(left == right)`
  left: `""`,
 right: `"AndrásWithKitKat"`', tests/shell/pipeline/commands/external.rs:198:13

---- shell::pipeline::commands::external::it_evaluation::takes_rows_of_nu_value_strings stdout ----
=== stderr

thread 'shell::pipeline::commands::external::it_evaluation::takes_rows_of_nu_value_strings' panicked at 'assertion failed: `(left == right)`
  left: `""`,
 right: `"jt_likes_cake.txt"`', tests/shell/pipeline/commands/external.rs:173:13


failures:
    modules::module_import_env_1
    modules::module_import_env_2
    overlays::overlay_use_do_cd_file_relative
    overlays::overlay_use_dont_cd_overlay
    parsing::parse_file_relative_to_parsed_file_dont_use_cwd_1
    parsing::parse_file_relative_to_parsed_file_simple
    shell::const_nu_lib_dirs_relative
    shell::pipeline::commands::external::it_evaluation::takes_rows_of_nu_value_lines
    shell::pipeline::commands::external::it_evaluation::takes_rows_of_nu_value_strings

test result: FAILED. 386 passed; 9 failed; 20 ignored; 0 measured; 0 filtered out; finished in 98.06s

error: test failed, to rerun pass `-p nu --test main`
failures:

---- modules::module_import_env_1 stdout ----
=== stderr
Error: nu:🐚:file_not_found

  × File not found
   ╭─[source:1:1]
 1 │ source-env main.nu; use main.nu foo; foo
   ·            ───┬───
   ·               ╰── file not found
   ╰────


thread 'modules::module_import_env_1' panicked at 'assertion failed: `(left == right)`
  left: `""`,
 right: `"foo"`', tests/modules/mod.rs:316:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- modules::module_import_env_2 stdout ----
=== stderr
Error: nu:🐚:file_not_found

  × File not found
   ╭─[source:1:1]
 1 │ source-env main.nu; $env.FOO
   ·            ───┬───
   ·               ╰── file not found
   ╰────


thread 'modules::module_import_env_2' panicked at 'assertion failed: `(left == right)`
  left: `""`,
 right: `"foo"`', tests/modules/mod.rs:341:9

---- overlays::overlay_use_do_cd_file_relative stdout ----
=== stderr

thread 'overlays::overlay_use_do_cd_file_relative' panicked at 'assertion failed: `(left == right)`
  left: `"nushell"`,
 right: `"test1"`', tests/overlays/mod.rs:919:9

---- overlays::overlay_use_dont_cd_overlay stdout ----
=== stderr
Error: nu:🐚:file_not_found

  × File not found
   ╭─[source:1:1]
 1 │ source-env test1/test2/spam.nu; $env.PWD | path basename
   ·            ─────────┬─────────
   ·                     ╰── file not found
   ╰────


thread 'overlays::overlay_use_dont_cd_overlay' panicked at 'assertion failed: `(left == right)`
  left: `""`,
 right: `"overlay_use_dont_cd_overlay"`', tests/overlays/mod.rs:946:9

---- parsing::parse_file_relative_to_parsed_file_dont_use_cwd_1 stdout ----
=== stderr
Error: nu:🐚:file_not_found

  × File not found
   ╭─[source:1:1]
 1 │ source-env lol/lol.nu; $env.FOO
   ·            ─────┬────
   ·                 ╰── file not found
   ╰────


thread 'parsing::parse_file_relative_to_parsed_file_dont_use_cwd_1' panicked at 'assertion failed: `(left == right)`
  left: `""`,
 right: `"good"`', tests/parsing/mod.rs:177:9

---- parsing::parse_file_relative_to_parsed_file_simple stdout ----
=== stderr
Error: nu:🐚:file_not_found

  × File not found
   ╭─[source:1:1]
 1 │ source-env lol/lol/lol.nu; $env.LOL
   ·            ───────┬──────
   ·                   ╰── file not found
   ╰────


thread 'parsing::parse_file_relative_to_parsed_file_simple' panicked at 'assertion failed: `(left == right)`
  left: `""`,
 right: `"lol"`', tests/parsing/mod.rs:99:9

---- shell::const_nu_lib_dirs_relative stdout ----
=== stderr
Error: nu:🐚:file_not_found

  × File not found
   ╭─[main.nu:1:1]
 1 │ const NU_LIB_DIRS = [ 'scripts' ]
 2 │ source-env foo.nu
   ·            ───┬──

thread 'shell::const_nu_lib_dirs_relative' panicked at 'assertion failed: outcome.err.is_empty()', tests/shell/mod.rs:166:9

---- shell::pipeline::commands::external::it_evaluation::takes_rows_of_nu_value_lines stdout ----
=== stderr

thread 'shell::pipeline::commands::external::it_evaluation::takes_rows_of_nu_value_lines' panicked at 'assertion failed: `(left == right)`
  left: `""`,
 right: `"AndrásWithKitKat"`', tests/shell/pipeline/commands/external.rs:198:13

---- shell::pipeline::commands::external::it_evaluation::takes_rows_of_nu_value_strings stdout ----
=== stderr

thread 'shell::pipeline::commands::external::it_evaluation::takes_rows_of_nu_value_strings' panicked at 'assertion failed: `(left == right)`
  left: `""`,
 right: `"jt_likes_cake.txt"`', tests/shell/pipeline/commands/external.rs:173:13


failures:
    modules::module_import_env_1
    modules::module_import_env_2
    overlays::overlay_use_do_cd_file_relative
    overlays::overlay_use_dont_cd_overlay
    parsing::parse_file_relative_to_parsed_file_dont_use_cwd_1
    parsing::parse_file_relative_to_parsed_file_simple
    shell::const_nu_lib_dirs_relative
    shell::pipeline::commands::external::it_evaluation::takes_rows_of_nu_value_lines
    shell::pipeline::commands::external::it_evaluation::takes_rows_of_nu_value_strings

test result: FAILED. 386 passed; 9 failed; 20 ignored; 0 measured; 0 filtered out; finished in 98.06s

error: test failed, to rerun pass `-p nu --test main`
```
2023-04-14 07:24:46 -05:00
dependabot[bot]
5afc49250f
Bump umask from 2.0.0 to 2.1.0 (#8835) 2023-04-14 12:15:22 +00:00
dependabot[bot]
efb81a1277
Bump winreg from 0.11.0 to 0.50.0 (#8837) 2023-04-14 12:15:01 +00:00
dependabot[bot]
b4400c4896
Bump rstest from 0.16.0 to 0.17.0 (#8836) 2023-04-13 18:58:37 +00:00
dependabot[bot]
5a8d4c628f
Bump sys-locale from 0.2.4 to 0.3.0 (#8838) 2023-04-13 18:57:25 +00:00