Skip to content

Commit

Permalink
feat: deprecate ux module (#1000)
Browse files Browse the repository at this point in the history
* feat: deprecate ux module

* chore: deprecate individual methods
  • Loading branch information
mdonnalley authored Mar 5, 2024
1 parent 5cc9671 commit 503c7ae
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/cli-ux/action/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
6 changes: 6 additions & 0 deletions src/cli-ux/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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
69 changes: 69 additions & 0 deletions src/cli-ux/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down
3 changes: 3 additions & 0 deletions src/cli-ux/prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/cli-ux/styled/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<T extends Record<string, unknown>> {
columns: (table.Column<T> & {key: string; maxWidth?: number; width?: number})[]

Expand Down
3 changes: 3 additions & 0 deletions src/cli-ux/write.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 503c7ae

Please sign in to comment.