rlsbl v0.60.1 /rlsbl.workspace
On this page

Workspace data layer for monorepo support handling discovery, loading, saving, and resolution of workspaces from workspace.toml config.

#rlsbl.workspace

#rlsbl.workspace

Workspace data layer for monorepo support handling discovery, loading, saving, and resolution of workspaces from workspace.toml config.

#WorkspaceProject

Typed wrapper over a workspace.toml project dict.

Provides typed property access for known fields while preserving the underlying dict for round-trip serialization. Unknown fields are kept intact. Dict-like [], get(), and in access is supported for backward compatibility with code that treats projects as dicts.

#name

python
def name(self) -> str

#path

python
def path(self) -> str

#watch

python
def watch(self) -> list[str]

#library

python
def library(self) -> bool

#dev_node

python
def dev_node(self) -> bool

#depends_on

python
def depends_on(self) -> list[str]

#get

python
def get(self, key, default=None)

Dict-like access for backward compatibility.

#to_dict

python
def to_dict(self) -> dict

Return the underlying dict for serialization.

#find_workspace_root

python
def find_workspace_root(start_path='.')

Walk up from start_path looking for a .rlsbl-monorepo/workspace.toml.

Returns the directory containing .rlsbl-monorepo/, or None if not found.

#load_workspace

python
def load_workspace(root)

Read and validate workspace.toml, returning a list of WorkspaceProject.

Each project has at least 'path' (str) and 'name' (str, defaults to basename of path). The returned WorkspaceProject instances support dict-like access for backward compatibility.

Raises FileNotFoundError if workspace.toml doesn't exist. Raises ValueError on invalid structure.

#save_workspace

python
def save_workspace(root, projects)

Write workspace.toml atomically using tomlkit for clean TOML output.

Preserves top-level sections, comments, and formatting from the existing file by reading it with tomlkit first and modifying the [[projects]] array in-place. Falls back to creating a new document when the file does not yet exist.

Creates .rlsbl-monorepo/ directory if it doesn't exist.

#resolve_project

python
def resolve_project(root, cwd='.')

Determine which project cwd is inside, returning a WorkspaceProject or None.

If multiple projects match (nested paths), returns the most specific one.