Skip to content

Commit f457dc7

Browse files
committed
fix: update version recommendation logic
1 parent 18b23f4 commit f457dc7

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,13 @@
219219
}
220220
},
221221
"apiVersionMetadata": {
222-
"comment": "Refer to ApiVersionMetadata in orgUtils.ts for details",
222+
"comment1": "Refer to ApiVersionMetadata in orgUtils.ts for more details.",
223+
"comment2": "target section defines the dev server version (matchingDevServerVersion) and the API version that it can support (versionNumber).",
223224
"target": {
224225
"versionNumber": "64.0",
225226
"matchingDevServerVersion": "~11.5.0"
226227
},
228+
"comment3": "versionToTagMappings section defines the mapping between released tags for our CLI plugin and the org version that each tag supports.",
227229
"versionToTagMappings": [
228230
{
229231
"versionNumber": "62.0",

src/shared/orgUtils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,9 @@ export class OrgUtils {
177177

178178
if (Version.same(orgVersion, targetVersion) === false) {
179179
let errorMessage = messages.getMessage('error.org.api-mismatch.message', [orgVersion, targetVersion]);
180+
// Find the tag (if any) that can support this org version
180181
const tagName = pkg.apiVersionMetadata.versionToTagMappings.find(
181-
(info) => info.versionNumber === targetVersion
182+
(info) => info.versionNumber === orgVersion
182183
)?.tagName;
183184
if (tagName) {
184185
const remediation = messages.getMessage('error.org.api-mismatch.remediation', [

0 commit comments

Comments
 (0)