Skip to content

Commit 38b5268

Browse files
committed
chore(templates): migrate to Spin manifest v2
Signed-off-by: Vaughn Dice <vaughn.dice@fermyon.com>
1 parent 7a2eb66 commit 38b5268

File tree

7 files changed

+31
-44
lines changed

7 files changed

+31
-44
lines changed

templates/README.md

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
11
## Starter templates for JS and TS
22

3-
### Requirements
4-
5-
It is assumed that the spinjs binary is available in path (Possibly later moved into spin plugins and therefore not required to be in the path).
6-
7-
## Building the templates
8-
9-
```
10-
npm install
11-
spin build
12-
```
13-
14-
## Running the templates
15-
16-
```
17-
spin up --follow-all
18-
```
3+
See [Installing the templates](../README.md#installing-the-templates) for details on how to install and run these templates.
Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
spin_manifest_version = "1"
1+
spin_manifest_version = 2
2+
3+
[application]
24
authors = ["{{authors}}"]
35
description = "{{project-description}}"
46
name = "{{project-name}}"
5-
trigger = { type = "http", base = "{{http-base}}" }
67
version = "0.1.0"
78

8-
[[component]]
9-
id = "{{project-name | kebab_case}}"
9+
[[trigger.http]]
10+
route = "{{http-path}}"
11+
component = "{{project-name | kebab_case}}"
12+
13+
[component.{{project-name | kebab_case}}]
1014
source = "target/{{project-name | kebab_case}}.wasm"
1115
exclude_files = ["**/node_modules"]
12-
[component.trigger]
13-
route = "{{http-path}}"
14-
[component.build]
16+
[component.{{project-name | kebab_case}}.build]
1517
command = "npm run build"
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
[[component]]
2-
id = "{{project-name | kebab_case}}"
3-
source = "{{ output-path }}/target/{{project-name | kebab_case}}.wasm"
4-
[component.trigger]
1+
[[trigger.http]]
52
route = "{{http-path}}"
6-
[component.build]
3+
component = "{{project-name | kebab_case}}"
4+
5+
[component.{{project-name | kebab_case}}]
6+
source = "{{ output-path }}/target/{{project-name | kebab_case}}.wasm"
7+
[component.{{project-name | kebab_case}}.build]
78
command = "npm run build"
89
workdir = "{{ output-path }}"
910

templates/http-js/metadata/spin-template.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@ description = "HTTP request handler using Javascript"
44

55
[add_component]
66
skip_files = ["spin.toml"]
7-
skip_parameters = ["http-base"]
87
[add_component.snippets]
98
component = "component.txt"
109

1110
[parameters]
1211
project-description = { type = "string", prompt = "Description", default = "" }
13-
http-base = { type = "string", prompt = "HTTP base", default = "/", pattern = "^/\\S*$" }
1412
http-path = { type = "string", prompt = "HTTP path", default = "/...", pattern = "^/\\S*$" }
Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
spin_manifest_version = "1"
1+
spin_manifest_version = 2
2+
3+
[application]
24
authors = ["{{authors}}"]
35
description = "{{project-description}}"
46
name = "{{project-name}}"
5-
trigger = { type = "http", base = "{{http-base}}" }
67
version = "0.1.0"
78

8-
[[component]]
9-
id = "{{project-name | kebab_case}}"
9+
[[trigger.http]]
10+
route = "{{http-path}}"
11+
component = "{{project-name | kebab_case}}"
12+
13+
[component.{{project-name | kebab_case}}]
1014
source = "target/{{project-name | kebab_case}}.wasm"
1115
exclude_files = ["**/node_modules"]
12-
[component.trigger]
13-
route = "{{http-path}}"
14-
[component.build]
16+
[component.{{project-name | kebab_case}}.build]
1517
command = "npm run build"
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
[[component]]
2-
id = "{{project-name | kebab_case}}"
3-
source = "{{ output-path }}/target/{{project-name | kebab_case}}.wasm"
4-
[component.trigger]
1+
[[trigger.http]]
52
route = "{{http-path}}"
6-
[component.build]
3+
component = "{{project-name | kebab_case}}"
4+
5+
[component.{{project-name | kebab_case}}]
6+
source = "{{ output-path }}/target/{{project-name | kebab_case}}.wasm"
7+
[component.{{project-name | kebab_case}}.build]
78
command = "npm run build"
89
workdir = "{{ output-path }}"
910

templates/http-ts/metadata/spin-template.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@ description = "HTTP request handler using Typescript"
44

55
[add_component]
66
skip_files = ["spin.toml"]
7-
skip_parameters = ["http-base"]
87
[add_component.snippets]
98
component = "component.txt"
109

1110
[parameters]
1211
project-description = { type = "string", prompt = "Description", default = "" }
13-
http-base = { type = "string", prompt = "HTTP base", default = "/", pattern = "^/\\S*$" }
1412
http-path = { type = "string", prompt = "HTTP path", default = "/...", pattern = "^/\\S*$" }

0 commit comments

Comments
 (0)