Extract core stuff into own crates
This commit extracts five new crates:
- nu-source, which contains the core source-code handling logic in Nu,
including Text, Span, and also the pretty.rs-based debug logic
- nu-parser, which is the parser and expander logic
- nu-protocol, which is the bulk of the types and basic conveniences
used by plugins
- nu-errors, which contains ShellError, ParseError and error handling
conveniences
- nu-textview, which is the textview plugin extracted into a crate
One of the major consequences of this refactor is that it's no longer
possible to `impl X for Spanned<Y>` outside of the `nu-source` crate, so
a lot of types became more concrete (Value became a concrete type
instead of Spanned<Value>, for example).
This also turned a number of inherent methods in the main nu crate into
plain functions (impl Value {} became a bunch of functions in the
`value` namespace in `crate::data::value`).
2019-11-26 03:30:48 +01:00
|
|
|
[package]
|
2022-03-22 21:25:38 +01:00
|
|
|
authors = ["The Nushell Project Developers"]
|
2022-04-11 20:17:06 +02:00
|
|
|
description = "Nushell's internal protocols, including its abstract syntax tree"
|
2022-08-14 14:21:20 +02:00
|
|
|
repository = "https://github.com/nushell/nushell/tree/main/crates/nu-protocol"
|
2022-03-22 21:25:38 +01:00
|
|
|
edition = "2021"
|
|
|
|
license = "MIT"
|
2020-07-05 22:12:44 +02:00
|
|
|
name = "nu-protocol"
|
2024-02-07 23:26:03 +01:00
|
|
|
version = "0.90.2"
|
2021-09-02 03:29:43 +02:00
|
|
|
|
|
|
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
|
|
|
2023-02-12 23:22:00 +01:00
|
|
|
[lib]
|
|
|
|
bench = false
|
|
|
|
|
2021-09-02 03:29:43 +02:00
|
|
|
[dependencies]
|
2024-02-07 23:26:03 +01:00
|
|
|
nu-utils = { path = "../nu-utils", version = "0.90.2" }
|
|
|
|
nu-path = { path = "../nu-path", version = "0.90.2" }
|
|
|
|
nu-system = { path = "../nu-system", version = "0.90.2" }
|
2022-08-04 21:51:02 +02:00
|
|
|
|
2024-02-06 23:20:09 +01:00
|
|
|
byte-unit = { version = "5.1", features = [ "serde" ] }
|
fix format date based on users locale (#11908)
<!--
if this PR closes one or more issues, you can automatically link the PR
with
them by using one of the [*linking
keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword),
e.g.
- this PR should close #xxxx
- fixes #xxxx
you can also mention related issues, PRs or discussions!
-->
# Description
Hi,
Fixes #10838, where before the `date` would be formatted incorrectly,
and was not picking `LC_TIME` for time formatting, but it picked the
first locale returned by the `sys-locale` crate instead. Now it will
format time based on `LC_TIME`. For example,
```
// my locale `nl_NL.UTF-8`
❯ date now | format date '%x %X'
20-02-24 17:17:12
$env.LC_TIME = "en_US.UTF-8"
❯ date now | format date '%x %X'
02/20/2024 05:16:28 PM
```
Note that I also changed the `default_env.nu` as otherwise the Time will
show AM/PM twice. Also reason for the `chrono` update is because this
relies on a fix to upstream repo, which i initially submitted an
[issue](https://github.com/chronotope/chrono/issues/1349#event-11765363286)
<!--
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:
- [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`
to check that you're using the standard code style
- [X] `cargo test --workspace` to check that all tests pass (on Windows
make sure to [enable developer
mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging))
- [X] `cargo run -- -c "use std testing; testing run-tests --path
crates/nu-std"` 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.
-->
2024-02-20 18:08:49 +01:00
|
|
|
chrono = { version = "0.4.34", features = [ "serde", "std", "unstable-locales" ], default-features = false }
|
2023-05-26 17:32:48 +02:00
|
|
|
chrono-humanize = "0.2"
|
2024-02-19 02:54:37 +01:00
|
|
|
fancy-regex = "0.13"
|
2024-02-08 13:31:41 +01:00
|
|
|
indexmap = "2.2"
|
2023-10-18 23:00:11 +02:00
|
|
|
lru = "0.12"
|
2024-02-19 02:54:08 +01:00
|
|
|
miette = { version = "7.1", features = ["fancy-no-backtrace"] }
|
2023-05-26 17:32:48 +02:00
|
|
|
num-format = "0.4"
|
2023-08-21 19:04:34 +02:00
|
|
|
serde = { version = "1.0", default-features = false }
|
2022-08-04 21:51:02 +02:00
|
|
|
serde_json = { version = "1.0", optional = true }
|
2023-05-26 17:32:48 +02:00
|
|
|
thiserror = "1.0"
|
|
|
|
typetag = "0.2"
|
2021-11-19 03:51:42 +01:00
|
|
|
|
|
|
|
[features]
|
|
|
|
plugin = ["serde_json"]
|
|
|
|
|
|
|
|
[dev-dependencies]
|
|
|
|
serde_json = "1.0"
|
2023-07-10 13:35:23 +02:00
|
|
|
strum = "0.25"
|
2023-07-17 08:23:17 +02:00
|
|
|
strum_macros = "0.25"
|
2024-02-07 23:26:03 +01:00
|
|
|
nu-test-support = { path = "../nu-test-support", version = "0.90.2" }
|
2023-08-22 23:09:23 +02:00
|
|
|
rstest = "0.18"
|
2023-11-29 16:17:22 +01:00
|
|
|
|
|
|
|
[package.metadata.docs.rs]
|
|
|
|
all-features = true
|