Skip to content

Commit 8365aa0

Browse files
authored
Merge branch 'main' into mog/showcase
2 parents 338455e + 78f90f6 commit 8365aa0

28 files changed

+334
-3901
lines changed

cloudflare/Cargo.lock

Lines changed: 0 additions & 3698 deletions
This file was deleted.

cloudflare/package-lock.json

Lines changed: 62 additions & 62 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cloudflare/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"scripts": {
66
"deploy": "npx wrangler deploy --minify",
7-
"publish": "npx wrangler publish --minify",
7+
"dev-debug": "npx wrangler dev --port 19194 --env debug",
88
"dev": "npx wrangler dev --port 19194",
99
"test": "cargo install -q worker-build && worker-build && vitest --run"
1010
},

cloudflare/wrangler.toml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
name = "tc-worker"
32
main = "build/worker/shim.mjs"
43
compatibility_date = "2023-03-22"
@@ -16,3 +15,14 @@ BUCKET = "MY_R2"
1615
binding = 'MY_R2' # this binding/name is to be used in code
1716
bucket_name = 'configs'
1817
preview_bucket_name = 'configs'
18+
19+
[env.debug.build]
20+
command = "cargo install -q worker-build && worker-build"
21+
22+
[env.debug.vars]
23+
BUCKET = "MY_R2"
24+
25+
[[env.debug.r2_buckets]]
26+
binding = 'MY_R2' # this binding/name is to be used in code
27+
bucket_name = 'configs'
28+
preview_bucket_name = 'configs'

src/blueprint/definitions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use crate::config::{Config, Field, GraphQLOperationType, Union};
1111
use crate::directive::DirectiveCodec;
1212
use crate::lambda::{Expression, Lambda};
1313
use crate::try_fold::TryFold;
14-
use crate::valid::Valid;
14+
use crate::valid::{Valid, Validator};
1515

1616
pub fn to_scalar_type_definition(name: &str) -> Valid<Definition, String> {
1717
Valid::succeed(Definition::ScalarTypeDefinition(ScalarTypeDefinition {

src/blueprint/from_config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::config::{Arg, Batch, Config, ConfigSet, Field};
77
use crate::json::JsonSchema;
88
use crate::lambda::{Expression, IO};
99
use crate::try_fold::TryFold;
10-
use crate::valid::{Valid, ValidationError};
10+
use crate::valid::{Valid, ValidationError, Validator};
1111

1212
pub fn config_blueprint<'a>() -> TryFold<'a, ConfigSet, Blueprint, String> {
1313
let server = TryFoldConfig::<Blueprint>::new(|config_set, blueprint| {

src/blueprint/mustache.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use super::{is_scalar, to_type, FieldDefinition, Type};
22
use crate::config::{self, Config};
33
use crate::lambda::{Expression, IO};
4-
use crate::valid::Valid;
4+
use crate::valid::{Valid, Validator};
55

66
struct MustachePartsValidator<'a> {
77
type_of: &'a config::Type,

src/blueprint/operation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::fmt::Write;
33
use async_graphql::dynamic::Schema;
44

55
use super::{Blueprint, SchemaModifiers};
6-
use crate::valid::{Cause, Valid};
6+
use crate::valid::{Cause, Valid, Validator};
77

88
#[derive(Debug)]
99
pub struct OperationQuery {

src/blueprint/operators/const_field.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::config::Field;
66
use crate::lambda::Expression;
77
use crate::lambda::Expression::Literal;
88
use crate::try_fold::TryFold;
9-
use crate::valid::Valid;
9+
use crate::valid::{Valid, Validator};
1010

1111
fn validate_data_with_schema(
1212
config: &config::Config,

src/blueprint/operators/expr.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use crate::config;
33
use crate::config::{ExprBody, Field, If};
44
use crate::lambda::{Expression, List, Logic, Math, Relation};
55
use crate::try_fold::TryFold;
6-
use crate::valid::Valid;
6+
use crate::valid::{Valid, Validator};
77

88
struct CompilationContext<'a> {
99
config_field: &'a config::Field,
@@ -78,9 +78,9 @@ fn compile(ctx: &CompilationContext, expr: ExprBody) -> Valid<Expression, String
7878
ExprBody::If(If { ref cond, on_true: ref then, on_false: ref els }) => {
7979
compile(ctx, *cond.clone())
8080
.map(Box::new)
81-
.zip(compile(ctx, *then.clone()).map(Box::new))
82-
.zip(compile(ctx, *els.clone()).map(Box::new))
83-
.map(|((cond, then), els)| {
81+
.fuse(compile(ctx, *then.clone()).map(Box::new))
82+
.fuse(compile(ctx, *els.clone()).map(Box::new))
83+
.map(|(cond, then, els)| {
8484
Expression::Logic(Logic::If { cond, then, els }).parallel_when(expr.has_io())
8585
})
8686
}
@@ -181,6 +181,7 @@ mod tests {
181181
use crate::config::{ConfigSet, Expr, Field, GraphQLOperationType};
182182
use crate::http::RequestContext;
183183
use crate::lambda::{Concurrent, Eval, EvaluationContext, ResolverContextLike};
184+
use crate::valid::Validator;
184185

185186
#[derive(Default)]
186187
struct Context<'a> {

0 commit comments

Comments
 (0)