Skip to content

Commit

Permalink
Renaming packages
Browse files Browse the repository at this point in the history
  • Loading branch information
andrzejressel committed Mar 10, 2024
1 parent b8f2c09 commit c5c8091
Show file tree
Hide file tree
Showing 48 changed files with 74 additions and 89 deletions.
65 changes: 29 additions & 36 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 5 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,15 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
pulumi_rust = { path = "pulumi_rust" }
tokio.workspace = true
log.workspace = true
anyhow.workspace = true
tonic = { workspace = true, default-features = true }
prost-types.workspace = true
clap.workspace = true
log4rs.workspace = true

[workspace]
members = [
"pulumi_rust",
"pulumi_wasm_runner",
"pulumi_wasm",
"pulumi_wasm_random",
"pulumi_wasm_main",
"pulumi_rust_wasm",
"wasm_common"
"providers/pulumi_wasm_provider_random",
"pulumi_wasm_rust",
"wasm_common",
"examples/simple"
]

[workspace.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion entrypoint.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

@REM cargo run -- run --wasm target/wasm32-wasi/debug/composed2.wasm

.\run.bat && cargo run -- run --wasm target/wasm32-wasi/debug/composed2.wasm
.\run.bat && cargo run -p pulumi_wasm_runner -- run --wasm target/wasm32-wasi/debug/composed2.wasm
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ set -e

./run.sh

cargo run -- run --wasm target/wasm32-wasi/debug/composed2.wasm
cargo run -p pulumi_wasm_runner -- run --wasm target/wasm32-wasi/debug/composed2.wasm
8 changes: 4 additions & 4 deletions pulumi_wasm_main/Cargo.toml → examples/simple/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "pulumi_wasm_main"
name = "pulumi_wasm_example_simple"
version = "0.1.0"
edition = "2021"

Expand All @@ -24,9 +24,9 @@ rmpv.workspace = true
serde.workspace = true
tonic.workspace = true
serde_json.workspace = true
pulumi_rust_wasm = { path = "../pulumi_rust_wasm" }
pulumi_rust_wasm = { path = "../../pulumi_wasm_rust" }
log.workspace = true
wasm_common = { path = "../wasm_common" }
wasm_common = { path = "../../wasm_common" }

[dev-dependencies]
wasmtime.workspace = true
Expand All @@ -36,5 +36,5 @@ wasmtime-wasi.workspace = true
package = "component:pulumi-wasm-main"

[package.metadata.component.target]
path = "../wits/world.wit"
path = "../../wits/world.wit"
world = "new-main"
File renamed without changes.
2 changes: 1 addition & 1 deletion pulumi_wasm_main/src/lib.rs → examples/simple/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ impl Guest for Component {
let length: Output<i32> = Output::new(&1).map(|i: i32| i * 3);

let _v = create_random_string(RandomStringArgs {
name: "test1234",
name: "test123456",
length,
});

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "pulumi_wasm_random"
name = "pulumi_wasm_provider_random"
version = "0.1.0"
edition = "2021"

Expand All @@ -25,7 +25,7 @@ serde.workspace = true
tonic.workspace = true
serde_json.workspace = true
log.workspace = true
wasm_common = { path = "../wasm_common" }
wasm_common = { path = "../../wasm_common" }

[dev-dependencies]
wasmtime.workspace = true
Expand All @@ -35,5 +35,5 @@ wasmtime-wasi.workspace = true
package = "component:pulumi-provider-random"

[package.metadata.component.target]
path = "../wits/world.wit"
path = "../../wits/world.wit"
world = "pulumi-provider-random"
File renamed without changes.
File renamed without changes.
6 changes: 0 additions & 6 deletions pulumi_rust/src/lib.rs

This file was deleted.

5 changes: 4 additions & 1 deletion pulumi_rust/Cargo.toml → pulumi_wasm_runner/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "pulumi_rust"
name = "pulumi_wasm_runner"
version = "0.1.0"
edition = "2021"

Expand All @@ -22,6 +22,9 @@ serde_json.workspace = true
futures.workspace = true
async-trait.workspace = true
regex.workspace = true
tokio.workspace = true
log4rs.workspace = true
clap.workspace = true

[build-dependencies]
tonic-build.workspace = true
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 8 additions & 1 deletion src/main.rs → pulumi_wasm_runner/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@ use log4rs::Config;
use log4rs::config::{Appender, Root};
use log4rs::encode::json::JsonEncoder;
use log::LevelFilter;
use crate::pulumi::{Pulumi, WasmFile};

use pulumi_rust::pulumi::{Pulumi, WasmFile};
mod pulumi;

mod grpc {
#![allow(clippy::all)]
#![allow(clippy::pedantic)]
tonic::include_proto!("pulumirpc");
}

#[derive(Parser, Debug)]
#[command(version, about, long_about = None)]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
26 changes: 12 additions & 14 deletions run.bat
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
cargo component build -p wasm_common || exit /b 1
cargo component build -p pulumi_wasm || exit /b 1
cargo component build -p pulumi_wasm_random || exit /b 1
cargo component build -p pulumi_rust_wasm || exit /b 1
cargo component build -p pulumi_wasm_main || exit /b 1
cargo component build -p pulumi_wasm_provider_random || exit /b 1
cargo component build -p pulumi_wasm_example_simple || exit /b 1
cargo build || exit /b 1
@REM cargo build -p pulumi_rust_wasm || exit /b
@REM @REM wasm-tools component wit target/wasm32-wasi/debug/pulumi_wasm_main.wasm
@REM @REM wasm-tools component wit target/wasm32-wasi/debug/pulumi_wasm_example_simple.wasm
@REM
echo F|xcopy /b /v /y ".\target\wasm32-wasi\debug\pulumi_wasm.wasm" ".\target\wasm32-wasi\debug\pulumi-wasm.wasm" || exit /b 1
echo F|xcopy /b /v /y ".\target\wasm32-wasi\debug\pulumi_wasm_main.wasm" ".\target\wasm32-wasi\debug\pulumi-wasm-main.wasm" || exit /b 1
echo F|xcopy /b /v /y ".\target\wasm32-wasi\debug\pulumi_wasm_random.wasm" ".\target\wasm32-wasi\debug\pulumi-wasm-random.wasm" || exit /b 1
echo F|xcopy /b /v /y ".\target\wasm32-wasi\debug\pulumi_rust_wasm.wasm" ".\target\wasm32-wasi\debug\pulumi-rust-wasm.wasm" || exit /b 1
echo F|xcopy /b /v /y ".\target\wasm32-wasi\debug\pulumi_wasm_example_simple.wasm" ".\target\wasm32-wasi\debug\pulumi-wasm-example-simple.wasm" || exit /b 1
echo F|xcopy /b /v /y ".\target\wasm32-wasi\debug\pulumi_wasm_provider_random.wasm" ".\target\wasm32-wasi\debug\pulumi-wasm-provider-random.wasm" || exit /b 1
@REM
@REM @REM wasm-tools component wit target/wasm32-wasi/debug/pulumi-wasm-main.wasm
@REM @REM wasm-tools component wit target/wasm32-wasi/debug/pulumi-wasm-random.wasm
@REM @REM wasm-tools component wit target/wasm32-wasi/debug/pulumi-wasm-example-simple.wasm
@REM @REM wasm-tools component wit target/wasm32-wasi/debug/pulumi-wasm-provider-random.wasm
@REM
wasm-tools compose -o target/wasm32-wasi/debug/composed1.wasm target/wasm32-wasi/debug/pulumi-wasm-main.wasm -d target/wasm32-wasi/debug/pulumi-wasm-random.wasm || exit /b 1
wasm-tools compose -o target/wasm32-wasi/debug/composed1.wasm target/wasm32-wasi/debug/pulumi-wasm-example-simple.wasm -d target/wasm32-wasi/debug/pulumi-wasm-provider-random.wasm || exit /b 1
wasm-tools compose -o target/wasm32-wasi/debug/composed2.wasm target/wasm32-wasi/debug/composed1.wasm -d target/wasm32-wasi/debug/pulumi-wasm.wasm || exit /b 1
cargo run -- compile --wasm target/wasm32-wasi/debug/composed2.wasm --output target/wasm32-wasi/debug/composed2.cwasm || exit /b 1
wasmtime compile -D debug-info=y,coredump=y,address-map=y -o target/wasm32-wasi/debug/composed2.cwasm target/wasm32-wasi/debug/composed2.wasm || exit /b 1
@REM cargo run -p pulumi_wasm_runner -- compile --wasm target/wasm32-wasi/debug/composed2.wasm --output target/wasm32-wasi/debug/composed2.cwasm || exit /b 1
@REM wasmtime compile -D debug-info=y,coredump=y,address-map=y -o target/wasm32-wasi/debug/composed2.cwasm target/wasm32-wasi/debug/composed2.wasm || exit /b 1
@REM
@REM cargo build -p pulumi_entrypoint || exit /b
@REM
@REM @REM wasm-tools component wit target/wasm32-wasi/debug/pulumi-wasm-random.wasm
@REM @REM wasm-tools component wit target/wasm32-wasi/debug/pulumi-wasm-main.wasm
@REM @REM wasm-tools component wit target/wasm32-wasi/debug/pulumi-wasm-provider-random.wasm
@REM @REM wasm-tools component wit target/wasm32-wasi/debug/pulumi-wasm-example-simple.wasm
@REM
@REM wasm-tools component wit target/wasm32-wasi/debug/composed1.wasm
@REM wasm-tools component wit target/wasm32-wasi/debug/composed2.wasm
Expand Down
14 changes: 6 additions & 8 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,19 @@ set -e

cargo component build -p wasm_common
cargo component build -p pulumi_wasm
cargo component build -p pulumi_wasm_random
cargo component build -p pulumi_rust_wasm
cargo component build -p pulumi_wasm_main
cargo component build -p pulumi_wasm_provider_random
cargo component build -p pulumi_wasm_example_simple
cargo build


cp "target/wasm32-wasi/debug/pulumi_wasm.wasm" "target/wasm32-wasi/debug/pulumi-wasm.wasm"
cp "target/wasm32-wasi/debug/pulumi_wasm_main.wasm" "target/wasm32-wasi/debug/pulumi-wasm-main.wasm"
cp "target/wasm32-wasi/debug/pulumi_wasm_random.wasm" "target/wasm32-wasi/debug/pulumi-wasm-random.wasm"
cp "target/wasm32-wasi/debug/pulumi_rust_wasm.wasm" "target/wasm32-wasi/debug/pulumi-rust-wasm.wasm"
cp "target/wasm32-wasi/debug/pulumi_wasm_example_simple.wasm" "target/wasm32-wasi/debug/pulumi-wasm-example-simple.wasm"
cp "target/wasm32-wasi/debug/pulumi_wasm_provider_random.wasm" "target/wasm32-wasi/debug/pulumi-wasm-provider-random.wasm"


wasm-tools compose -o target/wasm32-wasi/debug/composed1.wasm target/wasm32-wasi/debug/pulumi-wasm-main.wasm -d target/wasm32-wasi/debug/pulumi-wasm-random.wasm
wasm-tools compose -o target/wasm32-wasi/debug/composed1.wasm target/wasm32-wasi/debug/pulumi-wasm-example-simple.wasm -d target/wasm32-wasi/debug/pulumi-wasm-provider-random.wasm
wasm-tools compose -o target/wasm32-wasi/debug/composed2.wasm target/wasm32-wasi/debug/composed1.wasm -d target/wasm32-wasi/debug/pulumi-wasm.wasm
cargo run -- compile --wasm target/wasm32-wasi/debug/composed2.wasm --output target/wasm32-wasi/debug/composed2.cwasm
#cargo run -p pulumi_wasm_runner -- compile --wasm target/wasm32-wasi/debug/composed2.wasm --output target/wasm32-wasi/debug/composed2.cwasm
#wasmtime compile -D debug-info=y,coredump=y,address-map=y -o target/wasm32-wasi/debug/composed2.cwasm target/wasm32-wasi/debug/composed2.wasm || exit /b 1

wasm-tools component wit target/wasm32-wasi/debug/composed2.wasm
Expand Down
Empty file added src/lib.rs
Empty file.

0 comments on commit c5c8091

Please sign in to comment.