From 00d2d8a7a94a2a9a194c9173702a35f1423d0776 Mon Sep 17 00:00:00 2001 From: Eric Willhoit Date: Tue, 25 Feb 2025 13:53:01 -0600 Subject: [PATCH 1/2] feat: add a preview state for commands --- messages/messages.md | 4 ++++ src/sfCommand.ts | 12 ++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/messages/messages.md b/messages/messages.md index 375cd10b3..29624de55 100644 --- a/messages/messages.md +++ b/messages/messages.md @@ -107,6 +107,10 @@ Try this: This command is currently in beta. Any aspect of this command can change without advanced notice. Don't use beta commands in your scripts. +# warning.CommandInPreview + +This command is currently in preview. Preview commands will likely change before shipping, use at your own risk. Don't use preview commands in your scripts. + # error.InvalidArgumentFormat Error in the following argument diff --git a/src/sfCommand.ts b/src/sfCommand.ts index 1ffa1137e..4f659fa8d 100644 --- a/src/sfCommand.ts +++ b/src/sfCommand.ts @@ -327,9 +327,17 @@ export abstract class SfCommand extends Command { ...(this.statics.requiresProject ? [assignProject()] : []), ]); - if (this.statics.state === 'beta') { - this.warn(messages.getMessage('warning.CommandInBeta')); + switch (this.statics.state) { + case 'beta': + this.warn(messages.getMessage('warning.CommandInBeta')); + break; + case 'preview': + this.warn(messages.getMessage('warning.CommandInPreview')); + break; + default: + break; } + // eslint-disable-next-line @typescript-eslint/require-await this.lifecycle.onWarning(async (warning: string) => { this.warningsToFlush.push(warning); From c470d85f5b06e202990b4f9df795e4d17a54733a Mon Sep 17 00:00:00 2001 From: Willhoit Date: Tue, 25 Feb 2025 15:25:42 -0600 Subject: [PATCH 2/2] chore: wording Co-authored-by: Juliet Shackell <63259011+jshackell-sfdc@users.noreply.github.com> --- messages/messages.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/messages/messages.md b/messages/messages.md index 29624de55..21f3d0729 100644 --- a/messages/messages.md +++ b/messages/messages.md @@ -109,7 +109,7 @@ This command is currently in beta. Any aspect of this command can change without # warning.CommandInPreview -This command is currently in preview. Preview commands will likely change before shipping, use at your own risk. Don't use preview commands in your scripts. +This command is currently in developer preview. Developer preview commands will likely change before shipping, use at your own risk. Don't use developer preview commands in your scripts. # error.InvalidArgumentFormat