Skip to content

Commit

Permalink
Use 'package name' more consistently in docs (#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewagner authored Nov 10, 2023
1 parent 9a1ee9f commit d1f4756
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
10 changes: 5 additions & 5 deletions design/mvp/Explainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -1364,11 +1364,11 @@ interfacename ::= <namespace> <label> <projection> <version>?
namespace ::= <label> ':'
projection ::= '/' <label>
version ::= '@' <valid semver>
depname ::= 'unlocked-dep=<' <pkgidset> '>'
| 'locked-dep=<' <pkgid> '>' ( ',' <hashname> )?
pkgidset ::= <pkgname> <verrange>?
pkgid ::= <pkgname> <version>?
pkgname ::= <namespace> <label>
depname ::= 'unlocked-dep=<' <pkgnamequery> '>'
| 'locked-dep=<' <pkgname> '>' ( ',' <hashname> )?
pkgnamequery ::= <pkgpath> <verrange>?
pkgname ::= <pkgpath> <version>?
pkgpath ::= <namespace> <label>
| <namespace>+ <label> <projection>* 🪺
verrange ::= '@*'
| '@{' <verlower> '}'
Expand Down
29 changes: 16 additions & 13 deletions design/mvp/WIT.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,22 @@ package suitable for distribution.
[IDL]: https://en.wikipedia.org/wiki/Interface_description_language
[components]: https://github.com/webassembly/component-model

## Package identifiers
## Package Names

All WIT packages are assigned an "ID". IDs look like `foo:bar@1.0.0` and have
three components:
All WIT packages are assigned a *package name*. Package names look like
`foo:bar@1.0.0` and have three fields:

* A namespace, for example `foo` in `foo:bar`. This namespace is intended to
disambiguate between registries, top-level organizations, etc. For example
WASI interfaces use the `wasi` namespace.
* A *namespace field*, for example `foo` in `foo:bar`. This namespace is
intended to disambiguate between registries, top-level organizations, etc.
For example WASI interfaces use the `wasi` namespace.

* A package name, for example `clocks` in `wasi:clocks`. A package name groups
* A *package field*, for example `clocks` in `wasi:clocks`. A "package" groups
together a set of interfaces and worlds that would otherwise be named with a
common prefix.

* An optional version, specified as [full semver](https://semver.org/).
* An optional *version field*, specified as [full semver](https://semver.org/).

Package identifiers are specified at the top of a WIT file via a `package`
Package names are specified at the top of a WIT file via a `package`
declaration:

```wit
Expand All @@ -56,11 +56,14 @@ package wasi:clocks@1.2.0;
```

WIT packages can be defined in a collection of files and at least one of them
must specify a `package` identifier. Multiple files can specify a `package` and
they must all agree on what the identifier is.
must specify a package name. Multiple files can specify a `package` and
they must all agree on what the package name is.

Package identifiers are used to generate IDs in the component model binary
format for [`interface`s][interfaces] and [`world`s][worlds].
Package names are used to generate the [names of imports and exports]
in the Component Model's representation of [`interface`s][interfaces] and
[`world`s][worlds] as described [below](#package-format).

[names of imports and exports]: Explainer.md#import-and-export-definitions

## WIT Interfaces
[interfaces]: #wit-interfaces
Expand Down

0 comments on commit d1f4756

Please sign in to comment.