@@ -29,7 +29,7 @@ package suitable for distribution.
29
29
30
30
## Package identifiers
31
31
32
- All WIT packages are assigned an "ID". IDs look like
` foo:[email protected] ` and have
32
+ All WIT packages are assigned an "ID". IDs look like
` foo:[email protected] .0 ` and have
33
33
three components:
34
34
35
35
* A namespace, for example ` foo ` in ` foo:bar ` . This namespace is intended to
@@ -40,10 +40,7 @@ three components:
40
40
together a set of interfaces and worlds that would otherwise be named with a
41
41
common prefix.
42
42
43
- * An optional version, specified as a major and minor number. Because WIT
44
- packages define * interfaces* , not * implementations* , there is not a patch
45
- number, as in full semver. Both version numbers must be unsigned integers.
46
- Note that the version field is optional, though.
43
+ * An optional version, specified as [ full semver] ( https://semver.org/ ) .
47
44
48
45
Package identifiers are specified at the top of a WIT file via a ` package `
49
46
declaration:
@@ -55,7 +52,7 @@ package wasi:clocks
55
52
or
56
53
57
54
``` wit
58
-
55
+
59
56
```
60
57
61
58
WIT packages can be defined in a collection of files and at least one of them
@@ -369,12 +366,12 @@ so far it can get a bit repetitive to be referred to:
369
366
package local:demo
370
367
371
368
interface my-interface {
372
- use wasi:http/[email protected] .{request, response}
369
+ use wasi:http/[email protected] .0. {request, response}
373
370
}
374
371
375
372
world my-world {
376
- import wasi:http/[email protected]
377
- export wasi:http/[email protected]
373
+ import wasi:http/[email protected] .0
374
+ export wasi:http/[email protected] .0
378
375
}
379
376
```
380
377
@@ -386,8 +383,8 @@ rewritten as:
386
383
``` wit
387
384
package local:demo
388
385
389
-
390
-
386
+
387
+
391
388
392
389
interface my-interface {
393
390
use types.{request, response}
@@ -428,8 +425,8 @@ multiple versions and renaming as different identifiers.
428
425
``` wit
429
426
package local:demo
430
427
431
- use wasi:http/[email protected] as http-types1
432
- use wasi:http/[email protected] as http-types2
428
+ use wasi:http/[email protected] .0 as http-types1
429
+ use wasi:http/[email protected] .0 as http-types2
433
430
434
431
// ...
435
432
```
@@ -731,7 +728,10 @@ WIT files optionally start with a package declaration which defines the ID of
731
728
the package.
732
729
733
730
``` ebnf
734
- package-decl ::= 'package' id ':' id ('@' integer '.' integer)?
731
+ package-decl ::= 'package' id ':' id ('@' version)?
732
+ version ::= integer '.' integer '.' integer version-pre-release? version-build?
733
+ version-pre-release ::= '-' (id '.')* id
734
+ version-build ::= '+' (id '.')* id
735
735
```
736
736
737
737
Note that the version, specified with ` @ ` , is optional. Otherwise the first ` id `
0 commit comments