From f7b27f57f92d0a0879512f41abd551728ca388a1 Mon Sep 17 00:00:00 2001 From: j03-dev <24nomeniavo@gmail.com> Date: Wed, 18 Sep 2024 01:02:52 +0300 Subject: [PATCH 1/8] remplace all mkd inside docs --- .../docs/guides/external-functions/index.mdx | 10 +++++----- .../docs/guides/wasm-functions/index.mdx | 16 +++++++-------- .../reference/meta-cli/available-commands.mdx | 2 +- .../docs/reference/metagen/index.mdx | 20 +++++++++---------- .../docs/reference/runtimes/index.mdx | 2 +- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/docs/metatype.dev/docs/guides/external-functions/index.mdx b/docs/metatype.dev/docs/guides/external-functions/index.mdx index f994b8310d..c5ffb07300 100644 --- a/docs/metatype.dev/docs/guides/external-functions/index.mdx +++ b/docs/metatype.dev/docs/guides/external-functions/index.mdx @@ -104,7 +104,7 @@ metagen: targets: # named targets to configure a bunch of generators together metagen_deno: - - generator: mdk_typescript # generator to use + - generator: fdk_typescript # generator to use # path to generate to path: ./metagen/ts/ # point to the typegraph location @@ -126,23 +126,23 @@ This results in the following files. ❯ lsd --tree metagen  metagen └──  ts - └──  mdk.ts + └──  fdk.ts ``` -Within `mdk.ts` and the types and helpers, all the types from your typegraph should be there. Something like: +Within `fdk.ts` and the types and helpers, all the types from your typegraph should be there. Something like:
Code generation sample. Collapsed for aesthetic reasons.
-Note, this also include typescript function types for specific typegraph functions. By default, the `mdk_typescript` generator will only include stub function types for those defined on the `DenoRuntime` but this is [configurable](/docs/reference/metagen#mdk_typescript). +Note, this also include typescript function types for specific typegraph functions. By default, the `fdk_typescript` generator will only include stub function types for those defined on the `DenoRuntime` but this is [configurable](/docs/reference/metagen#fdk_typescript). We can then use these types in the following manner. Add the following snippet into `metagen/ts/remix.ts`. diff --git a/docs/metatype.dev/docs/guides/wasm-functions/index.mdx b/docs/metatype.dev/docs/guides/wasm-functions/index.mdx index 61424af88d..5f4c5af07b 100644 --- a/docs/metatype.dev/docs/guides/wasm-functions/index.mdx +++ b/docs/metatype.dev/docs/guides/wasm-functions/index.mdx @@ -39,14 +39,14 @@ Note that the `WasmRuntime` constructor mentions a non-existent wasm file on dis ## Metagen -We can now tackle the boilerplate. Metagen bundles the [`mdk_rust`](/docs/reference/metagen#mdk_rust) generator which can generate all the glue code along with Rust types that correspond to our typegraph types. Let's configure a metagen target in our configuration file to get just that done. +We can now tackle the boilerplate. Metagen bundles the [`fdk_rust`](/docs/reference/metagen#fdk_rust) generator which can generate all the glue code along with Rust types that correspond to our typegraph types. Let's configure a metagen target in our configuration file to get just that done. ```yaml metagen: targets: metagen_rs: # this is the generator we're interested in - - generator: mdk_rust + - generator: fdk_rust # the location where to put the generated files path: ./metagen/rs/ # the path to our typegraph @@ -66,10 +66,10 @@ This should give us the following files:  rs ├──  Cargo.toml ├──  lib.rs -└──  mdk.rs +└──  fdk.rs ``` -By default, the `mdk_rust` generator outputs all the necessary files required to build our wasm file. This includes the `Cargo.toml` manifest for our Rust crate. +By default, the `fdk_rust` generator outputs all the necessary files required to build our wasm file. This includes the `Cargo.toml` manifest for our Rust crate. { @@ -78,9 +78,9 @@ By default, the `mdk_rust` generator outputs all the necessary files required to } -`mdk_rust` will not overwrite a `Cargo.toml` file discovered at generation path so you can add other dependencies if need be. +`fdk_rust` will not overwrite a `Cargo.toml` file discovered at generation path so you can add other dependencies if need be. -The `mdk.rs` file contains all the glue code including the typegraph types. +The `fdk.rs` file contains all the glue code including the typegraph types.
@@ -89,7 +89,7 @@ The `mdk.rs` file contains all the glue code including the typegraph types. { - require("!!code-loader!../../../../../examples/typegraphs/metagen/rs/mdk.rs") + require("!!code-loader!../../../../../examples/typegraphs/metagen/rs/fdk.rs") .content } @@ -119,7 +119,7 @@ meta gen metagen_rs # variablize common names TARGET=wasm32-wasi -CRATE_NAME=metagen_rs_mdk +CRATE_NAME=metagen_rs_fdk # build in release mode for smallest sizes cargo build -p $CRATE_NAME --target $TARGET --release diff --git a/docs/metatype.dev/docs/reference/meta-cli/available-commands.mdx b/docs/metatype.dev/docs/reference/meta-cli/available-commands.mdx index de6a1b0596..b971a3960f 100644 --- a/docs/metatype.dev/docs/reference/meta-cli/available-commands.mdx +++ b/docs/metatype.dev/docs/reference/meta-cli/available-commands.mdx @@ -6,7 +6,7 @@ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- | | deploy |

meta deploy --target dev --file path/to/typegraph.py

meta --dir folder/to/typegraphs dev --run-destructive-migrations

| Deploy typegraph to a typegate instance | | undeploy |

meta undeploy --target dev --typegraph logs accounting services

| Undeploy typegraphs by name | -| gen |

meta gen mod --file path/to/typegraph.py

meta gen mdk
| Generate script or files that are used in your typegraph | +| gen |

meta gen mod --file path/to/typegraph.py

meta gen fdk
| Generate script or files that are used in your typegraph | | typegate |

meta typegate --quiet

| Access a minimal deno CLI | | dev |

meta dev

| Launch CLI in dev mode | diff --git a/docs/metatype.dev/docs/reference/metagen/index.mdx b/docs/metatype.dev/docs/reference/metagen/index.mdx index 69551b684c..3f9832b43e 100644 --- a/docs/metatype.dev/docs/reference/metagen/index.mdx +++ b/docs/metatype.dev/docs/reference/metagen/index.mdx @@ -30,20 +30,20 @@ metagen: targets: main: # generator to use - - generator: mdk_rust + - generator: fdk_rust # path to generate to path: ./bff/ # typegraph path to use typegraph_path: ./typegraphs/svc-bff.ts # we can have multiple generators per target - - generator: mdk_rust + - generator: fdk_rust path: ./telemetry/ typegraph_path: ./typegraphs/svc-telemetry.ts # generators might have custom keys stubbed_runtimes: ["wasm_wire", "deno"] # more than one targets avail if you need them iter: - - generator: mdk_typescript + - generator: fdk_typescript path: ./ts/ # name of typegraph to read from typegate typegraph: svc_products @@ -77,7 +77,7 @@ To resolve this concern, the SDKs support a serialization mode that skips resolu ::: -### `mdk_typescript` +### `fdk_typescript` This generator supports: @@ -110,7 +110,7 @@ Custom function:
@@ -121,14 +121,14 @@ It supports the following extra configuration keys. | ------------------ | ---------- | ---------- | ------------------------------------------ | | `stubbed_runtimes` | `string[]` | `["deno"]` | Runtimes for which to generate stub types. | -### `mdk_python` +### `fdk_python` This generator supports: - Python classes that map to typegraph types - Decorators for custom functions implementors that require adherance to typegraph function types. - By default, all functions from the `PythonRuntime` get stub types. - - TODO: `stubbed_runtimes` for `mdk_python` + - TODO: `stubbed_runtimes` for `fdk_python` - TODO: types for interacting with the typegate from within custom functions. If the referenced module for the custom function is not found, the generator will also output stub implementation (in addition to the types) at the given type. It will not replace our code on a second run. @@ -160,7 +160,7 @@ Custom function: /> -### `mdk_rust` +### `fdk_rust` This generator generates types, serializers and bindings needed to implement custom functions in Rust. Rust implementations will need to be compiled to wasm components to be executed on the metatype platform and the generator assumes such usage. @@ -200,7 +200,7 @@ Custom function: Code generation sample. { - require("!!code-loader!../../../../../examples/typegraphs/metagen/rs/mdk.rs") + require("!!code-loader!../../../../../examples/typegraphs/metagen/rs/fdk.rs") .content } @@ -211,6 +211,6 @@ It supports the following extra configuration keys. | Key | Type | Default | Description | | ------------------ | ---------- | ---------------------- | ----------------------------------------------------- | | `stubbed_runtimes` | `string[]` | `["wasm_wire"]` | Runtimes for which to generate stub types. | -| `crate_name` | `string` | `${typegraphName}_mdk` | Name to assign to crate when generating `Cargo.toml`. | +| `crate_name` | `string` | `${typegraphName}_fdk` | Name to assign to crate when generating `Cargo.toml`. | | `skip_cargo_toml` | `boolean` | `false` | Do not generate `Cargo.toml`. | | `skip_lib_rs` | `boolean` | `false` | Do not generate `lib.rs`, the sample entrypoint. | diff --git a/docs/metatype.dev/docs/reference/runtimes/index.mdx b/docs/metatype.dev/docs/reference/runtimes/index.mdx index 25fe025e56..7bbee2b274 100644 --- a/docs/metatype.dev/docs/reference/runtimes/index.mdx +++ b/docs/metatype.dev/docs/reference/runtimes/index.mdx @@ -36,4 +36,4 @@ This includes: ## Custom embedded runtimes This describes any user defined runtimes, you can write your own runtime logic and package it along with your typegraph.\ -This type of runtime refers to any runtime that uses the materializer development kit, which can be generated from the `meta gen mdk` command. +This type of runtime refers to any runtime that uses the materializer development kit, which can be generated from the `meta gen fdk` command. From 9a170c6246b026506fd46ee192d9e8ce451e7d73 Mon Sep 17 00:00:00 2001 From: j03-dev <24nomeniavo@gmail.com> Date: Wed, 18 Sep 2024 15:26:09 +0300 Subject: [PATCH 2/8] rename mdk -> fdk --- Cargo.lock | 2 +- Cargo.toml | 2 +- examples/metatype.yaml | 6 +- examples/typegraphs/metagen-deno.py | 2 +- examples/typegraphs/metagen-deno.ts | 6 +- examples/typegraphs/metagen-sdk.py | 4 +- examples/typegraphs/metagen-sdk.ts | 10 +-- examples/typegraphs/metagen/Cargo.lock | 2 +- examples/typegraphs/metagen/rs/Cargo.toml | 4 +- examples/typegraphs/metagen/rs/build.sh | 2 +- .../typegraphs/metagen/rs/{mdk.rs => fdk.rs} | 0 examples/typegraphs/metagen/rs/lib.rs | 4 +- .../typegraphs/metagen/ts/{mdk.ts => fdk.ts} | 0 examples/typegraphs/metagen/ts/remix.ts | 6 +- .../cli/{mdk_template.rs => fdk_template.rs} | 12 +-- src/meta-cli/src/cli/gen.rs | 12 +-- src/meta-cli/src/cli/mod.rs | 6 +- src/metagen/src/client_py/mod.rs | 4 +- src/metagen/src/client_rs/mod.rs | 10 +-- src/metagen/src/client_ts/mod.rs | 8 +- src/metagen/src/config.rs | 10 +-- .../src/{mdk_python => fdk_python}/mod.rs | 22 +++--- .../static/main.py.jinja | 0 .../static/struct.py.jinja | 0 .../static/types.py.jinja | 0 .../src/{mdk_python => fdk_python}/types.rs | 0 .../src/{mdk_python => fdk_python}/utils.rs | 0 src/metagen/src/{mdk_rust => fdk_rust}/mod.rs | 66 ++++++++--------- .../{mdk_rust => fdk_rust}/static/Cargo.toml | 2 +- .../static/mdk.rs => fdk_rust/static/fdk.rs} | 0 .../src/{mdk_rust => fdk_rust}/static/lib.rs | 2 +- .../src/{mdk_rust => fdk_rust}/stubs.rs | 14 ++-- .../src/{mdk_rust => fdk_rust}/types.rs | 0 .../src/{mdk_rust => fdk_rust}/utils.rs | 0 .../mod.rs | 12 +-- .../static/substantial.py | 0 .../static/types.py | 0 .../static/workflow.py | 0 .../{mdk_typescript => fdk_typescript}/mod.rs | 74 +++++++++---------- .../mdk.ts => fdk_typescript/static/fdk.ts} | 0 .../types.rs | 0 .../utils.rs | 0 src/metagen/src/lib.rs | 46 ++++++------ src/metagen/src/shared/mod.rs | 4 +- src/metagen/src/tests/mod.rs | 12 +-- src/typegraph/core/src/utils/metagen_utils.rs | 8 +- 46 files changed, 187 insertions(+), 187 deletions(-) rename examples/typegraphs/metagen/rs/{mdk.rs => fdk.rs} (100%) rename examples/typegraphs/metagen/ts/{mdk.ts => fdk.ts} (100%) rename src/meta-cli/src/cli/{mdk_template.rs => fdk_template.rs} (75%) rename src/metagen/src/{mdk_python => fdk_python}/mod.rs (95%) rename src/metagen/src/{mdk_python => fdk_python}/static/main.py.jinja (100%) rename src/metagen/src/{mdk_python => fdk_python}/static/struct.py.jinja (100%) rename src/metagen/src/{mdk_python => fdk_python}/static/types.py.jinja (100%) rename src/metagen/src/{mdk_python => fdk_python}/types.rs (100%) rename src/metagen/src/{mdk_python => fdk_python}/utils.rs (100%) rename src/metagen/src/{mdk_rust => fdk_rust}/mod.rs (88%) rename src/metagen/src/{mdk_rust => fdk_rust}/static/Cargo.toml (85%) rename src/metagen/src/{mdk_rust/static/mdk.rs => fdk_rust/static/fdk.rs} (100%) rename src/metagen/src/{mdk_rust => fdk_rust}/static/lib.rs (92%) rename src/metagen/src/{mdk_rust => fdk_rust}/stubs.rs (94%) rename src/metagen/src/{mdk_rust => fdk_rust}/types.rs (100%) rename src/metagen/src/{mdk_rust => fdk_rust}/utils.rs (100%) rename src/metagen/src/{mdk_substantial => fdk_substantial}/mod.rs (90%) rename src/metagen/src/{mdk_substantial => fdk_substantial}/static/substantial.py (100%) rename src/metagen/src/{mdk_substantial => fdk_substantial}/static/types.py (100%) rename src/metagen/src/{mdk_substantial => fdk_substantial}/static/workflow.py (100%) rename src/metagen/src/{mdk_typescript => fdk_typescript}/mod.rs (80%) rename src/metagen/src/{mdk_typescript/static/mdk.ts => fdk_typescript/static/fdk.ts} (100%) rename src/metagen/src/{mdk_typescript => fdk_typescript}/types.rs (100%) rename src/metagen/src/{mdk_typescript => fdk_typescript}/utils.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index eaea7011fd..819619ea1c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6822,7 +6822,7 @@ dependencies = [ ] [[package]] -name = "metagen_mdk_rust_static" +name = "metagen_fdk_rust_static" version = "0.0.1" dependencies = [ "anyhow", diff --git a/Cargo.toml b/Cargo.toml index 736c0e5eae..49aefaf539 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ members = [ "src/common", "src/meta-cli", "src/metagen", - "src/metagen/src/mdk_rust/static", + "src/metagen/src/fdk_rust/static", "src/mt_deno", "src/typegate/engine", "src/typegate/standalone", diff --git a/examples/metatype.yaml b/examples/metatype.yaml index fbe6b373ee..4e1508f8db 100644 --- a/examples/metatype.yaml +++ b/examples/metatype.yaml @@ -168,14 +168,14 @@ typegraphs: metagen: targets: metagen_deno: - - generator: mdk_typescript + - generator: fdk_typescript path: ./typegraphs/metagen/ts/ typegraph_path: ./typegraphs/metagen-deno.ts metagen_py: - - generator: mdk_python + - generator: fdk_python path: ./typegraphs/metagen/py/ typegraph_path: ./typegraphs/metagen-py.ts metagen_rs: - - generator: mdk_rust + - generator: fdk_rust path: ./typegraphs/metagen/rs/ typegraph_path: ./typegraphs/metagen-rs.ts diff --git a/examples/typegraphs/metagen-deno.py b/examples/typegraphs/metagen-deno.py index 3d03217905..7ef4e8bce7 100644 --- a/examples/typegraphs/metagen-deno.py +++ b/examples/typegraphs/metagen-deno.py @@ -28,7 +28,7 @@ def metagen_deno(g: Graph): idv3, idv3, module="./metagen/ts/remix.ts", - deps=["./metagen/ts/mdk.ts"], + deps=["./metagen/ts/fdk.ts"], name="remix_track", ).rename("remix_track"), # explicit names help ) diff --git a/examples/typegraphs/metagen-deno.ts b/examples/typegraphs/metagen-deno.ts index 35072302f4..ac3bf3d9b0 100644 --- a/examples/typegraphs/metagen-deno.ts +++ b/examples/typegraphs/metagen-deno.ts @@ -27,12 +27,12 @@ await typegraph( remix: deno .import(idv3, idv3, { module: "./metagen/ts/remix.ts", - deps: ["./metagen/ts/mdk.ts"], + deps: ["./metagen/ts/fdk.ts"], name: "remix_track", }) .rename("remix_track"), // explicit names help }, - Policy.public() + Policy.public(), ); - } + }, ); diff --git a/examples/typegraphs/metagen-sdk.py b/examples/typegraphs/metagen-sdk.py index a9cddb8195..a4fc2cbbc8 100644 --- a/examples/typegraphs/metagen-sdk.py +++ b/examples/typegraphs/metagen-sdk.py @@ -30,7 +30,7 @@ def metagen_sdk(g: Graph): idv3, idv3, module="./metagen/ts/remix.ts", - deps=["./metagen/ts/mdk.ts"], + deps=["./metagen/ts/fdk.ts"], name="remix_track", ).rename("remix_track"), ) @@ -45,7 +45,7 @@ def metagen_sdk(g: Graph): "targets": { "main": [ { - "generator": "mdk_typescript", + "generator": "fdk_typescript", "typegraph_path": __file__, "path": "funcs/", }, diff --git a/examples/typegraphs/metagen-sdk.ts b/examples/typegraphs/metagen-sdk.ts index 3229e69ee2..4e429514fa 100644 --- a/examples/typegraphs/metagen-sdk.ts +++ b/examples/typegraphs/metagen-sdk.ts @@ -28,14 +28,14 @@ const tg = await typegraph( remix: deno .import(idv3, idv3, { module: "./metagen/ts/remix.ts", - deps: ["./metagen/ts/mdk.ts"], + deps: ["./metagen/ts/fdk.ts"], name: "remix_track", }) .rename("remix_track"), }, - Policy.public() + Policy.public(), ); - } + }, ); if (false) { @@ -48,13 +48,13 @@ if (false) { targets: { main: [ { - generator: "mdk_typescript", + generator: "fdk_typescript", typegraph_path: myPath, path: "funcs/", }, ], }, - } + }, ); // dry_run doesn't write to disk metagen.dryRun(tg, "main"); diff --git a/examples/typegraphs/metagen/Cargo.lock b/examples/typegraphs/metagen/Cargo.lock index 2fe92e6192..9175cd3c7b 100644 --- a/examples/typegraphs/metagen/Cargo.lock +++ b/examples/typegraphs/metagen/Cargo.lock @@ -71,7 +71,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] -name = "metagen_rs_mdk" +name = "metagen_rs_fdk" version = "0.0.1" dependencies = [ "anyhow", diff --git a/examples/typegraphs/metagen/rs/Cargo.toml b/examples/typegraphs/metagen/rs/Cargo.toml index 8160994c53..6617dc94fe 100644 --- a/examples/typegraphs/metagen/rs/Cargo.toml +++ b/examples/typegraphs/metagen/rs/Cargo.toml @@ -1,4 +1,4 @@ -package.name = "metagen_rs_mdk" +package.name = "metagen_rs_fdk" package.edition = "2021" package.version = "0.0.1" @@ -15,7 +15,7 @@ serde = { version = "1", features = ["derive"] } # serialization serde_json = "1" #json serialization wit-bindgen = "0.22.0" # wasm component biding -# we set the following flags to minimize code size +# we set the following flags to minimize code size # when buliding in the release mode # this keeps our wasm files small [profile.release] diff --git a/examples/typegraphs/metagen/rs/build.sh b/examples/typegraphs/metagen/rs/build.sh index caad858886..f9bf59b8d3 100644 --- a/examples/typegraphs/metagen/rs/build.sh +++ b/examples/typegraphs/metagen/rs/build.sh @@ -9,7 +9,7 @@ ADAPTOR="../../../../.metatype/wasi_snapshot_preview1.reactor.wasm" [ -f "$ADAPTOR" ] || ghjk x install-wasi-adapter TARGET=wasm32-wasi -CRATE_NAME=metagen_rs_mdk +CRATE_NAME=metagen_rs_fdk cargo build -p $CRATE_NAME --target $TARGET # --release # wasm-opt --enable-bulk-memory -Oz ./target/$TARGET/release/rust.wasm -o ./target/rust-component.wasm.opt wasm-tools component new \ diff --git a/examples/typegraphs/metagen/rs/mdk.rs b/examples/typegraphs/metagen/rs/fdk.rs similarity index 100% rename from examples/typegraphs/metagen/rs/mdk.rs rename to examples/typegraphs/metagen/rs/fdk.rs diff --git a/examples/typegraphs/metagen/rs/lib.rs b/examples/typegraphs/metagen/rs/lib.rs index f1b2178f6c..b880b9581c 100644 --- a/examples/typegraphs/metagen/rs/lib.rs +++ b/examples/typegraphs/metagen/rs/lib.rs @@ -1,5 +1,5 @@ -mod mdk; -pub use mdk::*; +mod fdk; +pub use fdk::*; // the macro sets up all the glue init_mat! { diff --git a/examples/typegraphs/metagen/ts/mdk.ts b/examples/typegraphs/metagen/ts/fdk.ts similarity index 100% rename from examples/typegraphs/metagen/ts/mdk.ts rename to examples/typegraphs/metagen/ts/fdk.ts diff --git a/examples/typegraphs/metagen/ts/remix.ts b/examples/typegraphs/metagen/ts/remix.ts index 8c51abe076..0d0ecbac02 100644 --- a/examples/typegraphs/metagen/ts/remix.ts +++ b/examples/typegraphs/metagen/ts/remix.ts @@ -1,4 +1,4 @@ -import type { RemixTrackHandler, Ctx, Idv3 } from "./mdk.ts" +import type { RemixTrackHandler, Ctx, Idv3 } from "./fdk.ts"; // the name of the export must match the one referred int he typegraph export const remix_track: RemixTrackHandler = (inp, cx: Ctx) => { @@ -7,7 +7,7 @@ export const remix_track: RemixTrackHandler = (inp, cx: Ctx) => { artist: `${inp.artist} + DJ Cloud`, releaseTime: new Date().toISOString(), // S3Runtime could be used to really provide this service - mp3Url: `${cx.meta.url}/get_mp3` + mp3Url: `${cx.meta.url}/get_mp3`, }; return out; -} +}; diff --git a/src/meta-cli/src/cli/mdk_template.rs b/src/meta-cli/src/cli/fdk_template.rs similarity index 75% rename from src/meta-cli/src/cli/mdk_template.rs rename to src/meta-cli/src/cli/fdk_template.rs index 798bef5929..7d363f114d 100644 --- a/src/meta-cli/src/cli/mdk_template.rs +++ b/src/meta-cli/src/cli/fdk_template.rs @@ -13,7 +13,7 @@ enum Template { } #[derive(Parser, Debug)] -pub struct CreateMdkTemplate { +pub struct CreateFdkTemplate { /// Target directory #[clap(long)] dir: String, @@ -24,20 +24,20 @@ pub struct CreateMdkTemplate { } #[async_trait] -impl Action for CreateMdkTemplate { +impl Action for CreateFdkTemplate { #[tracing::instrument] async fn run(&self, args: ConfigArgs) -> Result<()> { let dir = args.dir()?.join(&self.dir); - tracing::info!("creating mdk template at {:?}", dir); + tracing::info!("creating fdk template at {:?}", dir); tokio::fs::create_dir_all(&dir) .await .context("failed to create target directory")?; let template = match self.template { - Template::Rust => metagen::MDK_RUST_DEFAULT_TEMPLATE, - Template::Python => metagen::MDK_PYTHON_DEFAULT_TEMPLATE, - Template::Typescript => metagen::MDK_TYPESCRIPT_DEFAULT_TEMPLATE, + Template::Rust => metagen::FDK_RUST_DEFAULT_TEMPLATE, + Template::Python => metagen::FDK_PYTHON_DEFAULT_TEMPLATE, + Template::Typescript => metagen::FDK_TYPESCRIPT_DEFAULT_TEMPLATE, }; for (file_name, content) in template.iter() { diff --git a/src/meta-cli/src/cli/gen.rs b/src/meta-cli/src/cli/gen.rs index 373460664a..88f2974a04 100644 --- a/src/meta-cli/src/cli/gen.rs +++ b/src/meta-cli/src/cli/gen.rs @@ -107,10 +107,10 @@ struct MetagenCtx { dir: PathBuf, } -async fn load_mdk_template( +async fn load_fdk_template( default: &[(&'static str, &'static str)], template_dir: Option<&std::path::Path>, -) -> anyhow::Result { +) -> anyhow::Result { let mut group = FutureGroup::new(); for (file_name, content) in default.iter() { // TODO absolute path? @@ -135,7 +135,7 @@ async fn load_mdk_template( let (file_name, content) = res?; entries.insert(file_name, content); } - Ok(MdkTemplate { entries }) + Ok(FdkTemplate { entries }) } impl InputResolver for MetagenCtx { @@ -161,12 +161,12 @@ impl InputResolver for MetagenCtx { let raw = load_tg_at(config, path, name.as_deref()).await?; GeneratorInputResolved::TypegraphFromTypegate { raw } } - GeneratorInputOrder::LoadMdkTemplate { + GeneratorInputOrder::LoadFdkTemplate { default, override_path, } => { - let template = load_mdk_template(default, override_path.as_deref()).await?; - GeneratorInputResolved::MdkTemplate { template } + let template = load_fdk_template(default, override_path.as_deref()).await?; + GeneratorInputResolved::FdkTemplate { template } } }) } diff --git a/src/meta-cli/src/cli/mod.rs b/src/meta-cli/src/cli/mod.rs index 4e5fdf8c26..dd405d3cc9 100644 --- a/src/meta-cli/src/cli/mod.rs +++ b/src/meta-cli/src/cli/mod.rs @@ -17,9 +17,9 @@ pub(crate) mod completion; pub(crate) mod deploy; pub(crate) mod dev; pub(crate) mod doctor; +pub(crate) mod fdk_template; pub(crate) mod gen; pub(crate) mod list; -pub(crate) mod mdk_template; pub(crate) mod new; pub(crate) mod serialize; pub(crate) mod typegate; @@ -88,8 +88,8 @@ pub(crate) enum Commands { Doctor(doctor::Doctor), /// Create a new Metatype project New(new::New), - /// Dump the default mdk template - MdkTemplate(mdk_template::CreateMdkTemplate), + /// Dump the default fdk template + FdkTemplate(fdk_template::CreateFdkTemplate), /// Access a minimal deno CLI Typegate(typegate::Typegate), } diff --git a/src/metagen/src/client_py/mod.rs b/src/metagen/src/client_py/mod.rs index 025476c44e..eed6d56140 100644 --- a/src/metagen/src/client_py/mod.rs +++ b/src/metagen/src/client_py/mod.rs @@ -25,7 +25,7 @@ use utils::normalize_type_title; pub struct ClienPyGenConfig { #[serde(flatten)] #[garde(dive)] - pub base: crate::config::MdkGeneratorConfigBase, + pub base: crate::config::FdkGeneratorConfigBase, } impl ClienPyGenConfig { @@ -315,7 +315,7 @@ fn e2e() -> anyhow::Result<()> { [GeneratorConfig { generator_name: "client_py".to_string(), other: serde_json::to_value(client_py::ClienPyGenConfig { - base: config::MdkGeneratorConfigBase { + base: config::FdkGeneratorConfigBase { typegraph_name: Some(tg_name.into()), typegraph_path: None, // NOTE: root will map to the test's tempdir diff --git a/src/metagen/src/client_rs/mod.rs b/src/metagen/src/client_rs/mod.rs index 3f2a9e03ef..e6c9737c69 100644 --- a/src/metagen/src/client_rs/mod.rs +++ b/src/metagen/src/client_rs/mod.rs @@ -12,7 +12,7 @@ use shared::get_gql_type; use crate::interlude::*; use crate::*; -use crate::mdk_rust::utils; +use crate::fdk_rust::utils; use crate::shared::client::*; use crate::shared::types::NameMemo; use crate::shared::types::TypeRenderer; @@ -23,7 +23,7 @@ use utils::normalize_type_title; pub struct ClienRsGenConfig { #[serde(flatten)] #[garde(dive)] - pub base: crate::config::MdkGeneratorConfigBase, + pub base: crate::config::FdkGeneratorConfigBase, #[garde(length(min = 1))] crate_name: Option, #[garde(skip)] @@ -220,7 +220,7 @@ impl QueryGraph {{ let args_row = match &arg_ty { Some(arg_ty) => format!( - " + " args: impl Into>" ), None => "".into(), @@ -305,7 +305,7 @@ fn render_data_types( ) -> anyhow::Result { let mut renderer = TypeRenderer::new( name_mapper.nodes.clone(), - Rc::new(mdk_rust::types::RustTypeRenderer { + Rc::new(fdk_rust::types::RustTypeRenderer { derive_debug: true, derive_serde: true, all_fields_optional: true, @@ -459,7 +459,7 @@ fn e2e() -> anyhow::Result<()> { skip_cargo_toml: None, skip_lib_rs: Some(true), crate_name: None, - base: config::MdkGeneratorConfigBase { + base: config::FdkGeneratorConfigBase { typegraph_name: Some(tg_name.into()), typegraph_path: None, // NOTE: root will map to the test's tempdir diff --git a/src/metagen/src/client_ts/mod.rs b/src/metagen/src/client_ts/mod.rs index 0afb5541e1..4f796ed47a 100644 --- a/src/metagen/src/client_ts/mod.rs +++ b/src/metagen/src/client_ts/mod.rs @@ -12,7 +12,7 @@ use shared::get_gql_type; use crate::interlude::*; use crate::*; -use crate::mdk_typescript::utils; +use crate::fdk_typescript::utils; use crate::shared::client::*; use crate::shared::types::NameMemo; use crate::shared::types::TypeRenderer; @@ -23,7 +23,7 @@ use utils::normalize_type_title; pub struct ClienTsGenConfig { #[serde(flatten)] #[garde(dive)] - pub base: crate::config::MdkGeneratorConfigBase, + pub base: crate::config::FdkGeneratorConfigBase, } impl ClienTsGenConfig { @@ -230,7 +230,7 @@ fn render_data_types( ) -> anyhow::Result { let mut renderer = TypeRenderer::new( name_mapper.nodes.clone(), - Rc::new(mdk_typescript::types::TypescriptTypeRenderer {}), + Rc::new(fdk_typescript::types::TypescriptTypeRenderer {}), ); for &id in &manifest.arg_types { _ = renderer.render(id)?; @@ -322,7 +322,7 @@ fn e2e() -> anyhow::Result<()> { [GeneratorConfig { generator_name: "client_ts".to_string(), other: serde_json::to_value(client_ts::ClienTsGenConfig { - base: config::MdkGeneratorConfigBase { + base: config::FdkGeneratorConfigBase { typegraph_name: Some(tg_name.into()), typegraph_path: None, // NOTE: root will map to the test's tempdir diff --git a/src/metagen/src/config.rs b/src/metagen/src/config.rs index dd8c1da1d5..6aa13a8565 100644 --- a/src/metagen/src/config.rs +++ b/src/metagen/src/config.rs @@ -4,15 +4,15 @@ //! Sample yaml: //! ```yaml //! generators: # this section only required when we support external generators -//! - mdk_rust -//! - mdk_ts +//! - fdk_rust +//! - fdk_ts //! - xgraph_ts //! - name: my_custom //! wasm_module: wasm.io/custom_gen //! targets: //! default: //! # config for any configured generatour under this name -//! generator: mdk_rust +//! generator: fdk_rust //! typegraph: console //! path: ./mats/gen //! annotate_debug: true @@ -38,7 +38,7 @@ pub struct GeneratorConfig { /// If both name and path are set, name is used to disambiguate /// from multiple typegrpahs loaded from file at path. #[derive(Serialize, Deserialize, Debug, garde::Validate)] -pub struct MdkGeneratorConfigBase { +pub struct FdkGeneratorConfigBase { #[garde(length(min = 1))] #[serde(rename = "typegraph")] #[garde(custom(|_, _| either_typegraph_name_or_path(self)))] @@ -52,7 +52,7 @@ pub struct MdkGeneratorConfigBase { pub template_dir: Option, } -fn either_typegraph_name_or_path(config: &MdkGeneratorConfigBase) -> garde::Result { +fn either_typegraph_name_or_path(config: &FdkGeneratorConfigBase) -> garde::Result { if config.typegraph_name.is_none() && config.typegraph_path.is_none() { Err(garde::Error::new( "either typegraph or typegraph_path must be set", diff --git a/src/metagen/src/mdk_python/mod.rs b/src/metagen/src/fdk_python/mod.rs similarity index 95% rename from src/metagen/src/mdk_python/mod.rs rename to src/metagen/src/fdk_python/mod.rs index ede9dfbe88..2a3c9d65a5 100644 --- a/src/metagen/src/mdk_python/mod.rs +++ b/src/metagen/src/fdk_python/mod.rs @@ -28,15 +28,15 @@ pub const DEFAULT_TEMPLATE: &[(&str, &str)] = &[ ]; #[derive(Serialize, Deserialize, Debug, garde::Validate)] -pub struct MdkPythonGenConfig { +pub struct FdkPythonGenConfig { #[serde(flatten)] #[garde(dive)] - pub base: crate::config::MdkGeneratorConfigBase, + pub base: crate::config::FdkGeneratorConfigBase, } -impl MdkPythonGenConfig { +impl FdkPythonGenConfig { pub fn from_json(json: serde_json::Value, workspace_path: &Path) -> anyhow::Result { - let mut config: mdk_python::MdkPythonGenConfig = serde_json::from_value(json)?; + let mut config: FdkPythonGenConfig = serde_json::from_value(json)?; config.base.path = workspace_path.join(config.base.path); config.base.typegraph_path = config .base @@ -48,25 +48,25 @@ impl MdkPythonGenConfig { } pub struct Generator { - config: MdkPythonGenConfig, + config: FdkPythonGenConfig, } impl Generator { pub const INPUT_TG: &'static str = "tg_name"; - pub fn new(config: MdkPythonGenConfig) -> anyhow::Result { + pub fn new(config: FdkPythonGenConfig) -> anyhow::Result { use garde::Validate; config .validate(&()) - .context("validating MDK_PYTHON config")?; + .context("validating FDK_PYTHON config")?; Ok(Self { config }) } } -impl TryFrom for tera::Tera { +impl TryFrom for tera::Tera { type Error = anyhow::Error; - fn try_from(template: MdkTemplate) -> Result { + fn try_from(template: FdkTemplate) -> Result { let mut tera = Self::default(); for (file_name, content) in template.entries { tera.add_raw_template(file_name, &content)?; @@ -95,7 +95,7 @@ impl crate::Plugin for Generator { .into_iter() .chain(std::iter::once(( "template_dir".to_string(), - GeneratorInputOrder::LoadMdkTemplate { + GeneratorInputOrder::LoadFdkTemplate { default: DEFAULT_TEMPLATE, override_path: self.config.base.template_dir.clone(), }, @@ -118,7 +118,7 @@ impl crate::Plugin for Generator { }; let template: tera::Tera = match inputs.remove("template_dir").unwrap() { - GeneratorInputResolved::MdkTemplate { template } => template.try_into()?, + GeneratorInputResolved::FdkTemplate { template } => template.try_into()?, _ => unreachable!(), }; diff --git a/src/metagen/src/mdk_python/static/main.py.jinja b/src/metagen/src/fdk_python/static/main.py.jinja similarity index 100% rename from src/metagen/src/mdk_python/static/main.py.jinja rename to src/metagen/src/fdk_python/static/main.py.jinja diff --git a/src/metagen/src/mdk_python/static/struct.py.jinja b/src/metagen/src/fdk_python/static/struct.py.jinja similarity index 100% rename from src/metagen/src/mdk_python/static/struct.py.jinja rename to src/metagen/src/fdk_python/static/struct.py.jinja diff --git a/src/metagen/src/mdk_python/static/types.py.jinja b/src/metagen/src/fdk_python/static/types.py.jinja similarity index 100% rename from src/metagen/src/mdk_python/static/types.py.jinja rename to src/metagen/src/fdk_python/static/types.py.jinja diff --git a/src/metagen/src/mdk_python/types.rs b/src/metagen/src/fdk_python/types.rs similarity index 100% rename from src/metagen/src/mdk_python/types.rs rename to src/metagen/src/fdk_python/types.rs diff --git a/src/metagen/src/mdk_python/utils.rs b/src/metagen/src/fdk_python/utils.rs similarity index 100% rename from src/metagen/src/mdk_python/utils.rs rename to src/metagen/src/fdk_python/utils.rs diff --git a/src/metagen/src/mdk_rust/mod.rs b/src/metagen/src/fdk_rust/mod.rs similarity index 88% rename from src/metagen/src/mdk_rust/mod.rs rename to src/metagen/src/fdk_rust/mod.rs index 3759f56bc1..368e70a5dd 100644 --- a/src/metagen/src/mdk_rust/mod.rs +++ b/src/metagen/src/fdk_rust/mod.rs @@ -1,11 +1,11 @@ // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. // SPDX-License-Identifier: MPL-2.0 -//! Generates typegraph types and mdk interface for rust. +//! Generates typegraph types and fdk interface for rust. //! - dir/Cargo.toml //! - Will not be replaced on second generation. -//! - dir/mdk.rs -//! - Contains generated types and mdk interface. +//! - dir/fdk.rs +//! - Contains generated types and fdk interface. //! - dir/lib.rs //! - Some directions to get the user started. //! - Will not be replaced on second generation. @@ -21,13 +21,13 @@ use crate::*; use std::borrow::Cow; use std::fmt::Write; -pub const DEFAULT_TEMPLATE: &[(&str, &str)] = &[("mdk.rs", include_str!("static/mdk.rs"))]; +pub const DEFAULT_TEMPLATE: &[(&str, &str)] = &[("fdk.rs", include_str!("static/fdk.rs"))]; #[derive(Serialize, Deserialize, Debug, garde::Validate)] -pub struct MdkRustGenConfig { +pub struct FdkRustGenConfig { #[serde(flatten)] #[garde(dive)] - pub base: crate::config::MdkGeneratorConfigBase, + pub base: crate::config::FdkGeneratorConfigBase, /// Runtimes to generate stubbed materializer implementations for. #[garde(skip)] pub stubbed_runtimes: Option>, @@ -40,9 +40,9 @@ pub struct MdkRustGenConfig { pub skip_lib_rs: Option, } -impl MdkRustGenConfig { +impl FdkRustGenConfig { pub fn from_json(json: serde_json::Value, workspace_path: &Path) -> anyhow::Result { - let mut config: mdk_rust::MdkRustGenConfig = serde_json::from_value(json)?; + let mut config: FdkRustGenConfig = serde_json::from_value(json)?; config.base.path = workspace_path.join(config.base.path); config.base.typegraph_path = config .base @@ -54,26 +54,26 @@ impl MdkRustGenConfig { } #[derive(Debug, Clone)] -struct MdkRustTemplate { +struct FdkRustTemplate { mod_rs: Cow<'static, str>, } -impl From for MdkRustTemplate { - fn from(template: MdkTemplate) -> Self { +impl From for FdkRustTemplate { + fn from(template: FdkTemplate) -> Self { let mut template = template.entries; Self { - mod_rs: template.remove("mdk.rs").unwrap(), + mod_rs: template.remove("fdk.rs").unwrap(), } } } pub struct Generator { - config: MdkRustGenConfig, + config: FdkRustGenConfig, } impl Generator { pub const INPUT_TG: &'static str = "tg_name"; - pub fn new(config: MdkRustGenConfig) -> Result { + pub fn new(config: FdkRustGenConfig) -> Result { use garde::Validate; config.validate(&())?; Ok(Self { config }) @@ -100,7 +100,7 @@ impl crate::Plugin for Generator { .into_iter() .chain(std::iter::once(( "template_dir".to_string(), - GeneratorInputOrder::LoadMdkTemplate { + GeneratorInputOrder::LoadFdkTemplate { default: DEFAULT_TEMPLATE, override_path: self.config.base.template_dir.clone(), }, @@ -112,7 +112,7 @@ impl crate::Plugin for Generator { &self, mut inputs: HashMap, ) -> anyhow::Result { - // TODO remove code duplication in mdk generators + // TODO remove code duplication in fdk generators let tg = match inputs .remove(Self::INPUT_TG) .context("missing generator input for typegraph")? @@ -122,17 +122,17 @@ impl crate::Plugin for Generator { _ => bail!("unexpected generator input variant"), }; - let template: MdkRustTemplate = match inputs + let template: FdkRustTemplate = match inputs .remove("template_dir") .context("missing generator input for template_dir")? { - GeneratorInputResolved::MdkTemplate { template } => template.into(), + GeneratorInputResolved::FdkTemplate { template } => template.into(), _ => bail!("unexpected generator input variant"), }; let mut out = HashMap::new(); out.insert( - self.config.base.path.join("mdk.rs"), + self.config.base.path.join("fdk.rs"), GeneratedFile { contents: template.gen_mod_rs(&self.config, &tg)?, overwrite: true, @@ -141,7 +141,7 @@ impl crate::Plugin for Generator { let crate_name = self.config.crate_name.clone().unwrap_or_else(|| { use heck::ToSnekCase; let tg_name = tg.name().unwrap_or_else(|_| "generated".to_string()); - format!("{}_mdk", tg_name.to_snek_case()) + format!("{}_fdk", tg_name.to_snek_case()) }); if !matches!(self.config.skip_cargo_toml, Some(true)) { out.insert( @@ -165,8 +165,8 @@ impl crate::Plugin for Generator { } } -impl MdkRustTemplate { - fn gen_mod_rs(&self, config: &MdkRustGenConfig, tg: &Typegraph) -> anyhow::Result { +impl FdkRustTemplate { + fn gen_mod_rs(&self, config: &FdkRustGenConfig, tg: &Typegraph) -> anyhow::Result { let mut mod_rs = GenDestBuf { buf: Default::default(), }; @@ -249,7 +249,7 @@ impl MdkRustTemplate { let mod_rs = self.mod_rs.clone().into_owned(); let mod_rs = mod_rs.replace("__METATYPE_VERSION__", std::env!("CARGO_PKG_VERSION")); - let mdk_wit = include_str!("../../../wit/wit-wire.wit"); + let fdk_wit = include_str!("../../../wit/wit-wire.wit"); writeln!(dest, "// gen-static-start")?; let gen_start = "// gen-start\n"; @@ -264,7 +264,7 @@ impl MdkRustTemplate { writeln!( &mut dest.buf, r#" - inline: "{mdk_wit}""# + inline: "{fdk_wit}""# )?; let gen_end = "// gen-end\n"; @@ -283,7 +283,7 @@ impl MdkRustTemplate { pub fn gen_cargo_toml(crate_name: Option<&str>) -> String { let cargo_toml = include_str!("static/Cargo.toml"); let mut cargo_toml = if let Some(crate_name) = crate_name { - const DEF_CRATE_NAME: &str = "metagen_mdk_rust_static"; + const DEF_CRATE_NAME: &str = "metagen_fdk_rust_static"; cargo_toml.replace(DEF_CRATE_NAME, crate_name) } else { cargo_toml.to_string() @@ -300,14 +300,14 @@ opt-level = "z""#, pub fn gen_lib_rs() -> String { r#" -mod mdk; -pub use mdk::*; +mod fdk; +pub use fdk::*; /* init_mat! { - hook: || { + hook: || {FdkGeneratorConfigBase // initialize global stuff here if you need it - MatBuilder::new() + MatBuilder::new() // register function handlers here .register_handler(stubs::MyFunc::erased(MyMat)) } @@ -315,7 +315,7 @@ init_mat! { struct MyMat; -// FIXME: use actual types from your mdk here +// FIXME: use actual types from your fdk here impl stubs::MyFunc for MyMat { fn handle(&self, input: types::MyFuncIn, _cx: Ctx) -> anyhow::Result { unimplemented!() @@ -336,13 +336,13 @@ fn e2e() -> anyhow::Result<()> { "default".to_string(), config::Target( [GeneratorConfig { - generator_name: "mdk_rust".to_string(), - other: serde_json::to_value(mdk_rust::MdkRustGenConfig { + generator_name: "fdk_rust".to_string(), + other: serde_json::to_value(fdk_rust::FdkRustGenConfig { skip_cargo_toml: None, skip_lib_rs: Some(true), stubbed_runtimes: Some(vec!["wasm_wire".into()]), crate_name: None, - base: config::MdkGeneratorConfigBase { + base: config::FdkGeneratorConfigBase { typegraph_name: Some(tg_name.into()), typegraph_path: None, // NOTE: root will map to the test's tempdir diff --git a/src/metagen/src/mdk_rust/static/Cargo.toml b/src/metagen/src/fdk_rust/static/Cargo.toml similarity index 85% rename from src/metagen/src/mdk_rust/static/Cargo.toml rename to src/metagen/src/fdk_rust/static/Cargo.toml index a811198585..aeb63fadb6 100644 --- a/src/metagen/src/mdk_rust/static/Cargo.toml +++ b/src/metagen/src/fdk_rust/static/Cargo.toml @@ -1,4 +1,4 @@ -package.name = "metagen_mdk_rust_static" +package.name = "metagen_fdk_rust_static" package.edition = "2021" package.version = "0.0.1" diff --git a/src/metagen/src/mdk_rust/static/mdk.rs b/src/metagen/src/fdk_rust/static/fdk.rs similarity index 100% rename from src/metagen/src/mdk_rust/static/mdk.rs rename to src/metagen/src/fdk_rust/static/fdk.rs diff --git a/src/metagen/src/mdk_rust/static/lib.rs b/src/metagen/src/fdk_rust/static/lib.rs similarity index 92% rename from src/metagen/src/mdk_rust/static/lib.rs rename to src/metagen/src/fdk_rust/static/lib.rs index af7247c9ee..3f6c2c8242 100644 --- a/src/metagen/src/mdk_rust/static/lib.rs +++ b/src/metagen/src/fdk_rust/static/lib.rs @@ -1,4 +1,4 @@ // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. // SPDX-License-Identifier: MPL-2.0 -mod mdk; +mod fdk; diff --git a/src/metagen/src/mdk_rust/stubs.rs b/src/metagen/src/fdk_rust/stubs.rs similarity index 94% rename from src/metagen/src/mdk_rust/stubs.rs rename to src/metagen/src/fdk_rust/stubs.rs index f686ab9087..9783efde37 100644 --- a/src/metagen/src/mdk_rust/stubs.rs +++ b/src/metagen/src/fdk_rust/stubs.rs @@ -81,7 +81,7 @@ pub fn gen_op_to_mat_map( #[cfg(test)] mod test { use super::*; - use crate::{mdk_rust::*, tests::default_type_node_base}; + use crate::{fdk_rust::*, tests::default_type_node_base}; use common::typegraph::*; #[test] @@ -148,8 +148,8 @@ mod test { }, ], }); - let generator = Generator::new(MdkRustGenConfig { - base: crate::config::MdkGeneratorConfigBase { + let generator = Generator::new(FdkRustGenConfig { + base: crate::config::FdkGeneratorConfigBase { path: "/".into(), typegraph_name: Some(tg_name.clone()), typegraph_path: None, @@ -168,9 +168,9 @@ mod test { ), ( "template_dir".to_owned(), - GeneratorInputResolved::MdkTemplate { - template: MdkTemplate { - entries: mdk_rust::DEFAULT_TEMPLATE + GeneratorInputResolved::FdkTemplate { + template: FdkTemplate { + entries: fdk_rust::DEFAULT_TEMPLATE .iter() .map(|(file, content)| (*file, (*content).into())) .collect(), @@ -184,7 +184,7 @@ mod test { let (_, buf) = out .0 .iter() - .find(|(path, _)| path.file_name().unwrap() == "mdk.rs") + .find(|(path, _)| path.file_name().unwrap() == "fdk.rs") .unwrap(); pretty_assertions::assert_eq!( r#"// gen-static-end diff --git a/src/metagen/src/mdk_rust/types.rs b/src/metagen/src/fdk_rust/types.rs similarity index 100% rename from src/metagen/src/mdk_rust/types.rs rename to src/metagen/src/fdk_rust/types.rs diff --git a/src/metagen/src/mdk_rust/utils.rs b/src/metagen/src/fdk_rust/utils.rs similarity index 100% rename from src/metagen/src/mdk_rust/utils.rs rename to src/metagen/src/fdk_rust/utils.rs diff --git a/src/metagen/src/mdk_substantial/mod.rs b/src/metagen/src/fdk_substantial/mod.rs similarity index 90% rename from src/metagen/src/mdk_substantial/mod.rs rename to src/metagen/src/fdk_substantial/mod.rs index 6c6f9e0a8b..c23d6ed5a0 100644 --- a/src/metagen/src/mdk_substantial/mod.rs +++ b/src/metagen/src/fdk_substantial/mod.rs @@ -7,15 +7,15 @@ use crate::interlude::*; use crate::*; #[derive(Serialize, Deserialize, Debug, garde::Validate)] -pub struct MdkSubstantialGenConfig { +pub struct FdkSubstantialGenConfig { #[serde(flatten)] #[garde(dive)] - pub base: crate::config::MdkGeneratorConfigBase, + pub base: crate::config::FdkGeneratorConfigBase, } -impl MdkSubstantialGenConfig { +impl FdkSubstantialGenConfig { pub fn from_json(json: serde_json::Value, workspace_path: &Path) -> anyhow::Result { - let mut config: MdkSubstantialGenConfig = serde_json::from_value(json)?; + let mut config: FdkSubstantialGenConfig = serde_json::from_value(json)?; config.base.path = workspace_path.join(config.base.path); config.base.typegraph_path = config .base @@ -27,12 +27,12 @@ impl MdkSubstantialGenConfig { } pub struct Generator { - config: MdkSubstantialGenConfig, + config: FdkSubstantialGenConfig, } impl Generator { pub const INPUT_TG: &'static str = "tg_name"; - pub fn new(config: MdkSubstantialGenConfig) -> Result { + pub fn new(config: FdkSubstantialGenConfig) -> Result { use garde::Validate; config.validate(&())?; Ok(Self { config }) diff --git a/src/metagen/src/mdk_substantial/static/substantial.py b/src/metagen/src/fdk_substantial/static/substantial.py similarity index 100% rename from src/metagen/src/mdk_substantial/static/substantial.py rename to src/metagen/src/fdk_substantial/static/substantial.py diff --git a/src/metagen/src/mdk_substantial/static/types.py b/src/metagen/src/fdk_substantial/static/types.py similarity index 100% rename from src/metagen/src/mdk_substantial/static/types.py rename to src/metagen/src/fdk_substantial/static/types.py diff --git a/src/metagen/src/mdk_substantial/static/workflow.py b/src/metagen/src/fdk_substantial/static/workflow.py similarity index 100% rename from src/metagen/src/mdk_substantial/static/workflow.py rename to src/metagen/src/fdk_substantial/static/workflow.py diff --git a/src/metagen/src/mdk_typescript/mod.rs b/src/metagen/src/fdk_typescript/mod.rs similarity index 80% rename from src/metagen/src/mdk_typescript/mod.rs rename to src/metagen/src/fdk_typescript/mod.rs index de20e51078..f9b930173b 100644 --- a/src/metagen/src/mdk_typescript/mod.rs +++ b/src/metagen/src/fdk_typescript/mod.rs @@ -16,34 +16,34 @@ use crate::utils::GenDestBuf; use self::shared::types::NameMemo; use self::shared::types::TypeRenderer; -pub const DEFAULT_TEMPLATE: &[(&str, &str)] = &[("mdk.ts", include_str!("static/mdk.ts"))]; +pub const DEFAULT_TEMPLATE: &[(&str, &str)] = &[("fdk.ts", include_str!("static/fdk.ts"))]; -struct MdkTypescriptTemplate { - mdk_ts: Cow<'static, str>, +struct FdkTypescriptTemplate { + fdk_ts: Cow<'static, str>, } -impl From for MdkTypescriptTemplate { - fn from(mut mdk_template: MdkTemplate) -> Self { - let mdk_ts = mdk_template.entries.remove("mdk.ts").unwrap(); +impl From for FdkTypescriptTemplate { + fn from(mut fdk_template: FdkTemplate) -> Self { + let fdk_ts = fdk_template.entries.remove("fdk.ts").unwrap(); Self { - mdk_ts: mdk_ts.clone(), + fdk_ts: fdk_ts.clone(), } } } #[derive(Serialize, Deserialize, Debug, garde::Validate)] -pub struct MdkTypescriptGenConfig { +pub struct FdkTypescriptGenConfig { #[serde(flatten)] #[garde(dive)] - pub base: crate::config::MdkGeneratorConfigBase, + pub base: crate::config::FdkGeneratorConfigBase, /// Runtimes to generate stubbed materializer implementations for. #[garde(skip)] pub stubbed_runtimes: Option>, } -impl MdkTypescriptGenConfig { +impl FdkTypescriptGenConfig { pub fn from_json(json: serde_json::Value, workspace_path: &Path) -> anyhow::Result { - let mut config: MdkTypescriptGenConfig = serde_json::from_value(json)?; + let mut config: FdkTypescriptGenConfig = serde_json::from_value(json)?; config.base.path = workspace_path.join(config.base.path); config.base.typegraph_path = config .base @@ -55,40 +55,40 @@ impl MdkTypescriptGenConfig { } pub struct Generator { - config: MdkTypescriptGenConfig, + config: FdkTypescriptGenConfig, } impl Generator { pub const INPUT_TG: &'static str = "tg_name"; - pub fn new(config: MdkTypescriptGenConfig) -> Result { + pub fn new(config: FdkTypescriptGenConfig) -> Result { use garde::Validate; config.validate(&())?; Ok(Self { config }) } } -impl MdkTypescriptTemplate { - fn render_mdk_ts( +impl FdkTypescriptTemplate { + fn render_fdk_ts( &self, - config: &MdkTypescriptGenConfig, + config: &FdkTypescriptGenConfig, tg: &Typegraph, ) -> anyhow::Result { - let mut mdk_ts = GenDestBuf { + let mut fdk_ts = GenDestBuf { buf: Default::default(), }; writeln!( - &mut mdk_ts, + &mut fdk_ts, "// This file was @generated by metagen and is intended" )?; writeln!( - &mut mdk_ts, + &mut fdk_ts, "// to be generated again on subsequent metagen runs." )?; - writeln!(&mut mdk_ts)?; - self.gen_static(&mut mdk_ts)?; - let ty_name_memo = render_types(&mut mdk_ts, tg)?; - writeln!(&mut mdk_ts)?; + writeln!(&mut fdk_ts)?; + self.gen_static(&mut fdk_ts)?; + let ty_name_memo = render_types(&mut fdk_ts, tg)?; + writeln!(&mut fdk_ts)?; { let stubbed_rts = config .stubbed_runtimes @@ -109,17 +109,17 @@ impl MdkTypescriptTemplate { .context("output type for function not found")?; let type_name: String = utils::normalize_type_title(&base.title); writeln!( - &mut mdk_ts, + &mut fdk_ts, "export type {type_name}Handler = Handler<{inp_ty}, {out_ty}>;" )?; } } - Ok(mdk_ts.buf) + Ok(fdk_ts.buf) } pub fn gen_static(&self, dest: &mut GenDestBuf) -> core::fmt::Result { - let mdk_ts = self.mdk_ts.as_ref(); - writeln!(dest, "{}", mdk_ts)?; + let fdk_ts = self.fdk_ts.as_ref(); + writeln!(dest, "{}", fdk_ts)?; Ok(()) } } @@ -144,7 +144,7 @@ impl crate::Plugin for Generator { .into_iter() .chain(std::iter::once(( "template_dir".to_string(), - GeneratorInputOrder::LoadMdkTemplate { + GeneratorInputOrder::LoadFdkTemplate { default: DEFAULT_TEMPLATE, override_path: self.config.base.template_dir.clone(), }, @@ -164,16 +164,16 @@ impl crate::Plugin for Generator { GeneratorInputResolved::TypegraphFromPath { raw } => raw, _ => unreachable!(), }; - let template: MdkTypescriptTemplate = match inputs.remove("template_dir").unwrap() { - GeneratorInputResolved::MdkTemplate { template } => template.into(), + let template: FdkTypescriptTemplate = match inputs.remove("template_dir").unwrap() { + GeneratorInputResolved::FdkTemplate { template } => template.into(), _ => unreachable!(), }; let mut out = HashMap::new(); out.insert( - self.config.base.path.join("mdk.ts"), + self.config.base.path.join("fdk.ts"), GeneratedFile { - contents: template.render_mdk_ts(&self.config, &tg)?, + contents: template.render_fdk_ts(&self.config, &tg)?, overwrite: true, }, ); @@ -208,10 +208,10 @@ fn e2e() -> anyhow::Result<()> { "default".to_string(), config::Target( [GeneratorConfig { - generator_name: "mdk_typescript".to_string(), - other: serde_json::to_value(mdk_typescript::MdkTypescriptGenConfig { + generator_name: "fdk_typescript".to_string(), + other: serde_json::to_value(fdk_typescript::FdkTypescriptGenConfig { stubbed_runtimes: Some(vec!["deno".into()]), - base: config::MdkGeneratorConfigBase { + base: config::FdkGeneratorConfigBase { typegraph_name: Some(tg_name.into()), typegraph_path: None, // NOTE: root will map to the test's tempdir @@ -240,7 +240,7 @@ fn e2e() -> anyhow::Result<()> { build_fn: |args| { Box::pin(async move { let status = tokio::process::Command::new("deno") - .args("check mdk.ts".split(' ').collect::>()) + .args("check fdk.ts".split(' ').collect::>()) .current_dir(&args.path) .kill_on_drop(true) .spawn()? @@ -250,7 +250,7 @@ fn e2e() -> anyhow::Result<()> { anyhow::bail!("error checking generated crate"); } let status = tokio::process::Command::new("deno") - .args("lint mdk.ts".split(' ').collect::>()) + .args("lint fdk.ts".split(' ').collect::>()) .current_dir(&args.path) .kill_on_drop(true) .spawn()? diff --git a/src/metagen/src/mdk_typescript/static/mdk.ts b/src/metagen/src/fdk_typescript/static/fdk.ts similarity index 100% rename from src/metagen/src/mdk_typescript/static/mdk.ts rename to src/metagen/src/fdk_typescript/static/fdk.ts diff --git a/src/metagen/src/mdk_typescript/types.rs b/src/metagen/src/fdk_typescript/types.rs similarity index 100% rename from src/metagen/src/mdk_typescript/types.rs rename to src/metagen/src/fdk_typescript/types.rs diff --git a/src/metagen/src/mdk_typescript/utils.rs b/src/metagen/src/fdk_typescript/utils.rs similarity index 100% rename from src/metagen/src/mdk_typescript/utils.rs rename to src/metagen/src/fdk_typescript/utils.rs diff --git a/src/metagen/src/lib.rs b/src/metagen/src/lib.rs index a87a3bbc4b..8b972bcf4e 100644 --- a/src/metagen/src/lib.rs +++ b/src/metagen/src/lib.rs @@ -30,10 +30,10 @@ mod config; mod macros; mod shared; -mod mdk_python; -mod mdk_rust; -mod mdk_substantial; -mod mdk_typescript; +mod fdk_python; +mod fdk_rust; +mod fdk_substantial; +mod fdk_typescript; mod client_py; mod client_rs; @@ -47,11 +47,11 @@ use crate::interlude::*; pub use config::*; use futures_concurrency::future::FutureGroup; -pub use shared::MdkTemplate; +pub use shared::FdkTemplate; -pub use mdk_python::DEFAULT_TEMPLATE as MDK_PYTHON_DEFAULT_TEMPLATE; -pub use mdk_rust::DEFAULT_TEMPLATE as MDK_RUST_DEFAULT_TEMPLATE; -pub use mdk_typescript::DEFAULT_TEMPLATE as MDK_TYPESCRIPT_DEFAULT_TEMPLATE; +pub use fdk_python::DEFAULT_TEMPLATE as FDK_PYTHON_DEFAULT_TEMPLATE; +pub use fdk_rust::DEFAULT_TEMPLATE as FDK_RUST_DEFAULT_TEMPLATE; +pub use fdk_typescript::DEFAULT_TEMPLATE as FDK_TYPESCRIPT_DEFAULT_TEMPLATE; /// This implements a command object pattern API for generator /// implementations to access the external world. See [InputResolver]. @@ -68,7 +68,7 @@ pub enum GeneratorInputOrder { path: PathBuf, name: Option, }, - LoadMdkTemplate { + LoadFdkTemplate { default: &'static [(&'static str, &'static str)], override_path: Option, }, @@ -80,7 +80,7 @@ pub enum GeneratorInputOrder { pub enum GeneratorInputResolved { TypegraphFromTypegate { raw: Box }, TypegraphFromPath { raw: Box }, - MdkTemplate { template: MdkTemplate }, + FdkTemplate { template: FdkTemplate }, } /// This type plays the "dispatcher" role to the command object @@ -137,43 +137,43 @@ impl GeneratorRunner { pub fn get(name: &str) -> Option { thread_local! { static GENERATORS: HashMap = HashMap::from([ - // builtin generators + // builtin generatorsFdkPythonGenConfig ( - "mdk_rust".to_string(), + "fdk_rust".to_string(), GeneratorRunner { op: |workspace_path: &Path, val| { - let config = mdk_rust::MdkRustGenConfig::from_json(val, workspace_path)?; - let generator = mdk_rust::Generator::new(config)?; + let config = fdk_rust::FdkRustGenConfig::from_json(val, workspace_path)?; + let generator = fdk_rust::Generator::new(config)?; Ok(Box::new(generator)) }, }, ), ( - "mdk_python".to_string(), + "fdk_python".to_string(), GeneratorRunner { op: |workspace_path: &Path, val| { - let config = mdk_python::MdkPythonGenConfig::from_json(val, workspace_path)?; - let generator = mdk_python::Generator::new(config)?; + let config = fdk_python::FdkPythonGenConfig::from_json(val, workspace_path)?; + let generator = fdk_python::Generator::new(config)?; Ok(Box::new(generator)) }, }, ), ( - "mdk_substantial".to_string(), + "fdk_substantial".to_string(), GeneratorRunner { op: |workspace_path: &Path, val| { - let config = mdk_substantial::MdkSubstantialGenConfig::from_json(val, workspace_path)?; - let generator = mdk_substantial::Generator::new(config)?; + let config = fdk_substantial::FdkSubstantialGenConfig::from_json(val, workspace_path)?; + let generator = fdk_substantial::Generator::new(config)?; Ok(Box::new(generator)) }, }, ), ( - "mdk_typescript".to_string(), + "fdk_typescript".to_string(), GeneratorRunner { op: |workspace_path: &Path, val| { - let config = mdk_typescript::MdkTypescriptGenConfig::from_json(val, workspace_path)?; - let generator = mdk_typescript::Generator::new(config)?; + let config = fdk_typescript::FdkTypescriptGenConfig::from_json(val, workspace_path)?; + let generator = fdk_typescript::Generator::new(config)?; Ok(Box::new(generator)) }, }, diff --git a/src/metagen/src/shared/mod.rs b/src/metagen/src/shared/mod.rs index 8facf3257a..14f40aded2 100644 --- a/src/metagen/src/shared/mod.rs +++ b/src/metagen/src/shared/mod.rs @@ -1,7 +1,7 @@ // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. // SPDX-License-Identifier: MPL-2.0 -//! This module contains common logic for mdk generation +//! This module contains common logic for fdk generation //! imlementations pub mod client; @@ -12,7 +12,7 @@ use common::typegraph::{runtimes::TGRuntime, Materializer}; use crate::interlude::*; #[derive(Debug, Clone)] -pub struct MdkTemplate { +pub struct FdkTemplate { pub entries: HashMap<&'static str, std::borrow::Cow<'static, str>>, } diff --git a/src/metagen/src/tests/mod.rs b/src/metagen/src/tests/mod.rs index cb3517f8eb..38ec1a1e6f 100644 --- a/src/metagen/src/tests/mod.rs +++ b/src/metagen/src/tests/mod.rs @@ -23,20 +23,20 @@ impl InputResolver for TestCtx { }) } GeneratorInputOrder::TypegraphFromPath { .. } => unimplemented!(), - GeneratorInputOrder::LoadMdkTemplate { + GeneratorInputOrder::LoadFdkTemplate { default, override_path, - } => Ok(GeneratorInputResolved::MdkTemplate { - template: load_mdk_template(default, override_path.as_deref()).await?, + } => Ok(GeneratorInputResolved::FdkTemplate { + template: load_fdk_template(default, override_path.as_deref()).await?, }), } } } -async fn load_mdk_template( +async fn load_fdk_template( default: &[(&'static str, &'static str)], template_dir: Option<&std::path::Path>, -) -> anyhow::Result { +) -> anyhow::Result { let mut group = FutureGroup::new(); for (file_name, content) in default.iter() { // TODO absolute path? @@ -61,7 +61,7 @@ async fn load_mdk_template( let (file_name, content) = res?; entries.insert(file_name, content); } - Ok(MdkTemplate { entries }) + Ok(FdkTemplate { entries }) } pub struct BuildArgs { diff --git a/src/typegraph/core/src/utils/metagen_utils.rs b/src/typegraph/core/src/utils/metagen_utils.rs index 7610078f6d..0671b13e92 100644 --- a/src/typegraph/core/src/utils/metagen_utils.rs +++ b/src/typegraph/core/src/utils/metagen_utils.rs @@ -23,10 +23,10 @@ impl InputResolverSync for RawTgResolver { }) } GeneratorInputOrder::TypegraphFromPath { .. } => unimplemented!(), - GeneratorInputOrder::LoadMdkTemplate { + GeneratorInputOrder::LoadFdkTemplate { default, override_path, - } => Ok(GeneratorInputResolved::MdkTemplate { + } => Ok(GeneratorInputResolved::FdkTemplate { template: self.load_mdk_template(default, override_path.as_deref())?, }), } @@ -38,7 +38,7 @@ impl RawTgResolver { &self, default: &[(&'static str, &'static str)], template_dir: Option<&std::path::Path>, - ) -> Result { + ) -> Result { let mut entries = HashMap::new(); for (file_name, default_content) in default.iter() { let content = if let Some(override_path) = template_dir { @@ -53,6 +53,6 @@ impl RawTgResolver { }; entries.insert(*file_name, content); } - Ok(metagen::MdkTemplate { entries }) + Ok(metagen::FdkTemplate { entries }) } } From 6b3ab05999e4c201d22574db105b8de49e46f296 Mon Sep 17 00:00:00 2001 From: j03-dev <24nomeniavo@gmail.com> Date: Wed, 18 Sep 2024 16:32:56 +0300 Subject: [PATCH 3/8] rename Mdk to Fdk on typegraph/core next step, refactor the example --- src/typegraph/core/src/utils/mod.rs | 8 ++++---- src/typegraph/core/wit/typegraph.wit | 8 ++++---- src/typegraph/deno/src/metagen.ts | 14 +++++++------- src/typegraph/python/typegraph/graph/metagen.py | 12 ++++++------ 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/typegraph/core/src/utils/mod.rs b/src/typegraph/core/src/utils/mod.rs index fdae33bf99..468381de52 100644 --- a/src/typegraph/core/src/utils/mod.rs +++ b/src/typegraph/core/src/utils/mod.rs @@ -16,7 +16,7 @@ use crate::global_store::{get_sdk_version, NameRegistration, Store}; use crate::types::subgraph::Subgraph; use crate::types::{TypeDefExt, TypeId}; use crate::wit::core::{Guest, TypeBase, TypeId as CoreTypeId, TypeStruct}; -use crate::wit::utils::{Auth as WitAuth, MdkConfig, MdkOutput, QueryDeployParams}; +use crate::wit::utils::{Auth as WitAuth, FdkConfig, FdkOutput, QueryDeployParams}; use crate::Lib; use std::path::Path; @@ -264,7 +264,7 @@ impl crate::wit::utils::Guest for crate::Lib { remove_injections_recursive(id.into()).map(|id| id.into()) } - fn metagen_exec(config: MdkConfig) -> Result> { + fn metagen_exec(config: FdkConfig) -> Result> { let gen_config: metagen::Config = serde_json::from_str(&config.config_json) .map_err(|e| format!("Load metagen config: {}", e))?; @@ -281,7 +281,7 @@ impl crate::wit::utils::Guest for crate::Lib { .map(|map| { map.0 .iter() - .map(|(k, v)| MdkOutput { + .map(|(k, v)| FdkOutput { path: k.to_string_lossy().to_string(), content: v.contents.clone(), overwrite: v.overwrite, @@ -291,7 +291,7 @@ impl crate::wit::utils::Guest for crate::Lib { .map_err(|e| format!("Generate target: {}", e).into()) } - fn metagen_write_files(items: Vec, typegraph_dir: String) -> Result<()> { + fn metagen_write_files(items: Vec, typegraph_dir: String) -> Result<()> { let fs_ctx = FsContext::new(typegraph_dir.into()); for item in items { if fs_ctx.exists(Path::new(&item.path))? && !item.overwrite { diff --git a/src/typegraph/core/wit/typegraph.wit b/src/typegraph/core/wit/typegraph.wit index 0ee20427d9..0dbdc32c18 100644 --- a/src/typegraph/core/wit/typegraph.wit +++ b/src/typegraph/core/wit/typegraph.wit @@ -643,21 +643,21 @@ interface utils { remove-injections: func(type-id: type-id) -> result; - record mdk-config { + record fdk-config { workspace-path: string, target-name: string, config-json: string, tg-json: string, } - record mdk-output { + record fdk-output { path: string, content: string, overwrite: bool, } - metagen-exec: func(config: mdk-config) -> result, error>; - metagen-write-files: func(items: list, typegraph-dir: string) -> result<_, error>; + metagen-exec: func(config: fdk-config) -> result, error>; + metagen-write-files: func(items: list, typegraph-dir: string) -> result<_, error>; } interface host { diff --git a/src/typegraph/deno/src/metagen.ts b/src/typegraph/deno/src/metagen.ts index ad24b97c57..b7d917c0cb 100644 --- a/src/typegraph/deno/src/metagen.ts +++ b/src/typegraph/deno/src/metagen.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: MPL-2.0 import { - MdkConfig, - MdkOutput, + FdkConfig, + FdkOutput, SerializeParams, } from "./gen/typegraph_core.d.ts"; import { TypegraphOutput } from "./typegraph.ts"; @@ -13,7 +13,7 @@ import { freezeTgOutput } from "./utils/func_utils.ts"; export class Metagen { constructor(private workspacePath: string, private genConfig: unknown) {} - private getMdkConfig(tgOutput: TypegraphOutput, targetName: string) { + private getFdkConfig(tgOutput: TypegraphOutput, targetName: string) { const serializeParams = { typegraphPath: `${this.workspacePath}/tg.ts`, prefix: undefined, @@ -36,7 +36,7 @@ export class Metagen { tgJson: frozenOut.serialize(serializeParams).tgJson, targetName, workspacePath: this.workspacePath, - } as MdkConfig; + } as FdkConfig; } /** dry-run metagen */ @@ -44,12 +44,12 @@ export class Metagen { tgOutput: TypegraphOutput, targetName: string, overwrite?: false, - ): Array { - const mdkConfig = this.getMdkConfig(tgOutput, targetName); + ): Array { + const mdkConfig = this.getFdkConfig(tgOutput, targetName); return wit_utils.metagenExec(mdkConfig).map((value: any) => ({ ...value, overwrite: overwrite ?? value.overwrite, - })) as Array; + })) as Array; } /** run metagen */ diff --git a/src/typegraph/python/typegraph/graph/metagen.py b/src/typegraph/python/typegraph/graph/metagen.py index bf14cddfbc..b7eebcafb3 100644 --- a/src/typegraph/python/typegraph/graph/metagen.py +++ b/src/typegraph/python/typegraph/graph/metagen.py @@ -8,7 +8,7 @@ SerializeParams, PrismaMigrationConfig, ) -from typegraph.gen.exports.utils import MdkConfig, MdkOutput +from typegraph.gen.exports.utils import FdkConfig, FdkOutput from typegraph.gen.types import Err from typegraph.graph.shared_types import TypegraphOutput from typegraph.utils import freeze_tg_output @@ -23,11 +23,11 @@ def __init__(self, workspace_path: str, gen_config: any) -> None: self.gen_config = gen_config self.workspace_path = workspace_path - def _get_mdk_config( + def _get_fdk_config( self, tg_output: TypegraphOutput, target_name: str, - ) -> MdkConfig: + ) -> FdkConfig: serialize_params = SerializeParams( typegraph_path=self.workspace_path + "/tg.py", prefix=None, @@ -44,7 +44,7 @@ def _get_mdk_config( ) frozen_out = freeze_tg_output(serialize_params, tg_output) - return MdkConfig( + return FdkConfig( tg_json=frozen_out.serialize(serialize_params).tgJson, config_json=json.dumps(self.gen_config), workspace_path=self.workspace_path, @@ -56,8 +56,8 @@ def dry_run( tg_output: TypegraphOutput, target_name: str, overwrite: Union[bool, None] = None, - ) -> List[MdkOutput]: - mdk_config = self._get_mdk_config(tg_output, target_name) + ) -> List[FdkOutput]: + mdk_config = self._get_fdk_config(tg_output, target_name) res = wit_utils.metagen_exec(store, mdk_config) if isinstance(res, Err): raise Exception(res.value) From 10172959a87649d9b180ba73e3d7ce6719e63a94 Mon Sep 17 00:00:00 2001 From: j03-dev <24nomeniavo@gmail.com> Date: Wed, 18 Sep 2024 16:40:26 +0300 Subject: [PATCH 4/8] forget to commit --- CHANGELOG.md | 4 ++-- tests/metagen/metagen_test.ts | 32 ++++++++++++++++---------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1d29691dd..716b3cf1b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1702,10 +1702,10 @@ _No Migrations Needed_
-(mdk) Mdk python (#707) +(Fdk) Fdk python (#707) -Mdk for python runtime +Fdk for python runtime #### Migration notes diff --git a/tests/metagen/metagen_test.ts b/tests/metagen/metagen_test.ts index 1c6e90add9..dae3f5508c 100644 --- a/tests/metagen/metagen_test.ts +++ b/tests/metagen/metagen_test.ts @@ -11,7 +11,7 @@ import { testDir } from "test-utils/dir.ts"; import $ from "@david/dax"; import { z as zod } from "zod"; import { workspaceDir } from "test-utils/dir.ts"; -import { MdkOutput } from "@typegraph/sdk/gen/typegraph_core.d.ts"; +import { FdkOutput } from "@typegraph/sdk/gen/typegraph_core.d.ts"; const denoJson = resolve(testDir, "./deno.jsonc"); @@ -19,7 +19,7 @@ Meta.test("metagen rust builds", async (t) => { const tmpDir = t.tempDir; const typegraphPath = join(import.meta.dirname!, "./typegraphs/metagen.ts"); - const genCratePath = join(tmpDir, "mdk"); + const genCratePath = join(tmpDir, "fdk"); await Deno.writeTextFile( join(tmpDir, "metatype.yml"), @@ -33,7 +33,7 @@ typegates: metagen: targets: main: - - generator: mdk_rust + - generator: fdk_rust path: ${genCratePath} typegraph_path: ${typegraphPath} stubbed_runtimes: ["python"] @@ -47,7 +47,7 @@ metagen: ` [workspace] resolver = "2" -members = ["mdk/"] +members = ["fdk/"] `, ); assertEquals( @@ -76,7 +76,7 @@ members = ["mdk/"] Meta.test("metagen python runs on cyclic types", async (t) => { const typegraphPath = join(import.meta.dirname!, "typegraphs/python.py"); - const basePath = join(t.tempDir, "mdk"); + const basePath = join(t.tempDir, "fdk"); Deno.writeTextFile( join(t.tempDir, "metatype.yml"), @@ -90,7 +90,7 @@ typegates: metagen: targets: my_target: - - generator: mdk_python + - generator: fdk_python path: ${basePath} typegraph_path: ${typegraphPath} `, @@ -109,24 +109,24 @@ Meta.test("Metagen within sdk", async (t) => { targets: { my_target: [ { - generator: "mdk_rust", + generator: "fdk_rust", typegraph: "example-metagen", path: "some/base/path/rust", stubbed_runtimes: ["python"], }, { - generator: "mdk_python", + generator: "fdk_python", typegraph: "example-metagen", path: "some/base/path/python", }, { - generator: "mdk_typescript", + generator: "fdk_typescript", typegraph: "example-metagen", path: "some/base/path/ts", stubbed_runtimes: ["python"], }, { - generator: "mdk_substantial", + generator: "fdk_substantial", typegraph: "example-metagen", path: "some/base/path/ts", }, @@ -164,7 +164,7 @@ Meta.test("Metagen within sdk", async (t) => { const output = await child.output(); if (output.success) { const stdout = new TextDecoder().decode(output.stdout); - const generated = JSON.parse(stdout) as Array; + const generated = JSON.parse(stdout) as Array; const sorted = generated.sort((a, b) => a.path.localeCompare(b.path)); await t.assertSnapshot(sorted); @@ -193,10 +193,10 @@ Meta.test("Metagen within sdk with custom template", async (t) => { targets: { my_target: [ { - generator: "mdk_python", + generator: "fdk_python", typegraph: "example-metagen", path: "some/base/path/python", - template_dir: "./mdk_py_templates", + template_dir: "./fdk_py_templates", }, ], }, @@ -232,7 +232,7 @@ Meta.test("Metagen within sdk with custom template", async (t) => { const output = await child.output(); if (output.success) { const stdout = new TextDecoder().decode(output.stdout); - const generated = JSON.parse(stdout) as Array; + const generated = JSON.parse(stdout) as Array; const sorted = generated.sort((a, b) => a.path.localeCompare(b.path)); await t.assertSnapshot(sorted); @@ -251,7 +251,7 @@ Meta.test("Metagen within sdk with custom template", async (t) => { } }); -Meta.test("mdk table suite", async (metaTest) => { +Meta.test("fdk table suite", async (metaTest) => { const scriptsPath = join(import.meta.dirname!, "typegraphs/identities"); const genCratePath = join(scriptsPath, "rs"); // const genPyPath = join(scriptsPath, "py"); @@ -492,7 +492,7 @@ Meta.test("mdk table suite", async (metaTest) => { "metagen/typegraphs/identities.py", ); for (const prefix of ["rs", "ts", "py"]) { - await metaTest.should(`mdk data go round ${prefix}`, async (t) => { + await metaTest.should(`fdk data go round ${prefix}`, async (t) => { for (const { name, vars, query, skip } of cases) { if (skip) { continue; From 2c3563a9686d6cb6fd057d21393bad9fce53e211 Mon Sep 17 00:00:00 2001 From: j03-dev <24nomeniavo@gmail.com> Date: Thu, 19 Sep 2024 16:04:39 +0300 Subject: [PATCH 5/8] finish rename mdk to fdk --- CHANGELOG.md | 19 +-- deno.lock | 1 + src/metagen/fixtures/mat_rust/lib.rs | 8 +- src/metagen/src/client_rs/mod.rs | 4 +- src/typegraph/core/src/utils/metagen_utils.rs | 4 +- src/typegraph/deno/src/metagen.ts | 4 +- .../python/typegraph/graph/metagen.py | 4 +- .../__snapshots__/metagen_test.ts.snap | 124 +++++++++--------- .../struct.py.jinja | 0 tests/metagen/typegraphs/identities.py | 10 +- .../typegraphs/identities/metatype.yml | 6 +- .../typegraphs/identities/rs/Cargo.lock | 2 +- .../typegraphs/identities/rs/Cargo.toml | 2 +- .../metagen/typegraphs/identities/rs/build.sh | 2 +- .../identities/rs/{mdk.rs => fdk.rs} | 0 tests/metagen/typegraphs/identities/rs/lib.rs | 4 +- .../identities/ts/{mdk.ts => fdk.ts} | 0 .../typegraphs/identities/ts/handlers.ts | 2 +- tests/metagen/typegraphs/sample/py/client.py | 50 +++---- tests/metagen/typegraphs/sample/rs/Cargo.lock | 2 +- tests/metagen/typegraphs/sample/rs/Cargo.toml | 6 +- tests/metagen/typegraphs/sample/rs/client.rs | 50 +++---- tests/metagen/typegraphs/sample/ts/client.ts | 24 ++-- tests/metatype.yml | 2 +- .../wasm_wire/rust/{mdk.rs => fdk.rs} | 0 tests/runtimes/wasm_wire/rust/lib.rs | 4 +- tools/Dockerfile.dockerignore | 2 +- tools/tasks/test.ts | 2 +- 28 files changed, 170 insertions(+), 168 deletions(-) rename tests/metagen/typegraphs/{mdk_py_templates => fdk_py_templates}/struct.py.jinja (100%) rename tests/metagen/typegraphs/identities/rs/{mdk.rs => fdk.rs} (100%) rename tests/metagen/typegraphs/identities/ts/{mdk.ts => fdk.ts} (100%) rename tests/runtimes/wasm_wire/rust/{mdk.rs => fdk.rs} (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 716b3cf1b8..0e4f5a2218 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1508,7 +1508,7 @@ default settings. - Adds `/docs/guides/wasm-functions` - Adds a codegen section to `/docs/guides/external-functions` -MDK-492. +FDK-492. #### Migration notes @@ -1743,11 +1743,12 @@ the codebase.
-(mdk) `mdk_typescript` (#739) - - BREAKING: `mdk_typescript` (#739) +(fdk) `fdk_typescript` (#739) + - BREAKING: `fdk +_typescript` (#739) -- Implements the `mdk_typescript` code generator for typescript type +- Implements the `fdk_typescript` code generator for typescript type inference on Deno runtime external modules. - Ports the very simple generator already present in meta-cli. - Removes old codegen from cli and sdk. @@ -1762,7 +1763,7 @@ to make it more uniform to handler. - (sdk) WasmRuntime `export` and `handler` method's now expect handler/func name under `name` instead of `func`. - (sdk) `codegen` flag has been removed from `ArtifactsConfig` object. -- (cli) `gen mod/mdk` has been simplified to just `gen` as the previous +- (cli) `gen mod/fdk` has been simplified to just `gen` as the previous mod option is no longer avail. --- @@ -1774,7 +1775,7 @@ mod option is no longer avail.
-(mdk,gate) Hostcall (#706) +(fdk,gate) Hostcall (#706) Introduces a mechanism for wasm materializers to access hostgate @@ -2984,7 +2985,7 @@ for more details.
-(metagen) Metagen mdk rust (#624) +(metagen) Metagen fdk rust (#624) Implements the general framework for metagen including a generator for @@ -3037,8 +3038,8 @@ syntax support. #### Motivation and context -The mdk codegen and typegraph mutually depends on each other (typegraph -needs a concrete mdk.wasm for hashing, and for the mdk.wasm to be built, +The fdk codegen and typegraph mutually depends on each other (typegraph +needs a concrete fdk.wasm for hashing, and for the fdk.wasm to be built, it needs type generation based on the typegraph) Add a flag to enable processing a partial typegraph when using `meta gen` (partial == no artifact resolution). diff --git a/deno.lock b/deno.lock index 96952651df..bc13d44a60 100644 --- a/deno.lock +++ b/deno.lock @@ -2208,6 +2208,7 @@ "https://raw.githubusercontent.com/metatypedev/metatype/67c1d0fa3f16ec6459ef28aa750db508a1758271/src/typegate/src/runtimes/deno.ts": "c893dcf170b38547239d550080a856aca46a788de9922f282bbacf9b5841b5fe", "https://raw.githubusercontent.com/metatypedev/metatype/67c1d0fa3f16ec6459ef28aa750db508a1758271/src/typegate/src/runtimes/deno/deno.ts": "c540c9049261a302e0cefd510fcca6e51e5d527ac2d432a32060d98fa5202ad3", "https://raw.githubusercontent.com/metatypedev/metatype/67c1d0fa3f16ec6459ef28aa750db508a1758271/src/typegate/src/runtimes/deno/deno_messenger.ts": "81160c8a9c9817b46b52c4eee15cde880fb3f6b013c3b5110ee07a4c9c7f7a5e", + "https://raw.githubusercontent.com/metatypedev/metatype/67c1d0fa3f16ec6459ef28aa750db508a1758271/src/typegate/src/runtimes/deno/worker.ts": "64604d323ffd85f864c4a15419077e5131561de1680504041157a05f8ad9b5eb", "https://raw.githubusercontent.com/metatypedev/metatype/67c1d0fa3f16ec6459ef28aa750db508a1758271/src/typegate/src/runtimes/graphql.ts": "e7b1126e80c433a3fa851aff47239b2571ba4ee0b175b25bda6d85804e8b50bd", "https://raw.githubusercontent.com/metatypedev/metatype/67c1d0fa3f16ec6459ef28aa750db508a1758271/src/typegate/src/runtimes/http.ts": "f598a33aa3cafcf37a1f33d84c06bfd0ef5fd768f72837042c83ac6ae1d90762", "https://raw.githubusercontent.com/metatypedev/metatype/67c1d0fa3f16ec6459ef28aa750db508a1758271/src/typegate/src/runtimes/kv.ts": "ea5365bf5cb3a2c1a7a82482d4b5c1f9fb5e84ed331edce4187464a4ca4e5801", diff --git a/src/metagen/fixtures/mat_rust/lib.rs b/src/metagen/fixtures/mat_rust/lib.rs index cab6d6f8da..98235d0840 100644 --- a/src/metagen/fixtures/mat_rust/lib.rs +++ b/src/metagen/fixtures/mat_rust/lib.rs @@ -2,10 +2,10 @@ // SPDX-License-Identifier: MPL-2.0 #[rustfmt::skip] -mod mdk; -use mdk::stubs::*; -use mdk::types::*; -use mdk::*; +mod fdk; +use fdk::stubs::*; +use fdk::types::*; +use fdk::*; init_mat! { hook: || MatBuilder::new().register_handler(FaasImpl::erased(FaasImpl)) diff --git a/src/metagen/src/client_rs/mod.rs b/src/metagen/src/client_rs/mod.rs index e6c9737c69..dad116b605 100644 --- a/src/metagen/src/client_rs/mod.rs +++ b/src/metagen/src/client_rs/mod.rs @@ -102,7 +102,7 @@ impl crate::Plugin for Generator { let crate_name = self.config.crate_name.clone().unwrap_or_else(|| { use heck::ToSnekCase; let tg_name = tg.name().unwrap_or_else(|_| "generated".to_string()); - format!("{}_mdk", tg_name.to_snek_case()) + format!("{}_fdk", tg_name.to_snek_case()) }); if !matches!(self.config.skip_cargo_toml, Some(true)) { out.insert( @@ -314,7 +314,7 @@ fn render_data_types( for &id in &manifest.arg_types { _ = renderer.render(id)?; } - /* renderer.replace_renderer(Rc::new(mdk_rust::types::RustTypeRenderer { + /* renderer.replace_renderer(Rc::new(fdk_rust::types::RustTypeRenderer { derive_debug: true, derive_serde: true, all_fields_optional: true, diff --git a/src/typegraph/core/src/utils/metagen_utils.rs b/src/typegraph/core/src/utils/metagen_utils.rs index 0671b13e92..42dc5d65f5 100644 --- a/src/typegraph/core/src/utils/metagen_utils.rs +++ b/src/typegraph/core/src/utils/metagen_utils.rs @@ -27,14 +27,14 @@ impl InputResolverSync for RawTgResolver { default, override_path, } => Ok(GeneratorInputResolved::FdkTemplate { - template: self.load_mdk_template(default, override_path.as_deref())?, + template: self.load_fdk_template(default, override_path.as_deref())?, }), } } } impl RawTgResolver { - fn load_mdk_template( + fn load_fdk_template( &self, default: &[(&'static str, &'static str)], template_dir: Option<&std::path::Path>, diff --git a/src/typegraph/deno/src/metagen.ts b/src/typegraph/deno/src/metagen.ts index b7d917c0cb..ac347c11f1 100644 --- a/src/typegraph/deno/src/metagen.ts +++ b/src/typegraph/deno/src/metagen.ts @@ -45,8 +45,8 @@ export class Metagen { targetName: string, overwrite?: false, ): Array { - const mdkConfig = this.getFdkConfig(tgOutput, targetName); - return wit_utils.metagenExec(mdkConfig).map((value: any) => ({ + const fdkConfig = this.getFdkConfig(tgOutput, targetName); + return wit_utils.metagenExec(fdkConfig).map((value: any) => ({ ...value, overwrite: overwrite ?? value.overwrite, })) as Array; diff --git a/src/typegraph/python/typegraph/graph/metagen.py b/src/typegraph/python/typegraph/graph/metagen.py index b7eebcafb3..c55068bec5 100644 --- a/src/typegraph/python/typegraph/graph/metagen.py +++ b/src/typegraph/python/typegraph/graph/metagen.py @@ -57,8 +57,8 @@ def dry_run( target_name: str, overwrite: Union[bool, None] = None, ) -> List[FdkOutput]: - mdk_config = self._get_fdk_config(tg_output, target_name) - res = wit_utils.metagen_exec(store, mdk_config) + fdk_config = self._get_fdk_config(tg_output, target_name) + res = wit_utils.metagen_exec(store, fdk_config) if isinstance(res, Err): raise Exception(res.value) for item in res.value: diff --git a/tests/metagen/__snapshots__/metagen_test.ts.snap b/tests/metagen/__snapshots__/metagen_test.ts.snap index 071ccdc337..f57662dd94 100644 --- a/tests/metagen/__snapshots__/metagen_test.ts.snap +++ b/tests/metagen/__snapshots__/metagen_test.ts.snap @@ -305,7 +305,7 @@ def fnTwo(inp: TwoInput) -> TypeString6: path: "./workspace/some/base/path/python/same_hit.py", }, { - content: 'package.name = "example_metagen_mdk" + content: 'package.name = "example_metagen_fdk" package.edition = "2021" package.version = "0.0.1" @@ -326,34 +326,6 @@ opt-level = "z"', overwrite: false, path: "./workspace/some/base/path/rust/Cargo.toml", }, - { - content: " -mod mdk; -pub use mdk::*; - -/* -init_mat! { - hook: || { - // initialize global stuff here if you need it - MatBuilder::new() - // register function handlers here - .register_handler(stubs::MyFunc::erased(MyMat)) - } -} - -struct MyMat; - -// FIXME: use actual types from your mdk here -impl stubs::MyFunc for MyMat { - fn handle(&self, input: types::MyFuncIn, _cx: Ctx) -> anyhow::Result { - unimplemented!() - } -} -*/ -", - overwrite: false, - path: "./workspace/some/base/path/rust/lib.rs", - }, { content: \`// This file was @generated by metagen and is intended // to be generated again on subsequent metagen runs. @@ -664,7 +636,35 @@ pub mod stubs { } \`, overwrite: true, - path: "./workspace/some/base/path/rust/mdk.rs", + path: "./workspace/some/base/path/rust/fdk.rs", + }, + { + content: " +mod fdk; +pub use fdk::*; + +/* +init_mat! { + hook: || {FdkGeneratorConfigBase + // initialize global stuff here if you need it + MatBuilder::new() + // register function handlers here + .register_handler(stubs::MyFunc::erased(MyMat)) + } +} + +struct MyMat; + +// FIXME: use actual types from your fdk here +impl stubs::MyFunc for MyMat { + fn handle(&self, input: types::MyFuncIn, _cx: Ctx) -> anyhow::Result { + unimplemented!() + } +} +*/ +", + overwrite: false, + path: "./workspace/some/base/path/rust/lib.rs", }, { content: '// This file was @generated by metagen and is intended @@ -723,7 +723,7 @@ export type Func19Handler = Handler; export type Func20Handler = Handler; ', overwrite: true, - path: "./workspace/some/base/path/ts/mdk.ts", + path: "./workspace/some/base/path/ts/fdk.ts", }, { content: "from datetime import timedelta @@ -1097,7 +1097,7 @@ def fnTwo(inp: TwoInput) -> TypeString6: path: "./workspace/some/base/path/python/same_hit.py", }, { - content: 'package.name = "example_metagen_mdk" + content: 'package.name = "example_metagen_fdk" package.edition = "2021" package.version = "0.0.1" @@ -1118,34 +1118,6 @@ opt-level = "z"', overwrite: false, path: "./workspace/some/base/path/rust/Cargo.toml", }, - { - content: " -mod mdk; -pub use mdk::*; - -/* -init_mat! { - hook: || { - // initialize global stuff here if you need it - MatBuilder::new() - // register function handlers here - .register_handler(stubs::MyFunc::erased(MyMat)) - } -} - -struct MyMat; - -// FIXME: use actual types from your mdk here -impl stubs::MyFunc for MyMat { - fn handle(&self, input: types::MyFuncIn, _cx: Ctx) -> anyhow::Result { - unimplemented!() - } -} -*/ -", - overwrite: false, - path: "./workspace/some/base/path/rust/lib.rs", - }, { content: \`// This file was @generated by metagen and is intended // to be generated again on subsequent metagen runs. @@ -1456,7 +1428,35 @@ pub mod stubs { } \`, overwrite: true, - path: "./workspace/some/base/path/rust/mdk.rs", + path: "./workspace/some/base/path/rust/fdk.rs", + }, + { + content: " +mod fdk; +pub use fdk::*; + +/* +init_mat! { + hook: || {FdkGeneratorConfigBase + // initialize global stuff here if you need it + MatBuilder::new() + // register function handlers here + .register_handler(stubs::MyFunc::erased(MyMat)) + } +} + +struct MyMat; + +// FIXME: use actual types from your fdk here +impl stubs::MyFunc for MyMat { + fn handle(&self, input: types::MyFuncIn, _cx: Ctx) -> anyhow::Result { + unimplemented!() + } +} +*/ +", + overwrite: false, + path: "./workspace/some/base/path/rust/lib.rs", }, { content: '// This file was @generated by metagen and is intended @@ -1515,7 +1515,7 @@ export type Func19Handler = Handler; export type Func20Handler = Handler; ', overwrite: true, - path: "./workspace/some/base/path/ts/mdk.ts", + path: "./workspace/some/base/path/ts/fdk.ts", }, { content: "from datetime import timedelta diff --git a/tests/metagen/typegraphs/mdk_py_templates/struct.py.jinja b/tests/metagen/typegraphs/fdk_py_templates/struct.py.jinja similarity index 100% rename from tests/metagen/typegraphs/mdk_py_templates/struct.py.jinja rename to tests/metagen/typegraphs/fdk_py_templates/struct.py.jinja diff --git a/tests/metagen/typegraphs/identities.py b/tests/metagen/typegraphs/identities.py index 78bf3c3e6c..6c57c14b98 100644 --- a/tests/metagen/typegraphs/identities.py +++ b/tests/metagen/typegraphs/identities.py @@ -23,7 +23,7 @@ def identities(g: Graph): "int": t.integer(), "float": t.float(), "boolean": t.boolean(), - # TODO: file upload support for MDK? + # TODO: file upload support for fdk? # "file": t.file(), } ).rename("primitives") @@ -151,28 +151,28 @@ def argify(ty): primitives_args, primitives, module="./identities/ts/handlers.ts", - deps=["./identities/ts/mdk.ts"], + deps=["./identities/ts/fdk.ts"], name="primitives", ).rename("ts_primitives"), ts_composites=deno.import_( composites_args, composites, module="./identities/ts/handlers.ts", - deps=["./identities/ts/mdk.ts"], + deps=["./identities/ts/fdk.ts"], name="composites", ).rename("ts_composites"), ts_cycles=deno.import_( cycles1_args, cycles1, module="./identities/ts/handlers.ts", - deps=["./identities/ts/mdk.ts"], + deps=["./identities/ts/fdk.ts"], name="cycles", ).rename("ts_cycles"), ts_simple_cycles=deno.import_( simple_cycles_1_args, simple_cycles_1, module="./identities/ts/handlers.ts", - deps=["./identities/ts/mdk.ts"], + deps=["./identities/ts/fdk.ts"], name="simple_cycles", ).rename("ts_simple_cycles"), rs_primitives=wasm.handler( diff --git a/tests/metagen/typegraphs/identities/metatype.yml b/tests/metagen/typegraphs/identities/metatype.yml index 8b19f5d0ad..d38845c80e 100644 --- a/tests/metagen/typegraphs/identities/metatype.yml +++ b/tests/metagen/typegraphs/identities/metatype.yml @@ -7,12 +7,12 @@ typegates: metagen: targets: main: - - generator: mdk_rust + - generator: fdk_rust path: ./rs/ typegraph_path: ../identities.py - - generator: mdk_python + - generator: fdk_python path: ./py/ typegraph_path: ../identities.py - - generator: mdk_typescript + - generator: fdk_typescript path: ./ts/ typegraph_path: ../identities.py diff --git a/tests/metagen/typegraphs/identities/rs/Cargo.lock b/tests/metagen/typegraphs/identities/rs/Cargo.lock index a190fbd4dc..e04cbe2302 100644 --- a/tests/metagen/typegraphs/identities/rs/Cargo.lock +++ b/tests/metagen/typegraphs/identities/rs/Cargo.lock @@ -71,7 +71,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] -name = "metagen_identities_mdk" +name = "metagen_identities_fdk" version = "0.0.1" dependencies = [ "anyhow", diff --git a/tests/metagen/typegraphs/identities/rs/Cargo.toml b/tests/metagen/typegraphs/identities/rs/Cargo.toml index bec2515909..7da6fb30ff 100644 --- a/tests/metagen/typegraphs/identities/rs/Cargo.toml +++ b/tests/metagen/typegraphs/identities/rs/Cargo.toml @@ -1,4 +1,4 @@ -package.name = "metagen_identities_mdk" +package.name = "metagen_identities_fdk" package.edition = "2021" package.version = "0.0.1" diff --git a/tests/metagen/typegraphs/identities/rs/build.sh b/tests/metagen/typegraphs/identities/rs/build.sh index b9ce191b0c..8b48757260 100755 --- a/tests/metagen/typegraphs/identities/rs/build.sh +++ b/tests/metagen/typegraphs/identities/rs/build.sh @@ -9,7 +9,7 @@ TARGET=wasm32-wasi cargo build --target $TARGET # --release # wasm-opt --enable-bulk-memory -Oz ./target/$TARGET/release/rust.wasm -o ./target/rust-component.wasm.opt wasm-tools component new \ - ./target/$TARGET/debug/metagen_identities_mdk.wasm \ + ./target/$TARGET/debug/metagen_identities_fdk.wasm \ -o ./target/rust-component.wasm \ --adapt wasi_snapshot_preview1=$ADAPTOR # wasm-tools component wit target/rust-component.wasm diff --git a/tests/metagen/typegraphs/identities/rs/mdk.rs b/tests/metagen/typegraphs/identities/rs/fdk.rs similarity index 100% rename from tests/metagen/typegraphs/identities/rs/mdk.rs rename to tests/metagen/typegraphs/identities/rs/fdk.rs diff --git a/tests/metagen/typegraphs/identities/rs/lib.rs b/tests/metagen/typegraphs/identities/rs/lib.rs index 8441e2786a..0214d4a872 100644 --- a/tests/metagen/typegraphs/identities/rs/lib.rs +++ b/tests/metagen/typegraphs/identities/rs/lib.rs @@ -1,8 +1,8 @@ // Copyright Metatype OÜ, licensed under the Elastic License 2.0. // SPDX-License-Identifier: Elastic-2.0 -mod mdk; -pub use mdk::*; +mod fdk; +pub use fdk::*; init_mat! { hook: || { diff --git a/tests/metagen/typegraphs/identities/ts/mdk.ts b/tests/metagen/typegraphs/identities/ts/fdk.ts similarity index 100% rename from tests/metagen/typegraphs/identities/ts/mdk.ts rename to tests/metagen/typegraphs/identities/ts/fdk.ts diff --git a/tests/metagen/typegraphs/identities/ts/handlers.ts b/tests/metagen/typegraphs/identities/ts/handlers.ts index 5912b3aee0..3f9fad44c9 100644 --- a/tests/metagen/typegraphs/identities/ts/handlers.ts +++ b/tests/metagen/typegraphs/identities/ts/handlers.ts @@ -10,7 +10,7 @@ import type { TsCyclesHandler, TsPrimitivesHandler, TsSimpleCyclesHandler, -} from "./mdk.ts"; +} from "./fdk.ts"; export const primitives: TsPrimitivesHandler = (inp, _ctx, _tg) => { const out: Primitives = { diff --git a/tests/metagen/typegraphs/sample/py/client.py b/tests/metagen/typegraphs/sample/py/client.py index 251d9bf08b..a13a8d56bd 100644 --- a/tests/metagen/typegraphs/sample/py/client.py +++ b/tests/metagen/typegraphs/sample/py/client.py @@ -522,35 +522,39 @@ def scalar(): return NodeMeta() @staticmethod - def Post(): + def Func26(): return NodeMeta( - sub_nodes={ - "id": NodeDescs.scalar, - "slug": NodeDescs.scalar, - "title": NodeDescs.scalar, + sub_nodes=NodeDescs.scalar().sub_nodes, + arg_types={ + "id": "String4", + "slug": "String1", + "title": "String1", }, ) @staticmethod - def User(): + def Post(): return NodeMeta( sub_nodes={ "id": NodeDescs.scalar, - "email": NodeDescs.scalar, - "posts": NodeDescs.Post, + "slug": NodeDescs.scalar, + "title": NodeDescs.scalar, }, ) @staticmethod - def Func23(): + def Func27(): return NodeMeta( - sub_nodes=NodeDescs.User().sub_nodes, + sub_nodes=NodeDescs.Post().sub_nodes, ) @staticmethod - def Func25(): + def Func28(): return NodeMeta( - sub_nodes=NodeDescs.scalar().sub_nodes, + sub_nodes=NodeDescs.Post().sub_nodes, + arg_types={ + "id": "String13", + }, ) @staticmethod @@ -560,29 +564,25 @@ def Func24(): ) @staticmethod - def Func27(): + def Func25(): return NodeMeta( - sub_nodes=NodeDescs.Post().sub_nodes, + sub_nodes=NodeDescs.scalar().sub_nodes, ) @staticmethod - def Func28(): + def User(): return NodeMeta( - sub_nodes=NodeDescs.Post().sub_nodes, - arg_types={ - "id": "String13", + sub_nodes={ + "id": NodeDescs.scalar, + "email": NodeDescs.scalar, + "posts": NodeDescs.Post, }, ) @staticmethod - def Func26(): + def Func23(): return NodeMeta( - sub_nodes=NodeDescs.scalar().sub_nodes, - arg_types={ - "id": "String4", - "slug": "String1", - "title": "String1", - }, + sub_nodes=NodeDescs.User().sub_nodes, ) diff --git a/tests/metagen/typegraphs/sample/rs/Cargo.lock b/tests/metagen/typegraphs/sample/rs/Cargo.lock index 34a50f6ca2..1188546a77 100644 --- a/tests/metagen/typegraphs/sample/rs/Cargo.lock +++ b/tests/metagen/typegraphs/sample/rs/Cargo.lock @@ -729,7 +729,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] -name = "sample_mdk" +name = "sample_fdk" version = "0.0.1" dependencies = [ "reqwest", diff --git a/tests/metagen/typegraphs/sample/rs/Cargo.toml b/tests/metagen/typegraphs/sample/rs/Cargo.toml index 336b0dd27c..fcb9748602 100644 --- a/tests/metagen/typegraphs/sample/rs/Cargo.toml +++ b/tests/metagen/typegraphs/sample/rs/Cargo.toml @@ -1,15 +1,15 @@ -package.name = "sample_mdk" +package.name = "sample_fdk" package.edition = "2021" package.version = "0.0.1" [dependencies] serde = { version = "1.0.203", features = ["derive"] } serde_json = "1.0.117" -reqwest = { version = "0.12", features = ["blocking","json"] } +reqwest = { version = "0.12", features = ["blocking", "json"] } tokio = { version = "1", features = ["rt-multi-thread"] } # The options after here are configured for crates intended to be # wasm artifacts. Remove them if your usage is different [[bin]] -name = "sample_mdk" +name = "sample_fdk" path = "main.rs" diff --git a/tests/metagen/typegraphs/sample/rs/client.rs b/tests/metagen/typegraphs/sample/rs/client.rs index 7a4d6fe02a..85955c7493 100644 --- a/tests/metagen/typegraphs/sample/rs/client.rs +++ b/tests/metagen/typegraphs/sample/rs/client.rs @@ -2152,54 +2152,58 @@ mod node_metas { ), } } + pub fn Func28() -> NodeMeta { + NodeMeta { + arg_types: Some([("id".into(), "String13".into())].into()), + ..Post() + } + } pub fn Func24() -> NodeMeta { NodeMeta { ..Post() } } pub fn Func27() -> NodeMeta { NodeMeta { ..Post() } } - pub fn User() -> NodeMeta { + pub fn Func26() -> NodeMeta { NodeMeta { - arg_types: None, - variants: None, - sub_nodes: Some( + arg_types: Some( [ - ("id".into(), scalar as NodeMetaFn), - ("email".into(), scalar as NodeMetaFn), - ("posts".into(), Post as NodeMetaFn), + ("id".into(), "String4".into()), + ("slug".into(), "String1".into()), + ("title".into(), "String1".into()), ] .into(), ), + ..scalar() } } - pub fn Func23() -> NodeMeta { - NodeMeta { ..User() } - } pub fn Func25() -> NodeMeta { NodeMeta { ..scalar() } } - pub fn Func26() -> NodeMeta { + pub fn User() -> NodeMeta { NodeMeta { - arg_types: Some( + arg_types: None, + variants: None, + sub_nodes: Some( [ - ("id".into(), "String4".into()), - ("slug".into(), "String1".into()), - ("title".into(), "String1".into()), + ("id".into(), scalar as NodeMetaFn), + ("email".into(), scalar as NodeMetaFn), + ("posts".into(), Post as NodeMetaFn), ] .into(), ), - ..scalar() } } - pub fn Func28() -> NodeMeta { - NodeMeta { - arg_types: Some([("id".into(), "String13".into())].into()), - ..Post() - } + pub fn Func23() -> NodeMeta { + NodeMeta { ..User() } } } use types::*; pub mod types { + #[derive(Debug, serde::Serialize, serde::Deserialize)] + pub struct Object21Partial { + pub id: Option, + } pub type StringUuid4 = String; #[derive(Debug, serde::Serialize, serde::Deserialize)] pub struct PostPartial { @@ -2207,10 +2211,6 @@ pub mod types { pub slug: Option, pub title: Option, } - #[derive(Debug, serde::Serialize, serde::Deserialize)] - pub struct Object21Partial { - pub id: Option, - } pub type StringEmail5 = String; pub type Post7 = Vec; #[derive(Debug, serde::Serialize, serde::Deserialize)] diff --git a/tests/metagen/typegraphs/sample/ts/client.ts b/tests/metagen/typegraphs/sample/ts/client.ts index 46644a8c87..ead8e27c08 100644 --- a/tests/metagen/typegraphs/sample/ts/client.ts +++ b/tests/metagen/typegraphs/sample/ts/client.ts @@ -656,11 +656,6 @@ const nodeMetas = { ], }; }, - Func27(): NodeMeta { - return { - ...nodeMetas.Post(), - }; - }, User(): NodeMeta { return { subNodes: [ @@ -675,14 +670,14 @@ const nodeMetas = { ...nodeMetas.User(), }; }, - Func25(): NodeMeta { + Func27(): NodeMeta { return { - ...nodeMetas.scalar(), + ...nodeMetas.Post(), }; }, - Func24(): NodeMeta { + Func25(): NodeMeta { return { - ...nodeMetas.Post(), + ...nodeMetas.scalar(), }; }, Func28(): NodeMeta { @@ -703,9 +698,11 @@ const nodeMetas = { }, }; }, -}; -export type Object21 = { - id: string; + Func24(): NodeMeta { + return { + ...nodeMetas.Post(), + }; + }, }; export type StringUuid4 = string; export type Post = { @@ -713,6 +710,9 @@ export type Post = { slug: string; title: string; }; +export type Object21 = { + id: string; +}; export type StringEmail5 = string; export type Post7 = Array; export type User = { diff --git a/tests/metatype.yml b/tests/metatype.yml index eed689a250..3be767ce58 100644 --- a/tests/metatype.yml +++ b/tests/metatype.yml @@ -31,7 +31,7 @@ typegraphs: metagen: targets: wasm_wire: - - generator: mdk_rust + - generator: fdk_rust path: ./runtimes/wasm_wire/rust/ typegraph_path: ./runtimes/wasm_wire/wasm_wire.ts stubbed_runtimes: ["wasm_wire"] diff --git a/tests/runtimes/wasm_wire/rust/mdk.rs b/tests/runtimes/wasm_wire/rust/fdk.rs similarity index 100% rename from tests/runtimes/wasm_wire/rust/mdk.rs rename to tests/runtimes/wasm_wire/rust/fdk.rs diff --git a/tests/runtimes/wasm_wire/rust/lib.rs b/tests/runtimes/wasm_wire/rust/lib.rs index 65a8a84ba5..56ad1c524d 100644 --- a/tests/runtimes/wasm_wire/rust/lib.rs +++ b/tests/runtimes/wasm_wire/rust/lib.rs @@ -1,9 +1,9 @@ // Copyright Metatype OÜ, licensed under the Elastic License 2.0. // SPDX-License-Identifier: Elastic-2.0 -mod mdk; +mod fdk; use anyhow::Context; -use mdk::*; +use fdk::*; use serde_json::json; init_mat! { diff --git a/tools/Dockerfile.dockerignore b/tools/Dockerfile.dockerignore index 6519da4603..9f797defd5 100644 --- a/tools/Dockerfile.dockerignore +++ b/tools/Dockerfile.dockerignore @@ -7,7 +7,7 @@ !src/common !src/meta-cli/Cargo.toml !src/metagen/Cargo.toml -!src/metagen/src/mdk_rust/static/Cargo.toml +!src/metagen/src/fdk_rust/static/Cargo.toml !src/mt_deno !src/pyrt_wit_wire !src/typegate/ diff --git a/tools/tasks/test.ts b/tools/tasks/test.ts index f00f76f212..649c9e4fc3 100644 --- a/tools/tasks/test.ts +++ b/tools/tasks/test.ts @@ -31,7 +31,7 @@ export default { --exclude typegate --exclude typegate_engine --exclude typegraph_core - --exclude metagen_mdk_rust_static`; + --exclude metagen_fdk_rust_static`; // typegraph_core tests need to be run separately // without --tests, the --doc is causing a link error "syntax error in VERSION script" await $`cargo test --locked --package typegraph_core --tests`; From eb2d7d96338b631a03c4f558b4959520767cac49 Mon Sep 17 00:00:00 2001 From: j03-dev <24nomeniavo@gmail.com> Date: Thu, 19 Sep 2024 16:11:56 +0300 Subject: [PATCH 6/8] fix grpc docs --- docs/metatype.dev/docs/reference/runtimes/grpc/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/metatype.dev/docs/reference/runtimes/grpc/index.mdx b/docs/metatype.dev/docs/reference/runtimes/grpc/index.mdx index 0e62623e74..e26167b98d 100644 --- a/docs/metatype.dev/docs/reference/runtimes/grpc/index.mdx +++ b/docs/metatype.dev/docs/reference/runtimes/grpc/index.mdx @@ -32,7 +32,7 @@ This method creates a typegraph function for gRPC method calls. It accepts the f ## Example From b5a56ccb3bf21f855f5925523050940b84de5f4c Mon Sep 17 00:00:00 2001 From: j03-dev <24nomeniavo@gmail.com> Date: Fri, 20 Sep 2024 07:52:49 +0300 Subject: [PATCH 7/8] upgrade protoc version to 24.4 --- .ghjk/lock.json | 30 ++++++++++++++++++------------ ghjk.ts | 2 +- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/.ghjk/lock.json b/.ghjk/lock.json index 0de2e9dc57..4bcc3c572a 100644 --- a/.ghjk/lock.json +++ b/.ghjk/lock.json @@ -791,6 +791,12 @@ "portRef": "cpy_bs_ghrel@0.1.0", "releaseTag": "20240814", "specifiedVersion": true + }, + "bciqef6pcivthu6ra2liydilk2afeip3lxwaqnvkv5l6dls3rzk2hvvq": { + "version": "v24.4", + "buildDepConfigs": {}, + "portRef": "protoc_ghrel@0.1.0", + "specifiedVersion": true } } }, @@ -815,7 +821,7 @@ }, "ghjkEnvProvInstSet____rust": { "installs": [ - "bciqj5xfgcxzfw3tusoy4v53dcinxqxskfwe3lylcjevxl6mbroky5za", + "bciqecz522d7oento2kjvwx3waohx4mjhjjerefepetwyal6hxxs57wa", "bciqlubbahrp4pxohyffmn5yj52atjgmn5nxepmkdev6wtmvpbx7kr7y", "bciqirg723pselb4g77l6ssuytptohd3rvin4ybnwncidus52tfpu6ty" ], @@ -832,7 +838,7 @@ "bciqmvgsg7h3ohj3m7das4bznahgt6tyq7mamta3n2vorulqvml7mywq", "bciqicdqw36v63cbrscwsgtu2htrmwmgtfoxexv4rx5d2y24vytxbuma", "bciqe33uhsuaesrjk6luzxrbbimwg5ydt6x2lrieelwbr7aft4g2qwsy", - "bciqj5xfgcxzfw3tusoy4v53dcinxqxskfwe3lylcjevxl6mbroky5za", + "bciqecz522d7oento2kjvwx3waohx4mjhjjerefepetwyal6hxxs57wa", "bciqlubbahrp4pxohyffmn5yj52atjgmn5nxepmkdev6wtmvpbx7kr7y", "bciqirg723pselb4g77l6ssuytptohd3rvin4ybnwncidus52tfpu6ty", "bciqfpjzi6gguk7dafyicfjpzpwtybgyc2dsnxg2zxkcmyinzy7abpla", @@ -851,7 +857,7 @@ "ghjkEnvProvInstSet___oci": { "installs": [ "bciqbx637744bfiyvprs77xdnvdt7uuwmtlntfjpwmkda672gklkbpmi", - "bciqj5xfgcxzfw3tusoy4v53dcinxqxskfwe3lylcjevxl6mbroky5za", + "bciqecz522d7oento2kjvwx3waohx4mjhjjerefepetwyal6hxxs57wa", "bciqlubbahrp4pxohyffmn5yj52atjgmn5nxepmkdev6wtmvpbx7kr7y", "bciqirg723pselb4g77l6ssuytptohd3rvin4ybnwncidus52tfpu6ty", "bciqojan3zglnfctnmqyxvnxaha46yrnlhj77j3kw4mxadvauqepqdba", @@ -895,7 +901,7 @@ "bciqmvgsg7h3ohj3m7das4bznahgt6tyq7mamta3n2vorulqvml7mywq", "bciqicdqw36v63cbrscwsgtu2htrmwmgtfoxexv4rx5d2y24vytxbuma", "bciqe33uhsuaesrjk6luzxrbbimwg5ydt6x2lrieelwbr7aft4g2qwsy", - "bciqj5xfgcxzfw3tusoy4v53dcinxqxskfwe3lylcjevxl6mbroky5za", + "bciqecz522d7oento2kjvwx3waohx4mjhjjerefepetwyal6hxxs57wa", "bciqlubbahrp4pxohyffmn5yj52atjgmn5nxepmkdev6wtmvpbx7kr7y", "bciqirg723pselb4g77l6ssuytptohd3rvin4ybnwncidus52tfpu6ty", "bciqfpjzi6gguk7dafyicfjpzpwtybgyc2dsnxg2zxkcmyinzy7abpla", @@ -933,7 +939,7 @@ }, "ghjkEnvProvInstSet_______task_env_test-rust": { "installs": [ - "bciqj5xfgcxzfw3tusoy4v53dcinxqxskfwe3lylcjevxl6mbroky5za", + "bciqecz522d7oento2kjvwx3waohx4mjhjjerefepetwyal6hxxs57wa", "bciqlubbahrp4pxohyffmn5yj52atjgmn5nxepmkdev6wtmvpbx7kr7y", "bciqirg723pselb4g77l6ssuytptohd3rvin4ybnwncidus52tfpu6ty", "bciqezep4ufkgwesldlm5etyfkgdsiickfudx7cosydcz6xtgeorn2hy", @@ -947,7 +953,7 @@ }, "ghjkEnvProvInstSet_______task_env_dev-eg-tgraphs": { "installs": [ - "bciqj5xfgcxzfw3tusoy4v53dcinxqxskfwe3lylcjevxl6mbroky5za", + "bciqecz522d7oento2kjvwx3waohx4mjhjjerefepetwyal6hxxs57wa", "bciqlubbahrp4pxohyffmn5yj52atjgmn5nxepmkdev6wtmvpbx7kr7y", "bciqirg723pselb4g77l6ssuytptohd3rvin4ybnwncidus52tfpu6ty", "bciqezep4ufkgwesldlm5etyfkgdsiickfudx7cosydcz6xtgeorn2hy", @@ -961,7 +967,7 @@ }, "ghjkEnvProvInstSet_______task_env_build-tgraph-core": { "installs": [ - "bciqj5xfgcxzfw3tusoy4v53dcinxqxskfwe3lylcjevxl6mbroky5za", + "bciqecz522d7oento2kjvwx3waohx4mjhjjerefepetwyal6hxxs57wa", "bciqlubbahrp4pxohyffmn5yj52atjgmn5nxepmkdev6wtmvpbx7kr7y", "bciqirg723pselb4g77l6ssuytptohd3rvin4ybnwncidus52tfpu6ty", "bciqojan3zglnfctnmqyxvnxaha46yrnlhj77j3kw4mxadvauqepqdba", @@ -973,7 +979,7 @@ }, "ghjkEnvProvInstSet_______task_env_build-tgraph-py": { "installs": [ - "bciqj5xfgcxzfw3tusoy4v53dcinxqxskfwe3lylcjevxl6mbroky5za", + "bciqecz522d7oento2kjvwx3waohx4mjhjjerefepetwyal6hxxs57wa", "bciqlubbahrp4pxohyffmn5yj52atjgmn5nxepmkdev6wtmvpbx7kr7y", "bciqirg723pselb4g77l6ssuytptohd3rvin4ybnwncidus52tfpu6ty", "bciqojan3zglnfctnmqyxvnxaha46yrnlhj77j3kw4mxadvauqepqdba", @@ -988,7 +994,7 @@ }, "ghjkEnvProvInstSet_______task_env_build-tgraph-ts": { "installs": [ - "bciqj5xfgcxzfw3tusoy4v53dcinxqxskfwe3lylcjevxl6mbroky5za", + "bciqecz522d7oento2kjvwx3waohx4mjhjjerefepetwyal6hxxs57wa", "bciqlubbahrp4pxohyffmn5yj52atjgmn5nxepmkdev6wtmvpbx7kr7y", "bciqirg723pselb4g77l6ssuytptohd3rvin4ybnwncidus52tfpu6ty", "bciqojan3zglnfctnmqyxvnxaha46yrnlhj77j3kw4mxadvauqepqdba", @@ -1003,7 +1009,7 @@ }, "ghjkEnvProvInstSet_______task_env_build-sys-tgraphs": { "installs": [ - "bciqj5xfgcxzfw3tusoy4v53dcinxqxskfwe3lylcjevxl6mbroky5za", + "bciqecz522d7oento2kjvwx3waohx4mjhjjerefepetwyal6hxxs57wa", "bciqlubbahrp4pxohyffmn5yj52atjgmn5nxepmkdev6wtmvpbx7kr7y", "bciqirg723pselb4g77l6ssuytptohd3rvin4ybnwncidus52tfpu6ty", "bciqfpjzi6gguk7dafyicfjpzpwtybgyc2dsnxg2zxkcmyinzy7abpla", @@ -2390,8 +2396,8 @@ "cpy_bs_ghrel": "bciqfjhy4uuhkcogsnxxs5fv4ml7m5ykvfm4my45npfyoap2efbfsmby", "node_org": "bciqexpmyf75pimfmu3czcedptwynipi6pztai4ixm6kdj6wwlymesby" }, - "bciqj5xfgcxzfw3tusoy4v53dcinxqxskfwe3lylcjevxl6mbroky5za": { - "version": "v24.1", + "bciqecz522d7oento2kjvwx3waohx4mjhjjerefepetwyal6hxxs57wa": { + "version": "v24.4", "port": { "ty": "denoWorker@v1", "name": "protoc_ghrel", diff --git a/ghjk.ts b/ghjk.ts index 1c43ee12b1..44246399b3 100644 --- a/ghjk.ts +++ b/ghjk.ts @@ -30,7 +30,7 @@ env("main") env("_rust").install( // use rustup for the actual toolchain - ports.protoc({ version: "v24.1" }), + ports.protoc({ version: "v24.4" }), ports.cmake()[0], ); From 859722e0cde6a885ba47e0730254a91ad74a6dcf Mon Sep 17 00:00:00 2001 From: j03-dev <24nomeniavo@gmail.com> Date: Fri, 20 Sep 2024 13:39:16 +0300 Subject: [PATCH 8/8] don't change the changelog --- CHANGELOG.md | 4895 +++++++++++++++++++++++++------------------------- 1 file changed, 2447 insertions(+), 2448 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e4f5a2218..f6288cc35f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,7 +25,7 @@ Bump to v0.4.10 (#835 Use import_map at runtime (#833) -- Bump to release v0.4.10-rc1 +- Bump to release v0.4.10-rc1 - Use import_map.json at runtime since remote configs aren't supported
@@ -40,7 +40,7 @@ Use import_map at runtime (#831) -- Bump version to v0.4.9 +- Bump version to v0.4.9 - Fix issue with cross config context @@ -78,39 +78,39 @@ Bump to v0.4.9 (#831< (metagen) Client_ts (#790) -- Implements `client_ts` as described in #777 . - -#### Migration notes - -... - -- [x] The change comes with new or modified tests -- [x] Hard-to-understand functions have explanatory comments -- [ ] End-user documentation is updated to reflect the change - - - -## Summary by CodeRabbit - -- **Bug Fixes** -- Improved error handling in the `typegraph` function to provide better -error messages. - -- **Chores** -- Updated Docker image references to use `docker.io` prefix for -consistency. - - Excluded unnecessary files from the VSCode settings. - - Enhanced configurability of Docker commands in development tasks. -- Updated environment variable `GHJK_VERSION` to reflect a semantic -versioning format. - -- **New Features** -- Introduced modules and methods for TypeScript and Python code -generation in the `metagen` library, enhancing client generation -capabilities. - - Added `test_typegraph_3` function for improved testing capabilities. - - Included metadata for the package manager in the project settings. +- Implements `client_ts` as described in #777 . + +#### Migration notes + +... + +- [x] The change comes with new or modified tests +- [x] Hard-to-understand functions have explanatory comments +- [ ] End-user documentation is updated to reflect the change + + + +## Summary by CodeRabbit + +- **Bug Fixes** +- Improved error handling in the `typegraph` function to provide better +error messages. + +- **Chores** +- Updated Docker image references to use `docker.io` prefix for +consistency. + - Excluded unnecessary files from the VSCode settings. + - Enhanced configurability of Docker commands in development tasks. +- Updated environment variable `GHJK_VERSION` to reflect a semantic +versioning format. + +- **New Features** +- Introduced modules and methods for TypeScript and Python code +generation in the `metagen` library, enhancing client generation +capabilities. + - Added `test_typegraph_3` function for improved testing capabilities. + - Included metadata for the package manager in the project settings. @@ -119,14 +119,14 @@ capabilities. (sub) Sdk and typing (#811) -User side of substantial - -#### Migration notes - -None - -- [ ] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments +User side of substantial + +#### Migration notes + +None + +- [ ] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change @@ -135,10 +135,10 @@ None Add caching to Secrets struct to improve performance (#813) -#### Migration notes - -- [ ] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments +#### Migration notes + +- [ ] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change @@ -151,33 +151,33 @@ Add caching to Secrets struct to improve performance (#822) - - - - -## Ensure documentation is pushing for meta dev instead of meta typegate -- [x] add a warning that envs are not set. - - - - -[MET-635](https://linear.app/metatypedev/issue/MET-635/cli-ensure-documentation-is-pushing-for-meta-dev-instead-of-meta) - - - -#### Migration notes - -_No Migration Needed_ - -- [ ] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments + + + + +## Ensure documentation is pushing for meta dev instead of meta typegate +- [x] add a warning that envs are not set. + + + + +[MET-635](https://linear.app/metatypedev/issue/MET-635/cli-ensure-documentation-is-pushing-for-meta-dev-instead-of-meta) + + + +#### Migration notes + +_No Migration Needed_ + +- [ ] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change @@ -186,39 +186,39 @@ _No Migration Needed_ Flatten deps and improve repo folder (#821) -- Renames `libs/` to `src/`. -- Moves `typegate/`, `meta-cli`, `typegraph/`, `meta-lsp/` to `src/`. -- Renames `dev/` to `tools/` -- Moves `website/` to `docs/metatype.dev`/ -- Moves `src/typegate/tests` to `tests/` -- Moves `src/typegraph/deno/dev` to `tools/jsr/` -- Moves `src/typegraph/deno/sdk` to `src/typegraph/deno/` -- Renames `src/deno` to `src/mt_deno` -- Bumps deno to `1.46.1` -- Bumps rust toolchain to `1.80.1` -- Moves all rust dependencies to workspace section -- Moves `tools/task-*.ts` to `tools/task/*.ts` -- Moves `cliff.toml`, `Cross.toml`, `ruff.toml` to `tools/` -- Uses deno -[workspaces](https://docs.deno.com/runtime/manual/basics/workspaces/) to -organize `src/typegraph/deno`, `src/typegate`, `tools/`, `tests/` and -more. -- Closes MET-607 -- Updates poetry to 1.8.3 -- Bumps metatype to version 0.4.9-rc1 -- [x] Update CONTRIBUTING.md -- [x] Fix CI workflows -- [x] Fix Dockerfile -- [x] Fix all tests - -#### Migration notes - -- No end user changes required - -- [x] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments -- [ ] End-user documentation is updated to reflect the change - +- Renames `libs/` to `src/`. +- Moves `typegate/`, `meta-cli`, `typegraph/`, `meta-lsp/` to `src/`. +- Renames `dev/` to `tools/` +- Moves `website/` to `docs/metatype.dev`/ +- Moves `src/typegate/tests` to `tests/` +- Moves `src/typegraph/deno/dev` to `tools/jsr/` +- Moves `src/typegraph/deno/sdk` to `src/typegraph/deno/` +- Renames `src/deno` to `src/mt_deno` +- Bumps deno to `1.46.1` +- Bumps rust toolchain to `1.80.1` +- Moves all rust dependencies to workspace section +- Moves `tools/task-*.ts` to `tools/task/*.ts` +- Moves `cliff.toml`, `Cross.toml`, `ruff.toml` to `tools/` +- Uses deno +[workspaces](https://docs.deno.com/runtime/manual/basics/workspaces/) to +organize `src/typegraph/deno`, `src/typegate`, `tools/`, `tests/` and +more. +- Closes MET-607 +- Updates poetry to 1.8.3 +- Bumps metatype to version 0.4.9-rc1 +- [x] Update CONTRIBUTING.md +- [x] Fix CI workflows +- [x] Fix Dockerfile +- [x] Fix all tests + +#### Migration notes + +- No end user changes required + +- [x] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments +- [ ] End-user documentation is updated to reflect the change + --------- @@ -233,7 +233,7 @@ more. Table method for kv runtime (#815) -I discover an issue in the KV runtime documentation +I discover an issue in the KV runtime documentation [kvruntime docs](https://metatype.dev/docs/reference/runtimes/kv) @@ -242,10 +242,10 @@ I discover an issue in the KV runtime documentation `wasm_backtrace` config bug (#814) -- `$WASM_BACKTRACE_DETAILS` was enabled in `main` ghjk env which -affected embedded wasm module compilation to have backtrace enabled. -This broke typegate runs without the flag enabled due to mismatch. -- Fixes Cargo.lock not being used in Dockerfile. +- `$WASM_BACKTRACE_DETAILS` was enabled in `main` ghjk env which +affected embedded wasm module compilation to have backtrace enabled. +This broke typegate runs without the flag enabled due to mismatch. +- Fixes Cargo.lock not being used in Dockerfile. - Prepare 0.4.8 release @@ -258,12 +258,12 @@ This broke typegate runs without the flag enabled due to mismatch. Kv runtime (#797) -#### Migration notes - -... - -- [x] The change comes with new or modified tests -- [x] End-user documentation is updated to reflect the change +#### Migration notes + +... + +- [x] The change comes with new or modified tests +- [x] End-user documentation is updated to reflect the change - [ ] Hard-to-understand functions have explanatory comments @@ -276,7 +276,7 @@ Kv runtime (#797) Bump to 0.4.8-0 (#810) -- Bump prerelease +- Bump prerelease - Fix minor issue with release pipeline @@ -291,39 +291,39 @@ Bump to 0.4.8-0 (#810 (cli) Fix auto deployment (#806) - - - - -- Upgrade lade-sdk -- Fix discovery -- Remove obsolete dep: actix-web - - - -- `lade-sdk` uses the main branch, which now has the fix for the -following issues: -- dependency version conflict with -[deno](https://github.com/metatypedev/deno/blob/691f297537c4a3d9a12ce005c0478b4aee86287c/Cargo.toml#L179): -`url` is set at `<2.5.0`; -- required ProjectID error for infisical: the project id is added -explicitly on the command. - - - -#### Migration notes - -... - -- [ ] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments + + + + +- Upgrade lade-sdk +- Fix discovery +- Remove obsolete dep: actix-web + + + +- `lade-sdk` uses the main branch, which now has the fix for the +following issues: +- dependency version conflict with +[deno](https://github.com/metatypedev/deno/blob/691f297537c4a3d9a12ce005c0478b4aee86287c/Cargo.toml#L179): +`url` is set at `<2.5.0`; +- required ProjectID error for infisical: the project id is added +explicitly on the command. + + + +#### Migration notes + +... + +- [ ] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change @@ -332,31 +332,31 @@ explicitly on the command. Cors headers on error (#803) - - - - -- - - - -- - - - -#### Migration notes - -... - -- [ ] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments + + + + +- + + + +- + + + +#### Migration notes + +... + +- [ ] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change @@ -381,41 +381,41 @@ Bump to 0.4.7-0 (#805 (docs) Add how to test typegraphs doc (#798) -# `How to test your typegraphs` documentation - - - -- [x] add python doc -- [x] add ts doc -- [x] upgrade bitnami/minIo image to 2024? - -#### Migration notes - -_No Migrations Needed_ - -- [ ] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments -- [ ] End-user documentation is updated to reflect the change - - - -## Summary by CodeRabbit - -- **New Features** -- Updated the Minio service to the latest version for improved -performance and potential new features. -- Introduced comprehensive documentation for testing typegraphs in both -TypeScript and Python, enhancing developer experience. - -- **Documentation** - - Enhanced readability of the `Meta CLI` upgrade instructions. -- Reformatted installation instructions for the `typegraph` package for -better clarity. - -- **Chores** -- Updated dependency management configuration for improved compatibility -and performance across different platforms. +# `How to test your typegraphs` documentation + + + +- [x] add python doc +- [x] add ts doc +- [x] upgrade bitnami/minIo image to 2024? + +#### Migration notes + +_No Migrations Needed_ + +- [ ] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments +- [ ] End-user documentation is updated to reflect the change + + + +## Summary by CodeRabbit + +- **New Features** +- Updated the Minio service to the latest version for improved +performance and potential new features. +- Introduced comprehensive documentation for testing typegraphs in both +TypeScript and Python, enhancing developer experience. + +- **Documentation** + - Enhanced readability of the `Meta CLI` upgrade instructions. +- Reformatted installation instructions for the `typegraph` package for +better clarity. + +- **Chores** +- Updated dependency management configuration for improved compatibility +and performance across different platforms. @@ -424,32 +424,32 @@ and performance across different platforms. Improve JSR score (part 1) (#807) - - - - -- Add symbol documentations -- Fix slow types - - - -- - - - -#### Migration notes - -... - -- [ ] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments + + + + +- Add symbol documentations +- Fix slow types + + + +- + + + +#### Migration notes + +... + +- [ ] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change @@ -464,31 +464,31 @@ readable changelog. Better arg split logic for MCLI_LOADER (#799) - - - - -- - - - -- - - - -#### Migration notes - -... - -- [ ] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments + + + + +- + + + +- + + + +#### Migration notes + +... + +- [ ] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change @@ -501,48 +501,48 @@ readable changelog. Prepare 0.4.6 (#795) -- Bump version to 0.4.6-0 -- Add sanity tests for published SDKs -- Bump deno to 1.45.2 -- Bump rust to 1.79.0 -- Fix myriad of bugs - -#### Migration notes - -... - -- [x] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments -- [ ] End-user documentation is updated to reflect the change - - - - -## Summary by CodeRabbit - -- **New Features** -- Introduced new logging capabilities in the `ConnectedEngine` with -adjustable logging levels. -- Implemented cleanup procedures in tests to enhance resource -management. - -- **Bug Fixes** -- Fixed import paths for permissions to ensure correct functionality in -tests and applications. - -- **Version Updates** -- Incremented version numbers across multiple projects and packages to -reflect ongoing development and improvements. - -- **Documentation** -- Added comments to clarify code behavior and potential future -considerations in various modules. - -- **Refactor** -- Optimized string handling in several functions and adjusted method -signatures for improved clarity and efficiency. - +- Bump version to 0.4.6-0 +- Add sanity tests for published SDKs +- Bump deno to 1.45.2 +- Bump rust to 1.79.0 +- Fix myriad of bugs + +#### Migration notes + +... + +- [x] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments +- [ ] End-user documentation is updated to reflect the change + + + + +## Summary by CodeRabbit + +- **New Features** +- Introduced new logging capabilities in the `ConnectedEngine` with +adjustable logging levels. +- Implemented cleanup procedures in tests to enhance resource +management. + +- **Bug Fixes** +- Fixed import paths for permissions to ensure correct functionality in +tests and applications. + +- **Version Updates** +- Incremented version numbers across multiple projects and packages to +reflect ongoing development and improvements. + +- **Documentation** +- Added comments to clarify code behavior and potential future +considerations in various modules. + +- **Refactor** +- Optimized string handling in several functions and adjusted method +signatures for improved clarity and efficiency. + @@ -555,36 +555,36 @@ signatures for improved clarity and efficiency. (docs) Better documentation on `quick-start` page (#793) -## Improve the documentation on `quick-start` page - -- [x] add dev hunt result to homepage. - - - - - - -- - - - -- - - - -#### Migration notes - -... - -- [ ] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments +## Improve the documentation on `quick-start` page + +- [x] add dev hunt result to homepage. + + + + + + +- + + + +- + + + +#### Migration notes + +... + +- [ ] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change @@ -599,15 +599,15 @@ readable changelog. Broken pipeline for 0.4.4 (#782) -Fixes erroneous usage of `setup-deno` which has been replaced by `ghjk` -itself. - -#### Migration notes - -... - -- [ ] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments +Fixes erroneous usage of `setup-deno` which has been replaced by `ghjk` +itself. + +#### Migration notes + +... + +- [ ] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change @@ -616,14 +616,14 @@ itself. Broken release pipeline 2 (#783) -Fix issue with the three remaining failing jobs. - -#### Migration notes - -... - -- [ ] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments +Fix issue with the three remaining failing jobs. + +#### Migration notes + +... + +- [ ] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change @@ -632,15 +632,15 @@ Fix issue with the three remaining failing jobs. Release pipeline 3 (#784) -- Remove accidental dry-run from jsr publish -- Fix cross dockerfile - -#### Migration notes - -... - -- [ ] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments +- Remove accidental dry-run from jsr publish +- Fix cross dockerfile + +#### Migration notes + +... + +- [ ] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change @@ -649,31 +649,31 @@ Release pipeline 3 (# Skip deno stack trace from error message (#787) - - - - -Skip the deno stack trace from the error message when tg_manage fails. - - - - - - - -#### Migration notes - -_N/A_ - -- [ ] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments + + + + +Skip the deno stack trace from the error message when tg_manage fails. + + + + + + + +#### Migration notes + +_N/A_ + +- [ ] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change @@ -687,35 +687,35 @@ _N/A_ - BREAKING: configurable backoff (#789) - - - - -- Make the backoff configurable through the `--retry` and -`--retry-interval-ms` options. -- The default max retry count is changed to 0 on the default mode, and -remains 3 on the watch mode. -- The `--max-parallel-loads` option has been renamed to `--threads`. - - - - - - - -#### Migration notes - -The `--max-parallel-loads` option has been renamed to `--threads`. - -- [ ] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments + + + + +- Make the backoff configurable through the `--retry` and +`--retry-interval-ms` options. +- The default max retry count is changed to 0 on the default mode, and +remains 3 on the watch mode. +- The `--max-parallel-loads` option has been renamed to `--threads`. + + + + + + + +#### Migration notes + +The `--max-parallel-loads` option has been renamed to `--threads`. + +- [ ] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [x] End-user documentation is updated to reflect the change @@ -724,35 +724,35 @@ The `--max-parallel-loads` option has been renamed to `--threads`. Add list subcommand features to meta_cli (#775) -new branch after conflict with main branch - - - - - -- - - - -- - - - -#### Migration notes - -... - -- [ ] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments -- [ ] End-user documentation is updated to reflect the change - +new branch after conflict with main branch + + + + + +- + + + +- + + + +#### Migration notes + +... + +- [ ] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments +- [ ] End-user documentation is updated to reflect the change + --------- @@ -761,13 +761,13 @@ readable changelog. Upgrade www and gha (#786) - @@ -776,19 +776,19 @@ readable changelog. Add back gleap (#791) - - - - -- Gleap.io was removed a while back -- this adds it back so visitors can open ticket and suggest feedback + + + + +- Gleap.io was removed a while back +- this adds it back so visitors can open ticket and suggest feedback - internally, we will use this to fine tune the documentation @@ -801,19 +801,19 @@ readable changelog. Bump v0.4.5 (#792) -- Bumps metatype version to 0.4.5 -- Bumps ghjk to latest commit -- Fixes `setup` whiz task to avoid issues on macos -- Fixes release pipeline to publish JSR - -MET-614 MET-606 MET-605 MET-613 - -#### Migration notes - -_No changes required._ - -- [ ] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments +- Bumps metatype version to 0.4.5 +- Bumps ghjk to latest commit +- Fixes `setup` whiz task to avoid issues on macos +- Fixes release pipeline to publish JSR + +MET-614 MET-606 MET-605 MET-613 + +#### Migration notes + +_No changes required._ + +- [ ] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change @@ -828,7 +828,7 @@ _No changes required._ (gate) Ensure all deps are defined in import_map.json (#768) -Ensure that all deps are defined in `import_map.json` with a specific +Ensure that all deps are defined in `import_map.json` with a specific version. @@ -837,104 +837,104 @@ version. Missing typegraphs (#755) - - - - -- fix the typegraphs that were incorrectly formatted - - - - - - - - - -- [ ] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments -- [ ] End-user documentation is updated to reflect the change + - - - - -- add prettier to avoid doc formatting issue -- now explicitly require `!!code-loader!` to load code inside the -documentation (will hopefully help also with the missing typegraphs -issues, still under investigation) - - - - - - - -- [ ] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments -- [ ] End-user documentation is updated to reflect the change - ---------- + - +- fix the typegraphs that were incorrectly formatted + -### Documentation -
- + + + + + +- [ ] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments +- [ ] End-user documentation is updated to reflect the change + +
+
+ +Stable formatting and uniformize the code-loader (#766) + + + + + + +- add prettier to avoid doc formatting issue +- now explicitly require `!!code-loader!` to load code inside the +documentation (will hopefully help also with the missing typegraphs +issues, still under investigation) + + + + + + + +- [ ] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments +- [ ] End-user documentation is updated to reflect the change + +--------- + +
+ + +### Documentation + +
+ Generate clients from openapi (#778) -Demonstrate how to use the openapi spec to generate clients in most -languages/frameworks. - -#### Migration notes - -None - -- [ ] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments -- [ ] End-user documentation is updated to reflect the change - - - - -## Summary by CodeRabbit - -- **Documentation** -- Updated REST API documentation URLs with placeholders for easier -configuration. -- Added information on generating and using OpenAPI clients, including -TypeScript fetch client generation. -- **Bug Fixes** -- Corrected a regular expression in import handling to ensure accurate -replacements. -- **Chores** -- Improved file writing by appending a newline character to JSON -strings. - +Demonstrate how to use the openapi spec to generate clients in most +languages/frameworks. + +#### Migration notes + +None + +- [ ] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments +- [ ] End-user documentation is updated to reflect the change + + + + +## Summary by CodeRabbit + +- **Documentation** +- Updated REST API documentation URLs with placeholders for easier +configuration. +- Added information on generating and using OpenAPI clients, including +TypeScript fetch client generation. +- **Bug Fixes** +- Corrected a regular expression in import handling to ensure accurate +replacements. +- **Chores** +- Improved file writing by appending a newline character to JSON +strings. +
@@ -947,38 +947,38 @@ strings. Move all the configs to one single file (#733) - - - - -- Move all the configs to one single file -- Remove some specific configs from the global config variable and make -them accessible on the `Typegate` instance, to improve test -configurability. - - - - - - - -#### Migration notes - -- `SYNC_REDIS_PASSWORD` has been removed, can only be set on the -`SYNC_REDIS_URL`. - - -- [x] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments -- [x] End-user documentation is updated to reflect the change - + + + + +- Move all the configs to one single file +- Remove some specific configs from the global config variable and make +them accessible on the `Typegate` instance, to improve test +configurability. + + + + + + + +#### Migration notes + +- `SYNC_REDIS_PASSWORD` has been removed, can only be set on the +`SYNC_REDIS_URL`. + + +- [x] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments +- [x] End-user documentation is updated to reflect the change + --------- @@ -987,45 +987,45 @@ configurability. Remove restrictions for union/either types (#761) - - - - -In the previous versions, we restricted the variant types allowed in -union/either to be all in the same category (after flattening -multi-level unions): -- *Category 1* - **GraphQL leaf types**: scalar type, or array of scalar -type, which require no selection set on GraphQL. -- *Category 2* - **GraphQL non-leaf types**: object type or array of -object type, which require a selection set on GraphQL (aka selectable -types in the codebase). - -Those restrictions can be lifted, and the selection field of an -union-type field will have inline fragments with type conditions for -each *Category 2* variant. No type condition is required for *Category -1* types, the selection sets are not relevant. - -The case that is not handled by this PR is when one of the variants is -an array of union type. - - - - -#### Migration notes - -_N/A_ - -- [ ] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments -- [ ] End-user documentation is updated to reflect the change - + + + + +In the previous versions, we restricted the variant types allowed in +union/either to be all in the same category (after flattening +multi-level unions): +- *Category 1* - **GraphQL leaf types**: scalar type, or array of scalar +type, which require no selection set on GraphQL. +- *Category 2* - **GraphQL non-leaf types**: object type or array of +object type, which require a selection set on GraphQL (aka selectable +types in the codebase). + +Those restrictions can be lifted, and the selection field of an +union-type field will have inline fragments with type conditions for +each *Category 2* variant. No type condition is required for *Category +1* types, the selection sets are not relevant. + +The case that is not handled by this PR is when one of the variants is +an array of union type. + + + + +#### Migration notes + +_N/A_ + +- [ ] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments +- [ ] End-user documentation is updated to reflect the change + --------- @@ -1034,38 +1034,38 @@ _N/A_ Typegate in meta dev, upgrade test (#776) - - - - -- Test the typegate upgrade from the latest published version to the -current version. -- Add a flag to run an instance of the typegate with the target -configuration (port, admin passsword) to `meta deploy`, enabled by -default for `meta dev`. - - - - - - - -#### Migration notes - -If you have a script that runs `meta dev`, add the flag `--no-typegate` -if you already have a typegate. - -- [x] The change comes with new or modified tests -- [x] Hard-to-understand functions have explanatory comments -- [ ] End-user documentation is updated to reflect the change - + + + + +- Test the typegate upgrade from the latest published version to the +current version. +- Add a flag to run an instance of the typegate with the target +configuration (port, admin passsword) to `meta deploy`, enabled by +default for `meta dev`. + + + + + + + +#### Migration notes + +If you have a script that runs `meta dev`, add the flag `--no-typegate` +if you already have a typegate. + +- [x] The change comes with new or modified tests +- [x] Hard-to-understand functions have explanatory comments +- [ ] End-user documentation is updated to reflect the change + --------- @@ -1078,31 +1078,31 @@ if you already have a typegate. Add programmatic deploy tests (#769) -## Add Programmatic deploy tests for the docs - -- [x] Add programmatic typegraph deploy/remove tests -- [x] refactor tg_remove to accept `typegraph_name` instead of -`TypegraphOutput` obj. - - - - -[MET-591](https://linear.app/metatypedev/issue/MET-591/docstest-test-example-script-for-tg-deploy) - - - -- - - - -#### Migration notes - -_No Migrations Needed_ - -... - -- [x] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments +## Add Programmatic deploy tests for the docs + +- [x] Add programmatic typegraph deploy/remove tests +- [x] refactor tg_remove to accept `typegraph_name` instead of +`TypegraphOutput` obj. + + + + +[MET-591](https://linear.app/metatypedev/issue/MET-591/docstest-test-example-script-for-tg-deploy) + + + +- + + + +#### Migration notes + +_No Migrations Needed_ + +... + +- [x] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [x] End-user documentation is updated to reflect the change @@ -1111,12 +1111,12 @@ _No Migrations Needed_ Bump to version 0.4.4 (#779) -Prepare release of the 0.4.4 version. - -#### Migration notes - -- [ ] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments +Prepare release of the 0.4.4 version. + +#### Migration notes + +- [ ] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change @@ -1130,22 +1130,22 @@ Prepare release of the 0.4.4 version. - BREAKING: back to deno + jsr exploration (#760) -Try reverting back to deno runtime for the typescript sdk in hope of -making the dx easier. -Hosting a custom node/npm project adds more layer of indirection which -may result in cryptic issues sometimes. - -This should also facilitate publishing on jsr although additional work -are still required on the `jco` codegen side. - -#### Migration notes - -N/A - -- [x] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments -- [ ] End-user documentation is updated to reflect the change - +Try reverting back to deno runtime for the typescript sdk in hope of +making the dx easier. +Hosting a custom node/npm project adds more layer of indirection which +may result in cryptic issues sometimes. + +This should also facilitate publishing on jsr although additional work +are still required on the `jco` codegen side. + +#### Migration notes + +N/A + +- [x] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments +- [ ] End-user documentation is updated to reflect the change + --------- @@ -1154,41 +1154,41 @@ N/A Move to ghjk 0.2.0 (#754) -- Refactors the ghjk.ts, CI to the latest version of ghjk -- Bumps version to 0.4.4-0 -- Fixes race bug in python_sync tests -- Fixes flakeout of wasm `build.sh` scripts due to wasm-tools EOF issue -- #763 -- #746 - -#### Migration notes - -- [ ] The change comes with new or modified tests -- [x] Hard-to-understand functions have explanatory comments -- [x] End-user documentation is updated to reflect the change - - - -## Summary by CodeRabbit - -- **Chores** -- Updated GitHub Actions workflows to use the latest version of -`metatypedev/setup-ghjk` for improved stability and performance. -- Modified `GHJK_VERSION` and various environment variables across -multiple configuration files to ensure compatibility with updated -dependencies. -- Revised Dockerfiles to streamline environment setup and improve build -efficiency. -- Updated dependency management in `pyproject.toml` for better security -and performance. - - Enhanced logging and error handling in test scripts. - -These updates collectively optimize the development environment, -ensuring smoother builds and more reliable workflows. - - - +- Refactors the ghjk.ts, CI to the latest version of ghjk +- Bumps version to 0.4.4-0 +- Fixes race bug in python_sync tests +- Fixes flakeout of wasm `build.sh` scripts due to wasm-tools EOF issue +- #763 +- #746 + +#### Migration notes + +- [ ] The change comes with new or modified tests +- [x] Hard-to-understand functions have explanatory comments +- [x] End-user documentation is updated to reflect the change + + + +## Summary by CodeRabbit + +- **Chores** +- Updated GitHub Actions workflows to use the latest version of +`metatypedev/setup-ghjk` for improved stability and performance. +- Modified `GHJK_VERSION` and various environment variables across +multiple configuration files to ensure compatibility with updated +dependencies. +- Revised Dockerfiles to streamline environment setup and improve build +efficiency. +- Updated dependency management in `pyproject.toml` for better security +and performance. + - Enhanced logging and error handling in test scripts. + +These updates collectively optimize the development environment, +ensuring smoother builds and more reliable workflows. + + + --------- @@ -1201,41 +1201,41 @@ ensuring smoother builds and more reliable workflows. (full) Update test runner (#705) - - - - -New test runner, by default: -- Less verbose -- No output for successful tests - -Parallel tests re-enabled. - - - - - - - - - - -#### Migration notes - -_N/A_ - - + + + +New test runner, by default: +- Less verbose +- No output for successful tests + +Parallel tests re-enabled. + + + + + + + + + + +#### Migration notes + +_N/A_ + + @@ -1259,38 +1259,38 @@ happening (docs) Fix demo typegraphs 2 (#756) - - -Fix example typegraphs on metatype.dev. -- [x] reduce.ts -- [x] policies.ts -- [x] graphql.ts -- [x] authentication.ts - - - - -[MET_574](https://linear.app/metatypedev/issue/MET-574/docs-fix-demo-typegraphs-2) - - - - - - - -#### Migration notes - -_No Migrations Needed_ - -- [ ] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments + + +Fix example typegraphs on metatype.dev. +- [x] reduce.ts +- [x] policies.ts +- [x] graphql.ts +- [x] authentication.ts + + + + +[MET_574](https://linear.app/metatypedev/issue/MET-574/docs-fix-demo-typegraphs-2) + + + + + + + +#### Migration notes + +_No Migrations Needed_ + +- [ ] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change @@ -1299,38 +1299,38 @@ _No Migrations Needed_ (docs) Fix programmatic deployment guides (#762) - - -- [x] Fix typo -- [x] fix/test tg deploy -- [x] fix/test tg remove - - - - -[MET-587](https://linear.app/metatypedev/issue/MET-587/docs-fix-programmatic-deployment-guides) - - - -- - - - -#### Migration notes - -_No Migration Needed_ - -... - -- [ ] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments + + +- [x] Fix typo +- [x] fix/test tg deploy +- [x] fix/test tg remove + + + + +[MET-587](https://linear.app/metatypedev/issue/MET-587/docs-fix-programmatic-deployment-guides) + + + +- + + + +#### Migration notes + +_No Migration Needed_ + +... + +- [ ] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change @@ -1339,32 +1339,32 @@ _No Migration Needed_ Only build xtask once for the tests (#720) -Use the xtask binary to run the tests. - -- [ ] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments -- [ ] End-user documentation is updated to reflect the change - - - - -## Summary by CodeRabbit - -- **New Features** - - Updated platform compatibility to `x86_64-linux`. -- Added new configuration entry for enhanced versioning and platform -support. - -- **Improvements** -- Modified test script to use a custom build script for better test -management. - -These changes improve platform compatibility and streamline the testing -process. - - - +Use the xtask binary to run the tests. + +- [ ] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments +- [ ] End-user documentation is updated to reflect the change + + + + +## Summary by CodeRabbit + +- **New Features** + - Updated platform compatibility to `x86_64-linux`. +- Added new configuration entry for enhanced versioning and platform +support. + +- **Improvements** +- Modified test script to use a custom build script for better test +management. + +These changes improve platform compatibility and streamline the testing +process. + + + --------- @@ -1373,33 +1373,33 @@ process. Missing typegraphs (#741) - -**Fix Missing Typegraphs** - - - -- attempt to fix the missing typegraphs on metatype.dev. - - - -- -[MET-563](https://linear.app/metatypedev/issue/MET-563/docs-complete-missing-typegraphs) - - - -#### Migration notes -_No Migrations Needed_ -... - -- [ ] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments + +**Fix Missing Typegraphs** + + + +- attempt to fix the missing typegraphs on metatype.dev. + + + +- +[MET-563](https://linear.app/metatypedev/issue/MET-563/docs-complete-missing-typegraphs) + + + +#### Migration notes +_No Migrations Needed_ +... + +- [ ] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change @@ -1408,22 +1408,22 @@ _No Migrations Needed_ Upload url path and add logging in the SDK (#740) -- Fix upload url: prepare-upload returns upload tokens instead of upload -urls -- Add logging in the typegraph SDK -- Refactor the actor system in the CLI -- Use jsonrpc for communication between the CLI and typegraph processes -(over stdin/stdout) - -#### Migration notes - -- The `typegraphs.deno` section of the `metatype.yaml` config file has -been replaced by `typegraphs.typescript` and `typegraphs.javascript`. -- `tg_deploy` params has changed. - - -- [x] The change comes with new or modified tests -- [x] Hard-to-understand functions have explanatory comments +- Fix upload url: prepare-upload returns upload tokens instead of upload +urls +- Add logging in the typegraph SDK +- Refactor the actor system in the CLI +- Use jsonrpc for communication between the CLI and typegraph processes +(over stdin/stdout) + +#### Migration notes + +- The `typegraphs.deno` section of the `metatype.yaml` config file has +been replaced by `typegraphs.typescript` and `typegraphs.javascript`. +- `tg_deploy` params has changed. + + +- [x] The change comes with new or modified tests +- [x] Hard-to-understand functions have explanatory comments - [x] End-user documentation is updated to reflect the change @@ -1432,32 +1432,32 @@ been replaced by `typegraphs.typescript` and `typegraphs.javascript`. Failed typegraph deployment (#758) - - - - -- Fix casing typo in the typescript sdk -- Fix error reporting in the typescript sdk -- Display the retry number -- Warning on cancelled retry - - - - - -#### Migration notes - -N/A - -- [ ] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments + + + + +- Fix casing typo in the typescript sdk +- Fix error reporting in the typescript sdk +- Display the retry number +- Warning on cancelled retry + + + + + +#### Migration notes + +N/A + +- [ ] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change @@ -1470,32 +1470,32 @@ N/A `/docs/concepts/features-overview/` (#725) -- Re-does the feature overview page of the documentation. - - -## Summary by CodeRabbit - -- **New Features** -- Added a "Features Roadmap" component to the website, displaying a list -of features with details and links. - -- **Documentation** -- Updated various guides and reference documents to improve clarity and -presentation of code examples. -- Added new sections for various features such as Typegate, Typegraph, -Runtimes, Prisma, Auth, Tooling, and SDK. - -- **Bug Fixes** - - Corrected a typo in the GraphQL runtimes reference documentation. - -- **Refactor** -- Replaced `SDKTabs` and `TabItem` components with `TGExample` for -better code example presentation. -- Adjusted the `MiniQL` component to handle optional properties and -default settings. - - +- Re-does the feature overview page of the documentation. + + +## Summary by CodeRabbit + +- **New Features** +- Added a "Features Roadmap" component to the website, displaying a list +of features with details and links. + +- **Documentation** +- Updated various guides and reference documents to improve clarity and +presentation of code examples. +- Added new sections for various features such as Typegate, Typegraph, +Runtimes, Prisma, Auth, Tooling, and SDK. + +- **Bug Fixes** + - Corrected a typo in the GraphQL runtimes reference documentation. + +- **Refactor** +- Replaced `SDKTabs` and `TabItem` components with `TGExample` for +better code example presentation. +- Adjusted the `MiniQL` component to handle optional properties and +default settings. + + --------- @@ -1504,51 +1504,51 @@ default settings. `/docs/reference/metagen` + `/docs/guides/wasm-functions` (#751) -- Adds `/docs/reference/metagen` -- Adds `/docs/guides/wasm-functions` -- Adds a codegen section to `/docs/guides/external-functions` - -FDK-492. - -#### Migration notes - -... - -- [ ] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments -- [x] End-user documentation is updated to reflect the change - - - - -## Summary by CodeRabbit - -- **New Features** -- Added new targets for `metagen` with different generators and paths -for TypeScript, Python, and Rust. -- Introduced new functionality for defining and exposing typegraphs with -policies in various environments (Deno, Python, Rust). -- Added automated Rust WebAssembly project generation and compilation -script. -- Enhanced documentation with new sections and updated code examples -using `TGExample`. - -- **Bug Fixes** - - Updated `.gitignore` to exclude `*.wasm` files. - -- **Documentation** -- Updated links and added detailed instructions for generating types -using `metagen`. - -- **Refactor** -- Switched from `HashMap` to `BTreeMap` and `HashSet` to `BTreeSet` in -various modules for better data structure handling. - - Added logging enhancements in the `Typegate` class. - -- **Chores** - - Updated build script for Rust WebAssembly target. - +- Adds `/docs/reference/metagen` +- Adds `/docs/guides/wasm-functions` +- Adds a codegen section to `/docs/guides/external-functions` + +MDK-492. + +#### Migration notes + +... + +- [ ] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments +- [x] End-user documentation is updated to reflect the change + + + + +## Summary by CodeRabbit + +- **New Features** +- Added new targets for `metagen` with different generators and paths +for TypeScript, Python, and Rust. +- Introduced new functionality for defining and exposing typegraphs with +policies in various environments (Deno, Python, Rust). +- Added automated Rust WebAssembly project generation and compilation +script. +- Enhanced documentation with new sections and updated code examples +using `TGExample`. + +- **Bug Fixes** + - Updated `.gitignore` to exclude `*.wasm` files. + +- **Documentation** +- Updated links and added detailed instructions for generating types +using `metagen`. + +- **Refactor** +- Switched from `HashMap` to `BTreeMap` and `HashSet` to `BTreeSet` in +various modules for better data structure handling. + - Added logging enhancements in the `Typegate` class. + +- **Chores** + - Updated build script for Rust WebAssembly target. + @@ -1580,175 +1580,174 @@ within the Metatype ecosystem using TypeScript/Python SDKs. - Added new configuration options and deployment functions to enhance automation and flexibility in deployment processes. -- **Documentation** -- Added a new blog post detailing the programmatic deployment feature -and its usage. +- **Documentation** +- Added a new blog post detailing the programmatic deployment feature +and its usage. + + + + + + +### Features + +
+ +(SDK) Add `globs` and `dir` support for artifact deps. (#698) + + +- [x] Include glob and dir support for `PythonRuntime` deps. +- [x] Include glob and dir support for `DenoRuntime` deps. +- [x] add tests + +The change includes support for declaring artifact dependencies through +`globs` and `dirs` + + + + + + + +[MET-441](https://linear.app/metatypedev/issue/MET-441/sdk-support-globs-and-directories-in-artifact-dependencies) + + + +#### Migration notes + +In the `deps` parameter for `python.import(...)` and `deno.import(...)`, +globs and dirs can be passed in addition to files. + + +- [x] The change come with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments +- [ ] End-user documentation is updated to reflect the change + + + + +## Summary by CodeRabbit + +- **New Features** +- Introduced functionality for defining and deploying Typegraphs for +Deno and Python runtimes. +- Added support for defining a Deno runtime dependency graph with +policies for test scenarios. + +- **Bug Fixes** +- Corrected the structure of the `Deno.serve` call in the `serve` +function. + +- **Refactor** +- Enhanced method chaining for better readability in the `MetaTest` +class. + +- **Tests** +- Updated test coverage reporting to include new Deno runtime test +files. + - Commented out and removed outdated test cases in Deno runtime tests. + +- **Chores** + - Updated platform specification in configuration files. + + +--------- + +
+
+ +(docs) Add `embedded typegate` page (#747) + + + +# Embedded typegate docs page + +- [x] need a page under meta-cli/embedded typegate to explain how that +works +- [x] tutorials should take advantage of the embedded one +- [x] the embedded one should be the default everything +- [x] explain that there is 2 flavors in reference/meta-cli + + +[MET-562](https://linear.app/metatypedev/issue/MET-562/docs-use-embedded-whenever-possible-in-the-docs-and-examples) + + + +- + + + +- + + + +#### Migration notes + +_No Migrations Needed_ +... + +- [ ] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments +- [ ] End-user documentation is updated to reflect the change + +
+
+ +(mdk) Mdk python (#707) + + +Mdk for python runtime + +#### Migration notes - +None -
+ +## Summary by CodeRabbit +- **New Features** +- Introduced new functionalities for generating Python code based on +configurations, including handling of templates and required objects. +- Added Python script templates for defining typed functions and +structured objects with comprehensive data type handling. + - Enhanced type management and priority handling in utility functions. -### Features +- **Documentation** +- Provided detailed summaries and documentation for new functionalities +and templates. -
- -(SDK) Add `globs` and `dir` support for artifact deps. (#698) - +- **Refactor** +- Implemented new structures and methods for efficient code generation +and type handling. -- [x] Include glob and dir support for `PythonRuntime` deps. -- [x] Include glob and dir support for `DenoRuntime` deps. -- [x] add tests - -The change includes support for declaring artifact dependencies through -`globs` and `dirs` - - - - - - - -[MET-441](https://linear.app/metatypedev/issue/MET-441/sdk-support-globs-and-directories-in-artifact-dependencies) - - - -#### Migration notes - -In the `deps` parameter for `python.import(...)` and `deno.import(...)`, -globs and dirs can be passed in addition to files. - - -- [x] The change come with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments -- [ ] End-user documentation is updated to reflect the change - - - - -## Summary by CodeRabbit - -- **New Features** -- Introduced functionality for defining and deploying Typegraphs for -Deno and Python runtimes. -- Added support for defining a Deno runtime dependency graph with -policies for test scenarios. - -- **Bug Fixes** -- Corrected the structure of the `Deno.serve` call in the `serve` -function. - -- **Refactor** -- Enhanced method chaining for better readability in the `MetaTest` -class. - -- **Tests** -- Updated test coverage reporting to include new Deno runtime test -files. - - Commented out and removed outdated test cases in Deno runtime tests. - -- **Chores** - - Updated platform specification in configuration files. - - ---------- +- **Tests** + - Added tests for defining typegraph structures and policies in Python. -
-
- -(docs) Add `embedded typegate` page (#747) - +- **Chores** +- Updated URLs in the `.ghjk/deno.lock` file to reflect new changes in +the codebase. + - -# Embedded typegate docs page - -- [x] need a page under meta-cli/embedded typegate to explain how that -works -- [x] tutorials should take advantage of the embedded one -- [x] the embedded one should be the default everything -- [x] explain that there is 2 flavors in reference/meta-cli - - -[MET-562](https://linear.app/metatypedev/issue/MET-562/docs-use-embedded-whenever-possible-in-the-docs-and-examples) - - - -- - - - -- - - - -#### Migration notes - -_No Migrations Needed_ -... - -- [ ] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments -- [ ] End-user documentation is updated to reflect the change - -
-
- -(Fdk) Fdk python (#707) - - -Fdk for python runtime - -#### Migration notes - -None - - -## Summary by CodeRabbit - -- **New Features** -- Introduced new functionalities for generating Python code based on -configurations, including handling of templates and required objects. -- Added Python script templates for defining typed functions and -structured objects with comprehensive data type handling. - - Enhanced type management and priority handling in utility functions. - -- **Documentation** -- Provided detailed summaries and documentation for new functionalities -and templates. - -- **Refactor** -- Implemented new structures and methods for efficient code generation -and type handling. - -- **Tests** - - Added tests for defining typegraph structures and policies in Python. - -- **Chores** -- Updated URLs in the `.ghjk/deno.lock` file to reflect new changes in -the codebase. - - ---------
-(fdk) `fdk_typescript` (#739) - - BREAKING: `fdk -_typescript` (#739) +(mdk) `mdk_typescript` (#739) + - BREAKING: `mdk_typescript` (#739) -- Implements the `fdk_typescript` code generator for typescript type +- Implements the `mdk_typescript` code generator for typescript type inference on Deno runtime external modules. - Ports the very simple generator already present in meta-cli. - Removes old codegen from cli and sdk. @@ -1763,7 +1762,7 @@ to make it more uniform to handler. - (sdk) WasmRuntime `export` and `handler` method's now expect handler/func name under `name` instead of `func`. - (sdk) `codegen` flag has been removed from `ArtifactsConfig` object. -- (cli) `gen mod/fdk` has been simplified to just `gen` as the previous +- (cli) `gen mod/mdk` has been simplified to just `gen` as the previous mod option is no longer avail. --- @@ -1775,57 +1774,57 @@ mod option is no longer avail.
-(fdk,gate) Hostcall (#706) - - -Introduces a mechanism for wasm materializers to access hostgate -functions. - -This implements a pretty basic JSON wire interface, a singular -`hostcall` function that's exposed to materializers. The only -implemented function on this interface are `gql` queries. - -This is a stacked PR on top of #687. - -MET-473. - -- [x] The change come with new or modified tests - - - - - -## Summary by CodeRabbit - -- **New Features** -- Added an import statement for `std_url` and a new task for installing -WASI adapter related files. -- Introduced new functionalities in the application's runtime to support -additional parameters and error handling. - -- **Enhancements** -- Improved the application's handling of GraphQL queries with new error -types and display methods. -- Enhanced the WASM runtime build process to target a more appropriate -architecture. - -- **Bug Fixes** -- Fixed issues in Python and WASM runtime tests to ensure reliability -and performance. - -- **Documentation** -- Updated internal documentation to reflect new command interfaces and -environmental interactions in the application's CLI tools. - -- **Refactor** -- Refactored various internal APIs to improve code maintainability and -efficiency. - - +(mdk,gate) Hostcall (#706) + + +Introduces a mechanism for wasm materializers to access hostgate +functions. + +This implements a pretty basic JSON wire interface, a singular +`hostcall` function that's exposed to materializers. The only +implemented function on this interface are `gql` queries. + +This is a stacked PR on top of #687. + +MET-473. + +- [x] The change come with new or modified tests + + + + + +## Summary by CodeRabbit + +- **New Features** +- Added an import statement for `std_url` and a new task for installing +WASI adapter related files. +- Introduced new functionalities in the application's runtime to support +additional parameters and error handling. + +- **Enhancements** +- Improved the application's handling of GraphQL queries with new error +types and display methods. +- Enhanced the WASM runtime build process to target a more appropriate +architecture. + +- **Bug Fixes** +- Fixed issues in Python and WASM runtime tests to ensure reliability +and performance. + +- **Documentation** +- Updated internal documentation to reflect new command interfaces and +environmental interactions in the application's CLI tools. + +- **Refactor** +- Refactored various internal APIs to improve code maintainability and +efficiency. + + ---------
@@ -1834,70 +1833,70 @@ efficiency. (meta-test) Update `t.engine()` impl (#716) -Update the implementation of `t.engine()` - - - -The change comes with removing the different spin-offs of `t.engine` -which arose from the previous impl of t.engine incompatibility with -artifact upload protocol. The change will make `t.engine` deploy the -artifacts in Artifact Resolution mode by running a shell command to -deploy the typegraph. - - - -... - - - - -[MET-500](https://linear.app/metatypedev/issue/MET-500/test-update-the-implementation-of-tengine) - - - -- [x] remove different versions of `t.engine` -- [x] add tg_deploy caller script which imports typegraphs dynamically -and deploys them. -- [x] make changes to make `t.engine` run in artifact resolution mode -- [x] update existing tests to adhere to the current change -- [x] pass unique different `tempDir`s to all the typegate instances -created during test. -- [x] add support for authoring multiple typegraphs in a single file in -`meta-test` and add multi typegraph tests. - -#### Migration notes - -python SDK test typegraphs' function names should be the same with the -filename of the typegraph file, for dynamic import compatibility -reasons. - - - - - -## Summary by CodeRabbit - -- **New Features** -- Introduced a new function `wasm_duplicate` to handle WebAssembly -runtimes with specific policies. - -- **Refactor** -- Renamed and refactored functions and test setups to align with updated -test frameworks and improve code clarity. - -- **Bug Fixes** -- Added error handling in the `getLocalPath` function to log warnings if -linking errors occur. - -- **Tests** -- Updated test scripts to reflect changes in function calls, imports, -and engine instantiation for better test accuracy and reliability. +Update the implementation of `t.engine()` + + + +The change comes with removing the different spin-offs of `t.engine` +which arose from the previous impl of t.engine incompatibility with +artifact upload protocol. The change will make `t.engine` deploy the +artifacts in Artifact Resolution mode by running a shell command to +deploy the typegraph. + + + +... + + + + +[MET-500](https://linear.app/metatypedev/issue/MET-500/test-update-the-implementation-of-tengine) + + + +- [x] remove different versions of `t.engine` +- [x] add tg_deploy caller script which imports typegraphs dynamically +and deploys them. +- [x] make changes to make `t.engine` run in artifact resolution mode +- [x] update existing tests to adhere to the current change +- [x] pass unique different `tempDir`s to all the typegate instances +created during test. +- [x] add support for authoring multiple typegraphs in a single file in +`meta-test` and add multi typegraph tests. + +#### Migration notes + +python SDK test typegraphs' function names should be the same with the +filename of the typegraph file, for dynamic import compatibility +reasons. + + + + + +## Summary by CodeRabbit + +- **New Features** +- Introduced a new function `wasm_duplicate` to handle WebAssembly +runtimes with specific policies. + +- **Refactor** +- Renamed and refactored functions and test setups to align with updated +test frameworks and improve code clarity. + +- **Bug Fixes** +- Added error handling in the `getLocalPath` function to log warnings if +linking errors occur. + +- **Tests** +- Updated test scripts to reflect changes in function calls, imports, +and engine instantiation for better test accuracy and reliability. @@ -1906,43 +1905,43 @@ and engine instantiation for better test accuracy and reliability. Doc polish (#735) -- doc polish and cleanup -- upgrade website except Docusaurus as the css issue is stil present -- bump to next pre-release -- not everything is done, but let's iterate! - - - - - -## Summary by CodeRabbit - -- **New Features** - - Added platform compatibility for `x86_64-linux`. -- Introduced new functionalities for generating Python code and enhanced -type management. -- Added import statement for `std_url` and new task for installing WASI -adapter files. -- Enhanced runtime support for additional parameters and error handling. - -- **Improvements** -- Enhanced GraphQL query handling with new error types and display -methods. -- Improved WASM runtime build process for better architecture targeting. - -- **Documentation** - - Updated feature overview and added a "Features Roadmap" component. - - Enhanced various guides and references for better clarity. -- Added new sections for Typegate, Typegraph, Runtimes, Prisma, Auth, -Tooling, and SDK. - - Corrected typos and improved code example presentation. - -- **Bug Fixes** - - Fixed issues in Python and WASM runtime tests to ensure reliability. - - - +- doc polish and cleanup +- upgrade website except Docusaurus as the css issue is stil present +- bump to next pre-release +- not everything is done, but let's iterate! + + + + + +## Summary by CodeRabbit + +- **New Features** + - Added platform compatibility for `x86_64-linux`. +- Introduced new functionalities for generating Python code and enhanced +type management. +- Added import statement for `std_url` and new task for installing WASI +adapter files. +- Enhanced runtime support for additional parameters and error handling. + +- **Improvements** +- Enhanced GraphQL query handling with new error types and display +methods. +- Improved WASM runtime build process for better architecture targeting. + +- **Documentation** + - Updated feature overview and added a "Features Roadmap" component. + - Enhanced various guides and references for better clarity. +- Added new sections for Typegate, Typegraph, Runtimes, Prisma, Auth, +Tooling, and SDK. + - Corrected typos and improved code example presentation. + +- **Bug Fixes** + - Fixed issues in Python and WASM runtime tests to ensure reliability. + + + --------- @@ -1955,37 +1954,37 @@ Tooling, and SDK. (docs) Replace term materializer with function for user facing concepts (#736) -Materializer and function might introduce confusion as they are pretty -much the same thing from the user point of view, one can be defined in -terms of the other. - -#### Migration notes - -None - -- [ ] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments -- [ ] End-user documentation is updated to reflect the change - - - - -## Summary by CodeRabbit - -- **Documentation** -- Updated terminology from "materializers" to "functions" across various -documentation files to reflect a semantic shift and provide clearer -descriptions. -- Improved clarity in descriptions of custom functions, runtimes, and -their roles in the Metatype computing model. -- Corrected typos and refined explanations in multiple guides and -reference documents. - -These changes enhance the readability and consistency of our -documentation, making it easier for users to understand and implement -the features and concepts within the system. - +Materializer and function might introduce confusion as they are pretty +much the same thing from the user point of view, one can be defined in +terms of the other. + +#### Migration notes + +None + +- [ ] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments +- [ ] End-user documentation is updated to reflect the change + + + + +## Summary by CodeRabbit + +- **Documentation** +- Updated terminology from "materializers" to "functions" across various +documentation files to reflect a semantic shift and provide clearer +descriptions. +- Improved clarity in descriptions of custom functions, runtimes, and +their roles in the Metatype computing model. +- Corrected typos and refined explanations in multiple guides and +reference documents. + +These changes enhance the readability and consistency of our +documentation, making it easier for users to understand and implement +the features and concepts within the system. + @@ -1994,56 +1993,56 @@ the features and concepts within the system. (docs) Embedded typegate (v0.3.x) blog (#750) - - -# Add a blog about Embedded Typegate. - - - - -[MET-564](https://linear.app/metatypedev/issue/MET-564/docs-embedded-typegate-v03x) - - - - - - - -#### Migration notes - -_No Migrations Needed_ - -- [ ] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments -- [ ] End-user documentation is updated to reflect the change - - - - -## Summary by CodeRabbit - -- **New Features** -- Introduced a new blog post on emulating server nodes locally using the -Embedded Typegate feature in Meta CLI. -- Added a new `BlogIntro` component to the website for displaying styled -blog introductions. - -- **Documentation** -- Updated documentation to explain how to spin up a local instance of -Typegate for testing and development. - -- **Chores** -- Updated platform compatibility from "x86_64-linux" to -"aarch64-darwin". - + + +# Add a blog about Embedded Typegate. + + + + +[MET-564](https://linear.app/metatypedev/issue/MET-564/docs-embedded-typegate-v03x) + + + + + + + +#### Migration notes + +_No Migrations Needed_ + +- [ ] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments +- [ ] End-user documentation is updated to reflect the change + + + + +## Summary by CodeRabbit + +- **New Features** +- Introduced a new blog post on emulating server nodes locally using the +Embedded Typegate feature in Meta CLI. +- Added a new `BlogIntro` component to the website for displaying styled +blog introductions. + +- **Documentation** +- Updated documentation to explain how to spin up a local instance of +Typegate for testing and development. + +- **Chores** +- Updated platform compatibility from "x86_64-linux" to +"aarch64-darwin". + @@ -2052,33 +2051,33 @@ Typegate for testing and development. (website) `g.rest` reference at `/docs/reference/rest` (#734) -Add reference page for `g.rest(..)` - -#### Migration notes - -None - -- [ ] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments -- [x] End-user documentation is updated to reflect the change - - - - -## Summary by CodeRabbit - -- **Documentation** - - Added a reference to the REST reference section in the REST guide. - - Introduced new documentation for consuming APIs using Metatype. -- Included examples in Python and TypeScript for interacting with REST -APIs. - - Explained query types, dynamic queries, and endpoint access. -- Provided guidance on accessing auto-generated documentation and -downloading the OpenAPI spec. - - - +Add reference page for `g.rest(..)` + +#### Migration notes + +None + +- [ ] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments +- [x] End-user documentation is updated to reflect the change + + + + +## Summary by CodeRabbit + +- **Documentation** + - Added a reference to the REST reference section in the REST guide. + - Introduced new documentation for consuming APIs using Metatype. +- Included examples in Python and TypeScript for interacting with REST +APIs. + - Explained query types, dynamic queries, and endpoint access. +- Provided guidance on accessing auto-generated documentation and +downloading the OpenAPI spec. + + + --------- @@ -2087,16 +2086,16 @@ downloading the OpenAPI spec. Bump deno to 1.43.6 (#737) -Update deno to 1.43.6 and make requisite changes. - -Required because of dep conflicts with latest lade-sdk. - -#### Migration notes - -- [ ] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments -- [ ] End-user documentation is updated to reflect the change - +Update deno to 1.43.6 and make requisite changes. + +Required because of dep conflicts with latest lade-sdk. + +#### Migration notes + +- [ ] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments +- [ ] End-user documentation is updated to reflect the change + --------- @@ -2105,34 +2104,34 @@ Required because of dep conflicts with latest lade-sdk. Update `rust` dependencies (#748) - - - - -update Rust dependencies - - - - -[MET-479](https://linear.app/metatypedev/issue/MET-479/sdkgate-update-rust-dependencies) - - - -#### Migration notes - -_No Migrations Needed_ - -... - -- [ ] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments + + + + +update Rust dependencies + + + + +[MET-479](https://linear.app/metatypedev/issue/MET-479/sdkgate-update-rust-dependencies) + + + +#### Migration notes + +_No Migrations Needed_ + +... + +- [ ] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change @@ -2155,17 +2154,17 @@ Bump `METATYPE_VERSION` to 0.4.3 (#730) -- Fix fat CLI compilation -- Bump to 0.4.2 -- Bump wasmtime to 21 -- Bump rust to 1.78.0 - - - -- [x] The change comes with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments -- [ ] End-user documentation is updated to reflect the change - +- Fix fat CLI compilation +- Bump to 0.4.2 +- Bump wasmtime to 21 +- Bump rust to 1.78.0 + + + +- [x] The change comes with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments +- [ ] End-user documentation is updated to reflect the change + --------- @@ -2180,11 +2179,11 @@ Bump `METATYPE_VERSION` to 0.4.3 (#715) -- [x] fix the bug where duplicate artifact references causing failure -during artifact resolution(typegate) during runtime. -- [x] add sync mode tests for Python and Deno runtime. -- [x] add other edge test cases to artifact upload. - - [x] test for no artifact in typegraph +- [x] fix the bug where duplicate artifact references causing failure +during artifact resolution(typegate) during runtime. +- [x] add sync mode tests for Python and Deno runtime. +- [x] add other edge test cases to artifact upload. + - [x] test for no artifact in typegraph - [x] test for duplicate artifact reference in the same typegraph @@ -2193,43 +2192,43 @@ during artifact resolution(typegate) during runtime. (gate) Improve logging and responses, prepare 0.4.1 (#714) -- Logging before and after each faillible operation - - Runtimes: foreign resolvers -- Always log before reporting error: HTTP response -- Fix error code in artifact_service -- Add `BaseError` class for structured messages in responses - - - - - -## Summary by CodeRabbit - -- **New Features** -- Updated Docker image versions and dependency versions to ensure -compatibility and stability. - - Added a search functionality to the app. - -- **Bug Fixes** -- Enhanced error handling with specific error classes for more detailed -error messages. - -- **Refactor** -- Replaced generic `Error` instances with specific error classes for -better error categorization. -- Refactored error handling in HTTP response functions to use a -`BaseError` class. - -- **Chores** -- Updated version numbers across multiple configuration files to -`0.4.1-0`. - - +- Logging before and after each faillible operation + - Runtimes: foreign resolvers +- Always log before reporting error: HTTP response +- Fix error code in artifact_service +- Add `BaseError` class for structured messages in responses + + + + + +## Summary by CodeRabbit + +- **New Features** +- Updated Docker image versions and dependency versions to ensure +compatibility and stability. + - Added a search functionality to the app. + +- **Bug Fixes** +- Enhanced error handling with specific error classes for more detailed +error messages. + +- **Refactor** +- Replaced generic `Error` instances with specific error classes for +better error categorization. +- Refactored error handling in HTTP response functions to use a +`BaseError` class. + +- **Chores** +- Updated version numbers across multiple configuration files to +`0.4.1-0`. + + --------- @@ -2242,48 +2241,48 @@ better error categorization. Polish documentation and project (#696) - - - - -- update the headline, the overviews and many other documentation areas -- upgrades the dependencies. - - - - - - -- [ ] The change come with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments -- [x] End-user documentation is updated to reflect the change - - - -## Summary by CodeRabbit - - -- **Bug Fixes** -- Updated Docker image version for the `typegate` service to ensure -stability and compatibility. - -- **Documentation** -- Revised `TAGLINE` for better clarity on supported languages: WASM, -Typescript, and Python. -- Updated version declarations for improved consistency and -functionality across multiple files. - - - + + + + +- update the headline, the overviews and many other documentation areas +- upgrades the dependencies. + + + + + + +- [ ] The change come with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments +- [x] End-user documentation is updated to reflect the change + + + +## Summary by CodeRabbit + + +- **Bug Fixes** +- Updated Docker image version for the `typegate` service to ensure +stability and compatibility. + +- **Documentation** +- Revised `TAGLINE` for better clarity on supported languages: WASM, +Typescript, and Python. +- Updated version declarations for improved consistency and +functionality across multiple files. + + + --------- @@ -2296,35 +2295,35 @@ functionality across multiple files. (docs) Final polish to comparison table. (#709) -some changes to comparison table(docs) - -#### Migration notes - -_No Migrations Needed_ - - - - - -## Summary by CodeRabbit - - -- **Documentation** -- Introduced a new section on Artifact Tracking Protocol in the -architecture documentation, explaining artifact classification and -tracking modes in Metatype. -- Updated comparisons documentation with additional platforms, criteria -for choosing Metatype, and detailed feature comparison tables. -- Renamed project directory for clarity and consistency in project setup -documentation. -- **Bug Fixes** - - Removed outdated `TODO` comment in installation documentation. - +some changes to comparison table(docs) + +#### Migration notes + +_No Migrations Needed_ + + + + + +## Summary by CodeRabbit + + +- **Documentation** +- Introduced a new section on Artifact Tracking Protocol in the +architecture documentation, explaining artifact classification and +tracking modes in Metatype. +- Updated comparisons documentation with additional platforms, criteria +for choosing Metatype, and detailed feature comparison tables. +- Renamed project directory for clarity and consistency in project setup +documentation. +- **Bug Fixes** + - Removed outdated `TODO` comment in installation documentation. + @@ -2333,44 +2332,44 @@ documentation. Bump to version 0.4.1-0 (#713) -- Bumps version to 0.4.1-0. -- Fixes broken release CI. -- #719 -- Adds 20 minutes to test-full timeout. - - - - - -## Summary by CodeRabbit - -## Summary by CodeRabbit - -- **New Features** -- Updated platform support for better compatibility with "x86_64-linux". - -- **Bug Fixes** -- Minor version updates across multiple configurations to enhance -stability. - -- **Chores** -- Updated version numbers from "0.4.0" to "0.4.1-0" across various files -and configurations. - -- **Refactor** -- Adjusted build and test scripts for improved efficiency and -compatibility. - -- **Documentation** -- Enhanced internal documentation to reflect version and platform -changes. - - +- Bumps version to 0.4.1-0. +- Fixes broken release CI. +- #719 +- Adds 20 minutes to test-full timeout. + + + + + +## Summary by CodeRabbit + +## Summary by CodeRabbit + +- **New Features** +- Updated platform support for better compatibility with "x86_64-linux". + +- **Bug Fixes** +- Minor version updates across multiple configurations to enhance +stability. + +- **Chores** +- Updated version numbers from "0.4.0" to "0.4.1-0" across various files +and configurations. + +- **Refactor** +- Adjusted build and test scripts for improved efficiency and +compatibility. + +- **Documentation** +- Enhanced internal documentation to reflect version and platform +changes. + + --------- @@ -2385,21 +2384,21 @@ changes. (ci) Fix broken nighly jobs (#659) -Fixes the broken nightly builds. Look at solved results -[here](https://github.com/metatypedev/metatype/actions/runs/8533669013). - -#### Motivation and context - -Nightly builds were broken due to oversight during the #571 fixes. - -#### Migration notes - -__No changes required__ - -### Checklist - -- [ ] The change come with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments +Fixes the broken nightly builds. Look at solved results +[here](https://github.com/metatypedev/metatype/actions/runs/8533669013). + +#### Motivation and context + +Nightly builds were broken due to oversight during the #571 fixes. + +#### Migration notes + +__No changes required__ + +### Checklist + +- [ ] The change come with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change @@ -2408,34 +2407,34 @@ __No changes required__ (gh-tests) Fix local npm registry config (#692) - - - - -Fix the NPM registry config in the Github tests. - - - - - - - -#### Migration notes - -_N/A_ - - + + + +Fix the NPM registry config in the Github tests. + + + + + + + +#### Migration notes + +_N/A_ + + @@ -2444,21 +2443,21 @@ _N/A_ Set max log level based on verbose flag (#664) -Set max log level based on verbose flag - -#### Motivation and context - - -[MET-445](https://linear.app/metatypedev/issue/MET-445/cli-no-verboselogging-how-to-debug-this) - -#### Migration notes - -_n/a_ - -### Checklist - -- [ ] The change come with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments +Set max log level based on verbose flag + +#### Motivation and context + + +[MET-445](https://linear.app/metatypedev/issue/MET-445/cli-no-verboselogging-how-to-debug-this) + +#### Migration notes + +_n/a_ + +### Checklist + +- [ ] The change come with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change @@ -2467,20 +2466,20 @@ _n/a_ Fix secret passing (#675) -Fix secret passing in examples and documentation. - -#### Motivation and context - -Followup to #666. - -#### Migration notes - -_N/A_ - -### Checklist - -- [x] The change come with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments +Fix secret passing in examples and documentation. + +#### Motivation and context + +Followup to #666. + +#### Migration notes + +_N/A_ + +### Checklist + +- [x] The change come with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [x] End-user documentation is updated to reflect the change @@ -2489,36 +2488,36 @@ _N/A_ Website and headline (#691) - - - - -#### Motivation and context - -Fix the CSS issue introduced by docusaurus 3.2.0 -(https://github.com/facebook/docusaurus/issues/10005). 3.2.1 should fix -it but the affected version maybe loaded by dependencies, so we will -have to wait a bit more. - - - - - - -### Checklist - -- [ ] The change come with new or modified tests -- [x] Hard-to-understand functions have explanatory comments -- [ ] End-user documentation is updated to reflect the change - + + + + +#### Motivation and context + +Fix the CSS issue introduced by docusaurus 3.2.0 +(https://github.com/facebook/docusaurus/issues/10005). 3.2.1 should fix +it but the affected version maybe loaded by dependencies, so we will +have to wait a bit more. + + + + + + +### Checklist + +- [ ] The change come with new or modified tests +- [x] Hard-to-understand functions have explanatory comments +- [ ] End-user documentation is updated to reflect the change + --------- @@ -2527,41 +2526,41 @@ have to wait a bit more. Do not override log level when no verbosity flag is present (#694) - - - - -Remove log level override by the verbosity flag when no flag is present. -It will default to the configured env_logger default level (or env -variable). - - - -... - - - -The default log level became "error" after #664, and `RUST_LOG` -environment variable where ignored. - - - -#### Migration notes - -_N/A_ - - + + + +Remove log level override by the verbosity flag when no flag is present. +It will default to the configured env_logger default level (or env +variable). + + + +... + + + +The default log level became "error" after #664, and `RUST_LOG` +environment variable where ignored. + + + +#### Migration notes + +_N/A_ + + @@ -2574,36 +2573,36 @@ _N/A_ Start rebranding (#641) - - - - -#### Motivation and context - -Changing the intro. - - - -#### Migration notes - -None. - - - -### Checklist - -- [ ] The change come with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments -- [ ] End-user documentation is updated to reflect the change - + + + + +#### Motivation and context + +Changing the intro. + + + +#### Migration notes + +None. + + + +### Checklist + +- [ ] The change come with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments +- [ ] End-user documentation is updated to reflect the change + --------- @@ -2612,18 +2611,18 @@ None. Add `reference/programmatic-deployment/` (#686) -#### Motivation and context - -Add missing docs for `tgDeploy`, `tgRemove` - -#### Migration notes - -None - -### Checklist - -- [ ] The change come with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments +#### Motivation and context + +Add missing docs for `tgDeploy`, `tgRemove` + +#### Migration notes + +None + +### Checklist + +- [ ] The change come with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change @@ -2632,18 +2631,18 @@ None Add examples for each command (#684) -#### Motivation and context - -Getting started with `meta` cli should be easy - -#### Migration notes - -None - -### Checklist - -- [ ] The change come with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments +#### Motivation and context + +Getting started with `meta` cli should be easy + +#### Migration notes + +None + +### Checklist + +- [ ] The change come with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change @@ -2652,26 +2651,26 @@ None Improve `/tutorials/quick-start` section. (#681) -- [x] Improve Layout -- [x] Include a simple project. -- [x] Add the result/outputs to running CLI commands. -- [x] Remove Metatype cloud registration form. -- [x] Separate the CLI commands to separate code blocks -- [x] Add links to references and concepts. -- [x] Add playground. - -#### Motivation and context - -[Docs -Meta-task](https://linear.app/metatypedev/issue/MET-440/docs-meta-task) - -#### Migration notes - -_No Migration Needed_ - -### Checklist - -- [x] Test the commands and the examples. +- [x] Improve Layout +- [x] Include a simple project. +- [x] Add the result/outputs to running CLI commands. +- [x] Remove Metatype cloud registration form. +- [x] Separate the CLI commands to separate code blocks +- [x] Add links to references and concepts. +- [x] Add playground. + +#### Motivation and context + +[Docs +Meta-task](https://linear.app/metatypedev/issue/MET-440/docs-meta-task) + +#### Migration notes + +_No Migration Needed_ + +### Checklist + +- [x] Test the commands and the examples. - [ ] The change come with new or modified tests @@ -2680,19 +2679,19 @@ _No Migration Needed_ Improve `/docs/tutorials/metatype-basics` (#688) -Improve `/docs/tutorials/metatype-basics` - -#### Motivation and context - -[Docs -Meta-task](https://linear.app/metatypedev/issue/MET-440/docs-meta-task) - -#### Migration notes - -_No Migrations Needed_ - -### Checklist - +Improve `/docs/tutorials/metatype-basics` + +#### Motivation and context + +[Docs +Meta-task](https://linear.app/metatypedev/issue/MET-440/docs-meta-task) + +#### Migration notes + +_No Migrations Needed_ + +### Checklist + - [ ] The change come with new or modified tests @@ -2701,18 +2700,18 @@ _No Migrations Needed_ Improve `/reference/runtimes/` (#676) -#### Motivation and context - -Better documentation - -#### Migration notes - -N/A - -### Checklist - -- [ ] The change come with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments +#### Motivation and context + +Better documentation + +#### Migration notes + +N/A + +### Checklist + +- [ ] The change come with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [x] End-user documentation is updated to reflect the change @@ -2721,23 +2720,23 @@ N/A Improve `/guides/external-functions` (#677) -- Improvements to the `/guides/external-functions` page. -- Adds a configuration file for git-town - -#### Motivation and context - -_N/A_ - -#### Migration notes - -_N/A_ - -### Checklist - -- [ ] The change come with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments -- [ ] End-user documentation is updated to reflect the change - +- Improvements to the `/guides/external-functions` page. +- Adds a configuration file for git-town + +#### Motivation and context + +_N/A_ + +#### Migration notes + +_N/A_ + +### Checklist + +- [ ] The change come with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments +- [ ] End-user documentation is updated to reflect the change + --------- @@ -2746,22 +2745,22 @@ _N/A_ Improve `docs/reference/types` (#685) -Improves `docs/reference/types` - -#### Motivation and context - -_N/A_ - -#### Migration notes - -_N/A_ - -### Checklist - -- [ ] The change come with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments -- [x] End-user documentation is updated to reflect the change - +Improves `docs/reference/types` + +#### Motivation and context + +_N/A_ + +#### Migration notes + +_N/A_ + +### Checklist + +- [ ] The change come with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments +- [x] End-user documentation is updated to reflect the change + --------- @@ -2770,36 +2769,36 @@ _N/A_ Add a comparison b/n metatype and other similar solutions/products. (#697) - - - -- Adds a comparison table between metatype and other similar services. -- Add artifact upload protocol to `Architecture` section in docs. - - - - - - -[MET-443](https://linear.app/metatypedev/issue/MET-443/include-comparisons-with-other-products-similar-to-metatype) - - - -#### Migration notes -_No Migration Needed_ - - + + +- Adds a comparison table between metatype and other similar services. +- Add artifact upload protocol to `Architecture` section in docs. + + + + + + +[MET-443](https://linear.app/metatypedev/issue/MET-443/include-comparisons-with-other-products-similar-to-metatype) + + + +#### Migration notes +_No Migration Needed_ + + @@ -2812,24 +2811,24 @@ _No Migration Needed_ (cli) Long running discovery (#599) -Delegate serialize, deploy, undeploy, unpack work to SDK. - -#### Motivation and context - -Remove duplicate logic, thinking of cli as a convenience on top of the -SDK. - -#### Migration notes - -When meta cli is used, Migration files are unpacked/resolved relative to -the typegraph's path, not the process's `workdir`. - -### Checklist - -- [x] The change come with new or modified tests -- [x] Hard-to-understand functions have explanatory comments -- [ ] End-user documentation is updated to reflect the change - +Delegate serialize, deploy, undeploy, unpack work to SDK. + +#### Motivation and context + +Remove duplicate logic, thinking of cli as a convenience on top of the +SDK. + +#### Migration notes + +When meta cli is used, Migration files are unpacked/resolved relative to +the typegraph's path, not the process's `workdir`. + +### Checklist + +- [x] The change come with new or modified tests +- [x] Hard-to-understand functions have explanatory comments +- [ ] End-user documentation is updated to reflect the change + --------- @@ -2838,22 +2837,22 @@ the typegraph's path, not the process's `workdir`. (cli) `meta gen` (#636) -Adds a command to `meta-cli` to invoke metagen. - -#### Motivation and context - -MET-424 - -#### Migration notes - -__No changes required__ - -### Checklist - -- [x] The change come with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments -- [ ] End-user documentation is updated to reflect the change - +Adds a command to `meta-cli` to invoke metagen. + +#### Motivation and context + +MET-424 + +#### Migration notes + +__No changes required__ + +### Checklist + +- [x] The change come with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments +- [ ] End-user documentation is updated to reflect the change + --------- @@ -2870,18 +2869,18 @@ __No changes required__ (cli,sdk) Codegen command (#661) -#### Motivation and context - -Enable back `codegen` on current cli implementation. - -#### Migration notes - -None - -### Checklist - -- [x] The change come with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments +#### Motivation and context + +Enable back `codegen` on current cli implementation. + +#### Migration notes + +None + +### Checklist + +- [x] The change come with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change @@ -2890,73 +2889,73 @@ None (cli,sdk) Better error messages (#689) -#### Motivation and context - -Make it more clear where failures happen - -#### Migration notes - -None - -### Checklist - -- [ ] The change come with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments +#### Motivation and context + +Make it more clear where failures happen + +#### Migration notes + +None + +### Checklist + +- [ ] The change come with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments +- [ ] End-user documentation is updated to reflect the change + + +
+ +(gate) Wasmtime support (#669) + - BREAKING: wasmtime support (#669) + + +#### Motivation and context + +Enable support for +[wit](https://github.com/WebAssembly/component-model/blob/main/design/mvp/WIT.md) +and facilitate readiness for the upcoming specs. + +#### Migration notes +`#[wasmedge_bindgen]` are replaced by wit bindings. + +In the old version we were restricted to`#[wasmedge_bindgen]`, which was +only available in Rust and unique to WasmEdge. +```rust +#[wasmedge_bindgen] +fn add(a: u32, b: u32) -> u32 { + a + b +} +``` + +In the new implementation, wasm modules written in any language that +uses the `wit` interface are now natively supported within `typegate`. +```wit +// wit/example.wit +package example:host; +world host { + export add: func(a: u32, b: u32) -> u32; +} +``` +An implementation (eg. in Rust) may look like this.. +```rust +// src/lib.rs +wit_bindgen::generate!({ world: "host" }); +struct MyLib; +impl Guest for MyLib { + fn add(a: u32, b: u32) -> u32 { + a + b + } +} +export!(MyLib); +``` + +### Checklist + +- [x] The change come with new or modified tests +- [x] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change -
-
- -(gate) Wasmtime support (#669) - - BREAKING: wasmtime support (#669) - - -#### Motivation and context - -Enable support for -[wit](https://github.com/WebAssembly/component-model/blob/main/design/mvp/WIT.md) -and facilitate readiness for the upcoming specs. - -#### Migration notes -`#[wasmedge_bindgen]` are replaced by wit bindings. - -In the old version we were restricted to`#[wasmedge_bindgen]`, which was -only available in Rust and unique to WasmEdge. -```rust -#[wasmedge_bindgen] -fn add(a: u32, b: u32) -> u32 { - a + b -} -``` - -In the new implementation, wasm modules written in any language that -uses the `wit` interface are now natively supported within `typegate`. -```wit -// wit/example.wit -package example:host; -world host { - export add: func(a: u32, b: u32) -> u32; -} -``` -An implementation (eg. in Rust) may look like this.. -```rust -// src/lib.rs -wit_bindgen::generate!({ world: "host" }); -struct MyLib; -impl Guest for MyLib { - fn add(a: u32, b: u32) -> u32 { - a + b - } -} -export!(MyLib); -``` - -### Checklist - -- [x] The change come with new or modified tests -- [x] Hard-to-understand functions have explanatory comments -- [ ] End-user documentation is updated to reflect the change - ---------
@@ -2965,44 +2964,44 @@ export!(MyLib); (gate,cli) `$DENO_V8_FLAGS` (#647) -Enables the `DENO_V8_FLAGS` env var for tuning v8. - -#### Motivation and context - -MET-435 or #621 - -#### Migration notes - -- This just exposes the deno paramter directly. Refer to deno or v8 docs -for more details. - -### Checklist - -- [x] The change come with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments +Enables the `DENO_V8_FLAGS` env var for tuning v8. + +#### Motivation and context + +MET-435 or #621 + +#### Migration notes + +- This just exposes the deno paramter directly. Refer to deno or v8 docs +for more details. + +### Checklist + +- [x] The change come with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [x] End-user documentation is updated to reflect the change
-(metagen) Metagen fdk rust (#624) +(metagen) Metagen mdk rust (#624) -Implements the general framework for metagen including a generator for -rust based wasm mat functions modules. - -#### Motivation and context - -MET-420 - -#### Migration notes - -__No breaking changes__ - -### Checklist - -- [x] The change come with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments +Implements the general framework for metagen including a generator for +rust based wasm mat functions modules. + +#### Motivation and context + +MET-420 + +#### Migration notes + +__No breaking changes__ + +### Checklist + +- [x] The change come with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change
@@ -3011,23 +3010,23 @@ __No breaking changes__ (sdk) .tgignore file support (#633) -#### Motivation and context - -Set what files/folders should be ignored when using the custom -`expand_path` function in an external `.tgignore` file. -`.tgignore` will behave similarly to most .ignore files with basic glob -syntax support. - -#### Migration notes - -`expand_glob` has been renamed to `expand_path` - -### Checklist - -- [x] The change come with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments -- [ ] End-user documentation is updated to reflect the change - +#### Motivation and context + +Set what files/folders should be ignored when using the custom +`expand_path` function in an external `.tgignore` file. +`.tgignore` will behave similarly to most .ignore files with basic glob +syntax support. + +#### Migration notes + +`expand_glob` has been renamed to `expand_path` + +### Checklist + +- [x] The change come with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments +- [ ] End-user documentation is updated to reflect the change + --------- @@ -3036,24 +3035,24 @@ syntax support. (sdk) Introduce flag for disabling hashing artifacts + move hash to rust (#645) -#### Motivation and context - -The fdk codegen and typegraph mutually depends on each other (typegraph -needs a concrete fdk.wasm for hashing, and for the fdk.wasm to be built, -it needs type generation based on the typegraph) -Add a flag to enable processing a partial typegraph when using `meta -gen` (partial == no artifact resolution). - -#### Migration notes - -`get_file_hash` has been moved to core sdk (under the name `hash_file`) - -### Checklist - -- [x] The change come with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments -- [ ] End-user documentation is updated to reflect the change - +#### Motivation and context + +The mdk codegen and typegraph mutually depends on each other (typegraph +needs a concrete mdk.wasm for hashing, and for the mdk.wasm to be built, +it needs type generation based on the typegraph) +Add a flag to enable processing a partial typegraph when using `meta +gen` (partial == no artifact resolution). + +#### Migration notes + +`get_file_hash` has been moved to core sdk (under the name `hash_file`) + +### Checklist + +- [x] The change come with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments +- [ ] End-user documentation is updated to reflect the change + --------- @@ -3062,25 +3061,25 @@ gen` (partial == no artifact resolution). (sdk, gate, cli) Upload protocol poc uploading wasm file for `WasmEdge Runtime` for single replica mode (#631) -Upload protocol for wasm files and atrifacts for `WasmEdge Runtime` for -single replica mode - -#### Motivation and context - -- Upload WasmEdge Runtime artifacts during typegraph deploy -- Access and load WasmEdge Runtime artifacts from the local file system -from typegate - -#### Migration notes - -*No Migrations Needed* - -### Checklist - -- [x] The change come with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments -- [ ] End-user documentation is updated to reflect the change - +Upload protocol for wasm files and atrifacts for `WasmEdge Runtime` for +single replica mode + +#### Motivation and context + +- Upload WasmEdge Runtime artifacts during typegraph deploy +- Access and load WasmEdge Runtime artifacts from the local file system +from typegate + +#### Migration notes + +*No Migrations Needed* + +### Checklist + +- [x] The change come with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments +- [ ] End-user documentation is updated to reflect the change + --------- @@ -3089,20 +3088,20 @@ from typegate Raw prisma query through the typegate runtime (#634) -- Enable prisma query execution through the typegate runtime - -#### Motivation and context - -Console. - -#### Migration notes - -_N/A_ - -### Checklist - -- [x] The change come with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments +- Enable prisma query execution through the typegate runtime + +#### Motivation and context + +Console. + +#### Migration notes + +_N/A_ + +### Checklist + +- [x] The change come with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change @@ -3112,27 +3111,27 @@ Store the typegraph on s3 (#620) -Store the typegraph on s3 for multiple instance support mode. - -#### Motivation and context - -Reduce Redis data. - -#### Migration notes - -Environment variables: -- `REDIS_URL` has been removed -- For multiple instance support, the following variables are required: -`SYNC_REDIS_URL`, `SYNC_S3_HOST`, `SYNC_S3_REGION`, `SYNC_S3_BUCKET`, -`SYNC_S3_ACCESS_KEY`, `SYNC_S3_SECRET_KEY`; and the following variables -are optional: `SYNC_REDIS_PASSWORD`, `SYNC_S3_PATH_STYLE`. Otherwise, -none of them can be set. - - -### Checklist - -- [x] The change come with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments +Store the typegraph on s3 for multiple instance support mode. + +#### Motivation and context + +Reduce Redis data. + +#### Migration notes + +Environment variables: +- `REDIS_URL` has been removed +- For multiple instance support, the following variables are required: +`SYNC_REDIS_URL`, `SYNC_S3_HOST`, `SYNC_S3_REGION`, `SYNC_S3_BUCKET`, +`SYNC_S3_ACCESS_KEY`, `SYNC_S3_SECRET_KEY`; and the following variables +are optional: `SYNC_REDIS_PASSWORD`, `SYNC_S3_PATH_STYLE`. Otherwise, +none of them can be set. + + +### Checklist + +- [x] The change come with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [x] End-user documentation is updated to reflect the change @@ -3142,57 +3141,57 @@ Remove secret definitions through env vars (#666) -Remove the ability to define secrets in the env vars of the typegate. - -Secrets can now only be defined in the metatype config file and the -`--secret` CLI option. - -#### Motivation and context - -- -[MET-370](https://linear.app/metatypedev/issue/MET-370/easier-way-to-pass-secrets-in-metatypeyaml-config-file) -- Security -- Better DX - -#### Migration notes - -1. **Metatype config file**: On the node configuration, secrets are -defined at `secrets..key`: - -```yaml -# before -typegates: - dev: - env: - TG_CONSOLE_POSTGRES_CONN: postgresql://postgres:password@localhost:5432/db?schema=console - TG_CONSOLE_BASIC_ADMIN: password - -#after -typegates: - dev: - secrets: - console: - POSTGRES_CONN: postgresql://postgres:password@localhost:5432/db?schema=console - BASIC_ADMIN: password -``` - -2. **Secret override option on meta/cli** - -```sh -# before -meta deploy -f my-tg.py --secret TG_CONSOLE_POSTGRES_CONN=postgresql://postgres:password@localhost:5432/db?schema=console - -# after -meta deploy -f my-tg.py --secret POSTGRES_CONN=postgresql://postgres:password@localhost:5432/db?schema=console -# or - with the typegraph name -meta deploy -f my-tg.py --secret console:POSTGRES_CONN=postgresql://postgres:password@localhost:5432/db?schema=console - -``` - -### Checklist - -- [x] The change come with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments +Remove the ability to define secrets in the env vars of the typegate. + +Secrets can now only be defined in the metatype config file and the +`--secret` CLI option. + +#### Motivation and context + +- +[MET-370](https://linear.app/metatypedev/issue/MET-370/easier-way-to-pass-secrets-in-metatypeyaml-config-file) +- Security +- Better DX + +#### Migration notes + +1. **Metatype config file**: On the node configuration, secrets are +defined at `secrets..key`: + +```yaml +# before +typegates: + dev: + env: + TG_CONSOLE_POSTGRES_CONN: postgresql://postgres:password@localhost:5432/db?schema=console + TG_CONSOLE_BASIC_ADMIN: password + +#after +typegates: + dev: + secrets: + console: + POSTGRES_CONN: postgresql://postgres:password@localhost:5432/db?schema=console + BASIC_ADMIN: password +``` + +2. **Secret override option on meta/cli** + +```sh +# before +meta deploy -f my-tg.py --secret TG_CONSOLE_POSTGRES_CONN=postgresql://postgres:password@localhost:5432/db?schema=console + +# after +meta deploy -f my-tg.py --secret POSTGRES_CONN=postgresql://postgres:password@localhost:5432/db?schema=console +# or - with the typegraph name +meta deploy -f my-tg.py --secret console:POSTGRES_CONN=postgresql://postgres:password@localhost:5432/db?schema=console + +``` + +### Checklist + +- [x] The change come with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [x] End-user documentation is updated to reflect the change @@ -3201,21 +3200,21 @@ meta deploy -f my-tg.py --secret console:POSTGRES_CONN=postgresql://postgres:pas Add queryPrismaModel in the typegate runtime (#635) -The `queryPrismaModel` function on the typegate typegraph queries rows -from a prisma model. - -#### Motivation and context - -Console. - -#### Migration notes - -_N/A_ - -### Checklist - -- [x] The change come with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments +The `queryPrismaModel` function on the typegate typegraph queries rows +from a prisma model. + +#### Motivation and context + +Console. + +#### Migration notes + +_N/A_ + +### Checklist + +- [x] The change come with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change @@ -3224,23 +3223,23 @@ _N/A_ Upload artifacts to s3 (#638) -Upload artifacts to S3 when sync-mode is enabled - -#### Motivation and context - -Sharing artifacts between replicas without including it in the typegraph -(and sync through redis) - -#### Migration notes - -No changes needed. - -### Checklist - -- [x] The change come with new or modified tests -- [x] Hard-to-understand functions have explanatory comments -- [ ] End-user documentation is updated to reflect the change - +Upload artifacts to S3 when sync-mode is enabled + +#### Motivation and context + +Sharing artifacts between replicas without including it in the typegraph +(and sync through redis) + +#### Migration notes + +No changes needed. + +### Checklist + +- [x] The change come with new or modified tests +- [x] Hard-to-understand functions have explanatory comments +- [ ] End-user documentation is updated to reflect the change + --------- @@ -3249,21 +3248,21 @@ No changes needed. Upload `PythonRuntime` artifacts and deps (#672) -#### Motivation and context - -Track artifact/module dependencis for `PythonRuntime` - - -#### Migration notes - -`python.import(...)` and `python.import_(...)` accept an optional parameter `deps` that accepts list of dependencies for the python module. - -### Checklist - -- [x] The change come with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments -- [ ] End-user documentation is updated to reflect the change - +#### Motivation and context + +Track artifact/module dependencis for `PythonRuntime` + + +#### Migration notes + +`python.import(...)` and `python.import_(...)` accept an optional parameter `deps` that accepts list of dependencies for the python module. + +### Checklist + +- [x] The change come with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments +- [ ] End-user documentation is updated to reflect the change + --------- @@ -3272,26 +3271,26 @@ Track artifact/module dependencis for `PythonRuntime` Upload `DenoRuntime` artifacts and deps (#674) -- [x] Track deno runtime artifacts(also dependencies) -- [x] Upload artifacts during deploy to either local(single replica) or -shared(s3) -- [x] resolve artifacts(module and deps) upon typegate runtime. - -#### Motivation and context - -Persisting deno runtime artifacts to a local/shared storage. - -#### Migration notes - -`deno.import(...)` and `deno.import_(...)` accept an optional parameter -that accepts list of dependencies for the deno/ts module. - -### Checklist - -- [x] The change come with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments -- [ ] End-user documentation is updated to reflect the change - +- [x] Track deno runtime artifacts(also dependencies) +- [x] Upload artifacts during deploy to either local(single replica) or +shared(s3) +- [x] resolve artifacts(module and deps) upon typegate runtime. + +#### Motivation and context + +Persisting deno runtime artifacts to a local/shared storage. + +#### Migration notes + +`deno.import(...)` and `deno.import_(...)` accept an optional parameter +that accepts list of dependencies for the deno/ts module. + +### Checklist + +- [x] The change come with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments +- [ ] End-user documentation is updated to reflect the change + --------- @@ -3326,61 +3325,61 @@ Console Artifact removal (#668) -- Add GC: remove artifacts when unreferenced by any deployed typegraph -- Improve resource management: use `AsyncDisposable` and -`AsyncDisposableStack` -- Improve testability (for parallel testing): always read the tmpDir -config from the `Typegate` object - -#### Motivation and context - -[MET-433](https://linear.app/metatypedev/issue/MET-433/file-removal) - -#### Migration notes - -_N/A_ - -### Checklist - -- [x] The change come with new or modified tests -- [x] Hard-to-understand functions have explanatory comments -- [x] End-user documentation is updated to reflect the change - - - -## Summary by CodeRabbit - -- **New Features** - - Enhanced search functionality with the addition of a new search bar. - - Introduced new test configurations to improve script execution. -- Updated artifact storage documentation to clarify management -processes. - - Added new extensions to support improved code commenting. - -- **Bug Fixes** -- Removed outdated Deno import mapping settings to streamline -development environment setup. - -- **Documentation** -- Expanded documentation on artifact tracking and management, including -reference counting and garbage collection mechanisms. - -- **Refactor** -- Implemented interface changes in `QueryEngine` for better async -disposal management. -- Code restructuring in artifact management for enhanced performance and -maintainability. - -- **Chores** -- Adjusted settings and configurations in the development environment to -align with current best practices. - -- **Tests** -- Introduced new test cases for artifact upload and management -functionalities. - - +- Add GC: remove artifacts when unreferenced by any deployed typegraph +- Improve resource management: use `AsyncDisposable` and +`AsyncDisposableStack` +- Improve testability (for parallel testing): always read the tmpDir +config from the `Typegate` object + +#### Motivation and context + +[MET-433](https://linear.app/metatypedev/issue/MET-433/file-removal) + +#### Migration notes + +_N/A_ + +### Checklist + +- [x] The change come with new or modified tests +- [x] Hard-to-understand functions have explanatory comments +- [x] End-user documentation is updated to reflect the change + + + +## Summary by CodeRabbit + +- **New Features** + - Enhanced search functionality with the addition of a new search bar. + - Introduced new test configurations to improve script execution. +- Updated artifact storage documentation to clarify management +processes. + - Added new extensions to support improved code commenting. + +- **Bug Fixes** +- Removed outdated Deno import mapping settings to streamline +development environment setup. + +- **Documentation** +- Expanded documentation on artifact tracking and management, including +reference counting and garbage collection mechanisms. + +- **Refactor** +- Implemented interface changes in `QueryEngine` for better async +disposal management. +- Code restructuring in artifact management for enhanced performance and +maintainability. + +- **Chores** +- Adjusted settings and configurations in the development environment to +align with current best practices. + +- **Tests** +- Introduced new test cases for artifact upload and management +functionalities. + + --------- @@ -3393,26 +3392,26 @@ functionalities. (release) Prepare 0.4.0 (#710) -Bumps version to release 0.4.0. - - -## Summary by CodeRabbit - - -- **New Features** -- Updated the software across various components to version 0.4.0, -enhancing functionality and potentially introducing new features or -fixes. -- **Documentation** -- Updated version documentation in multiple configuration files to -reflect new version 0.4.0. -- **Bug Fixes** -- Adjusted version constants and dependencies to ensure compatibility -and stability with the new software version 0.4.0. - - - +Bumps version to release 0.4.0. + + +## Summary by CodeRabbit + + +- **New Features** +- Updated the software across various components to version 0.4.0, +enhancing functionality and potentially introducing new features or +fixes. +- **Documentation** +- Updated version documentation in multiple configuration files to +reflect new version 0.4.0. +- **Bug Fixes** +- Adjusted version constants and dependencies to ensure compatibility +and stability with the new software version 0.4.0. + + + --------- @@ -3433,10 +3432,10 @@ and stability with the new software version 0.4.0. (gate) Wasi 0.2 pyrt (#687) -- Rewrites the PythonRuntime host using a `componentize-py` based -component. -- Leaf through this -[memo](https://hackmd.io/@SC-qT-WXTROceKYdNA-Lpg/ryyAXiQlC/edit) for a +- Rewrites the PythonRuntime host using a `componentize-py` based +component. +- Leaf through this +[memo](https://hackmd.io/@SC-qT-WXTROceKYdNA-Lpg/ryyAXiQlC/edit) for a mental model. @@ -3445,11 +3444,11 @@ mental model. (libs/xtask,gate) Remove xtask/codegen (#700) -Faster build time - -#### Migration notes - -Make sure to sync `typegate/src/types.ts` when an update is made on the +Faster build time + +#### Migration notes + +Make sure to sync `typegate/src/types.ts` when an update is made on the typegraph schema. @@ -3459,23 +3458,23 @@ typegraph schema. - BREAKING: improve temporal rt (#642) -Improve the temporal runtime exposing more parameters and adding more -tests. - -#### Motivation and context - -MET-397. The old implementation was bug-ridden and did not expose -necessary params. - -#### Migration notes - -API changes to `TemporalRuntime` ctor, methods and generated -materializers. - -### Checklist - -- [x] The change come with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments +Improve the temporal runtime exposing more parameters and adding more +tests. + +#### Motivation and context + +MET-397. The old implementation was bug-ridden and did not expose +necessary params. + +#### Migration notes + +API changes to `TemporalRuntime` ctor, methods and generated +materializers. + +### Checklist + +- [x] The change come with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [x] End-user documentation is updated to reflect the change @@ -3484,22 +3483,22 @@ materializers. Pass test options in the first parameter (#667) -Pass the test options in the first parameter along with the test -name/description. - -#### Motivation and context - -Avoid scrolling to the end of the test function to see/update the test -options. - -#### Migration notes - -_N/A_ - -### Checklist - -- [ ] The change come with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments +Pass the test options in the first parameter along with the test +name/description. + +#### Motivation and context + +Avoid scrolling to the end of the test function to see/update the test +options. + +#### Migration notes + +_N/A_ + +### Checklist + +- [ ] The change come with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change @@ -3512,25 +3511,25 @@ _N/A_ Use local npm registry for tests (#646) -Use verdaccio local npm registry for tests: -- The `@typegraph/sdk` package is published to the local npm registry, -and can now be consumed like any npm package from Nodejs or Deno. - -#### Motivation and context - -... - -#### Migration notes - -_N/A_ - -### Checklist - -- [x] The change come with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments -- [ ] End-user documentation is updated to reflect the change - - +Use verdaccio local npm registry for tests: +- The `@typegraph/sdk` package is published to the local npm registry, +and can now be consumed like any npm package from Nodejs or Deno. + +#### Motivation and context + +... + +#### Migration notes + +_N/A_ + +### Checklist + +- [x] The change come with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments +- [ ] End-user documentation is updated to reflect the change + + ![tg-sdk-verdaccio](https://github.com/metatypedev/metatype/assets/43663718/d22d8d8b-175a-4858-9238-da0ab5ac79a2) @@ -3545,24 +3544,24 @@ _N/A_ Optimize typegraph size (#618) -- Hash all type data to compare them on the conversion phase in -typegraph/core: remove duplicate types from type final typegraph -(duplicate: same value for all the fields except for the "random" -name/title). -- Skip unreferenced types in `.apply` - -#### Motivation and context - -Typegraph is too big sometimes. - -#### Migration notes - - - -### Checklist - -- [ ] The change come with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments +- Hash all type data to compare them on the conversion phase in +typegraph/core: remove duplicate types from type final typegraph +(duplicate: same value for all the fields except for the "random" +name/title). +- Skip unreferenced types in `.apply` + +#### Motivation and context + +Typegraph is too big sometimes. + +#### Migration notes + + + +### Checklist + +- [ ] The change come with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change @@ -3575,20 +3574,20 @@ Typegraph is too big sometimes. Prepare release v0.3.6 (#626) -Prepare release v0.3.6 - -#### Motivation and context - -_N/A_ - -#### Migration notes - -_N/A_ - -### Checklist - -- [ ] The change come with new or modified tests -- [ ] Hard-to-understand functions have explanatory comments +Prepare release v0.3.6 + +#### Motivation and context + +_N/A_ + +#### Migration notes + +_N/A_ + +### Checklist + +- [ ] The change come with new or modified tests +- [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change