Expand description
§changepacks-utils
Shared utilities for the changepacks system.
Provides git repository operations via gix, version calculation, dependency sorting with Kahn’s algorithm, config management, and format detection for JSON indentation. These utilities are used across all language-specific crates and CLI commands.
Functions§
- apply_
reverse_ dependencies - Apply reverse dependency updates: if package A depends on package B (via workspace:*), and B is being updated, then A should also be updated as PATCH.
- clear_
update_ logs - Remove all update logs without confirmation
- detect_
indent - Detects JSON indentation (2-space, 4-space, or tab) from file content.
- display_
update - Display the version update as a formatted string
- find_
current_ git_ repo - Find git repository from current directory using gix
- find_
project_ dirs - Find project directories containing specific files from git tracked files
- gen_
changepack_ result_ map - Generate a changepack result map from projects and update results
- gen_
update_ map - Generate update map from changepack logs
- get_
changepacks_ config - Get the changepacks configuration from .changepacks/config.json Returns default config if the file doesn’t exist or is empty
- get_
changepacks_ dir - Get the .changepacks directory path from the git repository root
- get_
relative_ path - Get the relative path from a git root to an absolute path
- next_
version - Calculate the next version based on semver and update type
- sort_
by_ dependencies - Sort projects by their dependencies using topological sort. Projects with no dependencies or whose dependencies are already published will come first. Returns a sorted vector of project references (no cloning, just reordering).
- split_
version - Split a version string into prefix and version parts