diff --git a/Cargo.lock b/Cargo.lock index e5d8661..f10c18f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -389,7 +389,7 @@ dependencies = [ [[package]] name = "comline-codegen" version = "0.1.0" -source = "git+https://github.com/ComlineProject/generation?rev=ecfd701ee98b8186281291ae46a86fcbfe2a6e11#ecfd701ee98b8186281291ae46a86fcbfe2a6e11" +source = "git+https://github.com/ComlineProject/generation?rev=f83897ee570074110c35a653bfd4caa7f22224da#f83897ee570074110c35a653bfd4caa7f22224da" dependencies = [ "comline-core", "eyre", @@ -398,7 +398,7 @@ dependencies = [ [[package]] name = "comline-codegen-rust" version = "0.1.0" -source = "git+https://github.com/ComlineProject/comline-rust?rev=2e3f1bbed726ed56fcf7e250de431b17ef2065e2#2e3f1bbed726ed56fcf7e250de431b17ef2065e2" +source = "git+https://github.com/ComlineProject/comline-rust?rev=d59e81a3b2aa3965985934d115e51767150e46fc#d59e81a3b2aa3965985934d115e51767150e46fc" dependencies = [ "comline-codegen", "comline-core", @@ -408,7 +408,7 @@ dependencies = [ [[package]] name = "comline-codegen-typescript" version = "0.1.0" -source = "git+https://github.com/ComlineProject/comline-typescript?rev=60980389663f2c7c48a027aac2562d58812db315#60980389663f2c7c48a027aac2562d58812db315" +source = "git+https://github.com/ComlineProject/comline-typescript?rev=017f79924863f3e44811adf780d83ede87506185#017f79924863f3e44811adf780d83ede87506185" dependencies = [ "comline-codegen", "comline-core", @@ -418,13 +418,14 @@ dependencies = [ [[package]] name = "comline-core" version = "0.1.0" -source = "git+https://github.com/ComlineProject/core?rev=d6d46171399d7bb232bc44b4e1ecaccbf2cf03de#d6d46171399d7bb232bc44b4e1ecaccbf2cf03de" +source = "git+https://github.com/ComlineProject/core?rev=1ec7ad15aae2c44c369c8983a6f5cab96733dbe1#1ec7ad15aae2c44c369c8983a6f5cab96733dbe1" dependencies = [ "ariadne", "bincode", "blake3", "chumsky", "codespan-reporting", + "comline-core-stdlib", "downcast-rs", "eyre", "glob", @@ -446,6 +447,11 @@ dependencies = [ "tracing", ] +[[package]] +name = "comline-core-stdlib" +version = "0.1.0" +source = "git+https://github.com/ComlineProject/core?rev=1ec7ad15aae2c44c369c8983a6f5cab96733dbe1#1ec7ad15aae2c44c369c8983a6f5cab96733dbe1" + [[package]] name = "concolor" version = "0.1.1" diff --git a/Cargo.toml b/Cargo.toml index 3f1f1c3..5b2c8cf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,15 +29,15 @@ toml = "0.8" # needs real I/O (git fetch, filesystem), so it's off by default for # `comline-core`'s wasm32 consumers (the playground editor, the language # server); the CLI is the one consumer that actually runs `comline build`. -comline-core = { git = "https://github.com/ComlineProject/core", rev = "d6d46171399d7bb232bc44b4e1ecaccbf2cf03de", features = ["deps"] } -# All three pinned to revs that already agree on comline-core@d6d4617 -# (relative prefixes in glob and multi imports, core#61) — bumped together: -# generation#31's first commit (comline-rust/comline-typescript's own codegen -# crates consume `comline-codegen`'s types, so this pins the same generation -# rev they do, not a later one), then comline-rust#19 and comline-typescript#17. -comline-codegen = { git = "https://github.com/ComlineProject/generation", rev = "ecfd701ee98b8186281291ae46a86fcbfe2a6e11" } -comline-codegen-rust = { git = "https://github.com/ComlineProject/comline-rust", rev = "2e3f1bbed726ed56fcf7e250de431b17ef2065e2", optional = true } -comline-codegen-typescript = { git = "https://github.com/ComlineProject/comline-typescript", rev = "60980389663f2c7c48a027aac2562d58812db315", optional = true } +comline-core = { git = "https://github.com/ComlineProject/core", rev = "1ec7ad15aae2c44c369c8983a6f5cab96733dbe1", features = ["deps"] } +# All three pinned to revs that already agree on comline-core@1ec7ad1 +# (the embedded std, core#62) — bumped together: generation#32's first commit +# (comline-rust/comline-typescript's own codegen crates consume +# `comline-codegen`'s types, so this pins the same generation rev they do, +# not a later one), then comline-rust#20 and comline-typescript#18. +comline-codegen = { git = "https://github.com/ComlineProject/generation", rev = "f83897ee570074110c35a653bfd4caa7f22224da" } +comline-codegen-rust = { git = "https://github.com/ComlineProject/comline-rust", rev = "d59e81a3b2aa3965985934d115e51767150e46fc", optional = true } +comline-codegen-typescript = { git = "https://github.com/ComlineProject/comline-typescript", rev = "017f79924863f3e44811adf780d83ede87506185", optional = true } [features] # Which language generators are compiled in. Drop one to shed its whole diff --git a/tests/cli/check.rs b/tests/cli/check.rs index e26d9aa..03e145a 100644 --- a/tests/cli/check.rs +++ b/tests/cli/check.rs @@ -51,3 +51,36 @@ fn reports_a_broken_schema() { .code(1) .stderr(predicate::str::contains("validation failed")); } + +#[test] +fn std_is_usable_and_checked() { + let temp = tempfile::tempdir().unwrap(); + let project = fixture_project(temp.path()); + fs::write( + project.join("src/exchange.ids"), + "use std::http::{Request, Response}\nuse std::validators::StringBounds\n\nstruct Exchange {\n request: Request\n response: Response\n @validators = [StringBounds(min_chars = 1)]\n label: str\n}\n", + ) + .unwrap(); + + comline_cmd() + .current_dir(&project) + .arg("check") + .assert() + .success() + .stderr(predicate::str::contains("Check passed")) + .stderr(predicate::str::contains("WARN").not()); + + fs::write( + project.join("src/typo.ids"), + "use std::htp::Request\n\nstruct T {\n r: Request\n}\n", + ) + .unwrap(); + comline_cmd() + .current_dir(&project) + .arg("check") + .assert() + .failure() + .stderr(predicate::str::contains( + "std has no schema matching 'std::htp::Request' - did you mean 'std::http'?", + )); +}