Compares two versions of a package to show what changed.
Provides file-level diffs between package versions, useful for reviewing what changed before updating.
Summary
Functions
Compares file lists between two extracted package directories.
Creates a file hash map from a directory.
Formats a change list as a human-readable string.
Summarizes changes between two versions.
Types
@type file_change() :: %{path: String.t(), type: :added | :removed | :modified}
@type version_diff() :: %{ name: String.t(), from: String.t(), to: String.t(), files: [file_change()] }
Functions
@spec compare_files(map(), map()) :: [file_change()]
Compares file lists between two extracted package directories.
Takes two maps of %{path => content_hash} and returns the changes.
Creates a file hash map from a directory.
Walks the directory and creates a map of relative paths to content hashes.
@spec format_changes([file_change()]) :: String.t()
Formats a change list as a human-readable string.
@spec summary([file_change()]) :: %{ added: non_neg_integer(), removed: non_neg_integer(), modified: non_neg_integer(), total: non_neg_integer() }
Summarizes changes between two versions.