Skip to content

Releases: c4spar/deno-cliffy

v0.19.1

30 May 21:02
Compare
Choose a tag to compare

Bug Fixes

Documentation Updates

  • changelog: fix commit links (8d8601f)

v0.19.0

26 May 16:55
Compare
Choose a tag to compare

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: allow numbers for completions (#195) (f30b3af)

  • command,flags: add integer type (#190) (2cc7e57)

    cmd.option("-a, --amount <amount:integer>");
  • keycode: add code property to parse result (#182) (366683f)

  • 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

Unit/Integration Tests

Documentation Updates

  • command,flags: add integer type to readme (6aec3db)
  • command: fix typo (a965ea3)
  • command: describe getHelp and showHelp (0e674c8)
  • command: documentation fixes (6442ae7)

v0.18.2

13 Apr 23:03
Compare
Choose a tag to compare

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

Unit/Integration Tests

Documentation Updates

v0.18.1

15 Mar 18:35
Compare
Choose a tag to compare

v0.18.1 (2021-03-15)

Bug Fixes

  • prompt: adopt prompts to work with enabled ts option useDefineForClassFields (#162) (ac6ce0e)

Chore

Documentation Updates

v0.18.0

07 Mar 18:51
Compare
Choose a tag to compare

Features

Bug Fixes

  • command: help callback does not work with global options and commands (#149) (0972cc0)

Chore

  • egg: ignore .DS_Store files (84fba89)

Documentation Updates

v0.17.2

07 Feb 23:34
Compare
Choose a tag to compare

Features

Bug Fixes

  • command: option action not executed for options with no value (#148) (c436221)

v0.17.1

07 Feb 12:29
Compare
Choose a tag to compare

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

11 Jan 18:35
Compare
Choose a tag to compare

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

BREAKING CHANGES

  • ansi: re-write ansi_escape module and rename to ansi (#124) (41a39d0)
  • command: rename help method to showHelp (0cfceb7)

v0.16.0

09 Dec 22:58
Compare
Choose a tag to compare

Features

  • table: add static Table.chars() method to set global default table characters (#107) (fec09df)

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

Chore

v0.15.0

24 Oct 21:47
Compare
Choose a tag to compare

Features

  • flags,command: add support for dotted options (#104) (9cd1191)
  • flags,command: improve support for negatable options (#103) (220dcea)