rlsbl v0.92.0 /rlsbl.targets
On this page

Release target registry and detection: maps ecosystem ids (npm, pypi, go, cargo, deno, zig, swift, hex, docker, maven, plain) to classes.

#rlsbl.targets

#rlsbl.targets

Release target discovery and registry that maps ecosystem identifiers (npm, pypi, go, cargo, deno, zig, swift, hex, docker, maven, plain) to their corresponding target classes for version bumps and scaffolding.

#TargetEntry

A detected target with its directory path.

#resolve_releasable_config_dir_for_ctx

python
def resolve_releasable_config_dir_for_ctx(ctx)

Resolve the releasable config directory from a check context.

When ctx is a WorkspaceCheckContext and the current project belongs to a releasable, returns the releasable config dir path. Otherwise returns None.

Uses the project attribute on the context to determine releasable membership.

#resolve_releasable_config_dir

python
def resolve_releasable_config_dir(proj, workspace_root)

Resolve the releasable config directory for a workspace project.

Checks the project's releasable field (works with both WorkspaceProject objects and plain dicts). Returns the path to the releasable's state directory if the project belongs to a named releasable, or None otherwise.

Args:

  • proj: a WorkspaceProject or dict with optional releasable key.
  • workspace_root: path to the monorepo root (str or Path).

Returns:

  • Path string to the releasable config directory, or None.

#_parse_target_entry

python
def _parse_target_entry(entry, base_dir)

Parse a target config entry (string or dict) into a TargetEntry.

#_auto_detect

python
def _auto_detect(dir_path)

Auto-detect targets from project file presence.

Returns list of TargetEntry(name, path) tuples for targets whose manifest files exist in dir_path.

#detect_targets

python
def detect_targets(dir_path='.', releasable_config_dir=None)

Detect which targets are applicable in the given directory.

Uses read_project_config() with optional releasable-level inheritance to get the merged config view. If the merged config has a "targets" list, uses that (opt-in config). Each entry can be a plain string (defaults to dir_path) or a dict with "name" and optional "path" (subdirectory relative to dir_path).

Two-tier rule when targets key is absent from the merged config:

  • **No .rlsbl/config.json exists** (discovery case): fall through

to auto-detection from project file manifests.

  • **.rlsbl/config.json exists but merged config has no targets

key**: auto-detect to populate hints, then raise ConfigError listing detected targets as suggestions.

Args:

  • dir_path: project directory to scan.
  • releasable_config_dir: optional path to a releasable's state

directory for config inheritance (4-level precedence).

Returns list of TargetEntry(name, path) tuples.

#collect_releasable_targets

python
def collect_releasable_targets(releasable_name, member_projects, workspace_root)

Collect targets for a releasable, preferring the releasable config.

If the releasable's config.json has a targets key, returns those directly (the releasable is the source of truth for targets in explicit mode). Falls back to unioning member-level detected targets for backward compatibility with releasables that haven't set targets yet.

Returns a deduplicated list of target names.