On this page
Release target protocol defining the formal interface for detection, versioning, scaffolding, build/publish steps, asset builds, and dev-install support.
#rlsbl.targets.protocol
#rlsbl.targets.protocol
Release target protocol defining the formal interface that all target implementations must satisfy for detection, versioning, and scaffolding.
#ReleaseTarget
Protocol defining a release target.
Targets handle version management, scaffolding templates, and optionally build/publish steps for a specific ecosystem (npm, pypi, go, codehome, docs, etc.)
#name
def name(self) -> strUnique identifier for this target (e.g. 'npm', 'pypi', 'codehome').
#detect
def detect(self, dir_path: str) -> boolCheck if this target is present/applicable in the given directory.
#read_version
def read_version(self, dir_path: str) -> strRead the current version from the target's manifest file.
#read_name
def read_name(self, dir_path: str) -> str | NoneRead the project's package name from the manifest, or None.
#read_metadata
def read_metadata(self, dir_path: str) -> dict[str, str]Read optional metadata (license, description) from the manifest.
#write_version
def write_version(self, dir_path: str, version: str) -> NoneWrite a new version to the target's manifest file (atomic).
#version_file
def version_file(self) -> str | NoneFilename that holds the version (e.g. 'package.json'), or None if inherited.
#tag_format
def tag_format(self, version: str) -> strFormat the git tag for a release. Returns f'v{version}' by default.
#monorepo_tag_format
def monorepo_tag_format(self, name: str, version: str, path: str | None=None) -> strFormat the git tag for a monorepo release. Default: f'{name}@v{version}'.
#monorepo_tag_glob
def monorepo_tag_glob(self, name: str, path: str | None=None) -> strReturn a glob pattern matching all monorepo version tags. Default: f'{name}@v*'.
#template_dir
def template_dir(self) -> str | NoneAbsolute path to target-specific template directory, or None.
#shared_template_dir
def shared_template_dir(self) -> str | NoneAbsolute path to shared template directory, or None.
#template_vars
def template_vars(self, dir_path: str) -> dict[str, str]Extract template placeholder values from the project.
#template_mappings
def template_mappings(self) -> list[dict[str, str]]Target-specific template-to-output-path mappings.
#shared_template_mappings
def shared_template_mappings(self) -> list[dict[str, str]]Shared template-to-output-path mappings.
#check_project_exists
def check_project_exists(self, dir_path: str) -> boolCheck if the target's project file exists (alias for detect).
#get_project_init_hint
def get_project_init_hint(self) -> strHuman-readable hint for initializing a project for this target.
#build
def build(self, dir_path: str, version: str) -> NonePre-publish build step (e.g. generate docs). No-op by default.
#publish
def publish(self, dir_path: str, version: str) -> NonePost-push publish/deploy step. No-op by default.
#build_assets
def build_assets(self, dir_path: str, version: str, dist_dir: str) -> list[str]Build distributable artifacts for GH Release upload.
Returns list of artifact file paths in dist_dir.
#dev_install_command
def dev_install_command(self, project_dir: str) -> dict[str, dict | None]Return the local-install specs for this target, keyed by mode.
Used by rlsbl dev install to install/uninstall the project for local development. Returns a dict with two keys:
"global": spec for the global-install mode, where the project is installed as a globally-available tool or symlink (e.g. uv tool install -e ., npm link, go install). None if the target has no global-install concept.
"venv": spec for the local/venv-install mode, where dependencies are fetched into the project's own environment without exposing a global CLI (e.g. uv sync, npm install). None for targets that have no separate local-environment concept (e.g. Go, Cargo, Zig, Swift).
Each spec dict has the shape: { "tool": "uv", "args": ["tool", "install", "-e", "."], "uninstall_args_template": ["tool", "uninstall", "{name}"], "purpose": "for editable Python install", }
Fields: tool: CLI tool that must be on PATH. args: argv passed to the tool to install. uninstall_args_template: argv list of templates passed to the tool to uninstall. Each entry may contain {name} (replaced with the project's package name) or {dir} (replaced with the project directory basename). None means uninstall is not supported for this mode of this target. purpose: human-readable string for the require_tool error message.