-
Notifications
You must be signed in to change notification settings - Fork 251
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stop kebab-casing and validate component names (#1294)
* stop kebab-casing and validate component names * tests * validate for wasm-compose * don't validate , change name to composition-root * new tests in * lose import map cow and shorten compostition root name
- Loading branch information
Showing
30 changed files
with
186 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
crates/wasm-compose/tests/compositions/conflict-on-import/error.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
cannot import instance with name `a` for an instantiation argument of component `b` because it conflicts with an imported instantiation argument of component `$input` | ||
cannot import instance with name `a` for an instantiation argument of component `b` because it conflicts with an imported instantiation argument of component `root` |
2 changes: 1 addition & 1 deletion
2
crates/wasm-compose/tests/compositions/connect-resources/config.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
instantiations: | ||
$input: | ||
root: | ||
arguments: | ||
example:service/logging@0.1.0: | ||
instance: logger | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
failed to connect instance `$input` to definition component `tests/compositions/def-mismatch/definitions.wat` | ||
failed to connect instance `root` to definition component `tests/compositions/def-mismatch/definitions.wat` | ||
|
||
Caused by: | ||
source instance export `foo` is not compatible with target instance import `foo` |
2 changes: 1 addition & 1 deletion
2
crates/wasm-compose/tests/compositions/export-on-import/config.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
instantiations: | ||
$input: | ||
root: | ||
arguments: | ||
a: | ||
instance: a | ||
|
2 changes: 1 addition & 1 deletion
2
crates/wasm-compose/tests/compositions/incompatible-explicit-export/config.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
instantiations: | ||
$input: | ||
root: | ||
arguments: | ||
a: | ||
instance: a | ||
|
2 changes: 1 addition & 1 deletion
2
crates/wasm-compose/tests/compositions/instantiation-cycle/config.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
instantiations: | ||
$input: | ||
root: | ||
arguments: | ||
b: a1 | ||
a1: | ||
|
2 changes: 1 addition & 1 deletion
2
crates/wasm-compose/tests/compositions/invalid-instantiation-arg/config.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
instantiations: | ||
$input: | ||
root: | ||
arguments: | ||
invalid: a |
5 changes: 5 additions & 0 deletions
5
crates/wasm-compose/tests/compositions/locked-dep-invalid-semver/a.wat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
(component | ||
(import "b" (instance (export "a" (func)))) | ||
(alias export 0 "a" (func)) | ||
(export "a" (func 0)) | ||
) |
6 changes: 6 additions & 0 deletions
6
crates/wasm-compose/tests/compositions/locked-dep-invalid-semver/config.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
instantiations: | ||
root: | ||
arguments: | ||
locked-dep=<foo:add@1.0.>: a1 | ||
a1: | ||
dependency: a |
5 changes: 5 additions & 0 deletions
5
crates/wasm-compose/tests/compositions/locked-dep-invalid-semver/error.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
failed to parse component `tests/compositions/locked-dep-invalid-semver/root.wat` | ||
|
||
Caused by: | ||
import name `locked-dep=<foo:add@1.0.>` is not a valid extern name | ||
`1.0.` is not a valid semver: unexpected end of input while parsing patch version number (at offset 0x1b) |
3 changes: 3 additions & 0 deletions
3
crates/wasm-compose/tests/compositions/locked-dep-invalid-semver/root.wat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
(component | ||
(import "locked-dep=<foo:add@1.0.>" (instance (export "a" (func)))) | ||
) |
5 changes: 5 additions & 0 deletions
5
crates/wasm-compose/tests/compositions/locked-dep-simple/a.wat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
(component | ||
(import "b" (instance (export "a" (func)))) | ||
(alias export 0 "a" (func)) | ||
(export "a" (func 0)) | ||
) |
37 changes: 37 additions & 0 deletions
37
crates/wasm-compose/tests/compositions/locked-dep-simple/composed.wat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
(component | ||
(type (;0;) | ||
(instance | ||
(type (;0;) (func)) | ||
(export (;0;) "a" (func (type 0))) | ||
) | ||
) | ||
(import "b" (instance (;0;) (type 0))) | ||
(component (;0;) | ||
(type (;0;) | ||
(instance | ||
(type (;0;) (func)) | ||
(export (;0;) "a" (func (type 0))) | ||
) | ||
) | ||
(import "locked-dep=<foo:add@1.0.0>" (instance (;0;) (type 0))) | ||
) | ||
(component (;1;) | ||
(type (;0;) | ||
(instance | ||
(type (;0;) (func)) | ||
(export (;0;) "a" (func (type 0))) | ||
) | ||
) | ||
(import "b" (instance (;0;) (type 0))) | ||
(alias export 0 "a" (func (;0;))) | ||
(export (;1;) "a" (func 0)) | ||
) | ||
(instance (;1;) (instantiate 1 | ||
(with "b" (instance 0)) | ||
) | ||
) | ||
(instance (;2;) (instantiate 0 | ||
(with "locked-dep=<foo:add@1.0.0>" (instance 1)) | ||
) | ||
) | ||
) |
6 changes: 6 additions & 0 deletions
6
crates/wasm-compose/tests/compositions/locked-dep-simple/config.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
instantiations: | ||
root: | ||
arguments: | ||
locked-dep=<foo:add@1.0.0>: a1 | ||
a1: | ||
dependency: a |
3 changes: 3 additions & 0 deletions
3
crates/wasm-compose/tests/compositions/locked-dep-simple/root.wat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
(component | ||
(import "locked-dep=<foo:add@1.0.0>" (instance (export "a" (func)))) | ||
) |
2 changes: 1 addition & 1 deletion
2
crates/wasm-compose/tests/compositions/missing-explicit-export/config.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
instantiations: | ||
$input: | ||
root: | ||
arguments: | ||
a: | ||
instance: a | ||
|
5 changes: 5 additions & 0 deletions
5
crates/wasm-compose/tests/compositions/unlocked-dep-invalid-semver/a.wat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
(component | ||
(import "b" (instance (export "a" (func)))) | ||
(alias export 0 "a" (func)) | ||
(export "a" (func 0)) | ||
) |
6 changes: 6 additions & 0 deletions
6
crates/wasm-compose/tests/compositions/unlocked-dep-invalid-semver/config.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
instantiations: | ||
root: | ||
arguments: | ||
unlocked-dep=<foo:add@{>=1.0.}>: a1 | ||
a1: | ||
dependency: a |
5 changes: 5 additions & 0 deletions
5
crates/wasm-compose/tests/compositions/unlocked-dep-invalid-semver/error.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
failed to parse component `tests/compositions/unlocked-dep-invalid-semver/root.wat` | ||
|
||
Caused by: | ||
import name `unlocked-dep=<foo:add@{>=1.0.}>` is not a valid extern name | ||
`1.0.` is not a valid semver: unexpected end of input while parsing patch version number (at offset 0x1b) |
3 changes: 3 additions & 0 deletions
3
crates/wasm-compose/tests/compositions/unlocked-dep-invalid-semver/root.wat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
(component | ||
(import "unlocked-dep=<foo:add@{>=1.0.}>" (instance (export "a" (func)))) | ||
) |
5 changes: 5 additions & 0 deletions
5
crates/wasm-compose/tests/compositions/unlocked-dep-simple/a.wat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
(component | ||
(import "b" (instance (export "a" (func)))) | ||
(alias export 0 "a" (func)) | ||
(export "a" (func 0)) | ||
) |
37 changes: 37 additions & 0 deletions
37
crates/wasm-compose/tests/compositions/unlocked-dep-simple/composed.wat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
(component | ||
(type (;0;) | ||
(instance | ||
(type (;0;) (func)) | ||
(export (;0;) "a" (func (type 0))) | ||
) | ||
) | ||
(import "b" (instance (;0;) (type 0))) | ||
(component (;0;) | ||
(type (;0;) | ||
(instance | ||
(type (;0;) (func)) | ||
(export (;0;) "a" (func (type 0))) | ||
) | ||
) | ||
(import "unlocked-dep=<foo:add@{>=1.0.0}>" (instance (;0;) (type 0))) | ||
) | ||
(component (;1;) | ||
(type (;0;) | ||
(instance | ||
(type (;0;) (func)) | ||
(export (;0;) "a" (func (type 0))) | ||
) | ||
) | ||
(import "b" (instance (;0;) (type 0))) | ||
(alias export 0 "a" (func (;0;))) | ||
(export (;1;) "a" (func 0)) | ||
) | ||
(instance (;1;) (instantiate 1 | ||
(with "b" (instance 0)) | ||
) | ||
) | ||
(instance (;2;) (instantiate 0 | ||
(with "unlocked-dep=<foo:add@{>=1.0.0}>" (instance 1)) | ||
) | ||
) | ||
) |
Oops, something went wrong.