From f04f3439bc78114c7e90f82ff56f5acf16268ea8 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Sun, 8 Nov 2020 18:37:47 -0500 Subject: [PATCH] fix(deno): import UIOptions from definitions (#97) --- .github/workflows/release-please.yml | 2 +- deno.ts | 3 ++- lib/index.ts | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index b363443..67ddab9 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -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 }} diff --git a/deno.ts b/deno.ts index 8adbc03..a94e49f 100644 --- a/deno.ts +++ b/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 { diff --git a/lib/index.ts b/lib/index.ts index db5052e..ff31794 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -12,7 +12,7 @@ const left = 3 export interface UIOptions { width: number; - wrap: boolean; + wrap?: boolean; rows?: string[]; } @@ -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 = [] } @@ -384,6 +384,6 @@ export function cliui (opts: Partial = {}, _mixin: Mixin) { mixin = _mixin return new UI({ width: opts.width || getWindowWidth(), - wrap: opts.wrap !== false + wrap: opts.wrap }) }