Releases: c4spar/deno-cliffy
Releases · c4spar/deno-cliffy
v0.19.1
v0.19.0
BREAKING CHANGES
-
keycode: refactor keycode module (#186) (4ac2719)
Before:
const key: KeyEvent = KeyCode.parse( "\x1b[A\x1b[B\x1b[C\x1b[D\x1b[E\x1b[F\x1b[H", );
After:
const key: KeyCode = parse("\x1b[A\x1b[B\x1b[C\x1b[D\x1b[E\x1b[F\x1b[H");
Features
-
command: add exitCode option to ValidationError (#201) (d4c0f12)
throw new ValidationError("Some validation error", { exitCode: 2 });
-
command: add enum type (#197) (36289a2)
cmd.type("log-level", new EnumType(["debug", "info", 0, 1])) .option("-L, --log-level <level:log-level>");
-
command: improve support for generic custom types (#191) (59b1a93)
const color = new EnumType(["red", "blue", "yellow"]); cmd.type("color", color) // you can pass the type .option<{ color: typeof color }>("-c, --color <name:color>");
-
command: add upgrade command (#203) (348f743)
// single registry with default options cmd.command( "upgrade", new UpgradeCommand({ provider: new DenoLandProvider(), }), ); // multi registry with custom options cmd.command( "upgrade", new UpgradeCommand({ main: "cli.ts", args: ["--allow-net", "--unstable"], provider: [ new DenoLandProvider({ name: "cliffy" }), new NestLandProvider({ name: "cliffy" }), new GithubProvider({ repository: "c4spar/deno-cliffy" }), ], }), );
-
command: add values method to types to show possible values in help text (#202) (143eb1b, 045c56e)
-
command,flags: add integer type (#190) (2cc7e57)
cmd.option("-a, --amount <amount:integer>");
-
keypress: add keypress module (#187) (5acf5db)
// promise const event: KeyPressEvent = await keypress(); // events keypress().addEventListener((event: KeyPressEvent) => { console.log("event:", event); if (event.ctrlKey && event.key === "c") { keypress().dispose(); } }); // async iterator for await (const event: KeyPressEvent of keypress()) { console.log("event:", event); if (event.ctrlKey && event.key === "c") { break; } }
-
prompt: add id option to automatically save suggestions to local storage (#204) (28f25bd)
await Input.prompt({ message: "Enter your name", id: "<local-storage-key>", });
Bug Fixes
- command,flags: value handler not called for default value if option is not defined on commandline (ef3df5e)
- keycode: fix esc key and sequence property for escaped keys (b9eb39b)
- table: fix getBody and hasHeaderBorder methods (2d65cc8)
Code Refactoring
- command: add CompleteHandlerResult type (#200) (ade3c3d)
- command: remove unnecessary dependency (#199) (b26f07c)
- flags: refactor number type (#196) (9b57f54)
- flags: refactor error message for boolean and number types (#189) (2a19c34)
- keycode: refactor special key handling (7aaaec4)
- prompt: enable raw mode only if stdin is a tty (#183) (83c644a)
Chore
- ci: upgrade to [email protected] (7a8e3dd)
- upgrade: deno/std v0.97.0 (#207) (37dc946)
Unit/Integration Tests
- flags: fix value tests (5ec86e8)
- prompt: add integration tests (#172) (0031490)
- table: add more tests (3dd6315)
Documentation Updates
v0.18.2
Features
Bug Fixes
- ansi: make getCursorPosition options optional (#164) (2e7c35d)
- command: fix typo in completions command help (#175) (c9f110a)
- command: fix shell completion of default types (#168) (e976378)
- command: command alias not working (#167) (45fc678)
Chore
- fix lint errors (#176) (ebccd05)
- ci: add release workflow (#173) (d7f24dc)
- ci: fix nightly tests (#171) (6e55b57)
- upgrade: deno/std v0.93.0 (#177) (d758012)
Unit/Integration Tests
- ansi: add more tests (#163) (e91d651)
- command: add integration tests (#169) (37b07e9)
- command: add more tests (#166) (298d5e0)
Documentation Updates
v0.18.1
v0.18.0
Features
- command: add improved support for generic types (#151, #157, #159) (f43a7f1, e143799, 406afc2)
- command: add globalOption, globalType, globalComplete and globalEnv alias
method's (#152) (e1a6bb2) - prompt: improve search and auto suggestions (#153) (6597205)
Bug Fixes
Chore
- egg: ignore .DS_Store files (84fba89)
Documentation Updates
v0.17.2
v0.17.1
Bug Fixes
- command: actions on hyphenated options won't run (#144) (1ee0366)
- prompt: clear stdout on ctrl+c (#142) (1e15d38, a6b5d36)
- prompt: disabled item gets selected when it's the first option (#137) (f5c9be5)
Code Refactoring
- use object spread instead of Object.assign (22681f0)
- command,flags: make options.flags an array (eeac740)
Chore
Documentation Updates
v0.17.0
Features
- ansi: add a chainable (chalk like) ansi colors module (#128) (f2d8c93)
- command: make generated help customizable (#134) (0cfceb7)
- command,flags: add did-you-mean support for improved error messages (#131) (afd8697)
- prompt: add cbreak option to support custom signal handling (#106) (a637b54)
- prompt: add auto suggestion support to Input, Number, Confirm and List prompt's (7dd6660, a67dc53)
- prompt: add search option to Select and Checkbox prompt (7d09739, a67dc53)
- prompt: add info option to all prompts with a select or suggestions list (c7bfce6)
- prompt: add pageup and pagedown keys to all prompts with a select or suggestions list (44575e3)
Code Refactoring
- flags, command: improve error handling and unify error messages (#133) (8c7789b)
- command: refactor hints formatting in help output (#130) (ed588e2)
- prompt: refactor indent option (ad7923f)
- prompt: refactor internal keypress event handling (37fcbaf)
Documentation Updates
- update documentations and add new example gifs (4dc9991, 87223aa, df45bd8, 5d060b0, 99153ba, 2383f5b)
BREAKING CHANGES
v0.16.0
Features
Bug Fixes
- keycode: f1-f4 + shift returns undefined key name (#111) (112c0b5)
- prompt: fix default value of select prompt (#123) (3a97617)
- prompt: wrong cursor position on windows (#114) (0e14b51)
- prompt: remove async modifer from abstract method declartion that breaks cliffy on deno 1.6 (#122) (63351d0)
Code Refactoring
- command: remove duplication description from completions command (#118) (d116c73)
- prompt: refactor prompt's (#122, #120, #119, #117) (63351d0, 2fda6e0, b5ecced, f4ca0bb)