mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 01:05:01 +02:00
Bump a lot of deps (#1560)
This commit is contained in:
@ -10,7 +10,7 @@ license = "MIT"
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "1.0.103", features = ["derive"] }
|
||||
serde = { version = "1.0.106", features = ["derive"] }
|
||||
lazy_static = "1.4.0"
|
||||
serde_json = "1.0.44"
|
||||
toml = "0.5.5"
|
||||
serde_json = "1.0.51"
|
||||
toml = "0.5.6"
|
||||
|
@ -35,12 +35,12 @@ ctrlc = "3.1.4"
|
||||
derive-new = "0.5.8"
|
||||
dirs = "2.0.2"
|
||||
dunce = "1.0.0"
|
||||
filesize = "0.1.0"
|
||||
filesize = "0.2.0"
|
||||
futures = { version = "0.3", features = ["compat", "io-compat"] }
|
||||
futures-util = "0.3.4"
|
||||
futures_codec = "0.4"
|
||||
getset = "0.1.0"
|
||||
git2 = { version = "0.13.0", default_features = false }
|
||||
git2 = { version = "0.13.1", default_features = false }
|
||||
glob = "0.3.0"
|
||||
hex = "0.4"
|
||||
htmlescape = "0.3.1"
|
||||
@ -52,9 +52,6 @@ language-reporting = "0.4.0"
|
||||
log = "0.4.8"
|
||||
meval = "0.2"
|
||||
natural = "0.5.0"
|
||||
nom = "5.0.1"
|
||||
nom-tracable = "0.4.1"
|
||||
nom_locate = "1.0.0"
|
||||
num-bigint = { version = "0.2.6", features = ["serde"] }
|
||||
num-traits = "0.2.11"
|
||||
parking_lot = "0.10.0"
|
||||
@ -66,13 +63,13 @@ ptree = {version = "0.2" }
|
||||
query_interface = "0.3.5"
|
||||
rand = "0.7"
|
||||
regex = "1"
|
||||
roxmltree = "0.10.0"
|
||||
rustyline = "6.0.0"
|
||||
serde = { version = "1.0.105", features = ["derive"] }
|
||||
roxmltree = "0.10.1"
|
||||
rustyline = "6.1.0"
|
||||
serde = { version = "1.0.106", features = ["derive"] }
|
||||
serde-hjson = "0.9.1"
|
||||
serde_bytes = "0.11.3"
|
||||
serde_ini = "0.2.0"
|
||||
serde_json = "1.0.48"
|
||||
serde_json = "1.0.51"
|
||||
serde_urlencoded = "0.6.1"
|
||||
serde_yaml = "0.8"
|
||||
shellexpand = "2.0.0"
|
||||
@ -88,18 +85,15 @@ umask = "0.1"
|
||||
unicode-xid = "0.2.0"
|
||||
|
||||
clipboard = { version = "0.5", optional = true }
|
||||
starship = { version = "0.38.0", optional = true }
|
||||
starship = { version = "0.39.0", optional = true }
|
||||
|
||||
[target.'cfg(unix)'.dependencies]
|
||||
users = "0.9"
|
||||
users = "0.10.0"
|
||||
|
||||
[dependencies.rusqlite]
|
||||
version = "0.21.0"
|
||||
version = "0.22.0-beta.0"
|
||||
features = ["bundled", "blob"]
|
||||
|
||||
[dev-dependencies]
|
||||
pretty_assertions = "0.6.1"
|
||||
|
||||
[build-dependencies]
|
||||
nu-build = { version = "0.12.0", path = "../nu-build" }
|
||||
|
||||
|
@ -9,11 +9,6 @@ use nu_source::Tagged;
|
||||
use nu_value_ext::{as_column_path, get_data_by_column_path};
|
||||
use std::borrow::Borrow;
|
||||
|
||||
use nom::{
|
||||
bytes::complete::{tag, take_while},
|
||||
IResult,
|
||||
};
|
||||
|
||||
pub struct Format;
|
||||
|
||||
impl PerItemCommand for Format {
|
||||
@ -45,14 +40,8 @@ impl PerItemCommand for Format {
|
||||
let pattern_tag = pattern.tag.clone();
|
||||
let pattern = pattern.as_string()?;
|
||||
|
||||
let format_pattern = format(&pattern).map_err(|_| {
|
||||
ShellError::labeled_error(
|
||||
"Could not create format pattern",
|
||||
"could not create format pattern",
|
||||
&pattern_tag,
|
||||
)
|
||||
})?;
|
||||
let commands = format_pattern.1;
|
||||
let format_pattern = format(&pattern);
|
||||
let commands = format_pattern;
|
||||
|
||||
let output = match value {
|
||||
value
|
||||
@ -66,7 +55,7 @@ impl PerItemCommand for Format {
|
||||
for command in &commands {
|
||||
match command {
|
||||
FormatCommand::Text(s) => {
|
||||
output.push_str(s);
|
||||
output.push_str(&s);
|
||||
}
|
||||
FormatCommand::Column(c) => {
|
||||
let key = to_column_path(&c, &pattern_tag)?;
|
||||
@ -104,32 +93,43 @@ enum FormatCommand {
|
||||
Column(String),
|
||||
}
|
||||
|
||||
fn format(input: &str) -> IResult<&str, Vec<FormatCommand>> {
|
||||
fn format(input: &str) -> Vec<FormatCommand> {
|
||||
let mut output = vec![];
|
||||
|
||||
let mut loop_input = input;
|
||||
let mut loop_input = input.chars();
|
||||
loop {
|
||||
let (input, before) = take_while(|c| c != '{')(loop_input)?;
|
||||
let mut before = String::new();
|
||||
|
||||
while let Some(c) = loop_input.next() {
|
||||
if c == '{' {
|
||||
break;
|
||||
}
|
||||
before.push(c);
|
||||
}
|
||||
|
||||
if !before.is_empty() {
|
||||
output.push(FormatCommand::Text(before.to_string()));
|
||||
}
|
||||
if input != "" {
|
||||
// Look for column as we're now at one
|
||||
let (input, _) = tag("{")(input)?;
|
||||
let (input, column) = take_while(|c| c != '}')(input)?;
|
||||
let (input, _) = tag("}")(input)?;
|
||||
// Look for column as we're now at one
|
||||
let mut column = String::new();
|
||||
|
||||
output.push(FormatCommand::Column(column.to_string()));
|
||||
loop_input = input;
|
||||
} else {
|
||||
loop_input = input;
|
||||
while let Some(c) = loop_input.next() {
|
||||
if c == '}' {
|
||||
break;
|
||||
}
|
||||
column.push(c);
|
||||
}
|
||||
if loop_input == "" {
|
||||
|
||||
if !column.is_empty() {
|
||||
output.push(FormatCommand::Column(column.to_string()));
|
||||
}
|
||||
|
||||
if before.is_empty() && column.is_empty() {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Ok((loop_input, output))
|
||||
output
|
||||
}
|
||||
|
||||
fn to_column_path(
|
||||
|
@ -6,10 +6,6 @@ use nu_protocol::{
|
||||
CallInfo, ReturnSuccess, Signature, SyntaxShape, TaggedDictBuilder, UntaggedValue, Value,
|
||||
};
|
||||
|
||||
use nom::{
|
||||
bytes::complete::{tag, take_while},
|
||||
IResult,
|
||||
};
|
||||
use regex::Regex;
|
||||
|
||||
#[derive(Debug)]
|
||||
@ -18,32 +14,44 @@ enum ParseCommand {
|
||||
Column(String),
|
||||
}
|
||||
|
||||
fn parse(input: &str) -> IResult<&str, Vec<ParseCommand>> {
|
||||
fn parse(input: &str) -> Vec<ParseCommand> {
|
||||
let mut output = vec![];
|
||||
|
||||
let mut loop_input = input;
|
||||
//let mut loop_input = input;
|
||||
let mut loop_input = input.chars();
|
||||
loop {
|
||||
let (input, before) = take_while(|c| c != '{')(loop_input)?;
|
||||
let mut before = String::new();
|
||||
|
||||
while let Some(c) = loop_input.next() {
|
||||
if c == '{' {
|
||||
break;
|
||||
}
|
||||
before.push(c);
|
||||
}
|
||||
|
||||
if !before.is_empty() {
|
||||
output.push(ParseCommand::Text(before.to_string()));
|
||||
}
|
||||
if input != "" {
|
||||
// Look for column as we're now at one
|
||||
let (input, _) = tag("{")(input)?;
|
||||
let (input, column) = take_while(|c| c != '}')(input)?;
|
||||
let (input, _) = tag("}")(input)?;
|
||||
// Look for column as we're now at one
|
||||
let mut column = String::new();
|
||||
|
||||
output.push(ParseCommand::Column(column.to_string()));
|
||||
loop_input = input;
|
||||
} else {
|
||||
loop_input = input;
|
||||
while let Some(c) = loop_input.next() {
|
||||
if c == '}' {
|
||||
break;
|
||||
}
|
||||
column.push(c);
|
||||
}
|
||||
if loop_input == "" {
|
||||
|
||||
if !column.is_empty() {
|
||||
output.push(ParseCommand::Column(column.to_string()));
|
||||
}
|
||||
|
||||
if before.is_empty() && column.is_empty() {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Ok((loop_input, output))
|
||||
output
|
||||
}
|
||||
|
||||
fn column_names(commands: &[ParseCommand]) -> Vec<String> {
|
||||
@ -103,16 +111,10 @@ impl PerItemCommand for Parse {
|
||||
//let value_tag = value.tag();
|
||||
let pattern = call_info.args.expect_nth(0)?.as_string()?;
|
||||
|
||||
let parse_pattern = parse(&pattern).map_err(|_| {
|
||||
ShellError::labeled_error(
|
||||
"Could not create parse pattern",
|
||||
"could not create parse pattern",
|
||||
&value.tag,
|
||||
)
|
||||
})?;
|
||||
let parse_regex = build_regex(&parse_pattern.1);
|
||||
let parse_pattern = parse(&pattern);
|
||||
let parse_regex = build_regex(&parse_pattern);
|
||||
|
||||
let column_names = column_names(&parse_pattern.1);
|
||||
let column_names = column_names(&parse_pattern);
|
||||
let regex = Regex::new(&parse_regex).map_err(|_| {
|
||||
ShellError::labeled_error("Could not parse regex", "could not parse regex", &value.tag)
|
||||
})?;
|
||||
|
@ -171,7 +171,6 @@ mod tests {
|
||||
use nu_protocol::{TaggedDictBuilder, UntaggedValue, Value};
|
||||
use nu_source::Tag;
|
||||
use nu_test_support::fs;
|
||||
use pretty_assertions::assert_eq;
|
||||
use std::path::PathBuf;
|
||||
|
||||
fn fixtures() -> PathBuf {
|
||||
|
@ -16,17 +16,15 @@ ansi_term = "0.12.1"
|
||||
bigdecimal = { version = "0.1.0", features = ["serde"] }
|
||||
derive-new = "0.5.8"
|
||||
language-reporting = "0.4.0"
|
||||
num-bigint = { version = "0.2.3", features = ["serde"] }
|
||||
num-traits = "0.2.10"
|
||||
serde = { version = "1.0.103", features = ["derive"] }
|
||||
nom = "5.0.1"
|
||||
nom_locate = "1.0.0"
|
||||
num-bigint = { version = "0.2.6", features = ["serde"] }
|
||||
num-traits = "0.2.11"
|
||||
serde = { version = "1.0.106", features = ["derive"] }
|
||||
getset = "0.0.9"
|
||||
|
||||
# implement conversions
|
||||
serde_yaml = "0.8"
|
||||
toml = "0.5.5"
|
||||
serde_json = "1.0.44"
|
||||
toml = "0.5.6"
|
||||
serde_json = "1.0.51"
|
||||
|
||||
[build-dependencies]
|
||||
nu-build = { version = "0.12.0", path = "../nu-build" }
|
||||
|
@ -3,9 +3,7 @@ use bigdecimal::BigDecimal;
|
||||
use derive_new::new;
|
||||
use getset::Getters;
|
||||
use language_reporting::{Diagnostic, Label, Severity};
|
||||
use nu_source::{
|
||||
b, DebugDocBuilder, HasFallibleSpan, PrettyDebug, Span, Spanned, SpannedItem, TracableContext,
|
||||
};
|
||||
use nu_source::{b, DebugDocBuilder, HasFallibleSpan, PrettyDebug, Span, Spanned, SpannedItem};
|
||||
use num_bigint::BigInt;
|
||||
use num_traits::ToPrimitive;
|
||||
use serde::{Deserialize, Serialize};
|
||||
@ -413,33 +411,6 @@ impl ShellError {
|
||||
.start()
|
||||
}
|
||||
|
||||
pub fn parse_error(
|
||||
error: nom::Err<(
|
||||
nom_locate::LocatedSpanEx<&str, TracableContext>,
|
||||
nom::error::ErrorKind,
|
||||
)>,
|
||||
) -> ShellError {
|
||||
use language_reporting::*;
|
||||
|
||||
match error {
|
||||
nom::Err::Incomplete(_) => {
|
||||
// TODO: Get span of EOF
|
||||
let diagnostic = Diagnostic::new(
|
||||
Severity::Error,
|
||||
"Parse Error: Unexpected end of line".to_string(),
|
||||
);
|
||||
|
||||
ShellError::diagnostic(diagnostic)
|
||||
}
|
||||
nom::Err::Failure(span) | nom::Err::Error(span) => {
|
||||
let diagnostic = Diagnostic::new(Severity::Error, "Parse Error".to_string())
|
||||
.with_label(Label::new_primary(Span::from(span.0)));
|
||||
|
||||
ShellError::diagnostic(diagnostic)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn diagnostic(diagnostic: Diagnostic<Span>) -> ShellError {
|
||||
ProximateShellError::Diagnostic(ShellDiagnostic { diagnostic }).start()
|
||||
}
|
||||
|
@ -15,10 +15,10 @@ nu-source = { path = "../nu-source", version = "0.12.0" }
|
||||
nu-errors = { path = "../nu-errors", version = "0.12.0" }
|
||||
nu-value-ext = { path = "../nu-value-ext", version = "0.12.0" }
|
||||
|
||||
indexmap = { version = "1.3.0", features = ["serde-1"] }
|
||||
serde = { version = "1.0.103", features = ["derive"] }
|
||||
num-bigint = { version = "0.2.3", features = ["serde"] }
|
||||
serde_json = "1.0.44"
|
||||
indexmap = { version = "1.3.2", features = ["serde-1"] }
|
||||
serde = { version = "1.0.106", features = ["derive"] }
|
||||
num-bigint = { version = "0.2.6", features = ["serde"] }
|
||||
serde_json = "1.0.51"
|
||||
|
||||
[build-dependencies]
|
||||
nu-build = { version = "0.12.0", path = "../nu-build" }
|
||||
|
@ -24,9 +24,6 @@ getset = "0.0.9"
|
||||
derive-new = "0.5.8"
|
||||
ansi_term = "0.12.1"
|
||||
language-reporting = "0.4.0"
|
||||
nom = "5.0.1"
|
||||
nom_locate = "1.0.0"
|
||||
nom-tracable = "0.4.1"
|
||||
typetag = "0.1.4"
|
||||
query_interface = "0.3.5"
|
||||
byte-unit = "3.0.3"
|
||||
|
@ -13,8 +13,6 @@ doctest = false
|
||||
serde = { version = "1.0.103", features = ["derive"] }
|
||||
derive-new = "0.5.8"
|
||||
getset = "0.0.9"
|
||||
nom_locate = "1.0.0"
|
||||
nom-tracable = "0.4.1"
|
||||
language-reporting = "0.4.0"
|
||||
termcolor = "1.0.5"
|
||||
pretty = "0.5.2"
|
||||
|
@ -2,7 +2,6 @@ mod meta;
|
||||
mod pretty;
|
||||
mod term_colored;
|
||||
mod text;
|
||||
mod tracable;
|
||||
|
||||
pub use self::meta::{
|
||||
span_for_spanned_list, tag_for_tagged_list, AnchorLocation, HasFallibleSpan, HasSpan, HasTag,
|
||||
@ -14,4 +13,3 @@ pub use self::pretty::{
|
||||
};
|
||||
pub use self::term_colored::TermColored;
|
||||
pub use self::text::Text;
|
||||
pub use self::tracable::{nom_input, NomSpan, TracableContext};
|
||||
|
@ -1,6 +1,5 @@
|
||||
use crate::pretty::{b, DebugDocBuilder, PrettyDebugWithSource};
|
||||
use crate::text::Text;
|
||||
use crate::tracable::TracableContext;
|
||||
|
||||
use derive_new::new;
|
||||
use getset::Getters;
|
||||
@ -227,28 +226,6 @@ impl From<&Tag> for Tag {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> From<nom_locate::LocatedSpanEx<&str, T>> for Span {
|
||||
fn from(input: nom_locate::LocatedSpanEx<&str, T>) -> Span {
|
||||
Span::new(input.offset, input.offset + input.fragment.len())
|
||||
}
|
||||
}
|
||||
|
||||
impl<T>
|
||||
From<(
|
||||
nom_locate::LocatedSpanEx<T, u64>,
|
||||
nom_locate::LocatedSpanEx<T, u64>,
|
||||
)> for Span
|
||||
{
|
||||
fn from(
|
||||
input: (
|
||||
nom_locate::LocatedSpanEx<T, u64>,
|
||||
nom_locate::LocatedSpanEx<T, u64>,
|
||||
),
|
||||
) -> Span {
|
||||
Span::new(input.0.offset, input.1.offset)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<(usize, usize)> for Span {
|
||||
fn from(input: (usize, usize)) -> Span {
|
||||
Span::new(input.0, input.1)
|
||||
@ -298,15 +275,6 @@ impl From<&Span> for Tag {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<(usize, usize, TracableContext)> for Tag {
|
||||
fn from((start, end, _context): (usize, usize, TracableContext)) -> Self {
|
||||
Tag {
|
||||
anchor: None,
|
||||
span: Span::new(start, end),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<(usize, usize, AnchorLocation)> for Tag {
|
||||
fn from((start, end, anchor): (usize, usize, AnchorLocation)) -> Self {
|
||||
Tag {
|
||||
@ -325,15 +293,6 @@ impl From<(usize, usize, Option<AnchorLocation>)> for Tag {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<nom_locate::LocatedSpanEx<&str, TracableContext>> for Tag {
|
||||
fn from(input: nom_locate::LocatedSpanEx<&str, TracableContext>) -> Tag {
|
||||
Tag {
|
||||
anchor: None,
|
||||
span: Span::new(input.offset, input.offset + input.fragment.len()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Tag> for Span {
|
||||
fn from(tag: Tag) -> Self {
|
||||
tag.span
|
||||
|
@ -1,32 +0,0 @@
|
||||
use derive_new::new;
|
||||
use nom_locate::LocatedSpanEx;
|
||||
use nom_tracable::{HasTracableInfo, TracableInfo};
|
||||
|
||||
pub type NomSpan<'a> = LocatedSpanEx<&'a str, TracableContext>;
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, new)]
|
||||
pub struct TracableContext {
|
||||
pub(crate) info: TracableInfo,
|
||||
}
|
||||
|
||||
impl HasTracableInfo for TracableContext {
|
||||
fn get_tracable_info(&self) -> TracableInfo {
|
||||
self.info
|
||||
}
|
||||
|
||||
fn set_tracable_info(self, info: TracableInfo) -> Self {
|
||||
TracableContext { info }
|
||||
}
|
||||
}
|
||||
|
||||
impl std::ops::Deref for TracableContext {
|
||||
type Target = TracableInfo;
|
||||
|
||||
fn deref(&self) -> &TracableInfo {
|
||||
&self.info
|
||||
}
|
||||
}
|
||||
|
||||
pub fn nom_input(s: &str) -> NomSpan<'_> {
|
||||
LocatedSpanEx::new_extra(s, TracableContext::new(TracableInfo::new()))
|
||||
}
|
@ -16,10 +16,10 @@ nu-protocol = { path = "../nu-protocol", version = "0.12.0" }
|
||||
|
||||
app_dirs = "1.2.1"
|
||||
dunce = "1.0.0"
|
||||
getset = "0.0.9"
|
||||
getset = "0.1.0"
|
||||
glob = "0.3.0"
|
||||
tempfile = "3.1.0"
|
||||
indexmap = { version = "1.3.0", features = ["serde-1"] }
|
||||
indexmap = { version = "1.3.2", features = ["serde-1"] }
|
||||
|
||||
[build-dependencies]
|
||||
nu-build = { version = "0.12.0", path = "../nu-build" }
|
||||
|
@ -15,9 +15,9 @@ nu-errors = { path = "../nu-errors", version = "0.12.0" }
|
||||
nu-parser = { path = "../nu-parser", version = "0.12.0" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.12.0" }
|
||||
|
||||
num-traits = "0.2.10"
|
||||
itertools = "0.8.2"
|
||||
indexmap = { version = "1.3.0", features = ["serde-1"] }
|
||||
num-traits = "0.2.11"
|
||||
itertools = "0.9.0"
|
||||
indexmap = { version = "1.3.2", features = ["serde-1"] }
|
||||
|
||||
[build-dependencies]
|
||||
nu-build = { version = "0.12.0", path = "../nu-build" }
|
||||
|
@ -11,7 +11,7 @@ doctest = false
|
||||
|
||||
[dependencies]
|
||||
ansi_term = "0.12.1"
|
||||
crossterm = { version = "0.16.0" }
|
||||
crossterm = { version = "0.17.1" }
|
||||
nu-plugin = { path = "../nu-plugin", version = "0.12.0" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.12.0" }
|
||||
nu-source = { path = "../nu-source", version = "0.12.0" }
|
||||
|
@ -17,8 +17,8 @@ nu-errors = { path = "../nu-errors", version = "0.12.0" }
|
||||
futures = { version = "0.3", features = ["compat", "io-compat"] }
|
||||
surf = "1.0.3"
|
||||
url = "2.1.1"
|
||||
serde_json = "1.0.46"
|
||||
base64 = "0.11"
|
||||
serde_json = "1.0.51"
|
||||
base64 = "0.12.0"
|
||||
num-traits = "0.2.11"
|
||||
|
||||
[build-dependencies]
|
||||
|
@ -15,9 +15,8 @@ nu-protocol = { path = "../nu-protocol", version = "0.12.0" }
|
||||
nu-source = { path = "../nu-source", version = "0.12.0" }
|
||||
nu-errors = { path = "../nu-errors", version = "0.12.0" }
|
||||
|
||||
crossterm = "0.16.0"
|
||||
syntect = "3.2.0"
|
||||
onig_sys = "~69.1.0"
|
||||
crossterm = "0.17.1"
|
||||
syntect = { version = "4.1", default-features = false, features = ["default-fancy"]}
|
||||
ansi_term = "0.12.1"
|
||||
url = "2.1.1"
|
||||
|
||||
|
Reference in New Issue
Block a user