Skip to main content

Module dependent_version_release

Module dependent_version_release 

Source
Expand description

Patch bumps of plain release versions and JSON.stringify quoting. What: Patch-bump a plain major.minor.patch release version, and quote text the way JSON.stringify does. Why: A dependent receives a patch bump. Only a plain release can be bumped automatically; anything else (a prerelease, build metadata, a leading zero, a missing component) is reported for a bump by hand, with the incumbent’s message (dependent-version-bump.ts:87-177). The patch component is incremented as a decimal digit string, so it is exact at any size.

In TS you’d write (pseudocode):

// patchBumpVersion({ name, version }); JSON.stringify(text);

Structs§

ReleaseBump
What: One automatic patch bump: the version before and after. Why: Both appear in the finding message and the text edit.
UnsupportedVersion
What: A dependent whose version cannot be bumped automatically. Vec<u16> keeps the version as the code units JavaScript holds. Why: The policy turns this into a dependent-version-unsupported finding without a patch, and the plan stops, exactly as the incumbent’s throw stops it.

Functions§

json_quote_units
What: Quote code units as JSON.stringify quotes a string. char::decode_utf16 pairs surrogates and yields an error for each unpaired one. Why: Messages and the version edit compare against the incumbent’s quoting: ", \ and the short control escapes are escaped, other units below U+0020 and unpaired surrogates become lower-case \u escapes, and everything else stays literal.
patch_bump_version
What: Bump the patch component of a plain release version. Why: Only plain releases are bumped automatically.
unsupported_message
What: The incumbent’s message for an unsupported version, verbatim. Why: The finding text tells the person to bump that package by hand.