Version Bump From Changelog
Purpose
Use the JSON changelogs in apps/web/changelogs/ to decide when and how to bump the app version, then:
- •update
package.jsonversion - •update all unreleased changelog entries with the new version
Changelog Entry Fields
Changelog entries may include:
- •
impact:patch|minor|major - •
version: optional string (missing/empty means unreleased)
Rules
- •Unreleased entries are those where
versionis missing,null, or an empty string. - •Determine the highest impact among unreleased entries:
- •
major>minor>patch
- •
- •If there are no unreleased entries, do not change anything; report that there is nothing to release.
- •Determine the next version from current
package.jsonversion using SemVer:- •
patch:X.Y.Z->X.Y.(Z+1) - •
minor:X.Y.Z->X.(Y+1).0 - •
major:X.Y.Z->(X+1).0.0
- •
Steps
- •Read
package.jsonand record the current version. - •Read all
apps/web/changelogs/*.jsonfiles. - •Collect unreleased entries and compute the highest required
impact. - •Calculate the new version.
- •Update
package.jsonwith the new version. - •Update all unreleased changelog entries by setting
versionto the new version. - •Do not modify released changelog entries.
Output
Return:
- •The previous version and new version
- •Count of entries stamped
- •Which impact level was used (patch/minor/major)
- •Which changelog files were modified
Safety
- •Never invent changelog entries.
- •Never change
time,commit,type,area, ordescriptionfields. - •Do not bump the version if there are no unreleased entries.
- •Do not change a version if it has a non empty value.