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(es6) : switch a new batch of modules to ES6 #119

Closed
wants to merge 1 commit into from
Closed
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: 2 additions & 1 deletion deno.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Bootstrap cliui with CommonJS dependencies:
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'
import wrap from 'wrap-ansi';
import stripAnsi from 'strip-ansi';

export default function ui (opts: UIOptions): UI {
return cliui(opts, {
Expand Down
3 changes: 2 additions & 1 deletion index.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Bootstrap cliui with CommonJS dependencies:
import { cliui } from './build/lib/index.js'
import { wrap, stripAnsi } from './build/lib/string-utils.js'
import wrap from 'wrap-ansi';
import stripAnsi from 'strip-ansi';

export default function ui (opts) {
return cliui(opts, {
Expand Down
6 changes: 3 additions & 3 deletions lib/cjs.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// 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')
import stringWidth from 'string-width'
import wrap from 'wrap-ansi'
import stripAnsi from 'strip-ansi'
export default function ui (opts: UIOptions) {
return cliui(opts, {
stringWidth,
Expand Down
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,17 @@
"author": "Ben Coe <[email protected]>",
"license": "ISC",
"dependencies": {
"string-width": "^4.2.0",
"strip-ansi": "^6.0.1",
"wrap-ansi": "^7.0.0"
"@rollup/plugin-commonjs": "^22.0.0",
"@types/wrap-ansi": "^8.0.1",
"string-width": "^5.1.2",
"strip-ansi": "^7.0.1",
"wrap-ansi": "^8.0.1"
},
"devDependencies": {
"@rollup/plugin-node-resolve": "^13.3.0",
"@types/node": "^14.0.27",
"@typescript-eslint/eslint-plugin": "^4.0.0",
"@typescript-eslint/parser": "^4.0.0",
"@wessberg/rollup-plugin-ts": "^1.3.2",
"c8": "^7.3.0",
"chai": "^4.2.0",
"chalk": "^4.1.0",
Expand All @@ -69,6 +71,7 @@
"mocha": "^9.1.3",
"rimraf": "^3.0.2",
"rollup": "^2.23.1",
"rollup-plugin-ts": "^2.0.7",
"standardx": "^7.0.0",
"typescript": "^4.0.0"
},
Expand Down
13 changes: 11 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import ts from '@wessberg/rollup-plugin-ts'
import ts from 'rollup-plugin-ts'
import nodeResolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'

const output = {
format: 'cjs',
Expand All @@ -12,6 +14,13 @@ export default {
input: './lib/cjs.ts',
output,
plugins: [
ts({ /* options */ })
ts({ /* options */ }),
nodeResolve(),
commonjs({
include: [
'node_modules/emoji-regex/index.js',
'node_modules/eastasianwidth/eastasianwidth.js'
]
})
]
}
Loading