diff --git a/.ghjk/lock.json b/.ghjk/lock.json index 68f6b154f3..0be1f5c980 100644 --- a/.ghjk/lock.json +++ b/.ghjk/lock.json @@ -431,6 +431,117 @@ } }, "portRef": "cpy_bs_ghrel@0.1.0" + }, + "1a32ccb180571a9900a107e159612ebceee73dde599642b53e5ad5d0a7754a4a": { + "version": "0.2.5", + "depConfigs": { + "cargo_binstall_ghrel": { + "version": "v1.6.4", + "depConfigs": {}, + "portRef": "cargo_binstall_ghrel@0.1.0" + }, + "rust_rustup": { + "version": "1.77.2", + "depConfigs": { + "rustup_rustlang": { + "version": "1.27.0", + "depConfigs": { + "git_aa": { + "version": "2.40.1", + "depConfigs": {}, + "portRef": "git_aa@0.1.0" + } + }, + "portRef": "rustup_rustlang@0.1.0" + } + }, + "portRef": "rust_rustup@0.1.0", + "profile": "minimal" + } + }, + "portRef": "cargobi_cratesio@0.1.0", + "crateName": "cross", + "locked": true + }, + "822c6d037dbb95cf180fa5a8e62786c57af9488d40ba3d6ec4727b590fd4eeda": { + "version": "1.2.4", + "depConfigs": { + "node_org": { + "version": "v20.8.0", + "depConfigs": { + "tar_aa": { + "version": "1.34", + "depConfigs": {}, + "portRef": "tar_aa@0.1.0" + } + }, + "portRef": "node_org@0.1.0" + } + }, + "portRef": "npmi_npm@0.1.0", + "packageName": "@bytecodealliance/jco" + }, + "919cc86bfec50bb6aadfb65d530e8625037f15b4041d28a840d54149be239889": { + "version": "0.116.1", + "depConfigs": { + "cargo_binstall_ghrel": { + "version": "v1.6.4", + "depConfigs": {}, + "portRef": "cargo_binstall_ghrel@0.1.0" + }, + "rust_rustup": { + "version": "1.77.2", + "depConfigs": { + "rustup_rustlang": { + "version": "1.27.0", + "depConfigs": { + "git_aa": { + "version": "2.40.1", + "depConfigs": {}, + "portRef": "git_aa@0.1.0" + } + }, + "portRef": "rustup_rustlang@0.1.0" + } + }, + "portRef": "rust_rustup@0.1.0", + "profile": "minimal" + } + }, + "portRef": "cargobi_cratesio@0.1.0", + "crateName": "wasm-opt", + "locked": true + }, + "a78b841fa383b2dcf4e40f8e969106fbb3c09c6d02c92f77b9f8e1b0d1f7fd72": { + "version": "1.208.1", + "depConfigs": { + "cargo_binstall_ghrel": { + "version": "v1.6.4", + "depConfigs": {}, + "portRef": "cargo_binstall_ghrel@0.1.0" + }, + "rust_rustup": { + "version": "1.77.2", + "depConfigs": { + "rustup_rustlang": { + "version": "1.27.0", + "depConfigs": { + "git_aa": { + "version": "2.40.1", + "depConfigs": {}, + "portRef": "git_aa@0.1.0" + } + }, + "portRef": "rustup_rustlang@0.1.0" + } + }, + "portRef": "rust_rustup@0.1.0", + "profile": "minimal" + } + }, + "portRef": "cargobi_cratesio@0.1.0", + "crateName": "wasm-tools", + "locked": true } } }, @@ -448,13 +559,14 @@ "6c4eb5db74544926094ea3be684f453ac448da0a", "0dac7df77bad6ba3f8a46710f1199cf36b260c82", "fefe1d7a6a79be5dedaf34f4c7e5c00bd6f41554", - "a4c9551574e821b184e492ffbdbf295311099397", - "c69d5f47d8bede1fc7a55bc46ca5f0f2c9252719", + "2c6e03fd977170941f6f43c75652fea6e50f5189", + "d286ef85d0b65f1a144ac4bb57827c1094d50870", "2aedace78ffe026f5c0918231de4f7f9050aab1c", "c13712d0a06c2329378872201d5cb51e0575bed9", "9e72a9f857bd9b14b47702b5b8ee660833828d4b", - "cfe6640502ddf9772073889af75888d361b1f2b9", + "69cc04434a8b51a9d34210383f1a931646772e3b", "8e5e02544073c4733d8f2156c404a0dd524cdaaf", + "54eba38cb79f88fca14cd3185e5bec0c3dd02682", "e05f859f4a734a85fd3439f9b0fc0de1e733bdac", "38285a3b335e394ccce5ac5d59e15f660bfa4cc9", "7bbf00da8e265c56c2bff5bb7d89ba806e2590d2", @@ -677,8 +789,8 @@ "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/2725af8/ports/temporal_cli.ts" } }, - "a4c9551574e821b184e492ffbdbf295311099397": { - "version": "0.116.0", + "2c6e03fd977170941f6f43c75652fea6e50f5189": { + "version": "0.116.1", "depConfigs": { "rust_rustup": { "portRef": "rust_rustup@0.1.0", @@ -722,8 +834,8 @@ "crateName": "wasm-opt", "locked": true }, - "c69d5f47d8bede1fc7a55bc46ca5f0f2c9252719": { - "version": "1.0.53", + "d286ef85d0b65f1a144ac4bb57827c1094d50870": { + "version": "1.208.1", "depConfigs": { "rust_rustup": { "portRef": "rust_rustup@0.1.0", @@ -851,8 +963,8 @@ "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/2725af8/ports/pnpm.ts" } }, - "cfe6640502ddf9772073889af75888d361b1f2b9": { - "version": "1.0.0", + "69cc04434a8b51a9d34210383f1a931646772e3b": { + "version": "1.2.4", "port": { "ty": "denoWorker@v1", "name": "npmi_npm", @@ -921,6 +1033,50 @@ }, "packageName": "node-gyp" }, + "54eba38cb79f88fca14cd3185e5bec0c3dd02682": { + "depConfigs": { + "rust_rustup": { + "portRef": "rust_rustup@0.1.0", + "profile": "minimal" + } + }, + "port": { + "ty": "denoWorker@v1", + "name": "cargobi_cratesio", + "platforms": [ + "x86_64-linux", + "aarch64-linux", + "x86_64-darwin", + "aarch64-darwin", + "x86_64-windows", + "aarch64-windows", + "x86_64-freebsd", + "aarch64-freebsd", + "x86_64-netbsd", + "aarch64-netbsd", + "x86_64-aix", + "aarch64-aix", + "x86_64-solaris", + "aarch64-solaris", + "x86_64-illumos", + "aarch64-illumos", + "x86_64-android", + "aarch64-android" + ], + "version": "0.1.0", + "deps": [ + { + "name": "cargo_binstall_ghrel" + }, + { + "name": "rust_rustup" + } + ], + "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/2725af8/ports/cargobi.ts" + }, + "crateName": "cross", + "locked": true + }, "e05f859f4a734a85fd3439f9b0fc0de1e733bdac": { "version": "v2.4.0", "port": { diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml new file mode 100644 index 0000000000..01384fbb78 --- /dev/null +++ b/.github/workflows/merge.yml @@ -0,0 +1,119 @@ +on: + merge_group: + types: + - checks_requested + +env: + GHJK_VERSION: "2725af8" + DENO_VERSION: "1.41.0" + RUST_BACKTRACE: "full" + RUST_LOG: "info,swc_ecma_codegen=off,tracing::span=off" + DENO_DIR: deno-dir + +jobs: + changes: + runs-on: ubuntu-latest + permissions: + pull-requests: read + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + website: + - '.github/workflows/tests.yml' + - 'website/**' + meta-cli: + - '.github/workflows/tests.yml' + - 'libs/**' + - 'meta-cli/**' + - 'Cargo.lock' + typegate: + - '.github/workflows/tests.yml' + - 'libs/**' + - 'typegate/**' + - 'meta-cli/**' + - 'Cargo.lock' + full: + - '.github/workflows/tests.yml' + - 'libs/**' + - 'typegate/**' + - 'typegraph/**' + - 'meta-cli/**' + - 'Cargo.lock' + - 'examples/**' + rust: + - '.github/workflows/tests.yml' + - 'libs/**' + - 'Cargo.lock' + outputs: + website: ${{ steps.filter.outputs.website }} + meta-cli: ${{ steps.filter.outputs.meta-cli }} + typegate: ${{ steps.filter.outputs.typegate }} + full: ${{ steps.filter.outputs.full }} + rust: ${{ steps.filter.outputs.rust }} + + + test-meta-cli-compat: + needs: changes + if: ${{ needs.changes.outputs.meta-cli == 'true' }} + runs-on: "${{ matrix.os }}" + strategy: + matrix: + include: + - os: macos-13 + activate: "source .venv/bin/activate" + - os: macos-14 + activate: "source .venv/bin/activate" + #- os: windows-latest + # activate: '.venv\Scripts\activate.bat' + steps: + - uses: actions/checkout@v4 + - uses: denoland/setup-deno@v1 + with: + deno-version: ${{ env.DENO_VERSION }} + - name: Cache deno dir + uses: actions/cache@v4 + with: + path: ${{ env.DENO_DIR }} + key: deno-mac-${{ hashFiles('**/deno.lock') }} + - uses: dsherret/rust-toolchain-file@v1 + - uses: Swatinem/rust-cache@v2 + with: + shared-key: ${{ runner.os }}-rust-${{ hashFiles('**/rust-toolchain.toml') }}-${{ hashFiles('**/Cargo.lock') }} + - name: Cache .venv dir + uses: actions/cache@v4 + with: + path: .venv + key: ${{ matrix.os }}-venv-${{ hashFiles('**/poetry.lock', '.ghjk/lock.json') }} + - uses: metatypedev/setup-ghjk@2e8bbf084060a18828338a7cdd43fde6feb2a3cc + with: + # temporary fix + cache-key-prefix: ${{ matrix.os }} + - shell: bash + env: + WASM_FILE: target/debug/typegraph_core.wasm + run: | + python3 -m venv .venv + ${{ matrix.activate }} + + cd typegraph/python + poetry install --no-root + cd ../.. + poetry install --no-root + + deno cache --import-map typegate/import_map.json typegate/src/main.ts typegate/tests/utils/mod.ts + + cargo build -p typegraph_core --target wasm32-unknown-unknown --target-dir target/wasm + mkdir -p $(dirname $WASM_FILE) + wasm-opt -Oz target/wasm/wasm32-unknown-unknown/debug/typegraph_core.wasm -o $WASM_FILE.opt + wasm-tools component new $WASM_FILE.opt -o $WASM_FILE + rm -rf typegraph/python/typegraph/gen + poetry run python -m wasmtime.bindgen $WASM_FILE --out-dir typegraph/python/typegraph/gen + + cargo run --locked --package meta-cli -- --help + cargo test --locked --package meta-cli + + # check the fat CLI build + cargo run --locked --package meta-cli --features typegate -- --help diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 803420276b..60f802b55c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -34,11 +34,10 @@ jobs: - 'libs/**' - 'meta-cli/**' - 'Cargo.lock' - typegate: + typegate: # for the standalone/image (not typegate tests which rely on everything) - '.github/workflows/tests.yml' - 'libs/**' - - 'typegate/**' - - 'meta-cli/**' + - 'typegate/**' # consider moving tests to other dir to improve test detection - 'Cargo.lock' full: - '.github/workflows/tests.yml' @@ -59,7 +58,7 @@ jobs: full: ${{ steps.filter.outputs.full }} rust: ${{ steps.filter.outputs.rust }} - test-pre-commit: + pre-commit: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -86,6 +85,48 @@ jobs: deno cache --import-map typegate/import_map.json typegate/src/main.ts typegate/tests/utils/mod.ts pre-commit run --show-diff-on-failure --color=always --all-files + lint-compat: + needs: changes + if: ${{ needs.changes.outputs.full == 'true' }} + runs-on: "${{ matrix.os }}" + strategy: + matrix: + include: + - os: macos-13 + target: x86_64-apple-darwin + cross: false + - os: macos-14 + target: aarch64-apple-darwin + cross: false + # FIXME: linux/arm64 needs arm runners + # this target doesn't have a meta-cli build anyways + # the typegate is covered by the docker build down below + # - os: custom-macos + # target: aarch64-unknown-linux-gnu + # cross: true + #- os: windows-latest + # activate: '.venv\Scripts\activate.bat' + steps: + - uses: actions/checkout@v4 + - uses: dsherret/rust-toolchain-file@v1 + - uses: metatypedev/setup-ghjk@2e8bbf084060a18828338a7cdd43fde6feb2a3cc + with: + # temporary fix + cache-key-prefix: ${{ matrix.os }} + - if: ${{ matrix.cross }} + shell: bash + env: + # arguments for our custom cross.Dockerfile + CROSS_BUILD_OPTS: "--build-arg 'CROSS_TARGET=${{ matrix.target }}'" + run: | + cross check --locked --all-features --all-targets --target ${{ matrix.target }} + - if: ${{ matrix.cross != true }} + shell: bash + env: + WASM_FILE: target/debug/typegraph_core.wasm + run: | + cargo check --locked --all-features --all-targets --target ${{ matrix.target }} + test-website: needs: changes if: ${{ needs.changes.outputs.website == 'true' }} @@ -116,67 +157,7 @@ jobs: pnpm lint pnpm build - test-meta-cli-compat: - needs: changes - if: ${{ needs.changes.outputs.meta-cli == 'true' }} - runs-on: "${{ matrix.os }}" - strategy: - matrix: - include: - - os: macos-13 - activate: "source .venv/bin/activate" - - os: macos-14 - activate: "source .venv/bin/activate" - #- os: windows-latest - # activate: '.venv\Scripts\activate.bat' - steps: - - uses: actions/checkout@v4 - - uses: denoland/setup-deno@v1 - with: - deno-version: ${{ env.DENO_VERSION }} - - name: Cache deno dir - uses: actions/cache@v4 - with: - path: ${{ env.DENO_DIR }} - key: deno-mac-${{ hashFiles('**/deno.lock') }} - - uses: dsherret/rust-toolchain-file@v1 - - uses: Swatinem/rust-cache@v2 - with: - shared-key: ${{ runner.os }}-rust-${{ hashFiles('**/rust-toolchain.toml') }}-${{ hashFiles('**/Cargo.lock') }} - - name: Cache .venv dir - uses: actions/cache@v4 - with: - path: .venv - key: ${{ matrix.os }}-venv-${{ hashFiles('**/poetry.lock', '.ghjk/lock.json') }} - - uses: metatypedev/setup-ghjk@2e8bbf084060a18828338a7cdd43fde6feb2a3cc - with: - # temporary fix - cache-key-prefix: ${{ matrix.os }} - - shell: bash - env: - WASM_FILE: target/debug/typegraph_core.wasm - run: | - python3 -m venv .venv - ${{ matrix.activate }} - - cd typegraph/python - poetry install --no-root - cd ../.. - poetry install --no-root - - deno cache --import-map typegate/import_map.json typegate/src/main.ts typegate/tests/utils/mod.ts - - cargo build -p typegraph_core --target wasm32-unknown-unknown --target-dir target/wasm - mkdir -p $(dirname $WASM_FILE) - wasm-opt -Oz target/wasm/wasm32-unknown-unknown/debug/typegraph_core.wasm -o $WASM_FILE.opt - wasm-tools component new $WASM_FILE.opt -o $WASM_FILE - rm -rf typegraph/python/typegraph/gen - poetry run python -m wasmtime.bindgen $WASM_FILE --out-dir typegraph/python/typegraph/gen - - cargo run --locked --package meta-cli -- --help - cargo test --locked --package meta-cli - - test-docker: + bulid-docker: needs: changes if: ${{ needs.changes.outputs.typegate == 'true' }} runs-on: ${{ matrix.runner }} @@ -185,13 +166,11 @@ jobs: matrix: include: - platform: linux/amd64 - runner: ubuntu-latest - # FIXME: try macos-14 runner once all actions support it - # docker buildx action broken as of 2024-02-09 + runner: custom-ubuntu-large - platform: linux/arm64 + # FIXME: official darwin images don't have docker + # and nested virtualizaiton runner: custom-macos - # - platform: linux/arm64 - # runner: macos-14 steps: - uses: actions/checkout@v4 - uses: docker/setup-buildx-action@v3 @@ -218,6 +197,7 @@ jobs: cache-to: type=registry,ref=docker.io/zifeo/metatype-cache:ci,mode=max # check target runs extra validation steps in the Dockerfile target: check + build-args: 'CARGO_PROFILE=dev' - name: Build without cache (external) uses: docker/build-push-action@v5 if: "! steps.check.outputs.has-permission" @@ -226,6 +206,7 @@ jobs: platforms: ${{ matrix.platform }} push: false cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/typegate:latest + build-args: 'CARGO_PROFILE=dev' target: check test-full: @@ -263,7 +244,7 @@ jobs: - uses: metatypedev/setup-ghjk@2e8bbf084060a18828338a7cdd43fde6feb2a3cc - shell: bash env: - WASM_FILE: target/debug/typegraph_core.wasm + WASM_FILE: target/release/typegraph_core.wasm run: | echo pwd in $(pwd) @@ -274,24 +255,25 @@ jobs: source .venv/bin/activate poetry install --no-root - deno cache --import-map typegate/import_map.json typegate/src/main.ts typegate/tests/utils/mod.ts - - cargo build -p typegraph_core --target wasm32-unknown-unknown --target-dir target/wasm + # build typegraph_core wasm + cargo build -p typegraph_core --target wasm32-unknown-unknown --release --target-dir target/wasm mkdir -p $(dirname $WASM_FILE) - wasm-opt -Oz target/wasm/wasm32-unknown-unknown/debug/typegraph_core.wasm -o $WASM_FILE.opt + wasm-opt -Oz target/wasm/wasm32-unknown-unknown/release/typegraph_core.wasm -o $WASM_FILE.opt wasm-tools component new $WASM_FILE.opt -o $WASM_FILE + # build python sdk package + poetry run python -m wasmtime.bindgen $WASM_FILE --out-dir typegraph/python/typegraph/gen + + # build node typegrap/sdk package jco transpile $WASM_FILE -o typegraph/node/sdk/src/gen --map metatype:typegraph/host=../host/host.js cd typegraph/node pnpm install pnpm run sdk-build cp ./sdk/{package.json,package-lock.json,LICENSE.md} ./sdk/dist - cd ../.. - - poetry run python -m wasmtime.bindgen $WASM_FILE --out-dir typegraph/python/typegraph/gen + cd - # start the docker containers - deno run -A dev/env.ts base prisma + ghjk x dev env base prisma export NPM_CONFIG_REGISTRY=http://localhost:4873 @@ -299,28 +281,31 @@ jobs: cd typegraph/node/sdk/dist npm config set "//localhost:4873/:_authToken" fooBar npm publish --registry $NPM_CONFIG_REGISTRY - cd ../../../.. + cd - ghjk x clean-deno-lock # install packages inside metatype examples pnpm install -C examples/typegraphs - # from old test-typegraph-core - # test in native rust, not in wasm for a future rust SDK - # without --tests, the --doc is causing a link error "syntax error in VERSION script" - cargo test --locked --package typegraph_core --tests + + deno cache --import-map typegate/import_map.json typegate/src/main.ts typegate/tests/utils/mod.ts + + deno run -A dev/update.ts --cache-only + + cargo build -p xtask # xtask and meta-cli are used by the test suite + cargo build -p meta-cli # from old test-meta-cli - cargo run --locked --package meta-cli -- --help cargo test --locked --package meta-cli # from old test-libs cargo test --locked --exclude meta-cli --exclude typegate --exclude typegate_engine --exclude typegraph_core --exclude metagen_mdk_rust_static --workspace - deno run -A dev/update.ts --cache-only || deno run -A dev/update.ts --cache-only - cargo build -p meta-cli - cargo build -p xtask # xtask and meta-cli are used by the test suite + # from old test-typegraph-core + # test in native rust, not in wasm for a future rust SDK + # without --tests, the --doc is causing a link error "syntax error in VERSION script" + cargo test --locked --package typegraph_core --tests ghjk x clean-deno-lock deno run -A dev/test.ts --threads 1 -- --coverage=coverage diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1bdc03aa12..b4df5dfa06 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,57 +1,18 @@ repos: - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 - hooks: - - id: check-added-large-files - args: - - --maxkb=768 - - id: check-ast - - id: check-json - exclude: .vscode/.*\.json - - id: check-toml - - id: check-yaml - - id: check-case-conflict - - id: check-executables-have-shebangs - - id: check-merge-conflict - - id: end-of-file-fixer - # exclude all generated files - exclude: (?x)( - .ghjk/.* - |.*deno.lock - |.*\.snap$|typegate/src/typegraphs/.*\.json - |website/docs/reference/ - |libs/pyrt_wit_wire/pyrt) - - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.27.2 - hooks: - - id: check-dependabot - - id: check-github-workflows - - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: "v0.1.7" - hooks: - - id: ruff - - id: ruff-format - - repo: https://github.com/commitizen-tools/commitizen - rev: v3.13.0 - hooks: - - id: commitizen - stages: - - commit-msg - - repo: https://github.com/doublify/pre-commit-rust - rev: v1.0 - hooks: - - id: fmt - - id: cargo-check - args: - - "--locked" - - id: clippy - args: - - "--locked" - - "--" - - "--deny" - - "warnings" - repo: local hooks: + - id: version + name: "Lock versions" + always_run: true + language: system + entry: bash -c 'deno run -A dev/lock.ts --check' + pass_filenames: false + - id: clean-deno-lock + name: "Clean deno.lock" + always_run: true + language: system + entry: ghjk x clean-deno-lock + pass_filenames: false - id: deno-fmt name: Deno format language: system @@ -86,18 +47,28 @@ repos: types: - ts files: ^meta-lsp/ - - id: version - name: "Lock versions" - always_run: true - language: system - entry: bash -c 'deno run -A dev/lock.ts --check' - pass_filenames: false - - id: clean-deno-lock - name: "Clean deno.lock" - always_run: true - language: system - entry: ghjk x clean-deno-lock - pass_filenames: false + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: check-added-large-files + args: + - --maxkb=768 + - id: check-ast + - id: check-json + exclude: .vscode/.*\.json + - id: check-toml + - id: check-yaml + - id: check-case-conflict + - id: check-executables-have-shebangs + - id: check-merge-conflict + - id: end-of-file-fixer + # exclude all generated files + exclude: (?x)( + .ghjk/.* + |.*deno.lock + |.*\.snap$|typegate/src/typegraphs/.*\.json + |website/docs/reference/ + |libs/pyrt_wit_wire/pyrt) - repo: https://github.com/Lucas-C/pre-commit-hooks rev: v1.5.4 hooks: @@ -164,3 +135,31 @@ repos: - tsx files: ^website/ exclude: website/typegraphs + - repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.27.2 + hooks: + - id: check-dependabot + - id: check-github-workflows + - repo: https://github.com/charliermarsh/ruff-pre-commit + rev: "v0.1.7" + hooks: + - id: ruff + - id: ruff-format + - repo: https://github.com/commitizen-tools/commitizen + rev: v3.13.0 + hooks: + - id: commitizen + stages: + - commit-msg + - repo: https://github.com/doublify/pre-commit-rust + rev: v1.0 + hooks: + - id: fmt + - id: clippy + args: + - "--locked" + - "--all-features" + - "--all-targets" + - "--" + - "--deny" + - "warnings" diff --git a/Cargo.lock b/Cargo.lock index 6d4739ff0f..41c74cda26 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1587,6 +1587,12 @@ dependencies = [ "cc", ] +[[package]] +name = "cobs" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" + [[package]] name = "codespan-reporting" version = "0.11.1" @@ -1682,7 +1688,7 @@ dependencies = [ [[package]] name = "common" -version = "0.4.1" +version = "0.4.2" dependencies = [ "anyhow", "async-trait", @@ -1916,18 +1922,18 @@ dependencies = [ [[package]] name = "cranelift-bforest" -version = "0.107.2" +version = "0.108.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebf72ceaf38f7d41194d0cf6748214d8ef7389167fe09aad80f87646dbfa325b" +checksum = "f75f0946f5e307e5dbf22e8bc0bd9bc5336a4f0240a4af4751c007a0cbf84917" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.107.2" +version = "0.108.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ee7fde5cd9173f00ce02c491ee9e306d64740f4b1a697946e0474f389999e13" +checksum = "a6b0a01705ef466bbc64e10af820f935f77256bcb14a40dde1e10b7a0969ce11" dependencies = [ "bumpalo", "cranelift-bforest", @@ -1940,39 +1946,40 @@ dependencies = [ "hashbrown 0.14.5", "log", "regalloc2", + "rustc-hash", "smallvec", "target-lexicon", ] [[package]] name = "cranelift-codegen-meta" -version = "0.107.2" +version = "0.108.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b49bec6a517e78d4067500dc16acb558e772491a2bcb37301127448adfb8413c" +checksum = "2cdaeff01606190dcccd13cf3d80b8d5f1f197812ba7bba1196ae08bd8e82592" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.107.2" +version = "0.108.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ead4ea497b2dc2ac31fcabd6d5d0d5dc25b3964814122e343724bdf65a53c843" +checksum = "cefa0243350ce9667f3320579c8a2c3dd3d1f9943e8ab2eb1d4ca533ccc1db57" [[package]] name = "cranelift-control" -version = "0.107.2" +version = "0.108.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f81e8028c8d711ea7592648e70221f2e54acb8665f7ecd49545f021ec14c3341" +checksum = "fa46a2d3331aa33cbd399665d6ea0f431f726a55fb69fdf897035cf5fe0a3301" dependencies = [ "arbitrary", ] [[package]] name = "cranelift-entity" -version = "0.107.2" +version = "0.108.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32acd0632ba65c2566e75f64af9ef094bb8d90e58a9fbd33d920977a9d85c054" +checksum = "9e8f7cc083e6d01d656283f293ec361ce7bae05eca896f3a932d42dad1850578" dependencies = [ "serde 1.0.202", "serde_derive", @@ -1980,9 +1987,9 @@ dependencies = [ [[package]] name = "cranelift-frontend" -version = "0.107.2" +version = "0.108.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a395a704934aa944ba8939cac9001174b9ae5236f48bc091f89e33bb968336f6" +checksum = "8490d83b85eeec14ebf3b4c0b0ebc33600f1943514b1406a7b99b85d8b80e4c0" dependencies = [ "cranelift-codegen", "log", @@ -1992,15 +1999,15 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.107.2" +version = "0.108.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b325ce81c4ee7082dc894537eb342c37898e14230fe7c02ea945691db3e2dd01" +checksum = "e617871f2347ca078a31d61acaf7de961852447e6009afa5be6e4df6d5785dd4" [[package]] name = "cranelift-native" -version = "0.107.2" +version = "0.108.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea11f5ac85996fa093075d66397922d4f56085d5d84ec13043d0cd4f159c6818" +checksum = "add05ee8162778fd7b545e0935f4a5c0c95afdac003362e040ef0229227ae967" dependencies = [ "cranelift-codegen", "libc", @@ -2009,9 +2016,9 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.107.2" +version = "0.108.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4f175d4e299a8edabfbd64fa93c7650836cc8ad7f4879f9bd2632575a1f12d0" +checksum = "318b671ce0a174347dcbc4a5e8b8fe292864fd63fdb0c91324239245c3d4caa2" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -2019,7 +2026,7 @@ dependencies = [ "itertools 0.12.1", "log", "smallvec", - "wasmparser 0.202.0", + "wasmparser 0.207.0", "wasmtime-types", ] @@ -2040,9 +2047,9 @@ checksum = "ccaeedb56da03b09f598226e25e80088cb4cd25f316e6e4df7d695f0feeb1403" [[package]] name = "crc32fast" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] @@ -3848,6 +3855,12 @@ dependencies = [ "zeroize", ] +[[package]] +name = "embedded-io" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" + [[package]] name = "encode_unicode" version = "0.3.6" @@ -6359,9 +6372,9 @@ dependencies = [ [[package]] name = "mach2" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d0d1830bcd151a6fc4aea1369af235b36c1528fe976b8ff678683c9995eade8" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" dependencies = [ "libc", ] @@ -6512,7 +6525,7 @@ dependencies = [ [[package]] name = "meta-cli" -version = "0.4.1" +version = "0.4.2" dependencies = [ "actix", "actix-web", @@ -6580,7 +6593,7 @@ dependencies = [ [[package]] name = "metagen" -version = "0.4.1" +version = "0.4.2" dependencies = [ "color-eyre", "common", @@ -6905,7 +6918,7 @@ dependencies = [ [[package]] name = "mt_deno" -version = "0.4.1" +version = "0.4.2" dependencies = [ "anyhow", "deno", @@ -8143,6 +8156,17 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" +[[package]] +name = "postcard" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a55c51ee6c0db07e68448e336cf8ea4131a620edefebf9893e759b2d793420f8" +dependencies = [ + "cobs", + "embedded-io", + "serde 1.0.202", +] + [[package]] name = "postgres-native-tls" version = "0.5.0" @@ -10270,6 +10294,9 @@ name = "smallvec" version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +dependencies = [ + "serde 1.0.202", +] [[package]] name = "smartstring" @@ -12156,7 +12183,7 @@ dependencies = [ [[package]] name = "typegate" -version = "0.4.1" +version = "0.4.2" dependencies = [ "colored", "env_logger", @@ -12169,7 +12196,7 @@ dependencies = [ [[package]] name = "typegate_engine" -version = "0.4.1" +version = "0.4.2" dependencies = [ "anyhow", "base64 0.21.7", @@ -12211,7 +12238,7 @@ dependencies = [ [[package]] name = "typegraph_core" -version = "0.4.1" +version = "0.4.2" dependencies = [ "common", "enum_dispatch", @@ -12246,7 +12273,7 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "typescript" -version = "0.4.1" +version = "0.4.2" dependencies = [ "anyhow", "dprint-plugin-typescript", @@ -12880,47 +12907,70 @@ dependencies = [ "semver 1.0.23", ] +[[package]] +name = "wasmparser" +version = "0.207.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e19bb9f8ab07616da582ef8adb24c54f1424c7ec876720b7da9db8ec0626c92c" +dependencies = [ + "ahash 0.8.11", + "bitflags 2.5.0", + "hashbrown 0.14.5", + "indexmap 2.2.6", + "semver 1.0.23", +] + [[package]] name = "wasmprinter" -version = "0.202.0" +version = "0.207.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab1cc9508685eef9502e787f4d4123745f5651a1e29aec047645d3cac1e2da7a" +checksum = "9c2d8a7b4dabb460208e6b4334d9db5766e84505038b2529e69c3d07ac619115" dependencies = [ "anyhow", - "wasmparser 0.202.0", + "wasmparser 0.207.0", ] [[package]] name = "wasmtime" -version = "20.0.2" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4af5cb32045daee8476711eb12b8b71275c2dd1fc7a58cc2a11b33ce9205f6a2" +checksum = "6fe2db63de4669214120414ae6d86afb6bb011748bf942836aba2d45f011972b" dependencies = [ "addr2line", "anyhow", "async-trait", - "bincode", "bumpalo", + "cc", "cfg-if", "encoding_rs", "fxprof-processed-profile", "gimli", + "hashbrown 0.14.5", "indexmap 2.2.6", "ittapi", "libc", + "libm", "log", + "mach2", + "memfd", + "memoffset 0.9.1", "object 0.33.0", "once_cell", "paste", + "postcard", + "psm", "rayon", "rustix 0.38.34", "semver 1.0.23", "serde 1.0.202", "serde_derive", "serde_json", + "smallvec", + "sptr", "target-lexicon", - "wasm-encoder 0.202.0", - "wasmparser 0.202.0", + "wasm-encoder 0.207.0", + "wasmparser 0.207.0", + "wasmtime-asm-macros", "wasmtime-cache", "wasmtime-component-macro", "wasmtime-component-util", @@ -12929,8 +12979,8 @@ dependencies = [ "wasmtime-fiber", "wasmtime-jit-debug", "wasmtime-jit-icache-coherence", - "wasmtime-runtime", "wasmtime-slab", + "wasmtime-versioned-export-macros", "wasmtime-winch", "wat", "windows-sys 0.52.0", @@ -12938,24 +12988,24 @@ dependencies = [ [[package]] name = "wasmtime-asm-macros" -version = "20.0.2" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7515c4d24c8b55c0feab67e3d52a42f999fda8b9cfafbd69a82ed6bcf299d26e" +checksum = "821f87828a6508995bf1243fda9dafd1b671a49b3bf998394c7b73f0f5d9eb5f" dependencies = [ "cfg-if", ] [[package]] name = "wasmtime-cache" -version = "20.0.2" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3aa2de7189ea6b3270727d0027790494aec5e7101ca50da3f9549a86628cae4" +checksum = "19200760d6720b40da359c096d050056731300d253cd2ed8614e6940c10f766c" dependencies = [ "anyhow", "base64 0.21.7", - "bincode", "directories-next", "log", + "postcard", "rustix 0.38.34", "serde 1.0.202", "serde_derive", @@ -12967,9 +13017,9 @@ dependencies = [ [[package]] name = "wasmtime-component-macro" -version = "20.0.2" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "794839a710a39a12677c67ff43fec54ef00d0ca6c6f631209a7c5524522221d3" +checksum = "aab7a588beec0116e99488768395eee70a1dc53869aae111d006f8928a16ed46" dependencies = [ "anyhow", "proc-macro2", @@ -12977,20 +13027,20 @@ dependencies = [ "syn 2.0.65", "wasmtime-component-util", "wasmtime-wit-bindgen", - "wit-parser 0.202.0", + "wit-parser 0.207.0", ] [[package]] name = "wasmtime-component-util" -version = "20.0.2" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7839a1b9e15d17be1cb2a105f18be8e0bbf52bdec7a7cd6eb5d80d4c2cdf74f0" +checksum = "52cc81977f24da3071f3f4b32f40ef6d8fb4f14e12f0bc4c68163935d6694ded" [[package]] name = "wasmtime-cranelift" -version = "20.0.2" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57ec2d9a4b9990bea53a5dfd689d48663dbd19a46903eaf73e2022b3d1ef20d3" +checksum = "e45cc4915c2b37b4d8b49aaab29d6e2612b393eabb01ae3a410d95e372c22d13" dependencies = [ "anyhow", "cfg-if", @@ -13005,32 +13055,31 @@ dependencies = [ "object 0.33.0", "target-lexicon", "thiserror", - "wasmparser 0.202.0", + "wasmparser 0.207.0", "wasmtime-environ", "wasmtime-versioned-export-macros", ] [[package]] name = "wasmtime-environ" -version = "20.0.2" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad72e2e3f7ea5b50fedf66dd36ba24634e4f445c370644683b433d45d88f6126" +checksum = "bba5317f774e37197d588deadb794289438866b72bc1531c593506a004d6cfe0" dependencies = [ "anyhow", - "bincode", "cpp_demangle", "cranelift-entity", "gimli", "indexmap 2.2.6", "log", "object 0.33.0", + "postcard", "rustc-demangle", "serde 1.0.202", "serde_derive", "target-lexicon", - "thiserror", - "wasm-encoder 0.202.0", - "wasmparser 0.202.0", + "wasm-encoder 0.207.0", + "wasmparser 0.207.0", "wasmprinter", "wasmtime-component-util", "wasmtime-types", @@ -13038,9 +13087,9 @@ dependencies = [ [[package]] name = "wasmtime-fiber" -version = "20.0.2" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dbdf3053e7e7ced0cd4ed76579995b62169a1a43696890584eae2de2e33bf54" +checksum = "89ecb5dd1253786c4809588b722a5990367ad0b730f53e676ea8edd2962a6834" dependencies = [ "anyhow", "cc", @@ -13053,9 +13102,9 @@ dependencies = [ [[package]] name = "wasmtime-jit-debug" -version = "20.0.2" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "983ca409f2cd66385ce49486c022da0128acb7910c055beb5230998b49c6084c" +checksum = "a16c89f914bfb8cb4301401cd54fdea569ae8c4da12057f981b6355bf5ba1bfe" dependencies = [ "object 0.33.0", "once_cell", @@ -13065,69 +13114,40 @@ dependencies = [ [[package]] name = "wasmtime-jit-icache-coherence" -version = "20.0.2" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ede45379f3b4d395d8947006de8043801806099a240a26db553919b68e96ab15" -dependencies = [ - "cfg-if", - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "wasmtime-runtime" -version = "20.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65019d29d175c567b84173f2adf3b7a3af6d5592f8fe510dccae55d2569ec0d2" +checksum = "e6ce46bf24b027e1ede83d14ed544c736d7e939a849c4429551eb27842356c77" dependencies = [ "anyhow", - "cc", "cfg-if", - "encoding_rs", - "indexmap 2.2.6", "libc", - "log", - "mach2", - "memfd", - "memoffset 0.9.1", - "paste", - "psm", - "rustix 0.38.34", - "sptr", - "wasm-encoder 0.202.0", - "wasmtime-asm-macros", - "wasmtime-environ", - "wasmtime-fiber", - "wasmtime-jit-debug", - "wasmtime-slab", - "wasmtime-versioned-export-macros", "windows-sys 0.52.0", ] [[package]] name = "wasmtime-slab" -version = "20.0.2" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6585868f5c427c3e9d2a8c0c3354e6d7d4518a0d17723ab25a0c1eebf5d5b4" +checksum = "90814f57c64afa02324829c3a8f88616ce3a75f1b2ce9728d34827d21329a836" [[package]] name = "wasmtime-types" -version = "20.0.2" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84d5381ff174faded38c7b2085fbe430dff59489c87a91403354d710075750fb" +checksum = "629bdcf8b1f7590834c1ad6cd043e93e1d57e80b776adb84109eed203fb74d38" dependencies = [ "cranelift-entity", "serde 1.0.202", "serde_derive", - "thiserror", - "wasmparser 0.202.0", + "smallvec", + "wasmparser 0.207.0", ] [[package]] name = "wasmtime-versioned-export-macros" -version = "20.0.2" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d3b70422fdfa915c903f003b8b42554a8ae1aa0c6208429d8314ebf5721f3ac" +checksum = "89b3438cb56868e235825c7026e85fe8a6c4b5437b5786ad010948e5c6eff0d4" dependencies = [ "proc-macro2", "quote", @@ -13136,9 +13156,9 @@ dependencies = [ [[package]] name = "wasmtime-wasi" -version = "20.0.2" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08dd00241969c3be8c5dfdedbb8d9c5af6783e514ffbf8f7522036561bd1337a" +checksum = "82e7931e19286a853fb5cae7790f9be473f7ab763043c659f1fa0a2a8eada10b" dependencies = [ "anyhow", "async-trait", @@ -13167,16 +13187,16 @@ dependencies = [ [[package]] name = "wasmtime-winch" -version = "20.0.2" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "996360967b5196dec20ddcfce499ce4dc80cc925c088b0f2b376d29b96833a6a" +checksum = "dd04ad4f7bbcf7925455cec6420481b972071284e611e105cc16b847fc6415e8" dependencies = [ "anyhow", "cranelift-codegen", "gimli", "object 0.33.0", "target-lexicon", - "wasmparser 0.202.0", + "wasmparser 0.207.0", "wasmtime-cranelift", "wasmtime-environ", "winch-codegen", @@ -13184,14 +13204,14 @@ dependencies = [ [[package]] name = "wasmtime-wit-bindgen" -version = "20.0.2" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01840c0cfbbb01664c796e3f4edbd656e58f9d76db083c7e7c6bba59ea657a96" +checksum = "50c5e4fc265a4d78c334b9fcd846ffd94859bf821ee34a77bc68035526d455ee" dependencies = [ "anyhow", "heck 0.4.1", "indexmap 2.2.6", - "wit-parser 0.202.0", + "wit-parser 0.207.0", ] [[package]] @@ -13373,9 +13393,9 @@ checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" [[package]] name = "wiggle" -version = "20.0.2" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93fc3510978a905f931d74784ed8685bd6453e18ad8f92809e793d48827e3cd" +checksum = "f08c5d8fa4a78e3b4617087f38a4e3d2a99f77564fb8cbc081171f51e71be68f" dependencies = [ "anyhow", "async-trait", @@ -13388,9 +13408,9 @@ dependencies = [ [[package]] name = "wiggle-generate" -version = "20.0.2" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec3909e70f36066526ad3b2abb4855ab836f8a6b293449582563ac50d651083" +checksum = "ca781e3c25a0fdca713b956749f3957f20ae61e88ad52225d2a6f5c20f349ac1" dependencies = [ "anyhow", "heck 0.4.1", @@ -13403,9 +13423,9 @@ dependencies = [ [[package]] name = "wiggle-macro" -version = "20.0.2" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c31124572ab16401c491c0d4fb5fe5d17dab65fcfcc56d7d8efb1c1e56a3db" +checksum = "117d24553966c27aff87b95f817519bd4aacd71165f961d04cf53e5ffdfc2f08" dependencies = [ "proc-macro2", "quote", @@ -13459,9 +13479,9 @@ dependencies = [ [[package]] name = "winch-codegen" -version = "0.18.2" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cefeb84a0f39227cf2eb665cf348e6150ebf3372d08adff03264064ab590fdf4" +checksum = "48691637c874363258ea7295497afdcfd426e5608fa36f62ab6bd0b9cac2bcb8" dependencies = [ "anyhow", "cranelift-codegen", @@ -13469,7 +13489,7 @@ dependencies = [ "regalloc2", "smallvec", "target-lexicon", - "wasmparser 0.202.0", + "wasmparser 0.207.0", "wasmtime-cranelift", "wasmtime-environ", ] @@ -13927,6 +13947,24 @@ dependencies = [ "wasmparser 0.202.0", ] +[[package]] +name = "wit-parser" +version = "0.207.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c83dab33a9618d86cfe3563cc864deffd08c17efc5db31a3b7cd1edeffe6e1" +dependencies = [ + "anyhow", + "id-arena", + "indexmap 2.2.6", + "log", + "semver 1.0.23", + "serde 1.0.202", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser 0.207.0", +] + [[package]] name = "witx" version = "0.9.1" @@ -13996,7 +14034,7 @@ checksum = "791978798f0597cfc70478424c2b4fdc2b7a8024aaff78497ef00f24ef674193" [[package]] name = "xtask" -version = "0.4.1" +version = "0.4.2" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index 14382a793d..64220f6770 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ exclude = [ "libs/pyrt_wit_wire", ] [workspace.package] -version = "0.4.1" +version = "0.4.2" edition = "2021" [workspace.dependencies] @@ -59,8 +59,8 @@ tempfile = "3.8.1" regex = "1.10.2" once_cell = "1.18.0" -wasmtime = "20.0.0" -wasmtime-wasi = "20.0.0" +wasmtime = "21.0.0" +wasmtime-wasi = "21.0.0" tracing = "0.1" # tracing core helper diff --git a/dev/Dockerfile b/dev/Dockerfile index 60ca57cbfa..88e6e2b145 100644 --- a/dev/Dockerfile +++ b/dev/Dockerfile @@ -1,5 +1,5 @@ # disable SHELL cmd down below if switching to non-debug -ARG RUST_VERSION=1.75.0 +ARG RUST_VERSION=1.77.1 ARG DENO_VERSION=1.41.0 ARG DISTROLESS_TAG=debug-nonroot @@ -9,7 +9,7 @@ FROM rust:${RUST_VERSION}-slim-bullseye AS base WORKDIR /app -RUN cargo install cargo-chef --locked +RUN cargo install cargo-chef --locked --debug FROM base as plan @@ -62,14 +62,21 @@ ENV GHJK_ENV=/root/.local/share/ghjk/env.sh COPY --from=plan /app/recipe.json recipe.json +ARG CARGO_PROFILE=release + RUN . $GHJK_ENV \ - && cargo chef cook --recipe-path recipe.json --release --package typegate \ + && cargo chef cook --recipe-path recipe.json --profile $CARGO_PROFILE --package typegate \ && rm recipe.json COPY . . RUN . $GHJK_ENV \ - && cargo build --release --package typegate + && cargo build --profile $CARGO_PROFILE --package typegate \ + && ( \ + [ $CARGO_PROFILE = 'release' ] \ + && cp target/release/typegate typegate-bin \ + || cp target/debug/typegate typegate-bin \ + ) RUN . $GHJK_ENV \ && deno run -A dev/update.ts --cache-only --src-only \ @@ -113,7 +120,7 @@ COPY --from=runtime-bin /tini /tini COPY --from=runtime-bin /lib/sym /lib/sym COPY --from=builder /lib/*-linux-gnu/libz.so* /lib/sym/${TARGETARCH} -COPY --from=builder /app/target/release/typegate /bin/typegate +COPY --from=builder /app/typegate-bin /bin/typegate # the typegate ecma sources COPY --from=builder /app/typegate/deno.jsonc /app/typegate/import_map.json ./typegate/ COPY --from=builder /app/typegate/engine/*.js /app/typegate/engine/*.ts ./typegate/engine/ diff --git a/dev/cross.Dockerfile b/dev/cross.Dockerfile index acf59cf472..de5f587c9e 100644 --- a/dev/cross.Dockerfile +++ b/dev/cross.Dockerfile @@ -17,6 +17,7 @@ RUN set -eux \ && apt-get update \ && apt install --fix-broken --assume-yes --no-install-recommends \ make \ + clang \ # libffi-sys cate build dep\ automake \ # protoc\ diff --git a/dev/lock.yml b/dev/lock.yml index a5230ececf..9279b27ded 100644 --- a/dev/lock.yml +++ b/dev/lock.yml @@ -70,7 +70,7 @@ dev: '( tagline: ").+(",)': TAGLINE '**/pyproject.toml': (version = ").+("): METATYPE_VERSION - (wasmtime = "\^).+("): WASMTIME_VERSION + (wasmtime = "\^).+("): WASMTIME_PY_VERSION examples/**/compose.yml: '( image: ghcr.io/metatypedev/typegate:v).+()': PUBLISHED_VERSION examples/**/pyproject.toml: @@ -88,19 +88,20 @@ dev: PYTHON_VERSION: 3.8.18 POETRY_VERSION: 1.7.0 PROTOC_VERSION: v24.1 - RUST_VERSION: 1.75.0 + RUST_VERSION: 1.77.1 DENO_VERSION: 1.41.0 NODE_VERSION: 20.8.0 PNPM_VERSION: v9.0.5 CARGO_INSTA_VERSION: 1.33.0 - WASM_TOOLS_VERSION: 1.0.53 - JCO_VERSION: 1.0.0 - WASMTIME_VERSION: 20.0.0 + WASM_TOOLS_VERSION: 1.208.1 + JCO_VERSION: 1.2.4 + WASMTIME_VERSION: 21.0.0 + WASMTIME_PY_VERSION: 21.0.0 TYPEGRAPH_VERSION: 0.0.3 PRISMA_VERSION: 5.5.2 - METATYPE_VERSION: 0.4.1 - PUBLISHED_VERSION: 0.4.0 - WASM_OPT_VERSION: 0.116.0 + METATYPE_VERSION: 0.4.2 + PUBLISHED_VERSION: 0.4.1 + WASM_OPT_VERSION: 0.116.1 MOLD_VERSION: v2.4.0 CMAKE_VERSION: 3.28.0-rc6 TEMPORAL_VERSION: 0.10.7 diff --git a/dev/verdaccio/config.yaml b/dev/verdaccio/config.yaml index dd328e56e0..19ed888dd3 100644 --- a/dev/verdaccio/config.yaml +++ b/dev/verdaccio/config.yaml @@ -6,7 +6,7 @@ packages: '@typegraph/*': access: $all publish: $all - proxy: npmjs + # proxy: npmjs '@*/*': access: $all publish: $authenticated diff --git a/examples/templates/deno/api/example.ts b/examples/templates/deno/api/example.ts index 9efc60a4da..bc3f790846 100644 --- a/examples/templates/deno/api/example.ts +++ b/examples/templates/deno/api/example.ts @@ -1,6 +1,6 @@ -import { Policy, t, typegraph } from "npm:@typegraph/sdk@0.4.0/index.js"; -import { PythonRuntime } from "npm:@typegraph/sdk@0.4.0/runtimes/python.js"; -import { DenoRuntime } from "npm:@typegraph/sdk@0.4.0/runtimes/deno.js"; +import { Policy, t, typegraph } from "npm:@typegraph/sdk@0.4.1/index.js"; +import { PythonRuntime } from "npm:@typegraph/sdk@0.4.1/runtimes/python.js"; +import { DenoRuntime } from "npm:@typegraph/sdk@0.4.1/runtimes/deno.js"; await typegraph("example", (g) => { const pub = Policy.public(); diff --git a/examples/templates/deno/compose.yml b/examples/templates/deno/compose.yml index 3f1e6b06f0..55b25b10ab 100644 --- a/examples/templates/deno/compose.yml +++ b/examples/templates/deno/compose.yml @@ -1,6 +1,6 @@ services: typegate: - image: ghcr.io/metatypedev/typegate:v0.4.0 + image: ghcr.io/metatypedev/typegate:v0.4.1 restart: always ports: - "7890:7890" diff --git a/examples/templates/node/compose.yml b/examples/templates/node/compose.yml index 3f1e6b06f0..55b25b10ab 100644 --- a/examples/templates/node/compose.yml +++ b/examples/templates/node/compose.yml @@ -1,6 +1,6 @@ services: typegate: - image: ghcr.io/metatypedev/typegate:v0.4.0 + image: ghcr.io/metatypedev/typegate:v0.4.1 restart: always ports: - "7890:7890" diff --git a/examples/templates/node/package.json b/examples/templates/node/package.json index c806750caa..8a5418b7e9 100644 --- a/examples/templates/node/package.json +++ b/examples/templates/node/package.json @@ -6,7 +6,7 @@ "dev": "MCLI_LOADER_CMD='npm x tsx' meta dev" }, "dependencies": { - "@typegraph/sdk": "^0.4.0" + "@typegraph/sdk": "^0.4.1" }, "devDependencies": { "tsx": "^3.13.0", diff --git a/examples/templates/python/compose.yml b/examples/templates/python/compose.yml index 3f1e6b06f0..55b25b10ab 100644 --- a/examples/templates/python/compose.yml +++ b/examples/templates/python/compose.yml @@ -1,6 +1,6 @@ services: typegate: - image: ghcr.io/metatypedev/typegate:v0.4.0 + image: ghcr.io/metatypedev/typegate:v0.4.1 restart: always ports: - "7890:7890" diff --git a/examples/templates/python/pyproject.toml b/examples/templates/python/pyproject.toml index 3fa4cb14cc..8ec1094a60 100644 --- a/examples/templates/python/pyproject.toml +++ b/examples/templates/python/pyproject.toml @@ -1,12 +1,12 @@ [tool.poetry] name = "example" -version = "0.4.1" +version = "0.4.2" description = "" authors = [] [tool.poetry.dependencies] python = ">=3.8,<4.0" -typegraph = "0.4.1" +typegraph = "0.4.2" [build-system] requires = ["poetry-core"] diff --git a/ghjk.ts b/ghjk.ts index 238b1ff8ca..ba7b7e80b1 100644 --- a/ghjk.ts +++ b/ghjk.ts @@ -8,16 +8,16 @@ const PROTOC_VERSION = "v24.1"; const POETRY_VERSION = "1.7.0"; const PYTHON_VERSION = "3.8.18"; const PNPM_VERSION = "v9.0.5"; -const WASM_TOOLS_VERSION = "1.0.53"; -const JCO_VERSION = "1.0.0"; -const WASMTIME_VERSION = "20.0.0"; -const WASM_OPT_VERSION = "0.116.0"; +const WASM_TOOLS_VERSION = "1.208.1"; +const JCO_VERSION = "1.2.4"; +const WASMTIME_VERSION = "21.0.0"; +const WASM_OPT_VERSION = "0.116.1"; const MOLD_VERSION = "v2.4.0"; const CMAKE_VERSION = "3.28.0-rc6"; const CARGO_INSTA_VERSION = "1.33.0"; const NODE_VERSION = "20.8.0"; const TEMPORAL_VERSION = "0.10.7"; -const METATYPE_VERSION = "0.4.1"; +const METATYPE_VERSION = "0.4.2"; const installs = { python: ports.cpy_bs({ version: PYTHON_VERSION, releaseTag: "20240224" }), @@ -62,7 +62,7 @@ ghjk.install( crateName: "wasm-tools", version: WASM_TOOLS_VERSION, locked: true, - }) + }), ); if (!inOci()) { @@ -80,7 +80,11 @@ if (!inOci()) { packageName: "@bytecodealliance/jco", version: JCO_VERSION, })[0], - ports.npmi({ packageName: "node-gyp", version: "10.0.1" })[0] + ports.npmi({ packageName: "node-gyp", version: "10.0.1" })[0], + ports.cargobi({ + crateName: "cross", + locked: true, + }), ); } @@ -89,7 +93,7 @@ if (Deno.build.os == "linux" && !Deno.env.has("NO_MOLD")) { ports.mold({ version: MOLD_VERSION, replaceLd: Deno.env.has("CI") || Deno.env.has("OCI"), - }) + }), ); } @@ -99,7 +103,7 @@ if (!Deno.env.has("NO_PYTHON")) { ports.pipi({ packageName: "poetry", version: POETRY_VERSION, - })[0] + })[0], ); if (!inOci()) { ghjk.install(ports.pipi({ packageName: "pre-commit" })[0]); @@ -110,7 +114,7 @@ if (inDev()) { ghjk.install( ports.act({}), ports.cargobi({ crateName: "whiz", locked: true }), - installs.comp_py[0] + installs.comp_py[0], ); } @@ -119,12 +123,13 @@ ghjk.task("clean-deno-lock", { // jq ], async fn({ $ }) { - const jqOp1 = `del(.packages.specifiers["npm:@typegraph/sdk@${METATYPE_VERSION}"])`; + const jqOp1 = + `del(.packages.specifiers["npm:@typegraph/sdk@${METATYPE_VERSION}"])`; const jqOp2 = `del(.packages.npm["@typegraph/sdk@${METATYPE_VERSION}"])`; const jqOp = `${jqOp1} | ${jqOp2}`; await Deno.writeTextFile( "typegate/deno.lock", - await $`jq ${jqOp} typegate/deno.lock`.text() + await $`jq ${jqOp} typegate/deno.lock`.text(), ); }, }); @@ -135,7 +140,7 @@ ghjk.task("gen-pyrt-bind", { async fn({ $ }) { await $.removeIfExists("./libs/pyrt_wit_wire/wit_wire"); await $`componentize-py -d ../../wit/wit-wire.wit bindings .`.cwd( - "./libs/pyrt_wit_wire" + "./libs/pyrt_wit_wire", ); }, }); diff --git a/libs/common/Cargo.toml b/libs/common/Cargo.toml index 2d4a8a27c3..cfd3520d6f 100644 --- a/libs/common/Cargo.toml +++ b/libs/common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "common" -version = "0.4.1" +version = "0.4.2" edition = "2021" [dependencies] diff --git a/libs/metagen/src/utils.rs b/libs/metagen/src/utils.rs index f2664d7f1a..9aaa36a3e0 100644 --- a/libs/metagen/src/utils.rs +++ b/libs/metagen/src/utils.rs @@ -1,18 +1,12 @@ // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. // SPDX-License-Identifier: MPL-2.0 -use crate::interlude::*; - -trait GenDest {} - /// A generation destination analogous to a single file. pub struct GenDestBuf { pub buf: String, } -impl GenDest for GenDestBuf {} -/// A generation destination analogous to a directory. +/* /// A generation destination analogous to a directory. pub struct GenDestFs { pub files: HashMap, -} -impl GenDest for GenDestFs {} +} */ diff --git a/libs/metagen/tests/mat_rust/Cargo.toml b/libs/metagen/tests/mat_rust/Cargo.toml index 32a7bba520..bb093fa7c3 100644 --- a/libs/metagen/tests/mat_rust/Cargo.toml +++ b/libs/metagen/tests/mat_rust/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "mat_rust" edition = "2021" -version = "0.4.1" +version = "0.4.2" [workspace] members = ["gen"] diff --git a/libs/pyrt_wit_wire/pyproject.toml b/libs/pyrt_wit_wire/pyproject.toml index c0c1893133..c2aee5973c 100644 --- a/libs/pyrt_wit_wire/pyproject.toml +++ b/libs/pyrt_wit_wire/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pyrt_wit_wire" -version = "0.4.1" +version = "0.4.2" description = "Wasm component implementing the PythonRuntime host using wit_wire protocol." license = "Elastic-2.0" readme = "README.md" diff --git a/libs/typescript/Cargo.toml b/libs/typescript/Cargo.toml index fcf03080d8..fb930557e5 100644 --- a/libs/typescript/Cargo.toml +++ b/libs/typescript/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "typescript" -version = "0.4.1" +version = "0.4.2" edition = "2021" [dependencies] diff --git a/libs/xtask/Cargo.toml b/libs/xtask/Cargo.toml index 6a152ccc18..5b5765c85a 100644 --- a/libs/xtask/Cargo.toml +++ b/libs/xtask/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "xtask" -version = "0.4.1" +version = "0.4.2" edition = "2021" [dependencies] diff --git a/meta-cli/Cargo.toml b/meta-cli/Cargo.toml index b846a95ac2..c15e4513bf 100644 --- a/meta-cli/Cargo.toml +++ b/meta-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "meta-cli" -version = "0.4.1" +version = "0.4.2" edition = "2021" description = "Declarative API development platform. Build backend components with WASM, Typescript and Python, no matter where and how your (legacy) systems are." diff --git a/meta-cli/src/cli/typegate.rs b/meta-cli/src/cli/typegate.rs index 09cd087291..31c7cd7fb6 100644 --- a/meta-cli/src/cli/typegate.rs +++ b/meta-cli/src/cli/typegate.rs @@ -41,14 +41,16 @@ pub fn command(_cmd: Typegate, _gen_args: ConfigArgs) -> Result<()> { BASE_URL.to_owned() + crate::build::COMMIT_HASH + "/typegate/import_map.json" }); - runtime.block_on(typegate_engine::launch_typegate_deno( - // typegate_core::resolve_url_or_path( - // "", - // &std::env::current_dir()?.join("./typegate/src/main.ts"), - // )?, - typegate_engine::resolve_url(&main_url)?, - Some(import_map_url), - ))?; + runtime + .block_on(typegate_engine::launch_typegate_deno( + // typegate_core::resolve_url_or_path( + // "", + // &std::env::current_dir()?.join("./typegate/src/main.ts"), + // )?, + typegate_engine::resolve_url(&main_url)?, + Some(import_map_url), + )) + .map_err(anyhow_to_eyre!())?; Ok(()) } } diff --git a/meta-cli/src/codegen/deno.rs b/meta-cli/src/codegen/deno.rs index 73588ac2fe..6f46f9a313 100644 --- a/meta-cli/src/codegen/deno.rs +++ b/meta-cli/src/codegen/deno.rs @@ -458,24 +458,6 @@ impl<'a> Codegen<'a> { } } -/** - * utils - **/ - -trait IntoJson { - fn into_json(self) -> Value; -} - -impl IntoJson for HashMap { - fn into_json(self) -> Value { - let mut map = serde_json::Map::with_capacity(self.len()); - for (k, v) in self { - map.insert(k, v); - } - Value::Object(map) - } -} - #[cfg(test)] mod tests { use std::sync::Arc; diff --git a/meta-cli/src/com/store.rs b/meta-cli/src/com/store.rs index a6ba744446..67e74a7610 100644 --- a/meta-cli/src/com/store.rs +++ b/meta-cli/src/com/store.rs @@ -143,7 +143,7 @@ impl ServerStore { with_store_mut(|s| { let mut items = vec![]; if let Some(actions) = s.migration_action.get(&tg_path) { - items = actions.as_ref().clone(); + items.clone_from(actions.as_ref()); } // remove previous rt action if any items.retain(|v| v.runtime_name.ne(&rt_migration.runtime_name)); diff --git a/meta-cli/src/typegraph/mod.rs b/meta-cli/src/typegraph/mod.rs index f162490006..b38ac8398d 100644 --- a/meta-cli/src/typegraph/mod.rs +++ b/meta-cli/src/typegraph/mod.rs @@ -3,4 +3,5 @@ pub mod dependency_graph; pub mod loader; +#[allow(unused)] pub mod postprocess; diff --git a/meta-cli/src/utils/mod.rs b/meta-cli/src/utils/mod.rs index 65068f9e94..bc901a6230 100644 --- a/meta-cli/src/utils/mod.rs +++ b/meta-cli/src/utils/mod.rs @@ -7,7 +7,6 @@ use crate::interlude::*; use dialoguer::{Input, Password}; use std::env::{set_var, var}; -use std::hash::Hash; use crate::config::VENV_FOLDERS; use crate::fs::find_in_parents; @@ -79,25 +78,3 @@ impl From for BasicAuthCommon { } } } - -pub trait MapValues: IntoIterator -where - // K: Eq, - O: FromIterator<(K, W)>, -{ - fn map_values(self, f: M) -> O - where - M: Fn(V) -> W; -} - -impl MapValues> for HashMap -where - K: Eq + Hash, -{ - fn map_values(self, f: M) -> HashMap - where - M: Fn(V) -> W, - { - self.into_iter().map(|(k, v)| (k, f(v))).collect() - } -} diff --git a/meta-lsp/package.json b/meta-lsp/package.json index a3cab57c4c..3a62513281 100644 --- a/meta-lsp/package.json +++ b/meta-lsp/package.json @@ -4,7 +4,7 @@ "description": "VSCode extension for Metatype support", "icon": "logo.png", "author": "Metatype Team", - "version": "0.4.1", + "version": "0.4.2", "repository": { "type": "git", "url": "https://github.com/metatypedev/metatype" diff --git a/meta-lsp/ts-language-server/package.json b/meta-lsp/ts-language-server/package.json index 5d9b559e8a..ede93cae53 100644 --- a/meta-lsp/ts-language-server/package.json +++ b/meta-lsp/ts-language-server/package.json @@ -2,7 +2,7 @@ "name": "typegraph-ts-server", "description": "TypeScript language server for TypeGraph", "author": "Metatype Team", - "version": "0.4.1", + "version": "0.4.2", "repository": { "type": "git", "url": "https://github.com/metatypedev/metatype" diff --git a/meta-lsp/vscode-metatype-support/package.json b/meta-lsp/vscode-metatype-support/package.json index 3a0470ccb6..e28f33ebe7 100644 --- a/meta-lsp/vscode-metatype-support/package.json +++ b/meta-lsp/vscode-metatype-support/package.json @@ -2,7 +2,7 @@ "name": "vscode-metatype-support", "description": "VSCode extension for Metatype support", "author": "Metatype Team", - "version": "0.4.1", + "version": "0.4.2", "repository": { "type": "git", "url": "https://github.com/metatypedev/metatype" diff --git a/poetry.lock b/poetry.lock index 1fdb267690..3b77e3125a 100644 --- a/poetry.lock +++ b/poetry.lock @@ -302,7 +302,7 @@ files = [ [[package]] name = "typegraph" -version = "0.4.1-0" +version = "0.4.2" description = "Declarative API development platform. Build backend components with WASM, Typescript and Python, no matter where and how your (legacy) systems are." optional = false python-versions = ">=3.8,<4.0" diff --git a/pyproject.toml b/pyproject.toml index 6b678c6dfd..20ffa66b43 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "metatype" -version = "0.4.1" +version = "0.4.2" description = "" authors = [] diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 568d44cb5f..ddad81baa4 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.75.0" +channel = "1.77.1" components = ["rustfmt", "clippy"] targets = [ "wasm32-unknown-unknown", "wasm32-wasi" ] diff --git a/typegate/engine/build.rs b/typegate/engine/build.rs index 171873e275..3b03e15b76 100644 --- a/typegate/engine/build.rs +++ b/typegate/engine/build.rs @@ -38,8 +38,10 @@ fn main() -> Result<(), Box> { .env("PYRT_WASM_OUT", &wasm_path) .env("PYRT_TARGET", &wasm_path) .current_dir(cwd.join("../../")) - .spawn()? - .wait()? + .spawn() + .expect("error spawning ghjk") + .wait() + .expect("error building pyrt") .success(), "error building pyrt" ); @@ -50,7 +52,8 @@ fn main() -> Result<(), Box> { .map_err(|err| format!("error reading system's wasmtime cache config: {err}"))? .target(&target) .map_err(|err| format!("error configuring wasmtime for target {target}: {err}"))?, - )?; + ) + .map_err(|err| format!("error making wasmtiem engine: {err}"))?; // note: compilation here is extra-slow if building under the debug profile // since wasmtime will also be in the debug profile // consider upgrading the cranelift crates to opt3 if this proves @@ -59,18 +62,23 @@ fn main() -> Result<(), Box> { // The cli is distrubuted in release mode and did the deed in 3 secs max. // The engine kept rejecting the checksum from the CLI even on the same // version (19.0.0). - let comp = wasmtime::component::Component::from_file(&engine, wasm_path)?; - let cwasm = comp.serialize().unwrap(); + let comp = wasmtime::component::Component::from_file(&engine, wasm_path) + .map_err(|err| format!("error making component from file: {err}"))?; + let cwasm = comp + .serialize() + .map_err(|err| format!("error serializing component: {err}"))?; zstd::stream::copy_encode( &cwasm[..], - std::fs::File::create(out_dir.join("pyrt.cwasm.zst")).unwrap(), + std::fs::File::create(out_dir.join("pyrt.cwasm.zst")) + .map_err(|err| format!("error creating pyrt.cwasm.zst: {err}"))?, if std::env::var("PROFILE")? == "release" { 19 } else { 1 }, - )?; + ) + .map_err(|err| format!("error compress writing pyrt.cwasm.zst: {err}"))?; // wasmtime::Component Ok(()) } diff --git a/typegate/engine/src/runtimes/prisma/migration.rs b/typegate/engine/src/runtimes/prisma/migration.rs index 7ac634b00a..168d3978f3 100644 --- a/typegate/engine/src/runtimes/prisma/migration.rs +++ b/typegate/engine/src/runtimes/prisma/migration.rs @@ -448,8 +448,8 @@ impl AsRef for MigrationsFolder { } } -impl ToString for MigrationsFolder { - fn to_string(&self) -> String { - self.as_ref().to_str().unwrap().to_owned() +impl core::fmt::Display for MigrationsFolder { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.dir.as_ref().display()) } } diff --git a/typegate/engine/src/runtimes/wit_wire.rs b/typegate/engine/src/runtimes/wit_wire.rs index d3d1776bcd..1456377c3e 100644 --- a/typegate/engine/src/runtimes/wit_wire.rs +++ b/typegate/engine/src/runtimes/wit_wire.rs @@ -141,10 +141,7 @@ struct TypegateHost {} #[wasmtime_wasi::async_trait] impl Host for TypegateHost { - async fn hostcall( - &mut self, - _req: (String, String), - ) -> wasmtime::Result> { + async fn hostcall(&mut self, _req: (String, String)) -> std::result::Result { todo!() } } diff --git a/typegate/import_map.json b/typegate/import_map.json index c576895b49..087fb6bf14 100644 --- a/typegate/import_map.json +++ b/typegate/import_map.json @@ -23,8 +23,8 @@ "outdent": "https://deno.land/x/outdent@v0.8.0/mod.ts", "json-schema-faker": "npm:json-schema-faker@0.5.3", "ajv": "https://esm.sh/ajv@8.12.0?pin=v131", - "@typegraph/sdk": "npm:@typegraph/sdk@0.4.1", - "@typegraph/sdk/": "npm:/@typegraph/sdk@0.4.1/", + "@typegraph/sdk": "npm:@typegraph/sdk@0.4.2", + "@typegraph/sdk/": "npm:/@typegraph/sdk@0.4.2/", "@typegate/": "./src/", "test-utils/": "./tests/utils/", "dax": "https://deno.land/x/dax@0.39.2/mod.ts", diff --git a/typegate/src/runtimes/wit_wire/mod.ts b/typegate/src/runtimes/wit_wire/mod.ts index 95ecf04f0b..83a9047c0a 100644 --- a/typegate/src/runtimes/wit_wire/mod.ts +++ b/typegate/src/runtimes/wit_wire/mod.ts @@ -4,7 +4,7 @@ import type { WitWireMatInfo } from "../../../engine/runtime.js"; import { ResolverArgs } from "../../types.ts"; -const METATYPE_VERSION = "0.4.1"; +const METATYPE_VERSION = "0.4.2"; export class WitWireMessenger { static async init( diff --git a/typegate/tests/runtimes/wasm_reflected/rust/Cargo.lock b/typegate/tests/runtimes/wasm_reflected/rust/Cargo.lock index c6434e50a3..ddcedf7370 100644 --- a/typegate/tests/runtimes/wasm_reflected/rust/Cargo.lock +++ b/typegate/tests/runtimes/wasm_reflected/rust/Cargo.lock @@ -90,7 +90,7 @@ dependencies = [ [[package]] name = "rust" -version = "0.4.1-0" +version = "0.4.2" dependencies = [ "wit-bindgen", ] diff --git a/typegate/tests/runtimes/wasm_reflected/rust/Cargo.toml b/typegate/tests/runtimes/wasm_reflected/rust/Cargo.toml index 6215be55a8..6614fd5948 100644 --- a/typegate/tests/runtimes/wasm_reflected/rust/Cargo.toml +++ b/typegate/tests/runtimes/wasm_reflected/rust/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rust" -version = "0.4.1" +version = "0.4.2" edition = "2021" [lib] diff --git a/typegate/tests/runtimes/wasm_wire/rust/mdk.rs b/typegate/tests/runtimes/wasm_wire/rust/mdk.rs index ad33010df0..3faaa9d16d 100644 --- a/typegate/tests/runtimes/wasm_wire/rust/mdk.rs +++ b/typegate/tests/runtimes/wasm_wire/rust/mdk.rs @@ -109,7 +109,7 @@ impl Router { } pub fn init(&self, args: InitArgs) -> Result { - static MT_VERSION: &str = "0.4.1-0"; + static MT_VERSION: &str = "0.4.2"; if args.metatype_version != MT_VERSION { return Err(InitError::VersionMismatch(MT_VERSION.into())); } diff --git a/typegraph/core/Cargo.toml b/typegraph/core/Cargo.toml index 9d03dc921d..f67b4b92d8 100644 --- a/typegraph/core/Cargo.toml +++ b/typegraph/core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "typegraph_core" -version = "0.4.1" +version = "0.4.2" edition = "2021" [lib] diff --git a/typegraph/core/src/global_store.rs b/typegraph/core/src/global_store.rs index b96b9735cf..ca834b471c 100644 --- a/typegraph/core/src/global_store.rs +++ b/typegraph/core/src/global_store.rs @@ -106,7 +106,7 @@ const PREDEFINED_DENO_FUNCTIONS: &[&str] = &["identity", "true"]; thread_local! { pub static STORE: RefCell = RefCell::new(Store::new()); - pub static SDK_VERSION: String = "0.4.1".to_owned(); + pub static SDK_VERSION: String = "0.4.2".to_owned(); } fn with_store T>(f: F) -> T { diff --git a/typegraph/core/src/params/apply.rs b/typegraph/core/src/params/apply.rs index cf338adcda..38b67caf1b 100644 --- a/typegraph/core/src/params/apply.rs +++ b/typegraph/core/src/params/apply.rs @@ -98,11 +98,11 @@ enum PathSeg { Index(usize), } -impl ToString for PathSeg { - fn to_string(&self) -> String { +impl core::fmt::Display for PathSeg { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { - PathSeg::Field(s) => s.clone(), - PathSeg::Index(i) => format!("[{i}]"), + PathSeg::Field(str) => write!(f, "{str}"), + PathSeg::Index(idx) => write!(f, "[{idx}]"), } } } diff --git a/typegraph/core/src/t.rs b/typegraph/core/src/t.rs index 687b2f028a..bc527d894c 100644 --- a/typegraph/core/src/t.rs +++ b/typegraph/core/src/t.rs @@ -32,6 +32,7 @@ impl TypeBuilder for TypeId { } } +#[allow(unused)] pub trait ConcreteTypeBuilder: TypeBuilder { fn base_mut(&mut self) -> &mut TypeBase; fn xbase_mut(&mut self) -> &mut ExtendedTypeBase; diff --git a/typegraph/core/src/typegraph.rs b/typegraph/core/src/typegraph.rs index 5fe0d748d3..84ce77d061 100644 --- a/typegraph/core/src/typegraph.rs +++ b/typegraph/core/src/typegraph.rs @@ -59,7 +59,7 @@ pub struct TypegraphContext { } thread_local! { - static TG: RefCell> = RefCell::new(None); + static TG: RefCell> = const { RefCell::new(None) }; } static TYPEGRAPH_VERSION: &str = "0.0.3"; @@ -222,7 +222,7 @@ pub fn finalize( }; let config = res_config.map(|config| { - tg.meta.prefix = config.prefix.clone(); + tg.meta.prefix.clone_from(&config.prefix); config }); TypegraphPostProcessor::new(config).postprocess(&mut tg)?; diff --git a/typegraph/core/src/utils/reduce.rs b/typegraph/core/src/utils/reduce.rs index b88fbb85a8..6bec8a3235 100644 --- a/typegraph/core/src/utils/reduce.rs +++ b/typegraph/core/src/utils/reduce.rs @@ -76,41 +76,40 @@ impl PathTree { self.entries.push(entry); } - fn print_helper(lines: &mut String, node: &PathTree, depth: u32) { + fn print_helper( + lines: &mut impl core::fmt::Write, + node: &PathTree, + depth: u32, + ) -> Result<(), core::fmt::Error> { if depth >= 1 { - let name = node.name.clone(); - let payload = node - .path_infos - .value - .payload - .clone() - .unwrap_or("--".to_string()); + let payload = node.path_infos.value.payload.as_deref().unwrap_or("--"); let spaces = 4; let symbol = if node.entries.len() == 1 || depth != 0 { "└─" } else { "├─" }; - lines.push_str(&format!( + write!( + lines, "{:indent$}{symbol} [{name} ({payload})]", "", + name = node.name, indent = ((depth as usize) - 1) * spaces - )); + )?; } else { - lines.push_str(&node.name); + write!(lines, "{}", node.name)?; } for entry in node.entries.iter() { - PathTree::print_helper(lines, entry, depth + 1); + PathTree::print_helper(lines, entry, depth + 1)?; } + Ok(()) } } -impl ToString for PathTree { - fn to_string(&self) -> String { - let mut lines = String::new(); - PathTree::print_helper(&mut lines, self, 0); - lines +impl core::fmt::Display for PathTree { + fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + PathTree::print_helper(fmt, self, 0) } } diff --git a/typegraph/node/package.json b/typegraph/node/package.json index ced8209b39..8804a38236 100644 --- a/typegraph/node/package.json +++ b/typegraph/node/package.json @@ -1,6 +1,6 @@ { "name": "metatype", - "version": "0.4.1", + "version": "0.4.2", "description": "Declarative API development platform. Build backend components with WASM, Typescript and Python, no matter where and how your (legacy) systems are.", "scripts": { "sdk-build": "cd sdk && pnpm run build", diff --git a/typegraph/node/sdk/package.json b/typegraph/node/sdk/package.json index f57bc52d80..48e9c9426a 100644 --- a/typegraph/node/sdk/package.json +++ b/typegraph/node/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@typegraph/sdk", - "version": "0.4.1", + "version": "0.4.2", "description": "Declarative API development platform. Build backend components with WASM, Typescript and Python, no matter where and how your (legacy) systems are.", "type": "module", "main": "index.js", diff --git a/typegraph/python/poetry.lock b/typegraph/python/poetry.lock index 24fc776425..70d0cd02c5 100644 --- a/typegraph/python/poetry.lock +++ b/typegraph/python/poetry.lock @@ -124,18 +124,18 @@ test = ["pytest (>=6.0.0)", "setuptools (>=65)"] [[package]] name = "zipp" -version = "3.18.1" +version = "3.18.2" description = "Backport of pathlib-compatible object wrapper for zip files" optional = false python-versions = ">=3.8" files = [ - {file = "zipp-3.18.1-py3-none-any.whl", hash = "sha256:206f5a15f2af3dbaee80769fb7dc6f249695e940acca08dfb2a4769fe61e538b"}, - {file = "zipp-3.18.1.tar.gz", hash = "sha256:2884ed22e7d8961de1c9a05142eb69a247f120291bc0206a00a7642f09b5b715"}, + {file = "zipp-3.18.2-py3-none-any.whl", hash = "sha256:dce197b859eb796242b0622af1b8beb0a722d52aa2f57133ead08edd5bf5374e"}, + {file = "zipp-3.18.2.tar.gz", hash = "sha256:6278d9ddbcfb1f1089a88fde84481528b07b0e10474e09dcfe53dad4069fa059"}, ] [package.extras] docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] -testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy", "pytest-ruff (>=0.2.1)"] +testing = ["big-O", "jaraco.functools", "jaraco.itertools", "jaraco.test", "more-itertools", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy", "pytest-ruff (>=0.2.1)"] [metadata] lock-version = "2.0" diff --git a/typegraph/python/pyproject.toml b/typegraph/python/pyproject.toml index e08ce2c536..f1aa3d07c9 100644 --- a/typegraph/python/pyproject.toml +++ b/typegraph/python/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "typegraph" -version = "0.4.1" +version = "0.4.2" description = "Declarative API development platform. Build backend components with WASM, Typescript and Python, no matter where and how your (legacy) systems are." authors = ["Metatype Contributors "] license = "MPL-2.0" @@ -15,7 +15,7 @@ classifiers = [ [tool.poetry.dependencies] python = ">=3.8,<4.0" -wasmtime = "^20.0.0" +wasmtime = "^21.0.0" typing-extensions = "^4.8.0" python-box = "^7.1.1" astunparse = "^1.6.3" diff --git a/typegraph/python/typegraph/__init__.py b/typegraph/python/typegraph/__init__.py index 755db6164c..beeef995a4 100644 --- a/typegraph/python/typegraph/__init__.py +++ b/typegraph/python/typegraph/__init__.py @@ -5,4 +5,4 @@ from typegraph.policy import Policy # noqa from typegraph import effects as fx # noqa -version = "0.4.1" +version = "0.4.2" diff --git a/whiz.yaml b/whiz.yaml index 4422595d63..75dd589453 100644 --- a/whiz.yaml +++ b/whiz.yaml @@ -57,12 +57,12 @@ typegraph: - "typegraph/core/wit/*.wit" - "typegraph/node/sdk/src/**/*.ts" env: - WASM_FILE: target/debug/typegraph_core.wasm + WASM_FILE: target/wasm/release/typegraph_core.wasm command: | set -e set -x - cargo build -p typegraph_core --target wasm32-unknown-unknown --target-dir target/wasm - wasm-tools component new target/wasm/wasm32-unknown-unknown/debug/typegraph_core.wasm -o $WASM_FILE + cargo build -p typegraph_core --target wasm32-unknown-unknown --release --target-dir target/wasm + wasm-tools component new target/wasm/wasm32-unknown-unknown/release/typegraph_core.wasm -o $WASM_FILE rm -rf typegraph/node/sdk/src/gen typegraph/node/sdk/dist jco transpile $WASM_FILE -o typegraph/node/sdk/src/gen --map metatype:typegraph/host=../host/host.js @@ -74,8 +74,8 @@ typegraph: cd ./sdk/dist npm config set "//localhost:4873/:_authToken" fooBar ln -s ../../../../README.md ./ - npm unpublish @typegraph/sdk --force --registry http://localhost:4873 - npm publish --no-git-checks --force --registry http://localhost:4873 + npm unpublish @typegraph/sdk --force --registry http://localhost:4873 || true + npm publish --tag dev --no-git-checks --force --registry http://localhost:4873 cd ../../../.. ghjk x clean-deno-lock @@ -83,8 +83,6 @@ typegraph: rm -rf typegraph/python/typegraph/gen poetry run python -m wasmtime.bindgen $WASM_FILE --out-dir typegraph/python/typegraph/gen poetry run ruff check typegraph/python/typegraph - depends_on: - - libs system_graphs: watch: @@ -92,16 +90,8 @@ system_graphs: - typegraph/**/*.py command: "deno run -A dev/serialize.ts" depends_on: - - libs - typegraph -libs: - workdir: libs - watch: - - common/**/*.rs - - typescript/**/*.rs - command: "cargo build -p common -p typescript" - website: workdir: website command: "pnpm start --no-open"