Skip to main content

update_package_files

Function update_package_files 

Source
pub fn update_package_files(
    vars: &VersionVariables,
    work_dir: &Path,
    files: &[String],
) -> Result<Vec<PathBuf>>
Expand description

Update the version field in package manifests for various languages.

Uses a format-preserving parser for each format (not regex):

  • package.json (Node.js): serde_json (preserves key order)
  • Cargo.toml (Rust), pyproject.toml (Python): toml_edit (preserves comments and formatting)

When files is empty, searches the working directory recursively for known manifests.