Skip to content

Commit 894b14a

Browse files
authored
fix: @W-17672756@ update version recommendation logic (#401)
* fix: update version recommendation logic * chore: address feedback
1 parent 18b23f4 commit 894b14a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,11 @@
219219
}
220220
},
221221
"apiVersionMetadata": {
222-
"comment": "Refer to ApiVersionMetadata in orgUtils.ts for details",
222+
"x-apiVersionMetadata-comments": [
223+
"Refer to ApiVersionMetadata in orgUtils.ts for more details.",
224+
"The 'target' section defines the dev server version (matchingDevServerVersion) and the API version that it can support (versionNumber).",
225+
"The 'versionToTagMappings' section defines the mapping between released tags for our CLI plugin and the org version that each tag supports."
226+
],
223227
"target": {
224228
"versionNumber": "64.0",
225229
"matchingDevServerVersion": "~11.5.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)