Skip to content

Commit

Permalink
fix: revert cli-ux dir renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Sep 1, 2023
1 parent cd8c1ee commit 27c1dd5
Show file tree
Hide file tree
Showing 40 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ See the [v3 migration guide](./guides/V3_MIGRATION.md) for an overview of breaki
CLI UX
=====

The [ux README](./src/ux/README.md) contains detailed usage examples of using the `ux` export.
The [ux README](./src/cli-ux/README.md) contains detailed usage examples of using the `ux` export.

Usage
=====
Expand Down
2 changes: 1 addition & 1 deletion flush.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('./lib/ux/flush').flush
module.exports = require('./lib/cli-ux/flush').flush
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 7 additions & 8 deletions src/ux/index.ts → src/cli-ux/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ import {ExitError} from './exit'
import {IPromptOptions} from './prompt'
import * as styled from './styled'
import {Table} from './styled'
export * from './styled/table'
import * as uxPrompt from './prompt'
import uxWait from './wait'
import {stdout} from './stream'
import {flush as _flush} from './flush'

const hyperlinker = require('hyperlinker')

export default class ux {
export class ux {
public static config: Config = config

public static get prompt(): typeof uxPrompt.prompt {
Expand Down Expand Up @@ -139,33 +138,33 @@ const warn = Errors.warn

export {
action,
ActionBase,
annotation,
anykey,
config,
Config,
confirm,
debug,
done,
error,
exit,
ExitError,
flush,
info,
IPromptOptions,
log,
progress,
prompt,
styledHeader,
styledJSON,
styledObject,
table,
Table,
trace,
tree,
url,
wait,
warn,
ActionBase,
config,
Config,
ExitError,
IPromptOptions,
Table,
}

const uxProcessExitHandler = async () => {
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions src/ux/prompt.ts → src/cli-ux/prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ async function _prompt(name: string, inputOptions: Partial<IPromptOptions> = {})
...inputOptions,
}
const passwordPrompt = require('password-prompt')

switch (options.type) {
case 'normal':
return normal(options)
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/ux/styled/json.ts → src/cli-ux/styled/json.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as chalk from 'chalk'

import ux from '../index'
import {ux} from '../index'

export default function styledJSON(obj: unknown): void {
const json = JSON.stringify(obj, null, 2)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/command.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {fileURLToPath} from 'url'
import * as chalk from 'chalk'
import {format, inspect} from 'util'
import ux from './ux'
import {ux} from './cli-ux'
import {Config} from './config'
import * as Errors from './errors'
import {PrettyPrintableError} from './errors'
Expand All @@ -27,7 +27,7 @@ import {CommandError} from './interfaces/errors'
import {boolean} from './flags'
import {requireJson} from './util'
import {PJSON} from './interfaces'
import {stdout, stderr} from './ux/stream'
import {stdout, stderr} from './cli-ux/stream'

const pjson = requireJson<PJSON>(__dirname, '..', 'package.json')

Expand Down
2 changes: 1 addition & 1 deletion src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import ModuleLoader from '../module-loader'
import {getHelpFlagAdditions} from '../help'
import {Command} from '../command'
import {CompletableOptionFlag, Arg} from '../interfaces/parser'
import {stdout} from '../ux/stream'
import {stdout} from '../cli-ux/stream'
import Performance from '../performance'
import {settings} from '../settings'
import {userInfo as osUserInfo} from 'node:os'
Expand Down
2 changes: 1 addition & 1 deletion src/execute.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {settings} from './settings'
import {flush} from './ux/flush'
import {flush} from './cli-ux/flush'
import {handle} from './errors/handle'
import run from './main'
import * as Interfaces from './interfaces'
Expand Down
2 changes: 1 addition & 1 deletion src/help/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {formatCommandDeprecationWarning, getHelpFlagAdditions, standardizeIDFrom
import {HelpFormatter} from './formatter'
import {toCached} from '../config/config'
import {Command} from '../command'
import {stdout} from '../ux/stream'
import {stdout} from '../cli-ux/stream'
export {CommandHelp} from './command'
export {standardizeIDFromArgv, loadHelpClass, getHelpFlagAdditions, normalizeArgv} from './util'

Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import * as Parser from './parser'
import {Hook} from './interfaces/hooks'
import {settings, Settings} from './settings'
import {HelpSection, HelpSectionRenderer, HelpSectionKeyValueTable} from './help/formatter'
import * as ux from './ux'
import {stderr, stdout} from './ux/stream'
import * as ux from './cli-ux'
import {stderr, stdout} from './cli-ux/stream'
import Performance from './performance'
import {flush} from './ux/flush'
import {flush} from './cli-ux/flush'

export {
Args,
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as Interfaces from './interfaces'
import {URL} from 'url'
import {Config} from './config'
import {getHelpFlagAdditions, loadHelpClass, normalizeArgv} from './help'
import {stdout} from './ux/stream'
import {stdout} from './cli-ux/stream'
import Performance from './performance'

const debug = require('debug')('oclif:main')
Expand Down
2 changes: 1 addition & 1 deletion src/parser/errors.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {CLIError} from '../errors'

import {flagUsages} from './help'
import {renderList} from '../ux/list'
import {renderList} from '../cli-ux/list'
import * as chalk from 'chalk'
import {OptionFlag, Flag} from '../interfaces'
import {uniq} from '../config/util'
Expand Down
2 changes: 1 addition & 1 deletion src/screen.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {stdout, stderr} from './ux/stream'
import {stdout, stderr} from './cli-ux/stream'
import {settings} from './settings'

function termwidth(stream: any): number {
Expand Down
2 changes: 1 addition & 1 deletion test/cli-ux/export.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ux, {Table, IPromptOptions, Config, ActionBase, ExitError} from '../../src/ux'
import {ux, Table, IPromptOptions, Config, ActionBase, ExitError} from '../../src/cli-ux'
import {expect} from 'chai'

type MyColumns = Record<string, unknown>
Expand Down
2 changes: 1 addition & 1 deletion test/cli-ux/fancy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {expect, fancy as base, FancyTypes} from 'fancy-test'
import {rm} from 'node:fs/promises'
import {join} from 'node:path'

import ux from '../../src/ux'
import {ux} from '../../src/cli-ux'

export {
expect,
Expand Down
2 changes: 1 addition & 1 deletion test/cli-ux/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ux from '../../src/ux'
import {ux} from '../../src/cli-ux'

import {expect, fancy} from './fancy'
const hyperlinker = require('hyperlinker')
Expand Down
2 changes: 1 addition & 1 deletion test/cli-ux/prompt.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as chai from 'chai'

const expect = chai.expect

import ux from '../../src/ux'
import {ux} from '../../src/cli-ux'

import {fancy} from './fancy'

Expand Down
2 changes: 1 addition & 1 deletion test/cli-ux/styled/header.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {expect} from 'chai'

import {stdout} from '../../../src'
import {stub, SinonStub} from 'sinon'
import ux from '../../../src/ux'
import {ux} from '../../../src/cli-ux'

describe('styled/header', () => {
let writeStub: SinonStub
Expand Down
2 changes: 1 addition & 1 deletion test/cli-ux/styled/object.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {expect, fancy} from 'fancy-test'

import ux from '../../../src/ux'
import {ux} from '../../../src/cli-ux'

describe('styled/object', () => {
fancy
Expand Down
2 changes: 1 addition & 1 deletion test/cli-ux/styled/progress.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {expect, fancy} from 'fancy-test'
import ux from '../../../src/ux'
import {ux} from '../../../src/cli-ux'

describe('progress', () => {
// single bar
Expand Down
2 changes: 1 addition & 1 deletion test/cli-ux/styled/table.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {expect, fancy} from 'fancy-test'
import ux from '../../../src/ux'
import {ux} from '../../../src/cli-ux'

describe('styled/table', () => {
describe('null/undefined handling', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/cli-ux/styled/table.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {expect, fancy} from 'fancy-test'

import ux from '../../../src/ux'
import {ux} from '../../../src/cli-ux'
import * as screen from '../../../src/screen'

/* eslint-disable camelcase */
Expand Down
2 changes: 1 addition & 1 deletion test/cli-ux/styled/tree.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {expect, fancy} from 'fancy-test'

import ux from '../../../src/ux'
import {ux} from '../../../src/cli-ux'

describe('styled/tree', () => {
fancy
Expand Down

0 comments on commit 27c1dd5

Please sign in to comment.