Skip to content

Commit

Permalink
Updated Dependencies
Browse files Browse the repository at this point in the history
Fixed Base URL Parsing
  • Loading branch information
Redfire75369 committed Nov 25, 2023
1 parent de3b3fc commit 38c4177
Show file tree
Hide file tree
Showing 16 changed files with 158 additions and 287 deletions.
243 changes: 57 additions & 186 deletions Cargo.lock

Large diffs are not rendered by default.

24 changes: 9 additions & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ members = [
]
resolver = "2"

[workspace.package]
edition = "2021"
license = "MPL-2.0"

[workspace.dependencies]
ion-proc = { path = "./ion-proc"}
ion = { path = "./ion"}
Expand All @@ -17,32 +21,22 @@ cli = { path = "./cli"}

bytes = "1.5.0"
colored = "2.0.4"
derivative = "2.2.0"
dunce = "1.0.4"
futures = "0.3.29"
indent = "0.1.1"
mozjs = { package = "mozjs", git = "https://github.com/servo/mozjs" }
mozjs_sys = { package = "mozjs_sys", git = "https://github.com/servo/mozjs" }
sourcemap = "6.4.1"
url = "2.4.1"
url = "2.5.0"

[workspace.dependencies.chrono]
version = "0.4.31"
default-features = false
features = ["clock", "std"]

[workspace.dependencies.http]
version = "0.2.9"

[workspace.dependencies.hyper]
version = "0.14.27"
features = ["client", "http1", "tcp"]

[workspace.dependencies.hyper-rustls]
version = "0.24.2"
default-features = false
features = ["http1", "logging", "tls12", "webpki-tokio"]

[workspace.dependencies.tokio]
version = "1.33.0"
version = "1.34.0"
default-features = false

[workspace.lints.rust]
unsafe_op_in_unsafe_fn = "forbid"
7 changes: 4 additions & 3 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[package]
name = "cli"
version = "0.1.0"
edition = "2021"

edition.workspace = true
license.workspace = true
authors = ["Redfire <redfire75369@hotmail.com>"]
license = "MPL-2.0"

[dependencies]
rustyline = "12.0.0"
Expand All @@ -17,7 +18,7 @@ mozjs.workspace = true
sourcemap.workspace = true

[dependencies.clap]
version = "4.4.7"
version = "4.4.8"
features = ["derive"]

[dependencies.runtime]
Expand Down
10 changes: 7 additions & 3 deletions ion-proc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[package]
name = "ion-proc"
version = "0.1.0"
edition = "2021"

edition.workspace = true
license.workspace = true
authors = ["Redfire <redfire75369@hotmail.com>"]
license = "MPL-2.0"

[dependencies]
convert_case = "0.6.0"
Expand All @@ -12,9 +13,12 @@ prettyplease = "0.2.15"
proc-macro2 = "1.0.69"

[dependencies.syn]
version = "2.0.38"
version = "2.0.39"
features = ["extra-traits", "full", "visit-mut"]

[lints]
workspace = true

[lib]
proc-macro = true
test = false
Expand Down
6 changes: 3 additions & 3 deletions ion/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[package]
name = "ion"
version = "0.1.0"
edition = "2021"

edition.workspace = true
license.workspace = true
authors = ["Redfire <redfire75369@hotmail.com>"]
license = "MPL-2.0"

[dependencies]
arrayvec = "0.7.4"
Expand All @@ -17,7 +18,6 @@ utf16string = "0.2.0"

colored.workspace = true
chrono.workspace = true
derivative.workspace = true
indent.workspace = true
mozjs.workspace = true
mozjs_sys.workspace = true
Expand Down
2 changes: 0 additions & 2 deletions ion/examples/macros/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![deny(unsafe_op_in_unsafe_fn)]

pub mod from_value;
pub mod js_class;
pub mod js_fn;
4 changes: 2 additions & 2 deletions ion/src/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::fmt::{Display, Formatter};
use std::str;

use arrayvec::ArrayVec;
use bitflags::Flags;
use bitflags::{bitflags, Flags};
use mozjs::jsapi::{
JSITER_FORAWAITOF, JSITER_HIDDEN, JSITER_OWNONLY, JSITER_PRIVATE, JSITER_SYMBOLS, JSITER_SYMBOLSONLY, JSPROP_ENUMERATE, JSPROP_PERMANENT,
JSPROP_READONLY, JSPROP_RESOLVING, RegExpFlag_DotAll, RegExpFlag_Global, RegExpFlag_HasIndices, RegExpFlag_IgnoreCase, RegExpFlag_Multiline,
Expand Down Expand Up @@ -37,7 +37,7 @@ bitflags! {

bitflags! {
/// Represents the flags when iterating over an [Object](crate::Object).
#[derive(Clone, Copy, Debug)]
#[derive(Clone, Copy, Debug, Default)]
pub struct IteratorFlags: u32 {
/// Allows iterating over private properties.
const PRIVATE = JSITER_PRIVATE;
Expand Down
92 changes: 51 additions & 41 deletions ion/src/format/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,47 +8,6 @@ use colored::Color;

use crate::flags::IteratorFlags;

/// Represents configuration for formatting
#[derive(Clone, Copy, Debug, Derivative)]
#[derivative(Default)]
pub struct Config {
pub colours: ColourConfig,
#[derivative(Default(value = "IteratorFlags::empty()"))]
pub iteration: IteratorFlags,
pub depth: u16,
pub indentation: u16,
#[derivative(Default(value = "true"))]
pub multiline: bool,
pub quoted: bool,
}

impl Config {
/// Replaces the colors in the [configuration](Config).
pub fn colours(self, colours: ColourConfig) -> Config {
Config { colours, ..self }
}

pub fn iteration(self, iteration: IteratorFlags) -> Config {
Config { iteration, ..self }
}

pub fn depth(self, depth: u16) -> Config {
Config { depth, ..self }
}

pub fn indentation(self, indentation: u16) -> Config {
Config { indentation, ..self }
}

pub fn multiline(self, multiline: bool) -> Config {
Config { multiline, ..self }
}

pub fn quoted(self, quoted: bool) -> Config {
Config { quoted, ..self }
}
}

/// Configuration for the colours used when formatting values as specific types.
#[derive(Clone, Copy, Debug)]
pub struct ColourConfig {
Expand Down Expand Up @@ -107,3 +66,54 @@ impl ColourConfig {
}
}
}

/// Represents configuration for formatting
#[derive(Clone, Copy, Debug)]
pub struct Config {
pub colours: ColourConfig,
pub iteration: IteratorFlags,
pub depth: u16,
pub indentation: u16,
pub multiline: bool,
pub quoted: bool,
}

impl Config {
/// Replaces the colors in the [configuration](Config).
pub fn colours(self, colours: ColourConfig) -> Config {
Config { colours, ..self }
}

pub fn iteration(self, iteration: IteratorFlags) -> Config {
Config { iteration, ..self }
}

pub fn depth(self, depth: u16) -> Config {
Config { depth, ..self }
}

pub fn indentation(self, indentation: u16) -> Config {
Config { indentation, ..self }
}

pub fn multiline(self, multiline: bool) -> Config {
Config { multiline, ..self }
}

pub fn quoted(self, quoted: bool) -> Config {
Config { quoted, ..self }
}
}

impl Default for Config {
fn default() -> Config {
Config {
colours: ColourConfig::default(),
iteration: IteratorFlags::default(),
depth: 0,
indentation: 0,
multiline: true,
quoted: false,
}
}
}
2 changes: 1 addition & 1 deletion ion/src/format/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl Display for KeyDisplay<'_> {
match self.key {
OwnedKey::Int(i) => {
let mut buffer = Buffer::new();
write!(f, "{}", buffer.format(i).color(colours.number))
write!(f, "{}", buffer.format(*i).color(colours.number))
}
OwnedKey::String(str) => write!(f, "{1}{}{1}", r#"""#.color(colours.string), str.color(colours.string)),
OwnedKey::Symbol(sym) => {
Expand Down
5 changes: 0 additions & 5 deletions ion/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@
*/

#![allow(clippy::missing_safety_doc)]
#![deny(unsafe_op_in_unsafe_fn)]

#[macro_use]
extern crate bitflags;
#[macro_use]
extern crate derivative;
#[macro_use]
extern crate mozjs;

Expand Down
9 changes: 5 additions & 4 deletions modules/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
[package]
name = "modules"
version = "0.1.0"
edition = "2021"

edition.workspace = true
license.workspace = true
authors = ["Redfire <redfire75369@hotmail.com>"]
license = "MPL-2.0"

[dependencies]
idna = "0.4.0"
idna = "0.5.0"

futures.workspace = true
mozjs.workspace = true
Expand All @@ -27,7 +28,7 @@ version = "0.1.14"
features = ["fs"]

[dev-dependencies.tokio]
version = "1.33.0"
workspace = true
features = ["macros", "rt"]

[features]
Expand Down
1 change: 0 additions & 1 deletion modules/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/

#![allow(clippy::module_inception)]
#![deny(unsafe_op_in_unsafe_fn)]

#[macro_use]
extern crate ion;
Expand Down
24 changes: 15 additions & 9 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
[package]
name = "runtime"
version = "0.1.0"
edition = "2021"

edition.workspace = true
license.workspace = true
authors = ["Redfire <redfire75369@hotmail.com>"]
license = "MPL-2.0"

[dependencies]
base64 = "0.21.5"
data-url = "0.3.0"
data-url = "0.3.1"
dirs = "5.0.1"
encoding_rs = "0.8.33"
form_urlencoded = "1.2.0"
form_urlencoded = "1.2.1"
indexmap = "2.1.0"
sha3 = "0.10.8"
term-table = "1.3.2"

bytes.workspace = true
chrono.workspace = true
derivative.workspace = true
dunce.workspace = true
futures.workspace = true
indent.workspace = true
Expand All @@ -34,15 +34,18 @@ version = "0.2.32"
optional = true

[dependencies.http]
workspace = true
version = "0.2.11"
optional = true

[dependencies.hyper]
workspace = true
version = "0.14.27"
features = ["client", "http1", "tcp"]
optional = true

[dependencies.hyper-rustls]
workspace = true
version = "0.24.2"
default-features = false
features = ["http1", "logging", "tls12", "webpki-tokio"]
optional = true

[dependencies.ion]
Expand All @@ -54,7 +57,7 @@ version = "0.3.17"
optional = true

[dependencies.swc_core]
version = "0.86.26"
version = "0.86.78"
features = [
"common",
"common_sourcemap",
Expand Down Expand Up @@ -88,6 +91,9 @@ fetch = [
"dep:sys-locale",
]

[lints]
workspace = true

[lib]
test = false
doctest = false
3 changes: 1 addition & 2 deletions runtime/src/globals/fetch/request/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,7 @@ impl<'cx> FromValue<'cx> for RequestPriority {
}
}

#[derive(Derivative, FromValue)]
#[derivative(Default)]
#[derive(Default, FromValue)]
pub struct RequestInit<'cx> {
pub(crate) method: Option<String>,
pub(crate) headers: Option<HeadersInit<'cx>>,
Expand Down
Loading

0 comments on commit 38c4177

Please sign in to comment.