DashboardcraftCraft uses home-grown SemVer utils — do…

Craft uses home-grown SemVer utils — don't add semver package for version comparisons

Category: pattern
Confidence: 1.00
ID: 019c9fa3-fcfe-7b07-8351-90944df38ca0
Project ID: e16af391-c497-4837-b681-c849a5514499
Cross-project: No
Recalled in other projects: 1
Source session: (none)
Created: 2026-06-10 21:07:09
Updated: 2026-06-10 21:07:09

Cross-Project Recalls

ProjectHitsLast recalled
opencode-lore 1 2026-08-06

Content

Despite semver being a dependency (used in src/utils/autoVersion.ts for semver.inc()), the codebase has its own SemVer interface and utilities in src/utils/version.ts: parseVersion(), versionGreaterOrEqualThan(), isPreviewRelease(), etc. These are used throughout the codebase (npm target, publish tag logic, etc.). When adding version comparison logic, use these existing utilities rather than introducing new custom comparison functions or reaching for the semver package. Example: the OIDC minimum npm version check was initially implemented with 3 separate constants and a custom comparison helper, then refactored to a single SemVer constant + versionGreaterOrEqualThan().

Move to: