Skip to content

Commit d8bd385

Browse files
authored
Merge pull request #26 from ThorstenHans/template
2 parents 39178ef + d6a443c commit d8bd385

File tree

6 files changed

+68
-0
lines changed

6 files changed

+68
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
target/
2+
.spin/
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[package]
2+
name = "{{project-name | kebab_case}}"
3+
authors = ["{{authors}}"]
4+
description = "{{project-description}}"
5+
version = "0.1.0"
6+
edition = "2021"
7+
8+
[package.metadata.component]
9+
package = "component:{{project-name | kebab_case}}"
10+
11+
[package.metadata.component.dependencies]
12+
13+
[dependencies]
14+
anyhow = "1"
15+
spin-sdk = "3.0.1"
16+
spin-executor = "3.0.1"
17+
wit-bindgen-rt = { version = "0.26.0", features = ["bitflags"] }
18+
19+
[workspace]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
spin_manifest_version = 2
2+
3+
[application]
4+
name = "{{project-name | kebab_case}}"
5+
version = "0.1.0"
6+
authors = ["{{authors}}"]
7+
description = "{{project-description}}"
8+
9+
[[trigger.command]]
10+
component = "{{project-name | kebab_case}}"
11+
12+
[component.{{project-name | kebab_case}}]
13+
source = "target/wasm32-wasi/release/{{project-name | kebab_case}}.wasm"
14+
allowed_outbound_hosts = []
15+
16+
[component.{{project-name | kebab_case}}.build]
17+
command = "cargo component build --target wasm32-wasi --release"
18+
watch = ["src/**/*.rs", "Cargo.toml"]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#[allow(warnings)]
2+
mod bindings;
3+
4+
fn main() {
5+
println!("Hello, Fermyon!");
6+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[[trigger.command]]
2+
component = "{{project-name | kebab_case}}"
3+
4+
[component.{{project-name | kebab_case}}]
5+
source = "{{ output-path }}/target/wasm32-wasi/release/{{project-name | kebab_case}}.wasm"
6+
allowed_outbound_hosts = []
7+
8+
[component.{{project-name | kebab_case}}.build]
9+
command = "cargo component build --target wasm32-wasi --release"
10+
workdir = "{{ output-path }}"
11+
watch = ["src/**/*.rs", "Cargo.toml"]
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
manifest_version = "1"
2+
id = "command-rust"
3+
description = "Command handler using Rust"
4+
tags = ["command", "rust"]
5+
6+
[add_component]
7+
skip_files = ["spin.toml"]
8+
[add_component.snippets]
9+
component = "component.txt"
10+
11+
[parameters]
12+
project-description = { type = "string", prompt = "Description", default = "" }

0 commit comments

Comments
 (0)