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
def targets_sharing_workspace_environment()Targets whose workspace members resolve into one shared environment.
#targets_consumed_by_repository_url
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
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
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
def targets_with_circular_dep_analysis()Targets for which import-cycle detection is meaningful.
#targets_with_dep_floors
def targets_with_dep_floors()Targets whose manifest states dependency floors a lockfile can outrun.
#targets_with_builtin_tests
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
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
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
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
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
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 optionalreleasablekey.workspace_root: path to the monorepo root (str or Path).
Returns:
- Path string to the releasable config directory, or None.
#_parse_target_entry
def _parse_target_entry(entry, base_dir)Parse a target config entry (string or dict) into a TargetEntry.
#_auto_detect
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
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.jsonexists** (discovery case): fall through
to auto-detection from project file manifests.
- **
.rlsbl/config.jsonexists but merged config has notargets
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
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 thetargetskey is absent (callers fall through to
member-level detection -- backward compat for releasables that haven't declared targets yet).
- Raises
ConfigErrorwhentargetsis an explicitly empty list, or a present-but-non-list value (string, dict, ...) -- the same loud story asvalidate_config_schema. A non-list value is never silently treated as absent. This keeps the two releasable target-resolution paths (collect_releasable_targetsused by release init, andvalidate_release_targetsused by release run) behaving identically on the banned config, instead of one short-circuiting while the other silently falls through.
#collect_releasable_targets
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.