From 3f5d94fe09d3f048da2b3e8ff66e07d03ad35765 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Tue, 2 Jan 2024 11:37:48 -0600 Subject: [PATCH 1/4] feat: deprecate aliases --- LICENSE.txt | 2 +- src/commands/org/login/device.ts | 5 ++- src/commands/org/login/jwt.ts | 5 ++- src/commands/org/login/sfdx-url.ts | 5 ++- src/commands/org/login/web.ts | 5 ++- yarn.lock | 57 ++---------------------------- 6 files changed, 11 insertions(+), 68 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index f2cee7bb..6cfd8734 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (c) 2023, Salesforce.com, Inc. +Copyright (c) 2024, Salesforce.com, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/src/commands/org/login/device.ts b/src/commands/org/login/device.ts index 9e4ff604..048b8d2c 100644 --- a/src/commands/org/login/device.ts +++ b/src/commands/org/login/device.ts @@ -5,8 +5,6 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ - - import { AuthFields, AuthInfo, DeviceOauthService, Messages, OAuth2Config } from '@salesforce/core'; import { Flags, loglevel } from '@salesforce/sf-plugins-core'; import { DeviceCodeResponse } from '@salesforce/core/lib/deviceOauthService.js'; @@ -14,7 +12,7 @@ import { ux } from '@oclif/core'; import { AuthBaseCommand } from '../../../authBaseCommand.js'; import { Common } from '../../../common.js'; -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/plugin-auth', 'device.login'); const commonMessages = Messages.loadMessages('@salesforce/plugin-auth', 'messages'); @@ -25,6 +23,7 @@ export default class LoginDevice extends AuthBaseCommand { public static readonly description = messages.getMessage('description'); public static readonly examples = messages.getMessages('examples'); public static aliases = ['force:auth:device:login', 'auth:device:login']; + public static readonly deprecateAliases = true; public static readonly flags = { 'client-id': Flags.string({ diff --git a/src/commands/org/login/jwt.ts b/src/commands/org/login/jwt.ts index 5b1d781c..229870a1 100644 --- a/src/commands/org/login/jwt.ts +++ b/src/commands/org/login/jwt.ts @@ -5,15 +5,13 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ - - import { Flags, loglevel } from '@salesforce/sf-plugins-core'; import { AuthFields, AuthInfo, AuthRemover, Logger, Messages, SfError } from '@salesforce/core'; import { Interfaces } from '@oclif/core'; import { AuthBaseCommand } from '../../../authBaseCommand.js'; import { Common } from '../../../common.js'; -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/plugin-auth', 'jwt.grant'); const commonMessages = Messages.loadMessages('@salesforce/plugin-auth', 'messages'); @@ -22,6 +20,7 @@ export default class LoginJwt extends AuthBaseCommand { public static readonly description = messages.getMessage('description'); public static readonly examples = messages.getMessages('examples'); public static aliases = ['force:auth:jwt:grant', 'auth:jwt:grant']; + public static readonly deprecateAliases = true; public static readonly flags = { username: Flags.string({ diff --git a/src/commands/org/login/sfdx-url.ts b/src/commands/org/login/sfdx-url.ts index 7945a9b9..2cd4cef1 100644 --- a/src/commands/org/login/sfdx-url.ts +++ b/src/commands/org/login/sfdx-url.ts @@ -5,8 +5,6 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ - - import fs from 'node:fs/promises'; import { Flags, loglevel } from '@salesforce/sf-plugins-core'; import { AuthFields, AuthInfo, Messages } from '@salesforce/core'; @@ -14,7 +12,7 @@ import { AnyJson } from '@salesforce/ts-types'; import { parseJson } from '@salesforce/kit'; import { AuthBaseCommand } from '../../../authBaseCommand.js'; -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/plugin-auth', 'sfdxurl.store'); const commonMessages = Messages.loadMessages('@salesforce/plugin-auth', 'messages'); @@ -29,6 +27,7 @@ export default class LoginSfdxUrl extends AuthBaseCommand { public static readonly description = messages.getMessage('description', [AUTH_URL_FORMAT]); public static readonly examples = messages.getMessages('examples'); public static aliases = ['force:auth:sfdxurl:store', 'auth:sfdxurl:store']; + public static readonly deprecateAliases = true; public static readonly flags = { 'sfdx-url-file': Flags.file({ diff --git a/src/commands/org/login/web.ts b/src/commands/org/login/web.ts index 2e1ecae1..135d5237 100644 --- a/src/commands/org/login/web.ts +++ b/src/commands/org/login/web.ts @@ -5,8 +5,6 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ - - import open, { apps, AppName } from 'open'; import { Flags, loglevel } from '@salesforce/sf-plugins-core'; import { AuthFields, AuthInfo, Logger, Messages, OAuth2Config, SfError, WebOAuthServer } from '@salesforce/core'; @@ -15,7 +13,7 @@ import { Interfaces } from '@oclif/core'; import { AuthBaseCommand } from '../../../authBaseCommand.js'; import { Common } from '../../../common.js'; -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/plugin-auth', 'web.login'); const commonMessages = Messages.loadMessages('@salesforce/plugin-auth', 'messages'); @@ -25,6 +23,7 @@ export default class LoginWeb extends AuthBaseCommand { public static readonly examples = messages.getMessages('examples'); public static readonly deprecateAliases = true; public static aliases = ['force:auth:web:login', 'auth:web:login']; + public static readonly deprecateAliases = true; public static readonly flags = { browser: Flags.string({ diff --git a/yarn.lock b/yarn.lock index a91b4569..db9a9cb7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1550,11 +1550,6 @@ ansi-colors@4.1.1: resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== -ansi-escapes@^3.1.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" - integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== - ansi-escapes@^4.2.1, ansi-escapes@^4.3.2: version "4.3.2" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" @@ -2526,17 +2521,6 @@ create-require@^1.1.0: resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== -cross-spawn@^6.0.5: - version "6.0.5" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" - integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== - dependencies: - nice-try "^1.0.4" - path-key "^2.0.1" - semver "^5.5.0" - shebang-command "^1.2.0" - which "^1.2.9" - cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" @@ -5436,11 +5420,6 @@ neo-async@^2.6.2: resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== -nice-try@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" - integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== - nise@^1.3.3: version "1.5.3" resolved "https://registry.yarnpkg.com/nise/-/nise-1.5.3.tgz#9d2cfe37d44f57317766c6e9408a359c5d3ac1f7" @@ -6003,15 +5982,7 @@ pascal-case@^3.1.2: no-case "^3.0.4" tslib "^2.0.3" -password-prompt@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/password-prompt/-/password-prompt-1.1.2.tgz#85b2f93896c5bd9e9f2d6ff0627fa5af3dc00923" - integrity sha512-bpuBhROdrhuN3E7G/koAju0WjVw9/uQOG5Co5mokNj0MiOSBVZS1JTwM4zl55hu0WFmIEFvO9cU9sJQiBIYeIA== - dependencies: - ansi-escapes "^3.1.0" - cross-spawn "^6.0.5" - -password-prompt@^1.1.3: +password-prompt@^1.1.2, password-prompt@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/password-prompt/-/password-prompt-1.1.3.tgz#05e539f4e7ca4d6c865d479313f10eb9db63ee5f" integrity sha512-HkrjG2aJlvF0t2BMH0e2LB/EHf3Lcq3fNMzy4GYHcQblAvOl+QQji1Lx7WRBMqpVK8p+KR7bCg7oqAMXtdgqyw== @@ -6037,11 +6008,6 @@ path-is-absolute@^1.0.0: resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== -path-key@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" - integrity sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw== - path-key@^3.0.0, path-key@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" @@ -6662,7 +6628,7 @@ secure-json-parse@^2.4.0: resolved "https://registry.yarnpkg.com/secure-json-parse/-/secure-json-parse-2.7.0.tgz#5a5f9cd6ae47df23dba3151edd06855d47e09862" integrity sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw== -"semver@2 || 3 || 4 || 5", semver@^5.5.0: +"semver@2 || 3 || 4 || 5": version "5.7.2" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== @@ -6741,13 +6707,6 @@ setimmediate@^1.0.5: resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" integrity sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA== -shebang-command@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" - integrity sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg== - dependencies: - shebang-regex "^1.0.0" - shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" @@ -6755,11 +6714,6 @@ shebang-command@^2.0.0: dependencies: shebang-regex "^3.0.0" -shebang-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" - integrity sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ== - shebang-regex@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" @@ -7715,13 +7669,6 @@ which-typed-array@^1.1.11, which-typed-array@^1.1.13, which-typed-array@^1.1.2: gopd "^1.0.1" has-tostringtag "^1.0.0" -which@^1.2.9: - version "1.3.1" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" - integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== - dependencies: - isexe "^2.0.0" - which@^2.0.1, which@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" From 3483914fcd220cfcefedb27ecae7a42392c4f65e Mon Sep 17 00:00:00 2001 From: mshanemc Date: Tue, 2 Jan 2024 11:46:17 -0600 Subject: [PATCH 2/4] fix: broken links caught a doc bug --- messages/jwt.grant.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/messages/jwt.grant.md b/messages/jwt.grant.md index d0bb8458..aaa05457 100644 --- a/messages/jwt.grant.md +++ b/messages/jwt.grant.md @@ -20,7 +20,7 @@ We recommend that you set an alias when you log into an org. Aliases make it eas # examples -- Log into an org with username jdoe@example.org and on the default instance URL (https://login.salesforce.org). The private key is stored in the file /Users/jdoe/JWT/server.key and the command uses the connected app with consumer key (client id) 04580y4051234051. +- Log into an org with username jdoe@example.org and on the default instance URL (https://login.salesforce.com). The private key is stored in the file /Users/jdoe/JWT/server.key and the command uses the connected app with consumer key (client id) 04580y4051234051. <%= config.bin %> <%= command.id %> --username jdoe@example.org --jwt-key-file /Users/jdoe/JWT/server.key --client-id 04580y4051234051 From c257e82ec05464d724cf9bc5778681c70590658c Mon Sep 17 00:00:00 2001 From: mshanemc Date: Tue, 2 Jan 2024 11:46:30 -0600 Subject: [PATCH 3/4] chore: bump dev-scripts for link check fix --- package.json | 4 ++-- yarn.lock | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 233fb9f1..f0005648 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "devDependencies": { "@oclif/plugin-command-snapshot": "^5.0.5", "@salesforce/cli-plugins-testkit": "^5.1.3", - "@salesforce/dev-scripts": "^8.1.3", + "@salesforce/dev-scripts": "^8.2.0", "@salesforce/plugin-command-reference": "^3.0.58", "@salesforce/ts-sinon": "^1.4.19", "eslint-plugin-sf-plugin": "^1.17.0", @@ -219,7 +219,7 @@ "output": [] }, "link-check": { - "command": "node -e \"process.exit(process.env.CI ? 0 : 1)\" || linkinator \"**/*.md\" --skip \"CHANGELOG.md|node_modules|test/|confluence.internal.salesforce.com|%s\" --markdown --retry --directory-listing --verbosity error", + "command": "node -e \"process.exit(process.env.CI ? 0 : 1)\" || linkinator \"**/*.md\" --skip \"CHANGELOG.md|node_modules|test/|confluence.internal.salesforce.com|my.salesforce.com|%s\" --markdown --retry --directory-listing --verbosity error", "files": [ "./*.md", "./!(CHANGELOG).md", diff --git a/yarn.lock b/yarn.lock index db9a9cb7..53a215ae 100644 --- a/yarn.lock +++ b/yarn.lock @@ -963,10 +963,10 @@ resolved "https://registry.yarnpkg.com/@salesforce/dev-config/-/dev-config-4.1.0.tgz#e529576466d074e7a5f1441236510fef123da01e" integrity sha512-2iDDepiIwjXHS5IVY7pwv8jMo4xWosJ7p/UTj+lllpB/gnJiYLhjJPE4Z3FCGFKyvfg5jGaimCd8Ca6bLGsCQA== -"@salesforce/dev-scripts@^8.1.3": - version "8.1.3" - resolved "https://registry.yarnpkg.com/@salesforce/dev-scripts/-/dev-scripts-8.1.3.tgz#b33c53b4b648b5090322d1144c6852ca587d6eb7" - integrity sha512-mSWCab+uO3O2QNBCRJpKsHw/UYpOGpNFWT12BC85e+VyWBp4LTIAsssBKDY8czRI02K7NwiYaC34fNdP+yqrzA== +"@salesforce/dev-scripts@^8.2.0": + version "8.2.0" + resolved "https://registry.yarnpkg.com/@salesforce/dev-scripts/-/dev-scripts-8.2.0.tgz#e8ca6fd377b0e85ecf88baea727493a68c2154ee" + integrity sha512-dzVBmetyBe8IM1XJCBw83U5rC0TSwvXa1MPRRI0pmE/VeBqlfxM7rneKtlORCirz9n8SAvCiQvI4oJ/yWW5Quw== dependencies: "@commitlint/cli" "^17.1.2" "@commitlint/config-conventional" "^17.8.1" From 10a02b729d5114b1538beb95ec36860ab32a0342 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Tue, 2 Jan 2024 11:46:47 -0600 Subject: [PATCH 4/4] refactor: remove duplicate prop --- src/commands/org/login/web.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/commands/org/login/web.ts b/src/commands/org/login/web.ts index 135d5237..17d4f272 100644 --- a/src/commands/org/login/web.ts +++ b/src/commands/org/login/web.ts @@ -22,8 +22,7 @@ export default class LoginWeb extends AuthBaseCommand { public static readonly description = messages.getMessage('description'); public static readonly examples = messages.getMessages('examples'); public static readonly deprecateAliases = true; - public static aliases = ['force:auth:web:login', 'auth:web:login']; - public static readonly deprecateAliases = true; + public static readonly aliases = ['force:auth:web:login', 'auth:web:login']; public static readonly flags = { browser: Flags.string({