Skip to content

Commit

Permalink
fix: more flag conflicts (#861)
Browse files Browse the repository at this point in the history
* chore: updates from devScripts

* fix: remove duplicate char alias

* fix: remove duplicate apiversion, add char to main apiVersion flag

* chore: snapshot

* chore: remove unused prop

---------

Co-authored-by: mshanemc <[email protected]>
  • Loading branch information
svc-cli-bot and mshanemc authored Jun 6, 2023
1 parent 1e973e6 commit 81bb1dc
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 93 deletions.
53 changes: 39 additions & 14 deletions command-snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"command": "force",
"plugin": "@salesforce/plugin-source",
"flags": ["json"],
"alias": []
"alias": [],
"flagChars": [],
"flagAliases": []
},
{
"command": "force:mdapi:deploy",
Expand Down Expand Up @@ -31,13 +33,17 @@
"wait",
"zipfile"
],
"alias": []
"alias": [],
"flagChars": ["c", "d", "f", "g", "l", "o", "q", "r", "s", "u", "w"],
"flagAliases": ["apiversion", "targetusername"]
},
{
"command": "force:mdapi:deploy:cancel",
"plugin": "@salesforce/plugin-source",
"flags": ["api-version", "jobid", "json", "loglevel", "target-org", "wait"],
"alias": []
"alias": [],
"flagChars": ["i", "o", "w"],
"flagAliases": ["apiversion", "targetusername", "u"]
},
{
"command": "force:mdapi:deploy:report",
Expand All @@ -55,7 +61,9 @@
"verbose",
"wait"
],
"alias": []
"alias": [],
"flagChars": ["i", "o", "w"],
"flagAliases": ["apiversion", "targetusername", "u"]
},
{
"command": "force:mdapi:retrieve",
Expand All @@ -75,7 +83,9 @@
"wait",
"zipfilename"
],
"alias": []
"alias": [],
"flagChars": ["a", "d", "k", "n", "o", "p", "r", "s", "w", "z"],
"flagAliases": ["targetusername", "u"]
},
{
"command": "force:mdapi:retrieve:report",
Expand All @@ -92,7 +102,9 @@
"wait",
"zipfilename"
],
"alias": []
"alias": [],
"flagChars": ["i", "n", "o", "r", "w", "z"],
"flagAliases": ["apiversion", "targetusername", "u"]
},
{
"command": "force:source:deploy",
Expand Down Expand Up @@ -123,13 +135,17 @@
"verbose",
"wait"
],
"alias": []
"alias": [],
"flagChars": ["c", "f", "g", "l", "m", "o", "p", "q", "r", "t", "u", "w", "x"],
"flagAliases": ["apiversion", "targetusername"]
},
{
"command": "force:source:deploy:cancel",
"plugin": "@salesforce/plugin-source",
"flags": ["api-version", "jobid", "json", "loglevel", "target-org", "wait"],
"alias": []
"alias": [],
"flagChars": ["i", "o", "w"],
"flagAliases": ["apiversion", "targetusername", "u"]
},
{
"command": "force:source:deploy:report",
Expand All @@ -146,26 +162,31 @@
"verbose",
"wait"
],
"alias": []
"alias": [],
"flagChars": ["i", "o", "w"],
"flagAliases": ["apiversion", "targetusername", "u"]
},
{
"command": "force:source:pull",
"plugin": "@salesforce/plugin-source",
"flags": ["api-version", "forceoverwrite", "json", "loglevel", "target-org", "verbose", "wait"],
"alias": []
"alias": [],
"flagChars": ["f", "o", "w"],
"flagAliases": ["apiversion", "targetusername", "u"]
},
{
"command": "force:source:push",
"plugin": "@salesforce/plugin-source",
"flags": ["api-version", "forceoverwrite", "ignorewarnings", "json", "loglevel", "quiet", "target-org", "wait"],
"alias": []
"alias": [],
"flagChars": ["f", "g", "o", "w"],
"flagAliases": ["apiversion", "targetusername", "u"]
},
{
"command": "force:source:retrieve",
"plugin": "@salesforce/plugin-source",
"flags": [
"api-version",
"apiversion",
"forceoverwrite",
"json",
"loglevel",
Expand All @@ -179,12 +200,16 @@
"verbose",
"wait"
],
"alias": []
"alias": [],
"flagChars": ["a", "f", "m", "n", "o", "p", "r", "t", "w", "x"],
"flagAliases": ["apiversion", "targetusername", "u"]
},
{
"command": "force:source:status",
"plugin": "@salesforce/plugin-source",
"flags": ["api-version", "concise", "json", "local", "loglevel", "remote", "target-org"],
"alias": []
"alias": [],
"flagChars": ["l", "o", "r"],
"flagAliases": ["apiversion", "targetusername", "u"]
}
]
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
"tslib": "^2"
},
"devDependencies": {
"@oclif/plugin-command-snapshot": "^3.3.13",
"@oclif/plugin-command-snapshot": "^4.0.2",
"@oclif/plugin-help": "^5.2.6",
"@salesforce/cli-plugins-testkit": "^4.0.1",
"@salesforce/dev-config": "^4.0.1",
"@salesforce/dev-scripts": "^5.4.1",
"@salesforce/dev-scripts": "^5.4.2",
"@salesforce/plugin-command-reference": "^3.0.2",
"@salesforce/plugin-deploy-retrieve": "^1.11.1",
"@salesforce/plugin-info": "^2.6.16",
Expand Down Expand Up @@ -54,7 +54,7 @@
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jsdoc": "^43.0.5",
"eslint-plugin-sf-plugin": "^1.15.5",
"eslint-plugin-sf-plugin": "^1.15.6",
"fast-glob": "^3.2.12",
"husky": "^7.0.4",
"mocha": "^9.1.3",
Expand Down Expand Up @@ -283,4 +283,4 @@
"output": []
}
}
}
}
12 changes: 4 additions & 8 deletions src/commands/force/source/retrieve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
requiredOrgFlagWithDeprecations,
Ux,
} from '@salesforce/sf-plugins-core';
import { AlphabetLowercase } from '@oclif/core/lib/interfaces';
import { SourceCommand } from '../../../sourceCommand';
import {
PackageRetrieval,
Expand All @@ -49,14 +50,14 @@ export class Retrieve extends SourceCommand {
public static readonly description = messages.getMessage('description');
public static readonly examples = messages.getMessages('examples');
public static readonly requiresProject = true;
public static readonly requiresUsername = true;
public static readonly state = 'deprecated';
public static readonly deprecationOptions = {
to: replacement,
message: messages.getMessage('deprecation', [replacement]),
};
public static readonly flags = {
'api-version': orgApiVersionFlagWithDeprecations,
// I have no idea why 'a' isn't matching the type AlphabetLowercase automatically
'api-version': { ...orgApiVersionFlagWithDeprecations, char: 'a' as AlphabetLowercase },
loglevel,
'target-org': requiredOrgFlagWithDeprecations,
retrievetargetdir: Flags.directory({
Expand All @@ -65,11 +66,6 @@ export class Retrieve extends SourceCommand {
summary: messages.getMessage('flags.retrievetargetdir.summary'),
exclusive: ['packagenames', 'sourcepath'],
}),
apiversion: Flags.string({
/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */
// @ts-ignore force char override for backward compat
char: 'a',
}),
sourcepath: arrayWithDeprecation({
char: 'p',
description: messages.getMessage('flags.sourcePath.description'),
Expand Down Expand Up @@ -167,7 +163,7 @@ export class Retrieve extends SourceCommand {
});
this.spinner.start(spinnerMessages.getMessage('retrieve.componentSetBuild'));
this.componentSet = await ComponentSetBuilder.build({
apiversion: this.flags.apiversion,
apiversion: this.flags['api-version'],
sourceapiversion: await this.getSourceApiVersion(),
packagenames: this.flags.packagenames,
sourcepath: this.flags.sourcepath,
Expand Down
2 changes: 1 addition & 1 deletion src/deployCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ export const targetUsernameFlag = Flags.string({
char: 'u',
deprecateAliases: true,
// DO NOT alias to 'o', it will conflict with '--ignoreerrors'
aliases: ['targetusername', 'u'],
aliases: ['targetusername'],
summary: messages.getMessage('flags.targetusername.summary'),
parse: async (input: string | undefined) => resolveUsername(input),
default: async () => resolveUsername(),
Expand Down
Loading

0 comments on commit 81bb1dc

Please sign in to comment.