From f622d82b969f09e39acaaa1f6a50c2f1a8cab8f1 Mon Sep 17 00:00:00 2001 From: Mehdi Salemi Date: Thu, 5 Sep 2024 12:23:34 +0000 Subject: [PATCH 1/3] adds bluejay code --- Cargo.lock | 161 ++++++++++++++++++- Cargo.toml | 3 + src/bluejay_schema_analyzer.rs | 281 +++++++++++++++++++++++++++++++++ src/scale_limits_analyzer.rs | 169 ++++++++++++++++++++ 4 files changed, 612 insertions(+), 2 deletions(-) create mode 100644 src/bluejay_schema_analyzer.rs create mode 100644 src/scale_limits_analyzer.rs diff --git a/Cargo.lock b/Cargo.lock index f5c6f32..14f6d6c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -123,6 +123,16 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +[[package]] +name = "ariadne" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44055e597c674aef7cb903b2b9f6e4cba1277ed0d2d61dae7cd52d7ffa81f8e2" +dependencies = [ + "unicode-width", + "yansi", +] + [[package]] name = "assert_cmd" version = "2.0.16" @@ -192,6 +202,12 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "beef" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" + [[package]] name = "bitflags" version = "1.3.2" @@ -213,6 +229,44 @@ dependencies = [ "generic-array", ] +[[package]] +name = "bluejay-core" +version = "0.1.0" +source = "git+https://github.com/Shopify/bluejay.git?rev=c7e7c2bfb73c7b4869aa8569c15cd3c4eb48b8bf#c7e7c2bfb73c7b4869aa8569c15cd3c4eb48b8bf" +dependencies = [ + "enum-as-inner", + "itertools 0.13.0", + "paste", + "serde_json", + "strum", +] + +[[package]] +name = "bluejay-parser" +version = "0.1.0" +source = "git+https://github.com/Shopify/bluejay.git?rev=c7e7c2bfb73c7b4869aa8569c15cd3c4eb48b8bf#c7e7c2bfb73c7b4869aa8569c15cd3c4eb48b8bf" +dependencies = [ + "ariadne", + "bluejay-core", + "enum-as-inner", + "itertools 0.13.0", + "logos", + "strum", +] + +[[package]] +name = "bluejay-validator" +version = "0.1.0" +source = "git+https://github.com/Shopify/bluejay.git?rev=c7e7c2bfb73c7b4869aa8569c15cd3c4eb48b8bf#c7e7c2bfb73c7b4869aa8569c15cd3c4eb48b8bf" +dependencies = [ + "bluejay-core", + "bluejay-parser", + "itertools 0.13.0", + "paste", + "seq-macro", + "serde_json", +] + [[package]] name = "bstr" version = "1.10.0" @@ -630,7 +684,7 @@ dependencies = [ "cranelift-codegen 0.109.0", "cranelift-entity 0.109.0", "cranelift-frontend 0.109.0", - "itertools", + "itertools 0.12.1", "log", "smallvec", "wasmparser 0.209.1", @@ -646,7 +700,7 @@ dependencies = [ "cranelift-codegen 0.110.2", "cranelift-entity 0.110.2", "cranelift-frontend 0.110.2", - "itertools", + "itertools 0.12.1", "log", "smallvec", "wasmparser 0.212.0", @@ -804,6 +858,18 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "enum-as-inner" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "equivalent" version = "1.0.1" @@ -863,6 +929,12 @@ dependencies = [ "num-traits", ] +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + [[package]] name = "form_urlencoded" version = "1.2.1" @@ -890,6 +962,9 @@ dependencies = [ "anyhow", "assert_cmd", "assert_fs", + "bluejay-core", + "bluejay-parser", + "bluejay-validator", "clap", "colored", "deterministic-wasi-ctx", @@ -1207,6 +1282,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.11" @@ -1305,6 +1389,39 @@ dependencies = [ "serde_json", ] +[[package]] +name = "logos" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff1ceb190eb9bdeecdd8f1ad6a71d6d632a50905948771718741b5461fb01e13" +dependencies = [ + "logos-derive", +] + +[[package]] +name = "logos-codegen" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90be66cb7bd40cb5cc2e9cfaf2d1133b04a3d93b72344267715010a466e0915a" +dependencies = [ + "beef", + "fnv", + "lazy_static", + "proc-macro2", + "quote", + "regex-syntax", + "syn", +] + +[[package]] +name = "logos-derive" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45154231e8e96586b39494029e58f12f8ffcb5ecf80333a603a13aa205ea8cbd" +dependencies = [ + "logos-codegen", +] + [[package]] name = "mach2" version = "0.4.2" @@ -1726,6 +1843,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "rustversion" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + [[package]] name = "ryu" version = "1.0.18" @@ -1750,6 +1873,12 @@ dependencies = [ "serde", ] +[[package]] +name = "seq-macro" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3f0bf26fd526d2a95683cd0f87bf103b8539e2ca1ef48ce002d67aad59aa0b4" + [[package]] name = "serde" version = "1.0.209" @@ -1863,6 +1992,28 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +[[package]] +name = "strum" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "rustversion", + "syn", +] + [[package]] name = "syn" version = "2.0.72" @@ -3193,6 +3344,12 @@ dependencies = [ "wast 35.0.2", ] +[[package]] +name = "yansi" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" + [[package]] name = "zerocopy" version = "0.6.6" diff --git a/Cargo.toml b/Cargo.toml index dc94281..d081332 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,6 +34,9 @@ rust-embed = "8.5.0" rmp-serde = "1.3" is-terminal = "0.4.13" wasmprof = "0.7.0" +bluejay-parser = { git = "https://github.com/Shopify/bluejay.git", rev = "c7e7c2bfb73c7b4869aa8569c15cd3c4eb48b8bf", features = ["format-errors"] } +bluejay-core = { git = "https://github.com/Shopify/bluejay.git", rev = "c7e7c2bfb73c7b4869aa8569c15cd3c4eb48b8bf" } +bluejay-validator = { git = "https://github.com/Shopify/bluejay.git", rev = "c7e7c2bfb73c7b4869aa8569c15cd3c4eb48b8bf" } [dev-dependencies] assert_cmd = "2.0" diff --git a/src/bluejay_schema_analyzer.rs b/src/bluejay_schema_analyzer.rs new file mode 100644 index 0000000..54804bf --- /dev/null +++ b/src/bluejay_schema_analyzer.rs @@ -0,0 +1,281 @@ +use crate::scale_limits_analyzer::ScaleLimitsAnalyzer; +use anyhow::{anyhow, Result}; +use bluejay_parser::{ + ast::{ + definition::{DefinitionDocument, SchemaDefinition}, + executable::ExecutableDocument, + Parse, + }, + Error, +}; + +pub struct BluejaySchemaAnalyzer; + +impl BluejaySchemaAnalyzer { + pub fn analyze_schema_definition( + schema_string: &str, + schema_path: Option<&str>, + query: &str, + query_path: Option<&str>, + input: &serde_json::Value, + ) -> Result { + let document_definition = DefinitionDocument::parse(schema_string) + .map_err(|errors| anyhow!(Error::format_errors(schema_string, schema_path, errors)))?; + + let schema_definition = SchemaDefinition::try_from(&document_definition) + .map_err(|errors| anyhow!(Error::format_errors(schema_string, schema_path, errors)))?; + + let executable_document = ExecutableDocument::parse(query) + .map_err(|errors| anyhow!(Error::format_errors(query, query_path, errors)))?; + + let cache = + bluejay_validator::executable::Cache::new(&executable_document, &schema_definition); + + ScaleLimitsAnalyzer::analyze( + &executable_document, + &schema_definition, + None, + &Default::default(), + &cache, + input, + ) + .map_err(|e| anyhow!("Unable to analyze scale limits: {}", e.message())) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use serde_json::json; + + #[test] + fn test_analyze_schema_definition() { + let schema_string = r#" + directive @scaleLimits(rate: Float!) on FIELD_DEFINITION + type Query { + field: String @scaleLimits(rate: 0.005) + } + "#; + let query = "{ field }"; + let input_json = json!({ + "field": "value" + }); + + let result = BluejaySchemaAnalyzer::analyze_schema_definition( + schema_string, + Some("schema.graphql"), + query, + Some("query.graphql"), + &input_json, + ); + assert!( + result.is_ok(), + "Expected successful analysis but got an error: {:?}", + result + ); + + let scale_factor = result.unwrap(); + let expected_scale_factor = 1.0; + assert_eq!( + scale_factor, expected_scale_factor, + "The scale factor did not match the expected value" + ); + } + + #[test] + fn test_analyze_schema_with_array_length_scaling() { + let schema_string = r#" + directive @scaleLimits(rate: Float!) on FIELD_DEFINITION + type Query { + cartLines: [String] @scaleLimits(rate: 0.005) + } + "#; + let query = "{ cartLines }"; + let input_json = json!({ + "cartLines": vec!["moeowomeow"; 500] + }); + + let result = BluejaySchemaAnalyzer::analyze_schema_definition( + schema_string, + Some("schema.graphql"), + query, + Some("query.graphql"), + &input_json, + ); + assert!( + result.is_ok(), + "Expected successful analysis but got an error: {:?}", + result + ); + + let scale_factor = result.unwrap(); + let expected_scale_factor = 2.5; // Adjust this based on how your scale limits are defined + assert_eq!( + scale_factor, expected_scale_factor, + "The scale factor did not match the expected value for array length scaling" + ); + } + + #[test] + fn test_analyze_schema_with_array_length_scaling_to_max_scale_factor() { + let schema_string = r#" + directive @scaleLimits(rate: Float!) on FIELD_DEFINITION + type Query { + cartLines: [String] @scaleLimits(rate: 0.005) + } + "#; + let query = "{ cartLines }"; + let input_json = json!({ + "cartLines": vec!["item"; 1000000] // value that would scale well beyond the max + }); + + let result = BluejaySchemaAnalyzer::analyze_schema_definition( + schema_string, + Some("schema.graphql"), + query, + Some("query.graphql"), + &input_json, + ); + assert!( + result.is_ok(), + "Expected successful analysis but got an error: {:?}", + result + ); + + let scale_factor = result.unwrap(); + let expected_scale_factor = 10.0; + assert_eq!( + scale_factor, expected_scale_factor, + "The scale factor did not match the expected value for array length scaling" + ); + } + + #[test] + fn test_invalid_schema() { + let invalid_schema_string = r#" + directive @scaleLimits(rate: Float!) on FIELD_DEFINITION + type Query { + field: String @scaleLimits(rate: "invalid") // Invalid rate type + } + "#; + let valid_query = "query { field }"; + let input_json = json!({ + "field": "value" + }); + + let result = BluejaySchemaAnalyzer::analyze_schema_definition( + invalid_schema_string, + Some("invalid_schema.graphql"), + valid_query, + Some("query.graphql"), + &input_json, + ); + + assert!( + result.is_err(), + "Expected an error due to invalid schema and query, but got success: {:?}", + result + ); + } + + #[test] + fn test_invalid_query() { + let schema_string = r#" + directive @scaleLimits(rate: Float!) on FIELD_DEFINITION + type Query { + field: String @scaleLimits(rate: 0.005) + } + "#; + let invalid_query = "query { field "; + let input_json = json!({ + "field": "value" + }); + + let result = BluejaySchemaAnalyzer::analyze_schema_definition( + schema_string, + Some("schema.graphql"), + invalid_query, + Some("invalid_query.graphql"), + &input_json, + ); + + assert!( + result.is_err(), + "Expected an error due to invalid schema and query, but got success: {:?}", + result + ); + } + + #[test] + fn test_no_double_counting_for_duplicate_fields_with_array() { + let schema_string = r#" + directive @scaleLimits(rate: Float!) on FIELD_DEFINITION + type Query { + field: [String] @scaleLimits(rate: 0.005) + } + "#; + let query = "{ field field }"; + let input_json = json!({ + "field": vec!["value"; 200] + }); + + let result = BluejaySchemaAnalyzer::analyze_schema_definition( + schema_string, + Some("schema.graphql"), + query, + Some("query.graphql"), + &input_json, + ); + assert!( + result.is_ok(), + "Expected successful analysis but got an error: {:?}", + result + ); + + let scale_factor = result.unwrap(); + let expected_scale_factor = 1.0; + assert_eq!( + scale_factor, expected_scale_factor, + "The scale factor did not match the expected value, indicating potential double counting" + ); + } + + #[test] + fn test_no_double_counting_for_duplicate_fields_with_nested_array() { + let schema_string = r#" + directive @scaleLimits(rate: Float!) on FIELD_DEFINITION + type Query { + field: [MyObject] + } + + type MyObject { + field: [String] @scaleLimits(rate: 0.005) + } + "#; + let query = "{ field { field } }"; + let nested_field = json!({ "field": vec!["value"; 200] }); + let input_json = json!({ + "field": vec![nested_field; 2] + }); + + let result = BluejaySchemaAnalyzer::analyze_schema_definition( + schema_string, + Some("schema.graphql"), + query, + Some("query.graphql"), + &input_json, + ); + assert!( + result.is_ok(), + "Expected successful analysis but got an error: {:?}", + result + ); + + let scale_factor = result.unwrap(); + let expected_scale_factor = 2.0; + assert_eq!( + scale_factor, expected_scale_factor, + "The scale factor did not match the expected value, indicating potential double counting" + ); + } +} diff --git a/src/scale_limits_analyzer.rs b/src/scale_limits_analyzer.rs new file mode 100644 index 0000000..4a85cb1 --- /dev/null +++ b/src/scale_limits_analyzer.rs @@ -0,0 +1,169 @@ +use bluejay_core::{ + definition::{prelude::*, SchemaDefinition as CoreSchemaDefinition}, + AsIter, Directive, Value as CoreValue, ValueReference, +}; +use bluejay_parser::ast::{ + definition::FieldDefinition, + definition::{DefaultContext, SchemaDefinition}, + executable::ExecutableDocument, +}; +use serde_json::Value; +use std::collections::HashMap; + +pub type ScaleLimitsAnalyzer<'a> = bluejay_validator::executable::operation::Orchestrator< + 'a, + ExecutableDocument<'a>, + SchemaDefinition<'a>, + serde_json::Map, + ScaleLimits<'a>, +>; + +#[derive(Hash, PartialEq, Eq, Debug)] +struct PathWithIndex<'a> { + path: Vec<&'a str>, + index: usize, +} + +pub struct ScaleLimits<'a> { + value_stack: Vec>, + path_stack: Vec<&'a str>, + rates: HashMap, f64>, +} + +impl<'a> + bluejay_validator::executable::operation::Visitor< + 'a, + ExecutableDocument<'a>, + SchemaDefinition<'a>, + serde_json::Map, + > for ScaleLimits<'a> +{ + type ExtraInfo = &'a Value; + + fn new( + _operation_definition: &'a ::OperationDefinition, + _schema_definition: &'a SchemaDefinition<'a>, + _variable_values: &'a serde_json::Map, + _cache: &'a bluejay_validator::executable::Cache<'a, ExecutableDocument, SchemaDefinition>, + extra_info: &'a Value, + ) -> Self { + Self { + value_stack: vec![vec![extra_info]], + path_stack: Vec::new(), + rates: Default::default(), + } + } + + fn visit_field( + &mut self, + field: &'a as bluejay_core::executable::ExecutableDocument>::Field, + field_definition: &'_ ::FieldDefinition, + _scoped_type: bluejay_core::definition::TypeDefinitionReference< + '_, + as CoreSchemaDefinition>::TypeDefinition, + >, + _included: bool, + ) { + self.path_stack.push(field.response_key()); + let rate = Self::rate_for_field_definition(field_definition); + let values = self.value_stack.last().unwrap(); + let mut nested_values = Vec::new(); + + values.iter().enumerate().for_each(|(index, value)| { + let value_for_field = match value { + Value::Object(object) => object.get(field.response_key()), + Value::Null => None, + _ => None, + }; + if let Some(rate) = rate { + let length = match value_for_field { + Some(Value::String(s)) => s.len(), + Some(Value::Array(arr)) => arr.len(), + _ => 1, + }; + let increment = length as f64 * rate; + + let path_with_index = PathWithIndex { + path: self.path_stack.clone(), + index, + }; + + let entry = self.rates.entry(path_with_index).or_default(); + + *entry = entry.max(increment); + } + + match value_for_field { + Some(Value::Array(values)) => nested_values.extend(values), + Some(value) => nested_values.push(value), + None => {} + } + }); + + self.value_stack.push(nested_values); + } + + fn leave_field( + &mut self, + _field: &'a as bluejay_core::executable::ExecutableDocument>::Field, + _field_definition: &'a as CoreSchemaDefinition>::FieldDefinition, + _scoped_type: bluejay_core::definition::TypeDefinitionReference< + 'a, + as CoreSchemaDefinition>::TypeDefinition, + >, + _included: bool, + ) { + self.path_stack.pop().unwrap(); + self.value_stack.pop().unwrap(); + } +} + +impl<'a> + bluejay_validator::executable::operation::Analyzer< + 'a, + ExecutableDocument<'a>, + SchemaDefinition<'a>, + serde_json::Map, + > for ScaleLimits<'a> +{ + type Output = f64; + + fn into_output(self) -> Self::Output { + let normalized_rates = self.rates.into_iter().fold( + HashMap::new(), + |mut normalized_rates, (PathWithIndex { path, .. }, rate)| { + *normalized_rates.entry(path).or_default() += rate; + normalized_rates + }, + ); + + normalized_rates + .into_values() + .fold(Self::MIN_SCALE_FACTOR, f64::max) + .clamp(Self::MIN_SCALE_FACTOR, Self::MAX_SCALE_FACTOR) + } +} + +impl<'a> ScaleLimits<'a> { + const MIN_SCALE_FACTOR: f64 = 1.0; + const MAX_SCALE_FACTOR: f64 = 10.0; + + fn rate_for_field_definition( + field_definition: &FieldDefinition, + ) -> Option { + field_definition + .directives() + .iter() + .flat_map(|directives| directives.iter()) + .find(|directive| directive.name() == "scaleLimits") + .and_then(|directive| directive.arguments()) + .and_then(|arguments| arguments.iter().find(|argument| argument.name() == "rate")) + .and_then(|argument| { + if let ValueReference::Float(rate) = argument.value().as_ref() { + Some(rate) + } else { + None + } + }) + } +} From 7901d98455ccea6d0dad3894754cc152daec2b3e Mon Sep 17 00:00:00 2001 From: Mehdi Salemi Date: Thu, 5 Sep 2024 12:24:31 -0400 Subject: [PATCH 2/3] code review updates --- src/bluejay_schema_analyzer.rs | 4 ++-- src/scale_limits_analyzer.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bluejay_schema_analyzer.rs b/src/bluejay_schema_analyzer.rs index 54804bf..2d92274 100644 --- a/src/bluejay_schema_analyzer.rs +++ b/src/bluejay_schema_analyzer.rs @@ -155,7 +155,7 @@ mod tests { let invalid_schema_string = r#" directive @scaleLimits(rate: Float!) on FIELD_DEFINITION type Query { - field: String @scaleLimits(rate: "invalid") // Invalid rate type + field: String @scaleLimits(rate: 0.005) // Invalid comment } "#; let valid_query = "query { field }"; @@ -207,7 +207,7 @@ mod tests { } #[test] - fn test_no_double_counting_for_duplicate_fields_with_array() { + fn test_accurate_scale_limits_for_nested_array() { let schema_string = r#" directive @scaleLimits(rate: Float!) on FIELD_DEFINITION type Query { diff --git a/src/scale_limits_analyzer.rs b/src/scale_limits_analyzer.rs index 4a85cb1..28fee16 100644 --- a/src/scale_limits_analyzer.rs +++ b/src/scale_limits_analyzer.rs @@ -62,7 +62,7 @@ impl<'a> '_, as CoreSchemaDefinition>::TypeDefinition, >, - _included: bool, + _included: bool, // Ignoring `_included` as @include and @skip directives are not supported in Shopify Functions. ) { self.path_stack.push(field.response_key()); let rate = Self::rate_for_field_definition(field_definition); From 4d8384c2f791ce53f9da93405f29d923ba17e264 Mon Sep 17 00:00:00 2001 From: Mehdi Salemi Date: Thu, 5 Sep 2024 12:30:19 -0400 Subject: [PATCH 3/3] update bluejay version --- Cargo.lock | 15 +++++++++------ Cargo.toml | 6 +++--- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 14f6d6c..7c2393a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -231,8 +231,9 @@ dependencies = [ [[package]] name = "bluejay-core" -version = "0.1.0" -source = "git+https://github.com/Shopify/bluejay.git?rev=c7e7c2bfb73c7b4869aa8569c15cd3c4eb48b8bf#c7e7c2bfb73c7b4869aa8569c15cd3c4eb48b8bf" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a03c9b3ce5aa1393971fb135d27ece66a73661d88918e4464fa1ef588a8f92c8" dependencies = [ "enum-as-inner", "itertools 0.13.0", @@ -243,8 +244,9 @@ dependencies = [ [[package]] name = "bluejay-parser" -version = "0.1.0" -source = "git+https://github.com/Shopify/bluejay.git?rev=c7e7c2bfb73c7b4869aa8569c15cd3c4eb48b8bf#c7e7c2bfb73c7b4869aa8569c15cd3c4eb48b8bf" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc27971910f67bb01cf725ce7a1c3275c14a5b9a405f790e6e52f4d6f1b7c0e9" dependencies = [ "ariadne", "bluejay-core", @@ -256,8 +258,9 @@ dependencies = [ [[package]] name = "bluejay-validator" -version = "0.1.0" -source = "git+https://github.com/Shopify/bluejay.git?rev=c7e7c2bfb73c7b4869aa8569c15cd3c4eb48b8bf#c7e7c2bfb73c7b4869aa8569c15cd3c4eb48b8bf" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91d8ece464b30376d6179dc48d107a2d66d283bab986ce69f4eef1e370a40d7e" dependencies = [ "bluejay-core", "bluejay-parser", diff --git a/Cargo.toml b/Cargo.toml index d081332..9c28995 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,9 +34,9 @@ rust-embed = "8.5.0" rmp-serde = "1.3" is-terminal = "0.4.13" wasmprof = "0.7.0" -bluejay-parser = { git = "https://github.com/Shopify/bluejay.git", rev = "c7e7c2bfb73c7b4869aa8569c15cd3c4eb48b8bf", features = ["format-errors"] } -bluejay-core = { git = "https://github.com/Shopify/bluejay.git", rev = "c7e7c2bfb73c7b4869aa8569c15cd3c4eb48b8bf" } -bluejay-validator = { git = "https://github.com/Shopify/bluejay.git", rev = "c7e7c2bfb73c7b4869aa8569c15cd3c4eb48b8bf" } +bluejay-core = { version = "=0.2.0" } +bluejay-parser = { version = "=0.2.0" } +bluejay-validator = { version = "=0.2.0" } [dev-dependencies] assert_cmd = "2.0"