-
Notifications
You must be signed in to change notification settings - Fork 43
feat!: cliui is now ESM only #165
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
4b0fcb4
feat!: yargs is now ESM only
shadowspawn dd06d6a
Update Node.js target versions for CI
shadowspawn 479f7af
Remove stale esm test from CI
shadowspawn 86f4bf3
Update Deno with wrapping
shadowspawn 96a961f
Update main entry point
shadowspawn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
---|---|---|
@@ -1,14 +1,14 @@ | ||
// 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 stringWidth from 'string-width' | ||
import stripAnsi from 'strip-ansi' | ||
import wrapAnsi from 'wrap-ansi' | ||
|
||
export default function ui (opts: UIOptions): UI { | ||
return cliui(opts, { | ||
stringWidth: (str: string) => { | ||
return [...str].length | ||
}, | ||
stringWidth, | ||
stripAnsi, | ||
wrap | ||
wrap: wrapAnsi | ||
}) | ||
} |
This file contains hidden or 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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
// Bootstrap cliui with CommonJS dependencies: | ||
import { cliui } from './build/lib/index.js' | ||
import { wrap, stripAnsi } from './build/lib/string-utils.js' | ||
import stringWidth from 'string-width' | ||
import stripAnsi from 'strip-ansi' | ||
import wrapAnsi from 'wrap-ansi' | ||
|
||
export default function ui (opts) { | ||
return cliui(opts, { | ||
stringWidth: (str) => { | ||
return [...str].length | ||
}, | ||
stringWidth, | ||
stripAnsi, | ||
wrap | ||
wrap: wrapAnsi | ||
}) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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 |
---|---|---|
|
@@ -2,30 +2,21 @@ | |
"name": "cliui", | ||
"version": "8.0.1", | ||
"description": "easily create complex multi-column command-line-interfaces", | ||
"main": "build/index.cjs", | ||
"main": "build/index.mjs", | ||
"exports": { | ||
".": [ | ||
{ | ||
"import": "./index.mjs", | ||
"require": "./build/index.cjs" | ||
}, | ||
"./build/index.cjs" | ||
] | ||
".": "./index.mjs" | ||
}, | ||
"type": "module", | ||
"module": "./index.mjs", | ||
"scripts": { | ||
"check": "standardx '**/*.ts' && standardx '**/*.js' && standardx '**/*.cjs'", | ||
"fix": "standardx --fix '**/*.ts' && standardx --fix '**/*.js' && standardx --fix '**/*.cjs'", | ||
"pretest": "rimraf build && tsc -p tsconfig.test.json && cross-env NODE_ENV=test npm run build:cjs", | ||
"test": "c8 mocha ./test/*.cjs", | ||
"test:esm": "c8 mocha ./test/esm/cliui-test.mjs", | ||
"check": "standardx '**/*.ts' && standardx '**/*.js'", | ||
"fix": "standardx --fix '**/*.ts' && standardx --fix '**/*.js'", | ||
"pretest": "rimraf build && tsc -p tsconfig.test.json", | ||
"test": "c8 mocha ./test/*.mjs", | ||
"postest": "check", | ||
"coverage": "c8 report --check-coverage", | ||
"precompile": "rimraf build", | ||
"compile": "tsc", | ||
"postcompile": "npm run build:cjs", | ||
"build:cjs": "rollup -c", | ||
"prepare": "npm run compile" | ||
}, | ||
"repository": "yargs/cliui", | ||
|
@@ -49,35 +40,33 @@ | |
"author": "Ben Coe <[email protected]>", | ||
"license": "ISC", | ||
"dependencies": { | ||
"string-width": "^4.2.0", | ||
"strip-ansi": "^6.0.1", | ||
"wrap-ansi": "^7.0.0" | ||
"string-width": "^7.2.0", | ||
"strip-ansi": "^7.1.0", | ||
"wrap-ansi": "^9.0.0" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^14.0.27", | ||
"@types/node": "^22.13.10", | ||
"@typescript-eslint/eslint-plugin": "^4.0.0", | ||
"@typescript-eslint/parser": "^4.0.0", | ||
"c8": "^7.3.0", | ||
"chai": "^4.2.0", | ||
"chalk": "^4.1.0", | ||
"c8": "^10.1.3", | ||
"chai": "^5.2.0", | ||
"chalk": "^5.4.1", | ||
"cross-env": "^7.0.2", | ||
"eslint": "^7.6.0", | ||
"eslint-plugin-import": "^2.22.0", | ||
"eslint-plugin-node": "^11.1.0", | ||
"gts": "^3.0.0", | ||
"mocha": "^10.0.0", | ||
"rimraf": "^3.0.2", | ||
"rollup": "^2.23.1", | ||
"rollup-plugin-ts": "^3.0.2", | ||
"gts": "^6.0.2", | ||
"mocha": "^11.1.0", | ||
"rimraf": "^6.0.1", | ||
"standardx": "^7.0.0", | ||
"typescript": "^4.0.0" | ||
"typescript": "^5.8.2" | ||
}, | ||
"files": [ | ||
"build", | ||
"index.mjs", | ||
"!*.d.ts" | ||
], | ||
"engines": { | ||
"node": ">=12" | ||
"node": ">=20" | ||
} | ||
} |
This file contains hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm bumping into some issues in yargs with
Node@<20.19.0
, should we consider making this our base engine version?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is 20.19.0 around something in particular? require(esm) ?
In which case, we might want a minimum for node 22 as well.
I am not against the idea of minimum versions within a major when there is a reason. (I need to remind myself that the early minor versions were before LTS status, so clearly not all equal! 😆 )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't notice this had been merged when I made this command. No reply necessary!