Compose Project
@shelson/compose-projectv2026.07.23.6
01README
Tracks a Docker Compose project's structure (services, volumes, networks) and flexible key/value configuration as swamp-managed data. Data-only — pair it with @keeb/docker/compose for actual lifecycle execution. Every parameter, service field, and volume/network option is validated against the official compose-spec JSON Schema before it's written, so typos and malformed values are rejected at write time rather than surfacing later as a broken docker compose run. Ships with a bundled schema snapshot so it works fully offline out of the box; run the updateSchema method on an instance to refresh it from the canonical compose-spec repository when you need a newer field.
02Models
@shelson/compose/projectv2026.07.23.6compose_project.ts
Global Arguments
| Argument | Type | Description |
|---|---|---|
| projectName | string | Compose project name (COMPOSE_PROJECT_NAME) |
fn updateSchema()
Fetch the latest compose-spec JSON Schema from the canonical compose-go repository and cache it on this instance for validating future create/update/import calls
fn importFromFile(path: string)
Populate this project from an existing compose.yaml/docker-compose.yml file — services, volumes, and networks (each with their per-entity config), and any other top-level keys as project parameters. Validated against the active compose-spec schema before anything is written. Entries already present are updated in place (matched by name/key); entries not mentioned in the file are left untouched.
| Argument | Type | Description |
|---|---|---|
| path | string | Path to the compose.yaml/docker-compose.yml file to import, relative to the repository root or absolute |
fn renderComposeFile()
Force a fresh render of this project's current services, volumes, networks, and parameters into a valid compose.yaml document, storing it as the composeFile data attribute. Every mutating method already does this automatically after writing its own change — call this directly only to refresh composeFile with no other side effect (e.g. after updateSchema)
fn createService(name: string)
Create and link a new compose service to this project
| Argument | Type | Description |
|---|---|---|
| name | string | Service name |
fn deleteService(name: string)
Unlink a service from this project
| Argument | Type | Description |
|---|---|---|
| name | string | Service name |
fn setServiceParameter(serviceName: string, key: string)
Create or update a configuration parameter on a service (upsert), validated against the active compose-spec schema
| Argument | Type | Description |
|---|---|---|
| serviceName | string | Service name |
| key | string | Parameter key |
fn deleteServiceParameter(serviceName: string, key: string)
Delete a service configuration parameter
| Argument | Type | Description |
|---|---|---|
| serviceName | string | Service name |
| key | string | Parameter key |
fn createVolume(name: string)
Create and link a new volume definition to this project
| Argument | Type | Description |
|---|---|---|
| name | string | Volume name |
fn deleteVolume(name: string)
Delete a volume definition
| Argument | Type | Description |
|---|---|---|
| name | string | Volume name |
fn setVolumeParameter(volumeName: string, key: string)
Create or update a configuration parameter on a volume (upsert), validated against the active compose-spec schema
| Argument | Type | Description |
|---|---|---|
| volumeName | string | Volume name |
| key | string | Parameter key |
fn deleteVolumeParameter(volumeName: string, key: string)
Delete a volume configuration parameter
| Argument | Type | Description |
|---|---|---|
| volumeName | string | Volume name |
| key | string | Parameter key |
fn createNetwork(name: string)
Create and link a new network definition to this project
| Argument | Type | Description |
|---|---|---|
| name | string | Network name |
fn deleteNetwork(name: string)
Delete a network definition
| Argument | Type | Description |
|---|---|---|
| name | string | Network name |
fn setNetworkParameter(networkName: string, key: string)
Create or update a configuration parameter on a network (upsert), validated against the active compose-spec schema
| Argument | Type | Description |
|---|---|---|
| networkName | string | Network name |
| key | string | Parameter key |
fn deleteNetworkParameter(networkName: string, key: string)
Delete a network configuration parameter
| Argument | Type | Description |
|---|---|---|
| networkName | string | Network name |
| key | string | Parameter key |
fn setProjectParameter(key: string)
Create or update a project-level configuration parameter (upsert), validated against the active compose-spec schema
| Argument | Type | Description |
|---|---|---|
| key | string | Parameter key |
fn deleteProjectParameter(key: string)
Delete a project-level configuration parameter
| Argument | Type | Description |
|---|---|---|
| key | string | Parameter key |
Resources
services(infinite)— List of services linked to this project
service(infinite)— Single compose service linked to this project
serviceParameters(infinite)— List of configuration parameters for a single service
serviceParameter(infinite)— Single service configuration parameter
volumes(infinite)— List of volume definitions for this project
volume(infinite)— Single volume definition
volumeParameters(infinite)— List of configuration parameters for a single volume
volumeParameter(infinite)— Single volume configuration parameter
networks(infinite)— List of network definitions for this project
network(infinite)— Single network definition
networkParameters(infinite)— List of configuration parameters for a single network
networkParameter(infinite)— Single network configuration parameter
parameters(infinite)— List of project-level configuration parameters
parameter(infinite)— Single project-level configuration parameter
composeSchema(infinite)— Active compose-spec JSON Schema used to validate parameters, refreshed via updateSchema
composeFile(infinite)— Rendered compose.yaml document generated from this project's current services, volumes, networks, and parameters
03Stats
A
100 / 100
Downloads
2
Archive size
128.1 KB
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License declared1/1earned
- Verified public repository2/2earned
04Platforms
05Labels