universal-dev-standards 3.4.0 → 3.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "universal-dev-standards",
3
- "version": "3.4.0",
3
+ "version": "3.4.2",
4
4
  "description": "CLI tool for adopting Universal Development Standards",
5
5
  "keywords": [
6
6
  "documentation",
@@ -6,6 +6,57 @@ import { readManifest, writeManifest, copyStandard, copyIntegration, isInitializ
6
6
  import { getRepositoryInfo } from '../utils/registry.js';
7
7
  import { computeFileHash } from '../utils/hasher.js';
8
8
 
9
+ /**
10
+ * Compare two semantic versions
11
+ * @param {string} v1 - First version (e.g., "3.4.0-beta.3")
12
+ * @param {string} v2 - Second version (e.g., "3.3.0")
13
+ * @returns {number} -1 if v1 < v2, 0 if equal, 1 if v1 > v2
14
+ */
15
+ function compareVersions(v1, v2) {
16
+ // Parse version into parts: major.minor.patch-prerelease
17
+ const parseVersion = (v) => {
18
+ const [main, prerelease] = v.split('-');
19
+ const [major, minor, patch] = main.split('.').map(Number);
20
+ return { major, minor, patch, prerelease: prerelease || null };
21
+ };
22
+
23
+ const p1 = parseVersion(v1);
24
+ const p2 = parseVersion(v2);
25
+
26
+ // Compare major.minor.patch
27
+ if (p1.major !== p2.major) return p1.major > p2.major ? 1 : -1;
28
+ if (p1.minor !== p2.minor) return p1.minor > p2.minor ? 1 : -1;
29
+ if (p1.patch !== p2.patch) return p1.patch > p2.patch ? 1 : -1;
30
+
31
+ // Same major.minor.patch - compare prerelease
32
+ // No prerelease > prerelease (e.g., 3.4.0 > 3.4.0-beta.1)
33
+ if (!p1.prerelease && p2.prerelease) return 1;
34
+ if (p1.prerelease && !p2.prerelease) return -1;
35
+ if (!p1.prerelease && !p2.prerelease) return 0;
36
+
37
+ // Both have prerelease - compare them
38
+ // Order: alpha < beta < rc
39
+ const prereleaseOrder = { alpha: 1, beta: 2, rc: 3 };
40
+ const parsePrerelease = (pr) => {
41
+ const match = pr.match(/^(alpha|beta|rc)\.?(\d+)?$/);
42
+ if (match) {
43
+ return { type: match[1], num: parseInt(match[2] || '0', 10) };
44
+ }
45
+ return { type: pr, num: 0 };
46
+ };
47
+
48
+ const pr1 = parsePrerelease(p1.prerelease);
49
+ const pr2 = parsePrerelease(p2.prerelease);
50
+
51
+ const order1 = prereleaseOrder[pr1.type] || 0;
52
+ const order2 = prereleaseOrder[pr2.type] || 0;
53
+
54
+ if (order1 !== order2) return order1 > order2 ? 1 : -1;
55
+ if (pr1.num !== pr2.num) return pr1.num > pr2.num ? 1 : -1;
56
+
57
+ return 0;
58
+ }
59
+
9
60
  // Integration file mappings (same as init.js)
10
61
  const INTEGRATION_MAPPINGS = {
11
62
  cursor: {
@@ -62,8 +113,15 @@ export async function updateCommand(options) {
62
113
  console.log(chalk.gray(`Latest version: ${latestVersion}`));
63
114
  console.log();
64
115
 
65
- if (currentVersion === latestVersion) {
116
+ // Compare versions properly using semver
117
+ const versionComparison = compareVersions(currentVersion, latestVersion);
118
+
119
+ if (versionComparison >= 0) {
120
+ // Current version is same or newer than registry
66
121
  console.log(chalk.green('✓ Standards are up to date.'));
122
+ if (versionComparison > 0) {
123
+ console.log(chalk.gray(` (You have a newer version than the registry: ${currentVersion})`));
124
+ }
67
125
  console.log();
68
126
  return;
69
127
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "version": "3.3.0",
3
+ "version": "3.4.2",
4
4
  "lastUpdated": "2026-01-07",
5
5
  "description": "Standards registry for universal-dev-standards with integrated skills and AI-optimized formats",
6
6
  "formats": {
@@ -48,14 +48,14 @@
48
48
  "standards": {
49
49
  "name": "universal-dev-standards",
50
50
  "url": "https://github.com/AsiaOstrich/universal-dev-standards",
51
- "version": "3.3.0"
51
+ "version": "3.4.1"
52
52
  },
53
53
  "skills": {
54
54
  "name": "universal-dev-standards",
55
55
  "url": "https://github.com/AsiaOstrich/universal-dev-standards",
56
56
  "localPath": "skills/claude-code",
57
57
  "rawUrl": "https://raw.githubusercontent.com/AsiaOstrich/universal-dev-standards/main/skills/claude-code",
58
- "version": "3.3.0",
58
+ "version": "3.4.2",
59
59
  "note": "Skills are now included in the main repository under skills/"
60
60
  }
61
61
  },