From 77f0651bd51dd9003e63ddc3be3538cee4b25674 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Tue, 2 Jan 2024 11:18:33 -0600 Subject: [PATCH] feat: deprecation warnings on renamed commands --- LICENSE.txt | 2 +- package.json | 2 +- src/commands/force/user/password/generate.ts | 8 ++++++-- src/commands/force/user/permset/assign.ts | 8 +++++--- src/commands/force/user/permsetlicense/assign.ts | 8 +++++--- 5 files changed, 18 insertions(+), 10 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/package.json b/package.json index 798cefe0..2c80020a 100644 --- a/package.json +++ b/package.json @@ -224,7 +224,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/src/commands/force/user/password/generate.ts b/src/commands/force/user/password/generate.ts index 3992c8b7..7bd0bfcc 100644 --- a/src/commands/force/user/password/generate.ts +++ b/src/commands/force/user/password/generate.ts @@ -5,7 +5,6 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ - import { arrayWithDeprecation, Flags, @@ -17,13 +16,18 @@ import { Messages } from '@salesforce/core'; import { ensureArray } from '@salesforce/kit'; import { GenerateResult, UserPasswordGenerateBaseCommand } from '../../../../baseCommands/user/password/generate.js'; -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/plugin-user', 'password.generate'); export class ForceUserPasswordGenerateCommand extends UserPasswordGenerateBaseCommand { public static readonly summary = messages.getMessage('summary'); public static readonly description = messages.getMessage('description'); public static readonly examples = messages.getMessages('examples'); + public static readonly state = 'deprecated'; + public static readonly deprecationOptions = { + to: 'org generate password', + }; + public static readonly hidden = true; public static readonly flags = { 'on-behalf-of': arrayWithDeprecation({ aliases: ['onbehalfof'], diff --git a/src/commands/force/user/permset/assign.ts b/src/commands/force/user/permset/assign.ts index b911b132..9e2ec67f 100644 --- a/src/commands/force/user/permset/assign.ts +++ b/src/commands/force/user/permset/assign.ts @@ -5,14 +5,12 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ - - import { Messages, Org } from '@salesforce/core'; import { Flags, arrayWithDeprecation, loglevel, orgApiVersionFlagWithDeprecations } from '@salesforce/sf-plugins-core'; import { ensureArray } from '@salesforce/kit'; import { PermsetAssignResult, UserPermSetAssignBaseCommand } from '../../../../baseCommands/user/permset/assign.js'; -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/plugin-user', 'permset.assign'); export class ForceUserPermSetAssignCommand extends UserPermSetAssignBaseCommand { @@ -20,6 +18,10 @@ export class ForceUserPermSetAssignCommand extends UserPermSetAssignBaseCommand public static readonly summary = messages.getMessage('summary'); public static readonly description = messages.getMessage('description.force'); public static readonly examples = messages.getMessages('examples.force'); + public static readonly state = 'deprecated'; + public static readonly deprecationOptions = { + to: 'org assign permset', + }; public static readonly flags = { 'perm-set-name': arrayWithDeprecation({ aliases: ['permsetname'], diff --git a/src/commands/force/user/permsetlicense/assign.ts b/src/commands/force/user/permsetlicense/assign.ts index be347ea2..1ec9e7dc 100644 --- a/src/commands/force/user/permsetlicense/assign.ts +++ b/src/commands/force/user/permsetlicense/assign.ts @@ -5,14 +5,12 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ - - import { Messages } from '@salesforce/core'; import { arrayWithDeprecation, Flags, loglevel, orgApiVersionFlagWithDeprecations } from '@salesforce/sf-plugins-core'; import { ensureArray } from '@salesforce/kit'; import { PSLResult, UserPermSetLicenseAssignBaseCommand } from '../../../../baseCommands/user/permsetlicense/assign.js'; -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/plugin-user', 'permsetlicense.assign'); export class ForceUserPermSetLicenseAssignCommand extends UserPermSetLicenseAssignBaseCommand { @@ -20,6 +18,10 @@ export class ForceUserPermSetLicenseAssignCommand extends UserPermSetLicenseAssi public static readonly summary = messages.getMessage('summary'); public static readonly description = messages.getMessage('description'); public static readonly examples = messages.getMessages('examples'); + public static readonly state = 'deprecated'; + public static readonly deprecationOptions = { + to: 'org assign permsetlicense', + }; public static readonly flags = { name: Flags.string({ char: 'n',