Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor!: tsc/ESM/Deno support (#82)
- Loading branch information
Showing
17 changed files
with
416 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"overrides": [ | ||
{ | ||
"files": "*.ts", | ||
"parser": "@typescript-eslint/parser", | ||
"rules": { | ||
"no-unused-vars": "off", | ||
"no-useless-constructor": "off", | ||
"@typescript-eslint/no-unused-vars": "error", | ||
"@typescript-eslint/no-useless-constructor": "error" | ||
} | ||
} | ||
], | ||
"parserOptions": { | ||
"ecmaVersion": 2018, | ||
"sourceType": "module" | ||
}, | ||
"plugins": [ | ||
"@typescript-eslint/eslint-plugin" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ node_modules | |
.nyc_output | ||
package-lock.json | ||
coverage | ||
|
||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Bootstrap cliui with CommonJS dependencies: | ||
import { cliui, UIOptions, UI } from './build/lib/index.js' | ||
import { wrap, stripAnsi } from './build/lib/string-utils.js' | ||
|
||
export default function ui (opts: UIOptions): UI { | ||
return cliui(opts, { | ||
stringWidth: (str: string) => { | ||
return [...str].length | ||
}, | ||
stripAnsi, | ||
wrap | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Bootstrap cliui with CommonJS dependencies: | ||
import { cliui } from './build/lib/index.js' | ||
import { wrap, stripAnsi } from './build/lib/string-utils.js' | ||
|
||
export default function ui (opts) { | ||
return cliui(opts, { | ||
stringWidth: (str) => { | ||
return [...str].length | ||
}, | ||
stripAnsi, | ||
wrap | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Bootstrap cliui with CommonJS dependencies: | ||
import { cliui, UIOptions } from './index.js' | ||
const stringWidth = require('string-width') | ||
const stripAnsi = require('strip-ansi') | ||
const wrap = require('wrap-ansi') | ||
export default function ui (opts: UIOptions) { | ||
return cliui(opts, { | ||
stringWidth, | ||
stripAnsi, | ||
wrap | ||
}) | ||
} |
Oops, something went wrong.