From 5a245aae6be28705433dadbcfb0391c462889257 Mon Sep 17 00:00:00 2001 From: Sandipsinh Rathod Date: Wed, 20 Nov 2024 13:03:02 -0500 Subject: [PATCH] rename `tailcall-jq` to `tailcall-template` --- Cargo.lock | 34 +++++++++---------- Cargo.toml | 2 +- ...impl_path_string_for_evaluation_context.rs | 2 +- benches/request_template_bench.rs | 2 +- src/cli/generator/generator.rs | 2 +- src/cli/llm/infer_type_name.rs | 2 +- src/core/blueprint/dynamic_value.rs | 2 +- src/core/blueprint/operators/grpc.rs | 2 +- src/core/blueprint/operators/http.rs | 2 +- src/core/config/apollo.rs | 2 +- src/core/config/directives/telemetry.rs | 2 +- src/core/config/reader_context.rs | 2 +- src/core/config/transformer/subgraph.rs | 2 +- src/core/graphql/request_template.rs | 6 ++-- src/core/grpc/request_template.rs | 8 ++--- src/core/helpers/body.rs | 4 +-- src/core/helpers/headers.rs | 4 +-- src/core/helpers/url.rs | 4 +-- src/core/http/query_encoder.rs | 2 +- src/core/http/request_template.rs | 14 ++++---- src/core/path.rs | 4 +-- src/core/proto_reader/fetch.rs | 2 +- src/core/serde_value_ext.rs | 2 +- tests/expression_spec.rs | 2 +- 24 files changed, 55 insertions(+), 55 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 694c86511d..8fff1d1ca6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2852,7 +2852,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" dependencies = [ "cfg-if", - "windows-targets 0.52.6", + "windows-targets 0.48.5", ] [[package]] @@ -5526,9 +5526,9 @@ dependencies = [ "tailcall-fixtures", "tailcall-hasher", "tailcall-http-cache", - "tailcall-jq", "tailcall-macros", "tailcall-prettier", + "tailcall-template", "tailcall-tracker", "tailcall-typedefs-common", "tailcall-valid", @@ -5630,20 +5630,6 @@ dependencies = [ "url", ] -[[package]] -name = "tailcall-jq" -version = "0.1.0" -source = "git+https://github.com/tailcallhq/tailcall-jq#53b7d679d657887bee72acfea19cf225e0a52de0" -dependencies = [ - "anyhow", - "async-graphql", - "async-graphql-value", - "indexmap 2.6.0", - "nom 8.0.0-alpha2", - "serde_json", - "serde_json_borrow", -] - [[package]] name = "tailcall-macros" version = "0.1.0" @@ -5663,6 +5649,20 @@ dependencies = [ "tokio", ] +[[package]] +name = "tailcall-template" +version = "0.1.0" +source = "git+https://github.com/tailcallhq/tailcall-template#5cbe15c9bb9d34ee1674b774965aa7ed90922709" +dependencies = [ + "anyhow", + "async-graphql", + "async-graphql-value", + "indexmap 2.6.0", + "nom 8.0.0-alpha2", + "serde_json", + "serde_json_borrow", +] + [[package]] name = "tailcall-tracker" version = "0.1.0" @@ -6750,7 +6750,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.48.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 04fd12cc16..a3ae3a7650 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -174,7 +174,7 @@ tailcall-valid = { workspace = true } dashmap = "6.1.0" urlencoding = "2.1.3" tailcall-chunk = "0.2.5" -tailcall-jq = { git = "https://github.com/tailcallhq/tailcall-jq" } +tailcall-template = { git = "https://github.com/tailcallhq/tailcall-template" } # to build rquickjs bindings on systems without builtin bindings [target.'cfg(all(target_os = "windows", target_arch = "x86"))'.dependencies] diff --git a/benches/impl_path_string_for_evaluation_context.rs b/benches/impl_path_string_for_evaluation_context.rs index 29797d378a..d319252e6d 100644 --- a/benches/impl_path_string_for_evaluation_context.rs +++ b/benches/impl_path_string_for_evaluation_context.rs @@ -20,7 +20,7 @@ use tailcall::core::ir::{EvalContext, ResolverContextLike, SelectionField}; use tailcall::core::runtime::TargetRuntime; use tailcall::core::{EnvIO, FileIO, HttpIO}; use tailcall_http_cache::HttpCacheManager; -use tailcall_jq::mustache::path::PathString; +use tailcall_template::mustache::path::PathString; struct Http { client: ClientWithMiddleware, diff --git a/benches/request_template_bench.rs b/benches/request_template_bench.rs index 9f55e3cb96..701f4656f4 100644 --- a/benches/request_template_bench.rs +++ b/benches/request_template_bench.rs @@ -8,7 +8,7 @@ use tailcall::core::endpoint::Endpoint; use tailcall::core::has_headers::HasHeaders; use tailcall::core::http::RequestTemplate; use tailcall::core::json::JsonLike; -use tailcall_jq::mustache::path::{PathString, PathValue, ValueString}; +use tailcall_template::mustache::path::{PathString, PathValue, ValueString}; #[derive(Setters)] struct Context { diff --git a/src/cli/generator/generator.rs b/src/cli/generator/generator.rs index 4a44a15828..e8a56bc38d 100644 --- a/src/cli/generator/generator.rs +++ b/src/cli/generator/generator.rs @@ -4,7 +4,7 @@ use std::path::Path; use http::header::{HeaderMap, HeaderName, HeaderValue}; use inquire::Confirm; use pathdiff::diff_paths; -use tailcall_jq::mustache::Mustache; +use tailcall_template::mustache::Mustache; use tailcall_valid::{ValidateInto, Validator}; use super::config::{Config, LLMConfig, Resolved, Source}; diff --git a/src/cli/llm/infer_type_name.rs b/src/cli/llm/infer_type_name.rs index 0021a36248..1d4ee96271 100644 --- a/src/cli/llm/infer_type_name.rs +++ b/src/cli/llm/infer_type_name.rs @@ -4,7 +4,7 @@ use genai::chat::{ChatMessage, ChatRequest, ChatResponse}; use indexmap::{indexset, IndexSet}; use serde::{Deserialize, Serialize}; use serde_json::json; -use tailcall_jq::mustache::Mustache; +use tailcall_template::mustache::Mustache; use super::{Error, Result, Wizard}; use crate::core::config::Config; diff --git a/src/core/blueprint/dynamic_value.rs b/src/core/blueprint/dynamic_value.rs index 3ddf7b1965..8c700bac96 100644 --- a/src/core/blueprint/dynamic_value.rs +++ b/src/core/blueprint/dynamic_value.rs @@ -1,7 +1,7 @@ use async_graphql_value::{ConstValue, Name}; use indexmap::IndexMap; use serde_json::Value; -use tailcall_jq::mustache::{Mustache, Segment}; +use tailcall_template::mustache::{Mustache, Segment}; #[derive(Debug, Clone, PartialEq)] pub enum DynamicValue { diff --git a/src/core/blueprint/operators/grpc.rs b/src/core/blueprint/operators/grpc.rs index 21aa7359bf..10f0cf9177 100644 --- a/src/core/blueprint/operators/grpc.rs +++ b/src/core/blueprint/operators/grpc.rs @@ -2,7 +2,7 @@ use std::fmt::Display; use prost_reflect::prost_types::FileDescriptorSet; use prost_reflect::FieldDescriptor; -use tailcall_jq::mustache::Mustache; +use tailcall_template::mustache::Mustache; use tailcall_valid::{Valid, ValidationError, Validator}; use super::apply_select; diff --git a/src/core/blueprint/operators/http.rs b/src/core/blueprint/operators/http.rs index 1c88acf4b0..31fe75b57c 100644 --- a/src/core/blueprint/operators/http.rs +++ b/src/core/blueprint/operators/http.rs @@ -1,4 +1,4 @@ -use tailcall_jq::mustache::Mustache; +use tailcall_template::mustache::Mustache; use tailcall_valid::{Valid, ValidationError, Validator}; use crate::core::blueprint::*; diff --git a/src/core/config/apollo.rs b/src/core/config/apollo.rs index 2049f0fe1f..cef3ba9018 100644 --- a/src/core/config/apollo.rs +++ b/src/core/config/apollo.rs @@ -1,5 +1,5 @@ use serde::{Deserialize, Serialize}; -use tailcall_jq::mustache::Mustache; +use tailcall_template::mustache::Mustache; use crate::core::config::ConfigReaderContext; use crate::core::is_default; diff --git a/src/core/config/directives/telemetry.rs b/src/core/config/directives/telemetry.rs index 197b6ca5c7..9c889543d0 100644 --- a/src/core/config/directives/telemetry.rs +++ b/src/core/config/directives/telemetry.rs @@ -1,6 +1,6 @@ use anyhow::Result; use serde::{Deserialize, Serialize}; -use tailcall_jq::mustache::Mustache; +use tailcall_template::mustache::Mustache; use tailcall_macros::{DirectiveDefinition, InputDefinition}; use tailcall_valid::Validator; diff --git a/src/core/config/reader_context.rs b/src/core/config/reader_context.rs index 96ee4ceab2..4d6155cf44 100644 --- a/src/core/config/reader_context.rs +++ b/src/core/config/reader_context.rs @@ -2,7 +2,7 @@ use std::borrow::Cow; use std::collections::BTreeMap; use http::header::HeaderMap; -use tailcall_jq::mustache::path::PathString; +use tailcall_template::mustache::path::PathString; use crate::core::has_headers::HasHeaders; use crate::core::runtime::TargetRuntime; diff --git a/src/core/config/transformer/subgraph.rs b/src/core/config/transformer/subgraph.rs index 320b108eab..5cef63bfa3 100644 --- a/src/core/config/transformer/subgraph.rs +++ b/src/core/config/transformer/subgraph.rs @@ -4,7 +4,7 @@ use std::convert::identity; use std::fmt::{Display, Write}; use std::ops::Deref; -use tailcall_jq::mustache::{Mustache, Segment}; +use tailcall_template::mustache::{Mustache, Segment}; use tailcall_macros::MergeRight; use tailcall_valid::{Valid, Validator}; diff --git a/src/core/graphql/request_template.rs b/src/core/graphql/request_template.rs index 63b996b543..9ba036d477 100644 --- a/src/core/graphql/request_template.rs +++ b/src/core/graphql/request_template.rs @@ -6,8 +6,8 @@ use std::hash::{Hash, Hasher}; use derive_setters::Setters; use http::header::{HeaderMap, HeaderValue}; use tailcall_hasher::TailcallHasher; -use tailcall_jq::mustache::path::PathGraphql; -use tailcall_jq::mustache::Mustache; +use tailcall_template::mustache::path::PathGraphql; +use tailcall_template::mustache::Mustache; use crate::core::config::{GraphQLOperationType, KeyValue}; use crate::core::has_headers::HasHeaders; @@ -170,7 +170,7 @@ mod tests { use http::header::HeaderMap; use pretty_assertions::assert_eq; use serde_json::json; - use tailcall_jq::mustache::path::PathGraphql; + use tailcall_template::mustache::path::PathGraphql; use crate::core::config::GraphQLOperationType; use crate::core::graphql::request_template::RelatedFields; diff --git a/src/core/grpc/request_template.rs b/src/core/grpc/request_template.rs index 5f1d34637c..dacd123433 100644 --- a/src/core/grpc/request_template.rs +++ b/src/core/grpc/request_template.rs @@ -4,8 +4,8 @@ use anyhow::Result; use derive_setters::Setters; use http::header::{HeaderMap, HeaderValue, CONTENT_TYPE}; use tailcall_hasher::TailcallHasher; -use tailcall_jq::mustache::path::PathString; -use tailcall_jq::mustache::Mustache; +use tailcall_template::mustache::path::PathString; +use tailcall_template::mustache::Mustache; use url::Url; use super::request::create_grpc_request; @@ -136,8 +136,8 @@ mod tests { use http::Method; use pretty_assertions::assert_eq; use tailcall_fixtures::protobuf; - use tailcall_jq::mustache::path::PathString; - use tailcall_jq::mustache::Mustache; + use tailcall_template::mustache::path::PathString; + use tailcall_template::mustache::Mustache; use super::{RequestBody, RequestTemplate}; use crate::core::blueprint::GrpcMethod; diff --git a/src/core/helpers/body.rs b/src/core/helpers/body.rs index 2ce6ccddad..75eb3b44f7 100644 --- a/src/core/helpers/body.rs +++ b/src/core/helpers/body.rs @@ -1,5 +1,5 @@ use serde_json::Value; -use tailcall_jq::mustache::Mustache; +use tailcall_template::mustache::Mustache; use tailcall_valid::Valid; use crate::core::grpc::request_template::RequestBody; @@ -21,7 +21,7 @@ pub fn to_body(body: Option<&Value>) -> Valid, String> { #[cfg(test)] mod tests { - use tailcall_jq::mustache::Mustache; + use tailcall_template::mustache::Mustache; use tailcall_valid::Valid; use super::to_body; diff --git a/src/core/helpers/headers.rs b/src/core/helpers/headers.rs index 0989d46fd1..f50ea75d24 100644 --- a/src/core/helpers/headers.rs +++ b/src/core/helpers/headers.rs @@ -1,5 +1,5 @@ use http::header::HeaderName; -use tailcall_jq::mustache::Mustache; +use tailcall_template::mustache::Mustache; use tailcall_valid::{Valid, ValidationError, Validator}; use crate::core::config::KeyValue; @@ -25,7 +25,7 @@ pub fn to_mustache_headers(headers: &[KeyValue]) -> Valid Valid { @@ -7,7 +7,7 @@ pub fn to_url(url: &str) -> Valid { #[cfg(test)] mod tests { - use tailcall_jq::mustache::Mustache; + use tailcall_template::mustache::Mustache; use super::to_url; diff --git a/src/core/http/query_encoder.rs b/src/core/http/query_encoder.rs index 8548bb710f..f5da7850a6 100644 --- a/src/core/http/query_encoder.rs +++ b/src/core/http/query_encoder.rs @@ -1,4 +1,4 @@ -use tailcall_jq::mustache::path::ValueString; +use tailcall_template::mustache::path::ValueString; /// Defines different strategies for encoding query parameters. #[derive(Default, Debug, Clone)] diff --git a/src/core/http/request_template.rs b/src/core/http/request_template.rs index 77c8d3c4bb..1a86c80c9a 100644 --- a/src/core/http/request_template.rs +++ b/src/core/http/request_template.rs @@ -4,9 +4,9 @@ use std::hash::{Hash, Hasher}; use derive_setters::Setters; use http::header::{HeaderMap, HeaderValue}; use tailcall_hasher::TailcallHasher; -use tailcall_jq::mustache::eval::Eval; -use tailcall_jq::mustache::path::{PathString, PathValue, ValueString}; -use tailcall_jq::mustache::{Mustache, Segment}; +use tailcall_template::mustache::eval::Eval; +use tailcall_template::mustache::path::{PathString, PathValue, ValueString}; +use tailcall_template::mustache::{Mustache, Segment}; use url::Url; use super::query_encoder::QueryEncoder; @@ -311,8 +311,8 @@ mod tests { use http::header::{HeaderMap, HeaderName}; use pretty_assertions::assert_eq; use serde_json::json; - use tailcall_jq::mustache::path::{PathString, PathValue, ValueString}; - use tailcall_jq::mustache::Mustache; + use tailcall_template::mustache::path::{PathString, PathValue, ValueString}; + use tailcall_template::mustache::Mustache; use super::{Query, RequestTemplate}; use crate::core::has_headers::HasHeaders; @@ -778,7 +778,7 @@ mod tests { mod form_encoded_url { use serde_json::json; - use tailcall_jq::mustache::Mustache; + use tailcall_template::mustache::Mustache; use crate::core::http::request_template::tests::Context; use crate::core::http::RequestTemplate; @@ -842,7 +842,7 @@ mod tests { use http::header::HeaderMap; use serde_json::json; - use tailcall_jq::mustache::Mustache; + use tailcall_template::mustache::Mustache; use crate::core::http::request_template::tests::Context; use crate::core::http::RequestTemplate; diff --git a/src/core/path.rs b/src/core/path.rs index 9ae1d4f02c..ec2a62c050 100644 --- a/src/core/path.rs +++ b/src/core/path.rs @@ -3,7 +3,7 @@ use std::borrow::Cow; use serde_json::json; -use tailcall_jq::mustache::path::{PathGraphql, PathString, PathValue, ValueString}; +use tailcall_template::mustache::path::{PathGraphql, PathString, PathValue, ValueString}; use crate::core::ir::{EvalContext, ResolverContextLike}; @@ -99,7 +99,7 @@ mod tests { use http::header::{HeaderMap, HeaderValue}; use indexmap::IndexMap; use once_cell::sync::Lazy; - use tailcall_jq::mustache::path::{PathString, PathValue, ValueString}; + use tailcall_template::mustache::path::{PathString, PathValue, ValueString}; use crate::core::http::RequestContext; use crate::core::ir::{EvalContext, ResolverContextLike, SelectionField}; diff --git a/src/core/proto_reader/fetch.rs b/src/core/proto_reader/fetch.rs index bb8648d268..d63465d0bf 100644 --- a/src/core/proto_reader/fetch.rs +++ b/src/core/proto_reader/fetch.rs @@ -9,7 +9,7 @@ use prost::Message; use prost_reflect::prost_types::{FileDescriptorProto, FileDescriptorSet}; use serde::{Deserialize, Serialize}; use serde_json::json; -use tailcall_jq::mustache::Mustache; +use tailcall_template::mustache::Mustache; use crate::core::blueprint::GrpcMethod; use crate::core::config::{ConfigReaderContext, KeyValue}; diff --git a/src/core/serde_value_ext.rs b/src/core/serde_value_ext.rs index 4e05234379..07ce0a1fe4 100644 --- a/src/core/serde_value_ext.rs +++ b/src/core/serde_value_ext.rs @@ -2,7 +2,7 @@ use std::borrow::Cow; use async_graphql::{Name, Value as GraphQLValue}; use indexmap::IndexMap; -use tailcall_jq::mustache::path::PathString; +use tailcall_template::mustache::path::PathString; use crate::core::blueprint::DynamicValue; diff --git a/tests/expression_spec.rs b/tests/expression_spec.rs index d7420063a1..e623141018 100644 --- a/tests/expression_spec.rs +++ b/tests/expression_spec.rs @@ -7,7 +7,7 @@ mod tests { use tailcall::core::http::RequestContext; use tailcall::core::ir::model::IR; use tailcall::core::ir::{EmptyResolverContext, Error, EvalContext}; - use tailcall_jq::mustache::Mustache; + use tailcall_template::mustache::Mustache; async fn eval(expr: &IR) -> Result { let runtime = tailcall::cli::runtime::init(&Blueprint::default());