On this page
All 17 rlsbl release targets — npm, PyPI, Go, Cargo, Deno, Hex, Maven, Swift, Zig, Docker, Dart, Flutter, docs, and more — with the ReleaseTarget protocol.
#Release targets
rlsbl supports 12 release targets, each handling version management and scaffolding for a specific ecosystem.
| Target | Ecosystem | Detection file |
|---|---|---|
| npm | Node.js / npm | package.json |
| pypi | Python / PyPI | pyproject.toml |
| go | Go modules | go.mod |
| cargo | Rust / crates.io | Cargo.toml |
| deno | Deno | deno.json |
| hex | Elixir / Hex | mix.exs |
| maven | Java / Maven | pom.xml |
| swift | Swift (SPM) | Package.swift |
| swift-apple | Swift (Apple) | *.xcodeproj |
| docker | Docker | Dockerfile |
| docs | Documentation (selfdoc) | selfdoc.json |
| spec | Specification | spec.json |
#ReleaseTarget protocol
All targets implement the ReleaseTarget protocol, a runtime-checkable Python Protocol that defines the required interface for detection, version reading and writing, tag formatting, and scaffolding template resolution. Targets may also provide optional build and publish steps for ecosystems that support automated publishing, such as npm and PyPI.
#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.
#Target implementations
Every concrete target extends BaseTarget, which provides sensible defaults for optional protocol methods including tag formatting (v{version}), monorepo tag formatting ({name}@v{version}), shared template mappings for changelogs, licenses, hooks, and lint configs, and no-op stubs for build and publish. Individual targets override only the methods specific to their ecosystem.
#rlsbl.targets.base
Base class for release targets providing shared defaults for version reading, writing, detection, scaffolding, and publish configuration.
#BaseTarget
Concrete base providing defaults for optional Protocol methods.
#version_file
def version_file(self)#tag_format
def tag_format(self, version)#monorepo_tag_format
def monorepo_tag_format(self, name, version, path=None)#monorepo_tag_glob
def monorepo_tag_glob(self, name, path=None)#template_dir
def template_dir(self)#shared_template_dir
def shared_template_dir(self)#read_name
def read_name(self, dir_path)#read_metadata
def read_metadata(self, dir_path)#template_vars
def template_vars(self, dir_path)#template_mappings
def template_mappings(self)#shared_template_mappings
def shared_template_mappings(self)#check_project_exists
def check_project_exists(self, dir_path)#get_project_init_hint
def get_project_init_hint(self)#write_version
def write_version(self, dir_path, version)Write a new version to the target's version file(s).
Returns a list of relative file paths (relative to dir_path) that were modified. Subclasses must override this method and return the actual paths written.
#build
def build(self, dir_path, version)#publish
def publish(self, dir_path, version)#build_assets
def build_assets(self, dir_path, version, dist_dir)#dev_install_command
def dev_install_command(self, project_dir)Specs for local install via rlsbl dev install, keyed by mode.
Subclasses override to return spec dicts for the "global" and/or "venv" modes. See the protocol docstring for the spec format. Default returns {"global": None, "venv": None} (unsupported).