Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: deprecate ux module #1000

Merged
merged 2 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading