rlsbl v0.40.1 /Release targets
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.

Release targets
TargetEcosystemDetection file
npmNode.js / npmpackage.json
pypiPython / PyPIpyproject.toml
goGo modulesgo.mod
cargoRust / crates.ioCargo.toml
denoDenodeno.json
hexElixir / Hexmix.exs
mavenJava / Mavenpom.xml
swiftSwift (SPM)Package.swift
swift-appleSwift (Apple)*.xcodeproj
dockerDockerDockerfile
docsDocumentation (selfdoc)selfdoc.json
specSpecificationspec.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

python
def name(self) -> str

Unique identifier for this target (e.g. 'npm', 'pypi', 'codehome').

#detect

python
def detect(self, dir_path: str) -> bool

Check if this target is present/applicable in the given directory.

#read_version

python
def read_version(self, dir_path: str) -> str

Read the current version from the target's manifest file.

#read_name

python
def read_name(self, dir_path: str) -> str | None

Read the project's package name from the manifest, or None.

#read_metadata

python
def read_metadata(self, dir_path: str) -> dict[str, str]

Read optional metadata (license, description) from the manifest.

#write_version

python
def write_version(self, dir_path: str, version: str) -> None

Write a new version to the target's manifest file (atomic).

#version_file

python
def version_file(self) -> str | None

Filename that holds the version (e.g. 'package.json'), or None if inherited.

#tag_format

python
def tag_format(self, version: str) -> str

Format the git tag for a release. Returns f'v{version}' by default.

#monorepo_tag_format

python
def monorepo_tag_format(self, name: str, version: str, path: str | None=None) -> str

Format the git tag for a monorepo release. Default: f'{name}@v{version}'.

#monorepo_tag_glob

python
def monorepo_tag_glob(self, name: str, path: str | None=None) -> str

Return a glob pattern matching all monorepo version tags. Default: f'{name}@v*'.

#template_dir

python
def template_dir(self) -> str | None

Absolute path to target-specific template directory, or None.

#shared_template_dir

python
def shared_template_dir(self) -> str | None

Absolute path to shared template directory, or None.

#template_vars

python
def template_vars(self, dir_path: str) -> dict[str, str]

Extract template placeholder values from the project.

#template_mappings

python
def template_mappings(self) -> list[dict[str, str]]

Target-specific template-to-output-path mappings.

#shared_template_mappings

python
def shared_template_mappings(self) -> list[dict[str, str]]

Shared template-to-output-path mappings.

#check_project_exists

python
def check_project_exists(self, dir_path: str) -> bool

Check if the target's project file exists (alias for detect).

#get_project_init_hint

python
def get_project_init_hint(self) -> str

Human-readable hint for initializing a project for this target.

#build

python
def build(self, dir_path: str, version: str) -> None

Pre-publish build step (e.g. generate docs). No-op by default.

#publish

python
def publish(self, dir_path: str, version: str) -> None

Post-push publish/deploy step. No-op by default.

#build_assets

python
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

python
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

python
def version_file(self)

#tag_format

python
def tag_format(self, version)

#monorepo_tag_format

python
def monorepo_tag_format(self, name, version, path=None)

#monorepo_tag_glob

python
def monorepo_tag_glob(self, name, path=None)

#template_dir

python
def template_dir(self)

#shared_template_dir

python
def shared_template_dir(self)

#read_name

python
def read_name(self, dir_path)

#read_metadata

python
def read_metadata(self, dir_path)

#template_vars

python
def template_vars(self, dir_path)

#template_mappings

python
def template_mappings(self)

#shared_template_mappings

python
def shared_template_mappings(self)

#check_project_exists

python
def check_project_exists(self, dir_path)

#get_project_init_hint

python
def get_project_init_hint(self)

#write_version

python
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

python
def build(self, dir_path, version)

#publish

python
def publish(self, dir_path, version)

#build_assets

python
def build_assets(self, dir_path, version, dist_dir)

#dev_install_command

python
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).