Skip to content

Nested components - #32

Draft
scothis wants to merge 5 commits into
componentized:mainfrom
scothis:nested-components
Draft

scothis wants to merge 5 commits into
componentized:mainfrom
scothis:nested-components

Conversation

@scothis

@scothis scothis commented Nov 22, 2026

Copy link
Copy Markdown
Member

Each component is a directory in a directory of components, with the files of one named for its directory: wit/<dir>.constants.wit, <dir>.properties, <dir>.wac, <dir>.plug, <dir>.wkg, or a Cargo.toml. components/ is a directory of components, and so is each directory with a components.toml, which names the prefix of its components, e.g. examples/components.toml:

prefix = "example-"

A component is named for the prefix and its directory, and built into target/components/<name>/, e.g. examples/hello/hello.wac is example-hello, which composes components of components/ as local:<name>. A component's directories that are components are a group, named for it, e.g. an internal component, its configuration, and their composition:

components/gate/
  gate.wac       gate, composing local:gate-internal and local:gate-config
  internal/      gate-internal, not published, see UNPUBLISHED_COMPONENTS
  config/        gate-config

A component built with cargo builds the package its Cargo.toml names, which may differ from the component's name. Two components with the same name are an error, e.g. components/hello and examples/hello without a prefix.

Each component is a directory in a directory of components, with the
files of one named for its directory: `wit/<dir>.constants.wit`,
`<dir>.properties`, `<dir>.wac`, `<dir>.plug`, `<dir>.wkg`, or a
`Cargo.toml`. `components/` is a directory of components, and so is each
directory with a `components.toml`, which names the prefix of its
components, e.g. `examples/components.toml`:

```toml
prefix = "example-"
```

A component is named for the prefix and its directory, and built into
`target/components/<name>/`, e.g. `examples/hello/hello.wac` is
`example-hello`, which composes components of `components/` as
`local:<name>`. A component's directories that are components are a
group, named for it, e.g. an internal component, its configuration, and
their composition:

```
components/gate/
  gate.wac       gate, composing local:gate-internal and local:gate-config
  internal/      gate-internal, not published, see UNPUBLISHED_COMPONENTS
  config/        gate-config
```

A component built with cargo builds the package its `Cargo.toml` names,
which may differ from the component's name. Two components with the same
name are an error, e.g. `components/hello` and `examples/hello` without
a prefix.

Signed-off-by: Scott Andrews <scott@andrews.me>
Signed-off-by: Scott Andrews <scott@andrews.me>
Signed-off-by: Scott Andrews <scott@andrews.me>
Signed-off-by: Scott Andrews <scott@andrews.me>
Signed-off-by: Scott Andrews <scott@andrews.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant