Skip to content

Commit

Permalink
Merge pull request #17 from redbadger/reorg
Browse files Browse the repository at this point in the history
reorg components and wits
  • Loading branch information
StuartHarris authored Feb 6, 2025
2 parents 24db13e + cdd2914 commit deba004
Show file tree
Hide file tree
Showing 56 changed files with 109 additions and 100 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/wasm-components.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ jobs:
sudo apt install fish
- name: Install Rust
uses: dtolnay/rust-toolchain@nightly
uses: dtolnay/rust-toolchain@1.84.1
with:
targets: wasm32-wasip2
targets: wasm32-wasip1,wasm32-wasip2
components: rustfmt

- name: Install wash
Expand All @@ -52,7 +52,7 @@ jobs:
- name: Check
shell: bash
working-directory: wasm-components/rust
working-directory: wasm-components
run: |
cargo fmt --all --check
Expand All @@ -70,7 +70,7 @@ jobs:

# - name: Run tests
# shell: bash
# working-directory: wasm-components/rust
# working-directory: wasm-components
# run: |
# rm .cargo/config.toml # so we don't attempt to execute wasm directly
# cargo nextest run --all-features
2 changes: 1 addition & 1 deletion platform-wasmcloud/build_and_sign.fish
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set SCRIPT_DIR (dirname (realpath (status -f)))
set OUTPUT_DIR $SCRIPT_DIR/signed/
set COMPONENT_DIR (realpath $SCRIPT_DIR/../wasm-components/rust)
set COMPONENT_DIR (realpath $SCRIPT_DIR/../wasm-components)
set INPUT_DIR $COMPONENT_DIR/target/wasm32-wasip2/release/

mkdir -p $OUTPUT_DIR
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
wit_bindgen::generate!({
world: "platform-poc:di/di",
world: "platform-poc:data-init/data-init-service",
generate_all,
});

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,3 @@ type = "component"
[component]
wit_world = "data-init"
wasm_target = "wasm32-wasi"

[[registry.pull.sources]]
target = "platform-poc:data-init"
source = "file://../../wit/data-init"
File renamed without changes.
9 changes: 9 additions & 0 deletions wasm-components/data-init/wit/world.wit
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package platform-poc:data-init@0.1.0;

world data-init-service {
import wasmcloud:postgres/query@0.1.1-draft;
import wasi:keyvalue/store@0.2.0-draft;
import wasi:logging/logging@0.1.0-draft;

export init-funcs;
}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
wit_bindgen::generate!({
world: "platform-poc:http-controller/http-controller",
world: "platform-poc:http-controller/service",
generate_all,
});

Expand Down
48 changes: 48 additions & 0 deletions wasm-components/http-controller/wasmcloud.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# This file is automatically generated.
# It is not intended for manual editing.
version = 1

[[packages]]
name = "wasi:http"
registry = "wasi.dev"

[[packages.versions]]
requirement = "=0.2.2"
version = "0.2.2"
digest = "sha256:a1f129cdf1fde55ec2d4ae8d998c39a7e5cf7544a8bd84a831054ac0d2ac64dd"

[[packages]]
name = "wasi:keyvalue"
registry = "wasi.dev"

[[packages.versions]]
requirement = "=0.2.0-draft"
version = "0.2.0-draft"
digest = "sha256:f5afa14646d3f32cee23106add8d7da53774083fef32f5648176aee7be61d36b"

[[packages]]
name = "wasi:logging"
registry = "wasi.dev"

[[packages.versions]]
requirement = "=0.1.0-draft"
version = "0.1.0-draft"
digest = "sha256:09621a45b12b0a9cddc798517f778aac0e5ae4bd234077b3d70758d6cf625580"

[[packages]]
name = "wasmcloud:messaging"
registry = "wasmcloud.com"

[[packages.versions]]
requirement = "=0.2.0"
version = "0.2.0"
digest = "sha256:bd2182f0a304b9a54a6b363f2f655422c8c0f00a03073c0195f1614a92dfdc7b"

[[packages]]
name = "wasmcloud:postgres"
registry = "wasmcloud.com"

[[packages.versions]]
requirement = "=0.1.1-draft"
version = "0.1.1-draft"
digest = "sha256:8bb72ea90cecb5c87e463da8c1a7642b61a44e6c7993fcab6112c03f44a9140a"
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ wasm_target = "wasm32-wasi"

[[registry.pull.sources]]
target = "platform-poc:data-init"
source = "file://../../wit/data-init"
source = "file://../data-init/wit"

[[registry.pull.sources]]
target = "platform-poc:inventory"
source = "file://../../wit/inventory"
source = "file://../inventory-service/wit"

[[registry.pull.sources]]
target = "platform-poc:orders"
source = "file://../../wit/orders"
source = "file://../orders-service/wit"

[[registry.pull.sources]]
target = "platform-poc:products"
source = "file://../../wit/products"
source = "file://../products-service/wit"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package platform-poc:http-controller;

world http-controller {
world service {
import wasi:logging/logging@0.1.0-draft;

import platform-poc:products/products@0.1.0;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
wit_bindgen::generate!({
world: "platform-poc:inventory-service/inventory-service",
world: "platform-poc:inventory/service",
generate_all,
});

Expand Down
8 changes: 8 additions & 0 deletions wasm-components/inventory-service/wasmcloud.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name = "inventory-service"
version = "0.1.0"
language = "rust"
type = "component"

[component]
wit_world = "inventory-service"
wasm_target = "wasm32-wasi"
File renamed without changes.
8 changes: 8 additions & 0 deletions wasm-components/inventory-service/wit/world.wit
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package platform-poc:inventory@0.1.0;

world service {
import wasmcloud:postgres/query@0.1.1-draft;
import wasi:logging/logging@0.1.0-draft;

export inventory;
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
wit_bindgen::generate!({
world: "platform-poc:notification-service/notification-service",
world: "platform-poc:notification/service",
generate_all,
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package platform-poc:notification-service;
package platform-poc:notification@0.1.0;

world notification-service {
world service {
import wasi:logging/logging@0.1.0-draft;

export wasmcloud:messaging/handler@0.2.0;
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
wit_bindgen::generate!({
world: "platform-poc:orders-service/orders-service",
world: "platform-poc:orders/service",
generate_all,
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name = "inventory-service"
name = "orders-service"
version = "0.1.0"
language = "rust"
type = "component"

[component]
wit_world = "inventory-service"
wit_world = "orders-service"
wasm_target = "wasm32-wasi"

[[registry.pull.sources]]
target = "platform-poc:inventory"
source = "file://../../wit/inventory"
source = "file://../inventory-service/wit"
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package platform-poc:orders-service;
package platform-poc:orders@0.1.0;

world orders-service {
world service {
import wasi:logging/logging@0.1.0-draft;
import wasmcloud:postgres/query@0.1.1-draft;
import wasmcloud:messaging/consumer@0.2.0;

import platform-poc:inventory/inventory@0.1.0;

export platform-poc:orders/orders@0.1.0;
export orders;
}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
wit_bindgen::generate!({
world: "platform-poc:products-service/products-service",
world: "platform-poc:products/service",
generate_all,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,3 @@ type = "component"
[component]
wit_world = "products-service"
wasm_target = "wasm32-wasi"

[[registry.pull.sources]]
target = "platform-poc:products"
source = "file://../../wit/products"
File renamed without changes.
8 changes: 8 additions & 0 deletions wasm-components/products-service/wit/world.wit
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package platform-poc:products@0.1.0;

world service {
import wasi:keyvalue/store@0.2.0-draft;
import wasi:logging/logging@0.1.0-draft;

export products;
}
3 changes: 3 additions & 0 deletions wasm-components/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[toolchain]
components = ["rust-src"]
targets = ["wasm32-wasip2"]
2 changes: 0 additions & 2 deletions wasm-components/rust/.cargo/config.toml

This file was deleted.

9 changes: 0 additions & 9 deletions wasm-components/rust/data-init/wit/world.wit

This file was deleted.

21 changes: 0 additions & 21 deletions wasm-components/rust/http-controller/wasmcloud.lock

This file was deleted.

8 changes: 0 additions & 8 deletions wasm-components/rust/inventory-service/wit/world.wit

This file was deleted.

16 changes: 0 additions & 16 deletions wasm-components/rust/orders-service/wasmcloud.toml

This file was deleted.

8 changes: 0 additions & 8 deletions wasm-components/rust/products-service/wit/world.wit

This file was deleted.

4 changes: 0 additions & 4 deletions wasm-components/rust/rust-toolchain.toml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@

cargo clean
fd --type dir deps -x rm -rf
rm -rf */build
File renamed without changes.
File renamed without changes.

0 comments on commit deba004

Please sign in to comment.