Skip to content

Releases: c4spar/deno-cliffy

v0.23.1

26 Apr 18:22
d803416
Compare
Choose a tag to compare

Bug Fixes

  • command: add missing default types for the FileType type (#361) (559bb4a)
  • command: only first argument of rest arguments is completed with zsh completions (#359) (dc0c1de)
  • command: first argument is also completed on index two (#358) (1784eef)
  • command: zsh completion action not called for arguments (#357) (1a62fe8)
  • command: fix option types for useRawArgs (#356) (7acac27)

Chore

v0.23.0

10 Apr 22:38
684ac10
Compare
Choose a tag to compare

BREAKING CHANGES

  • command: infer types and option names (#312) (efcad62)

    With this release the Command class is now strict by default. All names and types from option, argument and environment variable definitions will be now automatically inferred 🚀

    Previously it was necessary to pass the void type as first generic argument to the command class Command<void> (which is now the default) to enable strict typings.
    The name and the type could than be specified by passing them to the option, arguments or env methods:

    new Command<void>()
      .option<{ foo?: string }>("--foo <value:string>")
      .arguments<[string, string?]>("<input> [output]")

    This is no longer necessary. Names and types are now automatically inferred from the definitions "--foo <value:string>" and you can define it just like the following example. Options and arguments will be automatically typed.

    new Command()
      .option("--foo <value:string>")
      .arguments("<input> [output]")

    Dotted options, custom types like EnumType and options like default, value and prefix are supported as well.

    To disable strict types you can pass the any type to the command class Command<any> which was previously the default._

  • command: fix allowEmpty and disable it by default (#352) (c17718d)

    Previously .allowEmpty() was enabled by default, which means if an required option was registered no error was thrown if the command was called without any arguments.
    .allowEmpty() is now disabled by default and has to be enabled manually.

Features

  • command: add new file type with path completion support (#353) (969f2dd)

    If the CompletionCommand is registered, path completions will be enabled for arguments and options with the file type. The new file type can be used as following:

    new Command()
      .option("--input-file <path:file>", "The input file.")`
  • command: show long version format with long --version option (#343) (079b4ba)

  • command: show hint in help if a new version is available (#342) (bc9cfbf)

  • command,flags: add support for wildcard options (#351) (e604e44)

    Wildcard options can be used to allow options with dynamic names. You can register them as following:

    new Command()
      .option("--foo.*", "This options allows any name on the foo option.")
      .option("--bar.*.*", "This options allows any nested name on the bar option.")

    Following options are valid options for the --foo.* option:

    • --foo.bar
    • --foo.baz

    Following options are valid options for the --bar.*.* option:

    • --foo.bar.baz
    • --foo.beep.boop
  • flags: add ignoreDefaults option (#349) (22178af)

  • prompt: add n & p keys for next & previous and left & right for next & prev page (#345) (d568f37)

  • prompt: add hideDefault option (#344) (dc460b6)

Bug Fixes

  • suggestions value is always lower cased (#346) (5d1e3a7)
  • command: default value from option overrides env var (#350) (2cd7735)
  • prompt: prompt is not rendered properly if content is longer than the terminal (#347) (56755e1)

Code Refactoring

  • flags: infer option types in option callback method (#348) (483bbf7)
  • prompt: improve generic types for prompt methd (#335) (42e21f6)

Documentation Updates

Chore

v0.22.2

16 Mar 22:58
2b0b63e
Compare
Choose a tag to compare

Features

  • command: add support to show additional information in help text (#300) (e32f826)
  • command: add support for enum's in EnumType (#316) (d71071e)
  • prompt: add support for path completion and dynamic suggestions (#306) (0be6da7)

Bug Fixes

  • command: only first missing required variadic option throws an error (#331) (cf487de)
  • command: integer argument with value 0 is ignored (#329) (11b824c)
  • prompt: checkbox and select prompt fails with only one disabled option (#328) (683f260)
  • table: chinese characters are not aligned correctly (#330) (e31b680)

Performance Improvements

  • table: improve performance for tables without col and row span (#327) (29bcfd6)

Code Refactoring

  • command: change return type of action handler to unknown (#315) (04e6917)

Chore

Documentation Updates

  • prompt: add info for required --unstable flag (beca790)

v0.20.1

01 Nov 15:03
a7d5013
Compare
Choose a tag to compare

Code Refactoring

  • command: preparation for the new typescript option --useUnknownInCatchVariables (#294) (864e915)

Chore

v0.20.0

23 Oct 16:34
f6c3a3a
Compare
Choose a tag to compare

Features

  • command: add value option for env vars (#290) (e5b2b2b)

Bug Fixes

  • command: help text shows always long description for env vars (#289) (6201e28)
  • command: fix description column definition in help text (#286) (bf727fb)
  • command: highlight command usage in help text (#288) (7181724)

Chore

BREAKING CHANGES

  • command: execute command action after option action is called (#285) (9170a65)

    Prior to v0.20.0, when an option action was executed, the command action was not executed. Since v0.20.0, this has changed. The command action is now executed by default. Only standalone options do not execute the command actions (for more informations see the docs).

v0.19.6

23 Sep 21:23
46a2b83
Compare
Choose a tag to compare

Features

Bug Fixes

  • prompt: key symbols in prompt info are hardcoded (#274) (a6138b2)

Documentation Updates

v0.19.5

12 Aug 20:52
48079f4
Compare
Choose a tag to compare

Features

  • command: support import map in upgrade command (#265) (b400131)
  • command: add support for required env vars (#261) (ee69526)
  • command: make parsed environment variables available via command options (#263) (102161e)
  • command: add prefix to environment variable options (#268) (44c80c8)
await new Command<void>()
  .env<{ outputFile?: string }>(
    "CC_OUTPUT_FILE=<value:string>",
    "The output file.",
    { prefix: "CC_" },
  )
  .option<{ outputFile?: string }>(
    "--output-file <value:string>",
    "The output file.",
  )
  .action((options) => console.log(options.outputFile))
  .parse();
$ CC_OUTPUT_FILE=foo.txt deno run example.ts
foo.txt
$ CC_OUTPUT_FILE=foo.txt deno run example.ts --output-file bar.txt
bar.txt

Bug Fixes

  • command: output of --version should end with a new line (#256) (8107875)

Code Refactoring

  • command: refactor executable sub-commands (#259) (a13c79f)
  • command: remove extra new line from getHelp() and completion generator methods (#257) (99ccc2a)
  • table: use console.log to render output (#258) (4f05fad)

Chore

Documentation Updates

  • update readme's (#269) (83644f9)
  • command: update docs for environment variables (f4cee28, 9d025fc)
  • command: fix incorrectly import module in example (#262) (3e62ad6)
  • command: update docs for executable sub commands (0b2f3d1)

v0.19.4

26 Jul 23:03
5fc11b8
Compare
Choose a tag to compare

Bug Fixes

  • command,flags: equals sign not supported in option value (#253) (b074cb3)
  • command,flags: values starting with '-' not supported (#251) (ab598bf)
  • command,flags: required option value with default value is not required (#249) (0d3f8fa)
  • flags: allow collecting options by default if no flags are set (#252) (24e3f46)

Chore

v0.19.3

17 Jul 16:16
855a7b8
Compare
Choose a tag to compare

Features

Bug Fixes

  • command: external commands not working on windows (#224) (84ac5be)
  • command: remove v prefix from version in generated help text (#231) (f882abd)
  • command,flags: don't normalize arguments if stopEarly is enabled (#246) (2ea4938)
  • prompt: use exit code 130 for ctrl+c (#242) (2c014d7)

Code Refactoring

  • command: export github upgrade provider in upgrade/mod.ts (#232) (39a8075)
  • prompt: replace deprecated Deno.copy with copy method from std/io (#243) (f95b317)

Chore

  • ci: use denoland/setup-deno action (#219) (d93ad7d)
  • ci: use latest deno version in release action (36c1c07)
  • ci: upgrade eggs to v0.3.8 (1efd809)
  • egg: add keypress module to egg.yaml (fee6ed4)
  • upgrade: deno/std v0.101.0 (#244) (534094b)

Documentation Updates

  • ansi: fix functional example command (#235) (f3103b9)
  • command: fix type of args in stopEarly example (#240) (b909bc6)

v0.19.2

16 Jun 22:08
Compare
Choose a tag to compare

Features

Bug Fixes

  • prompt: unicode characters are not displayed properly on windows (#216) (fb6a22e)

Code Refactoring

  • flags: show better error message if an option occurs to many times (#215) (8b0dfcb)

Documentation Updates

  • docs: add keypress module to cliffy.io (15fe4e0)

Chore