Skip to content

Semantic Versioning

Superloom follows SemVer 2.0.0 with project-specific rules.

SemVer Specification

Version format: MAJOR.MINOR.PATCH (X.Y.Z)

ComponentIncrement WhenExample
MAJOR (X)Breaking API changesRemoving a function, changing parameter types
MINOR (Y)New backward-compatible featuresAdding a helper function, new config option
PATCH (Z)Backward-compatible bug fixesFixing logic, documentation updates

Superloom-Specific Rules

1. Public API Declaration

Every module MUST declare its public API in ROBOTS.md:

markdown
## Public API

### Functions
- `isEmpty(value)` - Check if value is empty
- `toSlug(str)` - Convert string to URL slug

### Configuration
- `CONFIG.timezone` - Default timezone string

Rule: Breaking changes to any documented function = Major version bump.

2. Initial Development Phase

Versions 0.y.z indicate initial development:

json
{
  "version": "0.5.2"
}
  • Anything MAY change at any time
  • Public API is NOT stable
  • Use in production at your own risk

First stable release: 1.0.0 establishes the public API contract.

3. Version Determination Matrix

Change TypeVersion ImpactExample Commit
New function addedMinor bumpfeat(utils): add isValidEmail()
Function parameter changedMajor bumpBREAKING: change validate() signature
Bug fix in existing functionPatch bumpfix(utils): handle null in isEmpty()
Documentation updatePatch bumpdocs(utils): improve JSDoc examples
Internal refactoringPatch bumprefactor(utils): simplify type checks
Performance improvementPatch bumpperf(utils): optimize deepClone()
New test coveragePatch bumptest(utils): add edge case tests

4. Pre-Release Versions

For beta/alpha releases:

json
{
  "version": "1.0.0-beta.1"
}

Pre-release versions:

  • Have lower precedence than the associated normal version
  • Indicate instability
  • Should not satisfy ^ or ~ ranges

5. Build Metadata

Build info (ignored for precedence):

json
{
  "version": "1.0.0+build.2024.01.15"
}

Breaking Change Definition

A change is breaking if:

  1. Function removed - Code calling it will error
  2. Parameter type changed - stringnumber breaks callers
  3. Return structure changed - {id, name}{userId, userName} breaks destructuring
  4. Default behavior changed - trim: falsetrim: true changes output
  5. Error thrown where none before - New validation throws unexpectedly

A change is NOT breaking if:

  1. New function added - Existing code unaffected
  2. New optional parameter - Existing calls work unchanged
  3. Additional return properties - {id, name}{id, name, email} is additive
  4. Bug fix - Corrects previously wrong behavior

Version Bump Decision Tree

Did you change the public API?
├── No → PATCH (1.0.0 → 1.0.1)

└── Yes → Is it backward compatible?
    ├── Yes → MINOR (1.0.0 → 1.1.0)

    └── No → MAJOR (1.0.0 → 2.0.0)

Commit Message Convention

Use Conventional Commits to automate changelog:

TypeVersion ImpactExample
featMinorfeat(utils): add isValidEmail()
fixPatchfix(utils): handle null in isEmpty()
docsPatchdocs(utils): add usage examples
stylePatchstyle(utils): fix indentation
refactorPatchrefactor(utils): simplify logic
perfPatchperf(utils): optimize loop
testPatchtest(utils): add edge cases
BREAKING CHANGEMajorFooter: BREAKING CHANGE: removed toSlug()

FAQ

Q: Won't I end up at version 42.0.0 rapidly? A: No. Major bumps indicate breaking changes. If you maintain backward compatibility, you stay on the same major version.

Q: What about updating dependencies? A: Updating your own dependencies without changing your public API = patch bump (if dependency change is transparent to users).

Q: How do I handle deprecating functionality? A:

  1. Minor bump: Mark as deprecated in docs, add deprecation warning
  2. Major bump (later): Remove the deprecated function

Q: What if I accidentally release a breaking change as minor? A:

  1. Immediately release a revert as patch
  2. Re-release the breaking change as major
  3. Document the incident in changelog

References

Released under the MIT License.