versioning - saltict/Demo-Docs GitHub Wiki
This document outlines the versioning strategy, semantic versioning practices, and automated version management for the SubWallet Services SDK.
- 📋 Overview
- 🏷️ Semantic Versioning
- 🔄 Version Management
- ⚙️ Automation Scripts
- 🔗 Dependency Management
The SubWallet Services SDK follows strict versioning guidelines to ensure compatibility, predictable updates, and clear communication of changes to consumers.
Current Version: 0.1.3-beta.5
We follow Semantic Versioning 2.0.0 specification:
MAJOR.MINOR.PATCH[-PRERELEASE][+BUILD]
- Breaking changes that require consumer code updates
- API signature changes
- Removed functionality
- Major architectural changes
Examples:
// v1.0.0 → v2.0.0
// Breaking: Method signature changed
- getUserBalance(address: string)
+ getUserBalance(address: string, options: BalanceOptions)
- New features that are backward compatible
- New API methods or properties
- Enhanced functionality
- New service integrations
Examples:
// v1.1.0 → v1.2.0
// Added: New method without breaking existing code
export class BalanceDetectionService {
// Existing methods remain unchanged
getBalance(address: string): Promise<Balance>
// New method added
getBalanceHistory(address: string): Promise<BalanceHistory[]>
}
- Bug fixes
- Performance improvements
- Documentation updates
- Internal refactoring without API changes
Examples:
// v1.1.1 → v1.1.2
// Fixed: Incorrect balance calculation
- const balance = amount * rate; // Bug: missing precision handling
+ const balance = new BigNumber(amount).multipliedBy(rate).toFixed();
0.1.3-beta.1
0.1.3-beta.2
0.1.3-beta.5 // Current
0.2.0-alpha.1
0.2.0-alpha.2
1.0.0-rc.1
1.0.0-rc.2
%%{init: {'theme':'dark'}}%%
graph LR
Dev[Development] --> Alpha[Alpha Release]
Alpha --> Beta[Beta Release]
Beta --> RC[Release Candidate]
RC --> Stable[Stable Release]
Alpha --> Patch1[Alpha Patch]
Beta --> Patch2[Beta Patch]
RC --> Patch3[RC Patch]
Stable --> Patch4[Stable Patch]
Stable --> Minor[Minor Release]
Minor --> Major[Major Release]
style Dev fill:#2d3748,stroke:#4a5568,color:#fff
style Alpha fill:#fbbf24,stroke:#f59e0b,color:#000
style Beta fill:#3b82f6,stroke:#2563eb,color:#fff
style RC fill:#8b5cf6,stroke:#7c3aed,color:#fff
style Stable fill:#10b981,stroke:#059669,color:#fff
style Minor fill:#10b981,stroke:#059669,color:#fff
style Major fill:#ef4444,stroke:#dc2626,color:#fff
Channel | Stability | Use Case | Version Pattern |
---|---|---|---|
Alpha | Experimental | Early testing | X.Y.Z-alpha.N |
Beta | Feature complete | Integration testing | X.Y.Z-beta.N |
RC | Release candidate | Final validation | X.Y.Z-rc.N |
Stable | Production ready | Production use | X.Y.Z |
The repository includes an automated version bumping script:
File: /scripts/bump-version.js
# Bump to specific version
node scripts/bump-version.js 0.1.4-beta.1
# Examples
node scripts/bump-version.js 0.2.0-alpha.1
node scripts/bump-version.js 1.0.0-rc.1
node scripts/bump-version.js 1.0.0
- Multi-library Updates: Updates all library package.json files
- Dependency Synchronization: Updates inter-library dependencies
- App Updates: Synchronizes app dependencies with new library versions
- Validation: Ensures version format compliance
Updated ./package.json with version 0.1.4-beta.1
Updated /libs/subwallet-services-sdk/package.json with version 0.1.4-beta.1
Updated /libs/cardano/package.json with version 0.1.4-beta.1
=========================================
Updating dependencies for app: /apps/subwallet-backend/package.json
Updated @subwallet-monorepos/subwallet-services-sdk to version 0.1.4-beta.1
// File: scripts/validate-version.ts
export function validateVersion(version: string): boolean {
const semverRegex = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
return semverRegex.test(version);
}
export function compareVersions(v1: string, v2: string): number {
// Implementation for version comparison
// Returns: -1 if v1 < v2, 0 if v1 = v2, 1 if v1 > v2
}
The SDK manages dependencies between multiple libraries in the monorepo:
{
"name": "@subwallet-monorepos/subwallet-services-sdk",
"dependencies": {
"@subwallet-monorepos/subwallet-interfaces": "0.1.3-beta.5",
"@subwallet-monorepos/subwallet-shared": "0.1.3-beta.5",
"@subwallet-monorepos/cardano": "0.1.3-beta.5",
"@subwallet-monorepos/xcm": "0.1.3-beta.5",
"@subwallet-monorepos/swap-service": "0.1.3-beta.5"
}
}
- Lockstep Versioning: All libraries maintain the same version number
- Automated Updates: Scripts automatically update all references
- Consistency Validation: CI/CD checks ensure version consistency
%%{init: {'theme':'dark'}}%%
graph TD
Change[Breaking Change] --> Analysis[Impact Analysis]
Analysis --> Plan[Migration Plan]
Plan --> Docs[Update Documentation]
Docs --> Version[Bump Major Version]
Version --> Notify[Notify Consumers]
style Change fill:#ef4444,stroke:#dc2626,color:#fff
style Analysis fill:#2d3748,stroke:#4a5568,color:#fff
style Plan fill:#2d3748,stroke:#4a5568,color:#fff
style Docs fill:#2d3748,stroke:#4a5568,color:#fff
style Version fill:#8b5cf6,stroke:#7c3aed,color:#fff
style Notify fill:#10b981,stroke:#059669,color:#fff
- Never manually edit version numbers - Always use automation scripts
- Follow commit message conventions for automated changelog generation
- Test thoroughly before version bumps
- Document breaking changes with migration guides
- Validate dependencies before releasing
- Test in staging environment first
- Coordinate with consuming teams for major releases
- Maintain release notes with clear change descriptions
- Pin to specific versions in production
- Test pre-release versions in development
- Follow upgrade guides for major version changes
- Monitor deprecation warnings
Version | Release Date | Type | Notable Changes |
---|---|---|---|
0.1.3-beta.5 |
Current | Beta | Latest beta with enhanced services |
0.1.2-beta.4 |
2024-01-15 | Beta | XCM service improvements |
0.1.1-beta.3 |
2024-01-10 | Beta | Balance detection enhancements |
0.1.0-beta.1 |
2024-01-01 | Beta | Initial beta release |
Next Steps:
- Review Release Process
- Set up Environment Configuration
- Check Build Documentation
Navigation: ← Deployment Overview | Release Process → | Environments →