Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 6 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ clap = { version = "4.5", features = [
"wrap_help",
] }
ignore = "0.4"
once_cell = "1"
serde = { version = "1", features = ["derive"] }
toml = "0.9"
typeshare-core = { path = "../core", version = "=1.13.3" }
Expand Down
4 changes: 1 addition & 3 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@ thiserror = "2"
itertools = "0.14"
lazy_format = "2"
joinery = "3.1"
topological-sort = { version = "0.2.2" }
convert_case = { version = "0.8" }
log.workspace = true
flexi_logger.workspace = true

[dev-dependencies]
flexi_logger.workspace = true
expect-test = "1.5"
once_cell = "1"
cool_asserts = "2"
syn = { version = "2", features = ["full", "visit", "extra-traits"] }
anyhow = "1"
19 changes: 9 additions & 10 deletions core/tests/snapshot_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,21 @@ use anyhow::anyhow;
use anyhow::Context;
use flexi_logger::DeferredNow;
use log::Record;
use once_cell::sync::Lazy;
use std::{
collections::{BTreeMap, HashMap},
fs::{self, OpenOptions},
io::{Read, Write},
path::{Path, PathBuf},
sync::Once,
sync::{LazyLock, Once},
};
use typeshare_core::{
context::{ParseContext, ParseFileContext},
language::{CrateName, Language},
reconcile::reconcile_aliases,
};

static TESTS_FOLDER_PATH: Lazy<PathBuf> =
Lazy::new(|| PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("data/tests"));
static TESTS_FOLDER_PATH: LazyLock<PathBuf> =
LazyLock::new(|| PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("data/tests"));

static INIT: Once = Once::new();

Expand Down Expand Up @@ -414,28 +413,28 @@ macro_rules! tests {
)*};
}

static KOTLIN_MAPPINGS: Lazy<HashMap<String, String>> = Lazy::new(|| {
static KOTLIN_MAPPINGS: LazyLock<HashMap<String, String>> = LazyLock::new(|| {
[("Url", "String"), ("DateTime", "String")]
.iter()
.map(|(k, v)| (k.to_string(), v.to_string()))
.collect()
});

static SCALA_MAPPINGS: Lazy<HashMap<String, String>> = Lazy::new(|| {
static SCALA_MAPPINGS: LazyLock<HashMap<String, String>> = LazyLock::new(|| {
[("Url", "String"), ("DateTime", "String")]
.iter()
.map(|(k, v)| (k.to_string(), v.to_string()))
.collect()
});

static SWIFT_MAPPINGS: Lazy<HashMap<String, String>> = Lazy::new(|| {
static SWIFT_MAPPINGS: LazyLock<HashMap<String, String>> = LazyLock::new(|| {
[("Url", "String"), ("DateTime", "Date")]
.iter()
.map(|(k, v)| (k.to_string(), v.to_string()))
.collect()
});

static TYPESCRIPT_MAPPINGS: Lazy<HashMap<String, String>> = Lazy::new(|| {
static TYPESCRIPT_MAPPINGS: LazyLock<HashMap<String, String>> = LazyLock::new(|| {
[
("Url", "string"),
("DateTime", "string"),
Expand All @@ -446,7 +445,7 @@ static TYPESCRIPT_MAPPINGS: Lazy<HashMap<String, String>> = Lazy::new(|| {
.collect()
});

static GO_MAPPINGS: Lazy<HashMap<String, String>> = Lazy::new(|| {
static GO_MAPPINGS: LazyLock<HashMap<String, String>> = LazyLock::new(|| {
[
("Url", "string"),
("DateTime", "string"),
Expand All @@ -457,7 +456,7 @@ static GO_MAPPINGS: Lazy<HashMap<String, String>> = Lazy::new(|| {
.collect()
});

static PYTHON_MAPPINGS: Lazy<HashMap<String, String>> = Lazy::new(|| {
static PYTHON_MAPPINGS: LazyLock<HashMap<String, String>> = LazyLock::new(|| {
[
("Url", "AnyUrl"),
("DateTime", "datetime"),
Expand Down
4 changes: 3 additions & 1 deletion lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ chrono = { version = "0.4", default-features = false, features = [
"std",
] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
typeshare-annotation = { path = "../annotation", version = "1.0.4" }

[dev-dependencies]
serde_json = "1"

[features]
default = ["wasmbind"]
wasmbind = ["chrono/wasmbind"]