An entry for the streamplace vod showcase
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

claude: Add debug logging to version resolution

+11 -2
+11 -2
packages/at-run/runner/src/index.ts
··· 138 138 139 139 let targetUri: string 140 140 if (version === "latest") { 141 + if (DEV_MODE) { 142 + console.log(`[resolveBundleUri] Found ${matchingRecords.length} versions:`, matchingRecords.map(r => r.version)) 143 + } 141 144 matchingRecords.sort((a, b) => { 142 - const [aMajor, aMinor, aPatch] = a.version.split(".").map(Number) 143 - const [bMajor, bMinor, bPatch] = b.version.split(".").map(Number) 145 + // Parse version, stripping any non-numeric suffixes (e.g., "1.2.3-beta" -> [1, 2, 3]) 146 + const parseVersion = (v: string) => v.split(".").map(p => parseInt(p, 10) || 0) 147 + const [aMajor = 0, aMinor = 0, aPatch = 0] = parseVersion(a.version) 148 + const [bMajor = 0, bMinor = 0, bPatch = 0] = parseVersion(b.version) 144 149 if (bMajor !== aMajor) return bMajor - aMajor 145 150 if (bMinor !== aMinor) return bMinor - aMinor 146 151 return bPatch - aPatch 147 152 }) 153 + if (DEV_MODE) { 154 + console.log(`[resolveBundleUri] Sorted versions:`, matchingRecords.map(r => r.version)) 155 + console.log(`[resolveBundleUri] Selected:`, matchingRecords[0].version, matchingRecords[0].uri) 156 + } 148 157 targetUri = matchingRecords[0].uri 149 158 } else { 150 159 const match = matchingRecords.find((r) => r.version === version)