---
# System prepended metadata

title: Component Dependencies Syntax Bikeshed

---

# Component Dependencies Syntax Bikeshed

## Satisfying one-or-more distinct imports

```toml
[component."myapp".dependencies."foo:bar"]
registry = "brian.io", 
package = "bar:foo", 
version = ">=0.1.0", 
export = "foo-bar"
```

## General Syntax


```
[component.infra-dashboard.dependencies]
"aws:client" = "1.0.0" # /s3-client ...
"aws:client/s3-client" = { version = "0.1.0" }
```

# Model

```rust
// Enforces string to be either `namespace:package` or `namespace:package/interface`
struct DependencyName(String);

struct Component {
    // ...
    dependencies: HashMap<DepdendencyName, Dependency>,
}

enum Dependency {
    Version(semver::Version),
    Package {
        version: semver::VersionReq,
        registry: Option<String>,
        package: Option<String>,
        export: Option<String>
    },
    Local {
        path: PathBuf,
        export: Option<String>,
    },
    // future:
    Component {
        component: ComponentIdOrInline, // or whatever lann named that
    }
}
```

## Open Qs

1. How to opt-in to capability inheritance, e.g. component or application level flag?