feat: implement server versioning approach with semantic versioning support (#296)

This implements the versioning approach agreed upon in issue #158:

## Key Changes

### Documentation
- Added comprehensive versioning guide (docs/versioning.md)
- Updated FAQ with versioning guidance and best practices 
- Enhanced schema description with SHOULD recommendations

### Schema Updates
- Added 255-character limit for version strings in schema.json
- Enhanced version field description with semantic versioning guidance

### Implementation 
- New isSemanticVersion() function for proper semver detection
- Enhanced compareSemanticVersions() with prerelease support
- Implemented compareVersions() strategy:
  * Both semver: use semantic comparison
  * Neither semver: use timestamp comparison
  * Mixed: semver versions always take precedence
- Updated publish logic to determine "latest" using new strategy
- Added version length validation (255 char max)

### Versioning Strategy
1. Version MUST be string up to 255 characters
2. SHOULD use semantic versioning for predictable ordering
3. SHOULD align with package versions to reduce confusion 
4. MAY use prerelease labels for registry-specific versions
5. Registry attempts semver parsing, falls back to timestamp ordering
6. Clients SHOULD follow same comparison logic

Resolves #158

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: adam jones <domdomegg@users.noreply.github.com>
This commit is contained in:
adam jones 2025-08-26 14:55:38 +01:00 • committed by GitHub
commit 7b211a46d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -72,13 +72,23 @@ More can be added as the community desires; feel free to open an issue if you ar
Yes, versioning is supported:
- Each version gets its own immutable metadata
- Version bumps are required for updates
- Version strings must be unique for each server
- Old versions remain accessible for compatibility
- The registry tracks which version is "latest"
- The registry tracks which version is "latest" based on semantic version ordering when possible
### How do I update my server metadata?
Submit a new `server.json` with an incremented version number. Once published, version metadata is immutable (similar to npm).
Submit a new `server.json` with a unique version string. Once published, version metadata is immutable (similar to npm).
### What version format should I use?
The registry accepts any version string up to 255 characters, but we recommend:
- **SHOULD use semantic versioning** (e.g., "1.0.2", "2.1.0-alpha") for predictable ordering
- **SHOULD align with package versions** to reduce confusion
- **MAY use prerelease labels** (e.g., "1.0.0-1") for registry-specific versions
The registry attempts to parse versions as semantic versions for proper ordering. Non-semantic versions are allowed but will be ordered by publication timestamp. See the [versioning guide](./versioning.md) for detailed guidance.
### Can I delete/unpublish my server?