From fddf2920905dc1d6970518e5cd8c0a4f06d5f8ba Mon Sep 17 00:00:00 2001 From: mshanemc Date: Mon, 17 Jul 2023 21:05:37 -0500 Subject: [PATCH 1/2] style: flag naming convention --- messages/clone.md | 12 ++++++------ messages/create.md | 20 ++++++++++---------- messages/delete.md | 4 ++-- messages/status.md | 8 ++++---- src/commands/force/org/clone.ts | 12 ++++++------ src/commands/force/org/create.ts | 20 ++++++++++---------- src/commands/force/org/delete.ts | 6 +++--- src/commands/force/org/status.ts | 8 ++++---- yarn.lock | 14 ++++++-------- 9 files changed, 51 insertions(+), 53 deletions(-) diff --git a/messages/clone.md b/messages/clone.md index e594d1ea..5a9b2e41 100644 --- a/messages/clone.md +++ b/messages/clone.md @@ -14,27 +14,27 @@ Set the --targetusername (-u) parameter to a production org with sandbox license - $ <%= config.bin %> <%= command.id %> -t sandbox SandboxName=NewClonedSandbox SourceSandboxName=ExistingSandbox -u prodOrg -a MyDevSandbox -# flags.type +# flags.type.summary Type of org to create. -# flags.wait +# flags.wait.summary Number of minutes to wait while polling for status. -# flags.setdefaultusername +# flags.setdefaultusername.summary Set the cloned org as your default. -# flags.setalias +# flags.setalias.summary Alias for the cloned org. -# flags.definitionfile +# flags.definitionfile.summary Path to the sandbox definition file. -# flagsLong.wait +# flags.wait.description Sets the streaming client socket timeout, in minutes. If the streaming client socket has no contact from the server for a number of minutes, the client exits. Specify a longer wait time if timeouts occur frequently. diff --git a/messages/create.md b/messages/create.md index b7b5fc7d..294fcabc 100644 --- a/messages/create.md +++ b/messages/create.md @@ -20,43 +20,43 @@ Creates a scratch org or a sandbox org using the values specified in a configura - $ <%= config.bin %> <%= command.id %> -t sandbox -f config/dev-sandbox-def.json -a MyDevSandbox -u prodOrg -# flags.clientId +# flags.clientid.summary Connected app consumer key; not supported for sandbox org creation. -# flags.setDefaultUsername +# flags.setdefaultusername.summary Set the created org as the default username. -# flags.setAlias +# flags.setalias.summary Alias for the created org. -# flags.definitionFile +# flags.definitionfile.summary Path to an org definition file. -# flags.noNamespace +# flags.nonamespace.summary Create the scratch org with no namespace. -# flags.noAncestors +# flags.noancestors.summary Do not include second-generation package ancestors in the scratch org. -# flags.type +# flags.type.summary Type of org to create. -# flags.durationDays +# flags.durationdays.summary Duration of the scratch org (in days) (default:7, min:1, max:30). -# flags.retry +# flags.retry.summary Number of scratch org auth retries after scratch org is successfully signed up. -# flags.wait +# flags.wait.summary Streaming client socket timeout (in minutes). diff --git a/messages/delete.md b/messages/delete.md index eeffd98a..9fa0468e 100644 --- a/messages/delete.md +++ b/messages/delete.md @@ -18,7 +18,7 @@ To mark the org for deletion without being prompted to confirm, specify --noprom - $ <%= config.bin %> <%= command.id %> -u MyOrgAlias -p -# flags.noprompt +# flags.noprompt.summary No prompt to confirm deletion. @@ -30,7 +30,7 @@ Unable to determine the username of the org to delete. Specify the username with Username or alias of the target org. -# flags.targetdevhubusername +# flags.targetdevhubusername.summary The targetdevhubusername flag exists only for backwards compatibility. It is not necessary and has no effect. diff --git a/messages/status.md b/messages/status.md index 44bcffe2..734f0d19 100644 --- a/messages/status.md +++ b/messages/status.md @@ -16,18 +16,18 @@ Use the --wait (-w) parameter to specify the number of minutes that the command Set the --target-org (-o) parameter to the username or alias of the production org that contains the sandbox license. -# flags.sandboxname +# flags.sandboxname.summary Name of the sandbox org to check status for. -# flags.wait +# flags.wait.summary Number of minutes to wait while polling for status. -# flags.setdefaultusername +# flags.setdefaultusername.summary Set the created or cloned org as your default. -# flags.setalias +# flags.setalias.summary Alias for the created or cloned org. diff --git a/src/commands/force/org/clone.ts b/src/commands/force/org/clone.ts index cbcb8b8d..7ca58691 100644 --- a/src/commands/force/org/clone.ts +++ b/src/commands/force/org/clone.ts @@ -51,27 +51,27 @@ export class OrgCloneCommand extends SfCommand { options: ['sandbox'], })({ char: 't', - summary: messages.getMessage('flags.type'), + summary: messages.getMessage('flags.type.summary'), required: true, }), definitionfile: Flags.file({ char: 'f', exists: true, - summary: messages.getMessage('flags.definitionfile'), + summary: messages.getMessage('flags.definitionfile.summary'), }), setdefaultusername: Flags.boolean({ char: 's', - summary: messages.getMessage('flags.setdefaultusername'), + summary: messages.getMessage('flags.setdefaultusername.summary'), }), setalias: Flags.string({ char: 'a', - summary: messages.getMessage('flags.setalias'), + summary: messages.getMessage('flags.setalias.summary'), }), wait: Flags.duration({ unit: 'minutes', char: 'w', - summary: messages.getMessage('flags.wait'), - description: messages.getMessage('flagsLong.wait'), + summary: messages.getMessage('flags.wait.summary'), + description: messages.getMessage('flags.wait.description'), min: 2, defaultValue: 6, }), diff --git a/src/commands/force/org/create.ts b/src/commands/force/org/create.ts index ba080945..e8eb0863 100644 --- a/src/commands/force/org/create.ts +++ b/src/commands/force/org/create.ts @@ -74,44 +74,44 @@ export class Create extends SfCommand { options: [OrgTypes.Scratch, OrgTypes.Sandbox], })({ char: 't', - summary: messages.getMessage('flags.type'), + summary: messages.getMessage('flags.type.summary'), default: OrgTypes.Scratch, }), definitionfile: Flags.file({ exists: true, char: 'f', - summary: messages.getMessage('flags.definitionFile'), + summary: messages.getMessage('flags.definitionfile.summary'), }), nonamespace: Flags.boolean({ char: 'n', - summary: messages.getMessage('flags.noNamespace'), + summary: messages.getMessage('flags.nonamespace.summary'), }), noancestors: Flags.boolean({ char: 'c', - summary: messages.getMessage('flags.noAncestors'), + summary: messages.getMessage('flags.noancestors.summary'), }), clientid: Flags.string({ char: 'i', - summary: messages.getMessage('flags.clientId'), + summary: messages.getMessage('flags.clientid.summary'), }), setdefaultusername: Flags.boolean({ char: 's', - summary: messages.getMessage('flags.setDefaultUsername'), + summary: messages.getMessage('flags.setdefaultusername.summary'), }), setalias: Flags.string({ char: 'a', - summary: messages.getMessage('flags.setAlias'), + summary: messages.getMessage('flags.setalias.summary'), }), wait: Flags.duration({ unit: 'minutes', char: 'w', - summary: messages.getMessage('flags.wait'), + summary: messages.getMessage('flags.wait.summary'), min: 6, defaultValue: 6, }), durationdays: Flags.integer({ char: 'd', - summary: messages.getMessage('flags.durationDays'), + summary: messages.getMessage('flags.durationdays.summary'), min: 1, max: 30, default: 7, @@ -120,7 +120,7 @@ export class Create extends SfCommand { hidden: true, default: 0, max: 10, - summary: messages.getMessage('flags.retry'), + summary: messages.getMessage('flags.retry.summary'), }), }; private sandboxAuth?: SandboxUserAuthResponse; diff --git a/src/commands/force/org/delete.ts b/src/commands/force/org/delete.ts index 0237a961..a68f5b66 100644 --- a/src/commands/force/org/delete.ts +++ b/src/commands/force/org/delete.ts @@ -30,18 +30,18 @@ export class Delete extends SfCommand { summary: messages.getMessage('flags.target-org.summary'), }), targetdevhubusername: Flags.string({ - summary: messages.getMessage('flags.targetdevhubusername'), + summary: messages.getMessage('flags.targetdevhubusername.summary'), char: 'v', hidden: true, deprecated: { version: '58.0', - message: messages.getMessage('flags.targetdevhubusername'), + message: messages.getMessage('flags.targetdevhubusername.summary'), }, }), 'api-version': orgApiVersionFlagWithDeprecations, 'no-prompt': Flags.boolean({ char: 'p', - summary: messages.getMessage('flags.noprompt'), + summary: messages.getMessage('flags.noprompt.summary'), deprecateAliases: true, aliases: ['noprompt'], }), diff --git a/src/commands/force/org/status.ts b/src/commands/force/org/status.ts index ed6338fd..a5e933a0 100644 --- a/src/commands/force/org/status.ts +++ b/src/commands/force/org/status.ts @@ -44,21 +44,21 @@ export class OrgStatusCommand extends SfCommand { 'api-version': orgApiVersionFlagWithDeprecations, sandboxname: Flags.string({ char: 'n', - summary: messages.getMessage('flags.sandboxname'), + summary: messages.getMessage('flags.sandboxname.summary'), required: true, }), setdefaultusername: Flags.boolean({ char: 's', - summary: messages.getMessage('flags.setdefaultusername'), + summary: messages.getMessage('flags.setdefaultusername.summary'), }), setalias: Flags.string({ char: 'a', - summary: messages.getMessage('flags.setalias'), + summary: messages.getMessage('flags.setalias.summary'), }), wait: Flags.duration({ unit: 'minutes', char: 'w', - summary: messages.getMessage('flags.wait'), + summary: messages.getMessage('flags.wait.summary'), min: 2, defaultValue: 6, }), diff --git a/yarn.lock b/yarn.lock index 2cc0e49e..bdda98b4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -911,7 +911,7 @@ strip-ansi "6.0.1" ts-retry-promise "^0.7.0" -"@salesforce/core@^4.0.1", "@salesforce/core@^4.1.0", "@salesforce/core@^4.3.1", "@salesforce/core@^4.3.2", "@salesforce/core@^4.3.5", "@salesforce/core@^4.3.7", "@salesforce/core@^4.3.8": +"@salesforce/core@^4.0.1", "@salesforce/core@^4.3.1", "@salesforce/core@^4.3.2", "@salesforce/core@^4.3.5", "@salesforce/core@^4.3.7", "@salesforce/core@^4.3.8": version "4.3.10" resolved "https://registry.yarnpkg.com/@salesforce/core/-/core-4.3.10.tgz#d3ada1411c41fbd182fbfbe6a7ab4cf5bc6afb9f" integrity sha512-xWwn9cSMXVSGobcROajVWNcEZ4QY3KbaSyZe7swXJtulJ26CB1Fv3QJB8RxStrj0XaXwt8m1nuiBwh03DTvCKg== @@ -1476,7 +1476,7 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.62.0", "@typescript-eslint/utils@^5.59.8": +"@typescript-eslint/utils@5.62.0", "@typescript-eslint/utils@^5.59.11": version "5.62.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.62.0.tgz#141e809c71636e4a75daa39faed2fb5f4b10df86" integrity sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ== @@ -3075,13 +3075,11 @@ eslint-plugin-prefer-arrow@^1.2.1: resolved "https://registry.yarnpkg.com/eslint-plugin-prefer-arrow/-/eslint-plugin-prefer-arrow-1.2.3.tgz#e7fbb3fa4cd84ff1015b9c51ad86550e55041041" integrity sha512-J9I5PKCOJretVuiZRGvPQxCbllxGAV/viI20JO3LYblAodofBxyMnZAJ+WGeClHgANnSJberTNoFWWjrWKBuXQ== -eslint-plugin-sf-plugin@^1.15.6: - version "1.15.8" - resolved "https://registry.yarnpkg.com/eslint-plugin-sf-plugin/-/eslint-plugin-sf-plugin-1.15.8.tgz#6926244f8f8ea7015b8109283abf44736e59aa76" - integrity sha512-78toJayNZinG0NFKPBVeRzGoYwUViQcrvCMQq/h/7D3f0XKZ6NRHEt1V+Dt3j0GOZ+A/UqWbrLuvMPl4sPMo2Q== +"eslint-plugin-sf-plugin@file:/Users/shane.mclaughlin/eng/eslint-plugin-sf-plugin": + version "1.15.13" dependencies: - "@salesforce/core" "^4.1.0" - "@typescript-eslint/utils" "^5.59.8" + "@salesforce/core" "^4.3.7" + "@typescript-eslint/utils" "^5.59.11" eslint-scope@^5.1.1: version "5.1.1" From 57108a714f3649899170cb25138838355d267744 Mon Sep 17 00:00:00 2001 From: Eric Willhoit Date: Wed, 26 Jul 2023 15:57:12 -0500 Subject: [PATCH 2/2] style: cleanup flags --- messages/create_scratch.md | 8 ++++---- messages/delete.md | 2 +- messages/list.md | 4 ++-- package.json | 2 +- src/commands/force/org/delete.ts | 2 +- src/commands/org/create/scratch.ts | 8 ++++---- src/commands/org/list.ts | 4 ++-- yarn.lock | 6 ++++-- 8 files changed, 19 insertions(+), 17 deletions(-) diff --git a/messages/create_scratch.md b/messages/create_scratch.md index a7770a30..d5843f4c 100644 --- a/messages/create_scratch.md +++ b/messages/create_scratch.md @@ -34,11 +34,11 @@ You must specify a Dev Hub to create a scratch org, either with the --target-dev <%= config.bin %> <%= command.id %> --edition enterprise --alias my-scratch-org --target-dev-hub MyHub --release preview -# flags.target-hub.summary +# flags.target-dev-hub.summary Username or alias of the Dev Hub org. -# flags.target-hub.description +# flags.target-dev-hub.description Overrides the value of the target-dev-hub configuration variable, if set. @@ -86,11 +86,11 @@ The scratch org definition file is a blueprint for the scratch org. It mimics th Consumer key of the Dev Hub connected app. -# flags.adminEmail.summary +# flags.admin-email.summary Email address that will be applied to the org's admin user. Overrides the value of the "adminEmail" option in the definition file, if set. -# flags.sourceOrg.summary +# flags.source-org.summary 15-character ID of the org whose shape the new scratch org will be based on. Overrides the value of the "sourceOrg" option in the definition file, if set. diff --git a/messages/delete.md b/messages/delete.md index 9fa0468e..d1f263d0 100644 --- a/messages/delete.md +++ b/messages/delete.md @@ -18,7 +18,7 @@ To mark the org for deletion without being prompted to confirm, specify --noprom - $ <%= config.bin %> <%= command.id %> -u MyOrgAlias -p -# flags.noprompt.summary +# flags.no-prompt.summary No prompt to confirm deletion. diff --git a/messages/list.md b/messages/list.md index edc6778e..fb4e5b4b 100644 --- a/messages/list.md +++ b/messages/list.md @@ -28,11 +28,11 @@ Include expired, deleted, and unknown-status scratch orgs. Remove all local org authorizations for non-active scratch orgs. Use "org logout" to remove non-scratch orgs. -# flags.noPrompt.summary +# flags.no-prompt.summary Don't prompt for confirmation. -# flags.skipConnectionStatus.summary +# flags.skip-connection-status.summary Skip retrieving the connection status of non-scratch orgs. diff --git a/package.json b/package.json index aeea2820..e09f5e40 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,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.6", + "eslint-plugin-sf-plugin": "^1.16.0", "husky": "^7.0.4", "mocha": "^10.2.0", "moment": "^2.29.1", diff --git a/src/commands/force/org/delete.ts b/src/commands/force/org/delete.ts index a68f5b66..75072ab7 100644 --- a/src/commands/force/org/delete.ts +++ b/src/commands/force/org/delete.ts @@ -41,7 +41,7 @@ export class Delete extends SfCommand { 'api-version': orgApiVersionFlagWithDeprecations, 'no-prompt': Flags.boolean({ char: 'p', - summary: messages.getMessage('flags.noprompt.summary'), + summary: messages.getMessage('flags.no-prompt.summary'), deprecateAliases: true, aliases: ['noprompt'], }), diff --git a/src/commands/org/create/scratch.ts b/src/commands/org/create/scratch.ts index cab454e9..a5f3398a 100644 --- a/src/commands/org/create/scratch.ts +++ b/src/commands/org/create/scratch.ts @@ -54,8 +54,8 @@ export default class EnvCreateScratch extends SfCommand { }), 'target-dev-hub': Flags.requiredHub({ char: 'v', - summary: messages.getMessage('flags.target-hub.summary'), - description: messages.getMessage('flags.target-hub.description'), + summary: messages.getMessage('flags.target-dev-hub.summary'), + description: messages.getMessage('flags.target-dev-hub.description'), required: true, }), 'no-ancestors': Flags.boolean({ @@ -134,11 +134,11 @@ export default class EnvCreateScratch extends SfCommand { helpGroup: definitionFileHelpGroupName, }), 'admin-email': Flags.string({ - summary: messages.getMessage('flags.adminEmail.summary'), + summary: messages.getMessage('flags.admin-email.summary'), helpGroup: definitionFileHelpGroupName, }), 'source-org': Flags.salesforceId({ - summary: messages.getMessage('flags.sourceOrg.summary'), + summary: messages.getMessage('flags.source-org.summary'), startsWith: '00D', length: 15, helpGroup: definitionFileHelpGroupName, diff --git a/src/commands/org/list.ts b/src/commands/org/list.ts index f8ddc117..a82c42af 100644 --- a/src/commands/org/list.ts +++ b/src/commands/org/list.ts @@ -36,13 +36,13 @@ export class OrgListCommand extends SfCommand { }), 'no-prompt': Flags.boolean({ char: 'p', - summary: messages.getMessage('flags.noPrompt.summary'), + summary: messages.getMessage('flags.no-prompt.summary'), dependsOn: ['clean'], aliases: ['noprompt'], deprecateAliases: true, }), 'skip-connection-status': Flags.boolean({ - summary: messages.getMessage('flags.skipConnectionStatus.summary'), + summary: messages.getMessage('flags.skip-connection-status.summary'), aliases: ['skipconnectionstatus'], deprecateAliases: true, }), diff --git a/yarn.lock b/yarn.lock index bdda98b4..20d16c0b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3075,8 +3075,10 @@ eslint-plugin-prefer-arrow@^1.2.1: resolved "https://registry.yarnpkg.com/eslint-plugin-prefer-arrow/-/eslint-plugin-prefer-arrow-1.2.3.tgz#e7fbb3fa4cd84ff1015b9c51ad86550e55041041" integrity sha512-J9I5PKCOJretVuiZRGvPQxCbllxGAV/viI20JO3LYblAodofBxyMnZAJ+WGeClHgANnSJberTNoFWWjrWKBuXQ== -"eslint-plugin-sf-plugin@file:/Users/shane.mclaughlin/eng/eslint-plugin-sf-plugin": - version "1.15.13" +eslint-plugin-sf-plugin@^1.16.0: + version "1.16.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-sf-plugin/-/eslint-plugin-sf-plugin-1.16.0.tgz#9c82d9a69be28b754ba8637a5bddba350dcf565e" + integrity sha512-f/1VQDKq1ffOrp5VZUJB6wI44c+57N5A6S1p7/Mtl4JOk9WmBHUT6Tg8W0I2cwM+KV08Bh49u6iesFdZsLUXGg== dependencies: "@salesforce/core" "^4.3.7" "@typescript-eslint/utils" "^5.59.11"