Skip to content
rlsbl.targets
On this page

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

#rlsbl.targets

#rlsbl.targets

Release target discovery and registry that maps ecosystem identifiers (npm, pypi, go, 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.

#targets_sharing_workspace_environment

python
def targets_sharing_workspace_environment()

Targets whose workspace members resolve into one shared environment.

#targets_consumed_by_repository_url

python
def targets_consumed_by_repository_url()

Targets whose consumers resolve a package by repository URL and tag.

The mirror requirement's scope: a monorepo member declaring one of these is unconsumable until its releasable is bound to a standalone mirror.

#mirror_identity_manifests

python
def mirror_identity_manifests()

Every manifest any target rewrites to a mirror's own identity.

The mirror's scaffold layer writes these files, so they are scaffold-owned on a mirror -- derived here rather than pinned beside the reconciler's other owned paths, so a target that gains an identity manifest cannot become a foreign-commit false positive.

#targets_with_import_analysis

python
def targets_with_import_analysis()

Targets whose sources rlsbl can read to follow imports.

Backs the dead-module and workspace dependency checks, which used to keep the same list of target names in five places between them.

#targets_with_circular_dep_analysis

python
def targets_with_circular_dep_analysis()

Targets for which import-cycle detection is meaningful.

#targets_with_dep_floors

python
def targets_with_dep_floors()

Targets whose manifest states dependency floors a lockfile can outrun.

#targets_with_builtin_tests

python
def targets_with_builtin_tests()

Targets that ship a built-in test runner.

Derived from the targets that override run_tests. The test-suite and test-suite-workspace checks each used to carry their own copy of this set, which could disagree with the dispatch and with each other.

#targets_with_library_lint

python
def targets_with_library_lint()

Targets that participate in library boundary lint.

Derived by asking every registered target which lint language its sources are written in. Adding a target with a lint_language puts it in scope automatically; there is no set to remember to edit.

#targets_with_version_queries

python
def targets_with_version_queries()

Targets whose registry can be asked for a package's latest version.

Derived from the targets that override query_latest_version. Replaces the hand-mapped dispatch table rlsbl.registry used to carry.

#claimable_targets

python
def claimable_targets()

Targets on which rlsbl claim-name can reserve a name.

Derived from the targets that override claim_placeholder. The command used to hard-code the pair and then branch on the name twice more.

#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 has workspace_root and project attributes (i.e. is a WorkspaceCheckContext), returns the releasable config dir path. Otherwise returns None.

Uses duck typing to avoid importing check_context (which would create a circular dependency).

#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.

#read_releasable_targets

python
def read_releasable_targets(rel_config_path)

Read the targets list from a releasable config, enforcing the ban.

Returns:

  • - the declared targets as a list of names, when the config has a

non-empty targets list. An entry may be a bare name or the record form a target in a subdirectory needs ({"name": "npm", "path": "npm"}); both reduce to the name here, because both callers want names -- validate_release_targets puts them in a set and collect_releasable_targets puts them in the release file's include list, and a record reaching either is a crash rather than a diagnosis;

  • - None, when the targets key is absent (callers fall through to

member-level detection -- backward compat for releasables that haven't declared targets yet).

  • Raises ConfigError when targets is an explicitly empty list, or a present-but-non-list value (string, dict, ...) -- the same loud story as validate_config_schema. A non-list value is never silently treated as absent. This keeps the two releasable target-resolution paths (collect_releasable_targets used by release init, and validate_release_targets used by release run) behaving identically on the banned config, instead of one short-circuiting while the other silently falls through.

#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 non-empty targets key, returns those directly (the releasable is the source of truth for targets in explicit mode). An explicitly empty targets list is banned and raises ConfigError (see read_releasable_targets). When the key is absent, 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.

More tools from this site

  • claudestream Drive Claude Code from Python: run it as a subprocess and read its output as typed events, with async and sync sessions, sandbox policies, and tools you define in Python
  • claudewheel A TUI Claude Code Launcher that lets you have more than one profile, manage sessions lifecycle, pick the exact CC version, model to use (even older unlisted ones), pick which GitHub account to use, etc.
  • dirstat Fast, single-binary directory statistics CLI: every file under a tree grouped by format, with counts, sizes, and lines of code, as a colored terminal table or as JSON
  • fastware A batteries-included ASGI framework: msgspec JSON, a managed Granian server, dependency injection, SSE, WebSockets, auth, and a test client
  • go-toml-edit Zero-dep TOML editing library for Go with comment preservation
  • howmuchleft The fastest Claude Code statusline: context window, 5-hour, and weekly limit usage as three customizable gradient bars, rendering in about 6 ms
  • orxtra
  • pgdesign
  • predraw Declarative rendering pipeline: describe a scene in JSON and get SVG, PNG and WebP out, with light and dark style tokens, reusable components and text converted to path outlines
  • reposummary Turn a git repository's history into a Markdown journal: pick a time window or revision range and get a readable digest of what changed, optionally narrated by an LLM
  • safegit git wrapper CLI that gives each commit its own temporary index and retries ref updates on conflict, so concurrent agents share one repository
  • saferm Command-line replacement for rm that archives every deletion with a mandatory reason and the context it ran in, so deleted files can be listed, inspected and restored
  • selfdoc Static Site Generator that builds a project's documentation site directly from its source code, so the docs can never drift from the code they describe, with SEO/AEO, first-class blog, search, and cross-project linking built in
  • strictcli
  • stricttest An always-on test-isolation floor: a pytest plugin and a Go env-hygiene module that make a test suite structurally unable to reach real credentials, the real HOME, the network, or the development repository.
  • wesktop A Python framework that turns an ASGI web app into a desktop application, serving it from a local Granian server and displaying it in a native OS window via pywebview
Search