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

fix(deno): import UIOptions from definitions #97

Merged
merged 3 commits into from Nov 8, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release-please.yml
Expand Up @@ -7,7 +7,7 @@ jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: bcoe/release-please-action@v2.5.5
- uses: bcoe/release-please-action@v2.6.0
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
3 changes: 2 additions & 1 deletion deno.ts
@@ -1,5 +1,6 @@
// Bootstrap cliui with CommonJS dependencies:
import { cliui, UIOptions, UI } from './build/lib/index.js'
import { cliui, UI } from './build/lib/index.js'
import type { UIOptions } from './build/lib/index.d.ts'
import { wrap, stripAnsi } from './build/lib/string-utils.js'

export default function ui (opts: UIOptions): UI {
Expand Down
6 changes: 3 additions & 3 deletions lib/index.ts
Expand Up @@ -12,7 +12,7 @@ const left = 3

export interface UIOptions {
width: number;
wrap: boolean;
wrap?: boolean;
rows?: string[];
}

Expand Down Expand Up @@ -47,7 +47,7 @@ export class UI {

constructor (opts: UIOptions) {
this.width = opts.width
this.wrap = opts.wrap
this.wrap = opts.wrap ?? true
this.rows = []
}

Expand Down Expand Up @@ -384,6 +384,6 @@ export function cliui (opts: Partial<UIOptions> = {}, _mixin: Mixin) {
mixin = _mixin
return new UI({
width: opts.width || getWindowWidth(),
wrap: opts.wrap !== false
wrap: opts.wrap
})
}