From 503c7ae39aa1e42cebf79bdd98c05d85c3721309 Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Tue, 5 Mar 2024 14:49:01 -0700 Subject: [PATCH] feat: deprecate ux module (#1000) * feat: deprecate ux module * chore: deprecate individual methods --- src/cli-ux/action/base.ts | 3 ++ src/cli-ux/config.ts | 6 ++++ src/cli-ux/index.ts | 69 ++++++++++++++++++++++++++++++++++++++ src/cli-ux/prompt.ts | 3 ++ src/cli-ux/styled/table.ts | 3 ++ src/cli-ux/write.ts | 3 ++ 6 files changed, 87 insertions(+) diff --git a/src/cli-ux/action/base.ts b/src/cli-ux/action/base.ts index 9b738dd8b..b92fa1abe 100644 --- a/src/cli-ux/action/base.ts +++ b/src/cli-ux/action/base.ts @@ -11,6 +11,9 @@ export interface ITask { export type ActionType = 'debug' | 'simple' | 'spinner' +/** + * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999 + */ export class ActionBase { std: 'stderr' | 'stdout' = 'stderr' diff --git a/src/cli-ux/config.ts b/src/cli-ux/config.ts index b60d8f31c..a2c9ddaa7 100644 --- a/src/cli-ux/config.ts +++ b/src/cli-ux/config.ts @@ -23,6 +23,9 @@ const actionType = const Action = actionType === 'spinner' ? spinner : simple +/** + * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999 + */ export class Config { action: ActionBase = new Action() @@ -57,5 +60,8 @@ function fetch() { return globals[major] } +/** + * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999 + */ export const config: Config = fetch() export default config diff --git a/src/cli-ux/index.ts b/src/cli-ux/index.ts index ab626f9ce..d85026a59 100644 --- a/src/cli-ux/index.ts +++ b/src/cli-ux/index.ts @@ -147,28 +147,97 @@ const { const {error, exit, warn} = Errors export { + /** + * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999 + */ action, + /** + * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999 + */ annotation, + /** + * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999 + */ anykey, + /** + * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999 + */ confirm, + /** + * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999 + */ debug, + /** + * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999 + */ done, + /** + * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999 + */ error, + /** + * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999 + */ exit, + /** + * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999 + */ flush, + /** + * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999 + */ info, + /** + * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999 + */ log, + /** + * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999 + */ logToStderr, + /** + * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999 + */ progress, + /** + * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999 + */ prompt, + /** + * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999 + */ styledHeader, + /** + * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999 + */ styledJSON, + /** + * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999 + */ styledObject, + /** + * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999 + */ table, + /** + * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999 + */ trace, + /** + * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999 + */ tree, + /** + * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999 + */ url, + /** + * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999 + */ wait, + /** + * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999 + */ warn, } diff --git a/src/cli-ux/prompt.ts b/src/cli-ux/prompt.ts index 84f25dc21..0b7560e23 100644 --- a/src/cli-ux/prompt.ts +++ b/src/cli-ux/prompt.ts @@ -3,6 +3,9 @@ import chalk from 'chalk' import * as Errors from '../errors' import {config} from './config' +/** + * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999 + */ export interface IPromptOptions { default?: string prompt?: string diff --git a/src/cli-ux/styled/table.ts b/src/cli-ux/styled/table.ts index c7087533a..a43f3cb47 100644 --- a/src/cli-ux/styled/table.ts +++ b/src/cli-ux/styled/table.ts @@ -11,6 +11,9 @@ import {stdtermwidth} from '../../screen' import {capitalize, sumBy} from '../../util/util' import write from '../write' +/** + * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999 + */ class Table> { columns: (table.Column & {key: string; maxWidth?: number; width?: number})[] diff --git a/src/cli-ux/write.ts b/src/cli-ux/write.ts index aa85d2b0f..56c195270 100644 --- a/src/cli-ux/write.ts +++ b/src/cli-ux/write.ts @@ -6,6 +6,9 @@ const stderr = (msg: string): void => { process.stderr.write(msg) } +/** + * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999 + */ export default { stderr, stdout,