Skip to main content
Module

x/cliffy/CHANGELOG.md

Command line framework for deno 🦕 Including Commandline-Interfaces, Prompts, CLI-Table, Arguments Parser and more...
Extremely Popular
Go to Latest
File

v0.14.1 (2020-10-13)

Bug Fixes

  • command: quotes and brackets in option description breaks shell-completion (#82) (7907413)
  • command: only generate argument completions for types that have completions (#81) (1998108, 8040abf)

Chore

v0.14.0 (2020-09-02)

Features

  • command: add bash completions support (#78) (09c0fc2)
  • command: implement argument types validation (#70) (01acb53)

Bug Fixes

  • command: fix complete command error “No type registered with name: action” (#77) (f2c6bea)
  • command: fix shell completion bug which occurs when an option has only one flag (9fbef68)
  • command: fix shell completion bug which occurs when the conflicts option is defined without dashes (2dfa8b1)
  • command: default command ‘help’ not found error on completions command (580bacd)
  • command: fix typo in error message (2fa9d29)

Code Refactoring

  • use stripColor from deno/std (56bcc89)

Style

  • command: fix jsdoc formatting (230cac7)

Chore

  • fix test workflow name (0e683c1)
  • use deno fmt for code formatting (#71) (e7dd856)
  • ci: run shellcheck on bash/zsh completion scripts (#79) (40f2dc9)
  • ci: add deno lint step (e48f293)
  • ci: split workflows, add nightly test and lint workflow (#72) (d13af64)
  • ci: update deno version to v1.3.2 (a8d6a60)
  • lint: fix lint errors (25d8e24, 92c84ac)
  • upgrade: deno/std v0.67.0 (43204a5)

Documentation Updates

  • add contribution guidelines (#73) (afe47ff)

v0.13.0 (2020-08-25)

Features

  • prompt: add support for prompt list and dynamic prompts (6968c1d)

Bug Fixes

  • flags: standalone parameter incompatible with dashed parameter which has a default value (1aa9b55)
  • prompt: cursor not visible after error (1de8a84)

Performance Improvements

  • command,flags: implement simple camel-case and remove param-case and snake-case methods to improve performance (20dc077, 4587284)

Code Refactoring

  • remove format utils method (2496431)
  • refactor project structure for url friendly imports (8b5fbdd)
  • ansi-escape: add return types (2bb165c)
  • command: re-export flag types in command module and some refactorings (05b3c9e)
  • command: refactor error message (6f6e750)
  • command: remove some helper methods: write, writeError, log, logError from command class (88bdc95)
  • command: refactor completions command description and disable unimplemented bash completions command (a181cbb)
  • command: add version option only if version is set (32e6687)
  • prompt: remove read-line module and move methods to generic prompt class (dd1de10)

Style

  • ansi-escape: add semicolons (7ed6424)

Chore

  • ci: update deno version to v1.3.1 (#62) (1cff32b)
  • deno: update deno/std to v0.66.0 (#63) (5c27a4b)

Documentation Updates

BREAKING CHANGES

  • command: refactor external sub-commands (#66) (6181747)

    Following line no longer registers an external command.

    new Command()
        .command( 'sub-command', 'description...' ) //
    
    // is same as
    new Command()
        .command( 'sub-command' )
        .description( 'description...' )

    To register an external command you have to use the .external() method for now.

    new Command()
        .command( 'sub-command', 'description...' )
        .external()
    
    // is same as
    new Command()
        .command( 'sub-command' )
        .description( 'description...' )
        .external()
  • command,flags: refactor type handler (bf12441)

    To make types compatible with environment variable and arguments the arguments of the type handler has changed from:

    const myType: ITypeHandler<number> = ( option: IFlagOptions, arg: IFlagArgument, value: string ): number => {};

    to:

    const myType: ITypeHandler<number> = ( { label, name, value, type }: ITypeInfo ): number => {};

    This makes it possible to write a single error messages for different contexts.

    throw new Error( `${ label } ${ name } must be of type ${ type } but got: ${ value }` );

    For options the error message will be: Option --my-option must be of type number but got: abc For environment variables the error message will be: Environment variable MY_ENV_VAR must be of type number but got: abc For arguments the error message will be: Argument my-argument must be of type number but got: abc

  • command,flags: rename some types (0645313)

    • ICompletionSettings -> ICompletion
    • IArgumentDetails -> IArgument
    • ITypeOption -> ITypeOptions
    • ITypeSettings -> ITypeInfo
    • IEnvVariable -> IEnvVar
    • IEnvVarOption -> IEnvVarOptions
  • table: rename min/maxCellWidth to min/maxColWidth (#65) (c75b94c)

v0.12.1 (2020-08-03)

Bug Fixes

  • remove “v” prefix from deno std url (#57) (10c951a)

v0.12.0 (2020-08-01)

Features

  • table: add support for rowSpan (9c05cc3)
  • table: add support for colSpan (bb6cae9)
  • table: add .fromJson() method (4be3edd)
  • table: add support for enabling and disabling border per row and cell (d62182d)
  • table: add .body() method to Table (2526ff2)
  • table: make border chars customizable (866b71e)

Bug Fixes

  • keycode: KeyCode.parse(data) captures only the first character (#54) (f153909)
  • prompt: pasting clipboard into prompt returns corrupted data (#54) (5de866c)
  • prompt: show option name instead of value as result with select and checkbox prompt (#53) (1d81235)
  • prompt: cursor not visible after exiting with ctrl + c (110a07e)
  • table: remove trailing line break from .toString() method (3af8850)

Code Refactoring

  • table: set default table padding to 1 (a6e6aa3)
  • table: reformat table (16ae13d)
  • table: add TableLayout class (699c0d1)
  • table: refactor .from() and .clone() method’s (ddee9d7)

Chore

Unit/Integration Tests

  • table: add colspan and rowspan test’s (d8df570)

Documentation Updates

v0.11.2 (2020-07-22)

Features

  • prompt: add support for custom keys (5df1f95)

Code Refactoring

  • prompt: add fallback keys for unsupported keys on windows (#47) (71f54f5)
  • prompt: extend Toggle prompt from GenericPrompt (#50) (cfe2064)

v0.11.1 (2020-07-15)

Bug Fixes

  • prompt: fix default value (#48) (805f5a1)

v0.11.0 (2020-07-14)

Features

  • command: add .versionOption() and .helpOption() method’s (85d66b9)

Code Refactoring

  • remove IGenericObject interface (e3c8660)
  • command: remove OptionType type from IArgumentDetails (c8dc229)
  • command: refactor ICommandOption interface (88263b5)

Chore

  • deno: update deno/std to v0.61.0 and deno ci version to v1.2.0 (#45) (f23da64)
  • nest: add egg.yaml config (f8447cc)

Unit/Integration Tests

  • command: fix depends test (9ec513c)

Documentation Updates

  • command: fix options type in action handler example’s (#44) (d661cc4)

v0.10.0 (2020-06-30)

Breaking Changes

  • command: remove BaseCommand class (#27) (029aac5, 2bc4660)

    All commands have to be created with the Command class for now. The help and completions commands are now optional and can be registered as descripted in the example below. The --help and --version option will be registered only on the main command for now. The --help option is a global option and available on all child-command’s.

    import { Command, HelpCommand, CompletionsCommand } from 'https://deno.land/x/cliffy/command.ts';
    
    await new Command()
        .command( 'help', new HelpCommand() )
        .command( 'completions', new CompletionsCommand() )
        .parse()
  • command: remove optional argument from boolean flags which was registered per default (#40) (94ea644)

    An option defined with .option('-d, --debug', '...') has no longer an boolean argument per default. To add an boolean argument you have add the argument explicitly with .option('-d, --debug [arg:boolean]', '...')

  • flags: remove optional argument from boolean flags which was registered per default (#40) (00ac846)

    A boolean flag no longer has an optional value per default. To add an optional or required value use the optionalValue or requiredValue option.

Features

  • command: add prepend option to .option() method (5164692)
  • command: add .getGlobalParent() method (a1d61c9)
  • command: pass command to completion handler (1e8d51b)
  • command: add support for function as description parameter (8dfe004)
  • command: add .getParent() and .getMainCommand() method’s (1a900be)
  • command: make executed command accessible with this in action handler (#28) (461145f)
  • flags: add support for shorthand flag’s with value e.g. -n5 results in {n: 5} but -abc will still result in {a: true, b: true, c: true} (775c528)
  • flags: add support for equal sign in flags e.g. --foo=bar (53ba110)

Bug Fixes

  • command: getGlobal* methods does not return all globals (c7f5a5a)
  • prompt: hide cursor in Secret prompt only if hidden is enabled (5ebf343)

Code Refactoring

  • command: refactor help command (6269e1b, d3c2fa1)
  • command: remove DefaultCommand class (#27) (9e3913c, 9cdc2d2)
  • command: make command properties private (7d5e318)
  • command: don’t reset child commands with .reset() method (ba85b2a)
  • command: refactor completions command (5e07fff)
  • command: add ArgumentsParser util class (c30e474)
  • command: pass parent command to completion handler (8e4167f)
  • command: make .complete() method optional in custom type’s (53a9af7)
  • prompt: remove generic options from Select prompt (a694881)
  • prompt: remove unused Separator class (31b41e4)

Chore

Documentation Updates

v0.9.0 (2020-06-05)

Features

  • command: implement .stopEarly() method (#39) (45f28e7)
  • command: add .getRawArgs() method (4f18db7)
  • command: return literal arguments in .parse() method and add .getLiteralArgs() method (#26) (385f38f)
  • flags: implement stopEarly option (#39) (ee683d3)
  • prompt: add minOptions and maxOptions option’s to Checkbox prompt (#38) (0980b42)
  • prompt: add minLength, maxLength, minTags and maxTags option to List prompt (#37) (6836a7d)
  • prompt: add label option to Secret prompt (9127471)
  • prompt: add minLength and maxLength to Input and Secret prompt’s (#36) (2b13fab)
  • prompt: add secret prompt (#35) (9aaa740)

Chore

  • ci: update deno version to v1.0.5 (bb2eb25)

v0.8.2 (2020-05-30)

Bug Fixes

  • table: table fails if word is longer than maxCellWidth (#34) (b6c5f07)

Code Refactoring

  • prompt: remove undefined return type from .prompt() method’s (#25) (15f707a)
  • table: remove unused method (6d00cc3)

v0.8.1 (2020-05-29)

Bug Fixes

  • prompt: ignore ctrl and meta keys in input prompt’s (1f266b6)
  • prompt: c character is not working in input prompt’s (a0d6545)

v0.8.0 (2020-05-29)

Features

  • command: add support for global and hidden environment variable’s (9e98940)
  • command: add support for global command’s (ec42c7a)
  • command: add support for global completion’s (1d814e2)
  • command: add support for global type’s (91c1569)
  • command: add support for global option’s (#2) (7d6e7cf)
  • command: make args parameter optional in .parse() method (fabfd32)

Code Refactoring

  • command: remove ICommandMap interface (eb3f578)

v0.7.1 (2020-05-24)

Bug Fixes

  • command: help command fails with registered environment variables (#31) (b176bd4)

Chore

  • ci: test’s in packages/command/test/command were not executed (2436fd2)

v0.7.0 (2020-05-22)

Features

  • command: add support for hidden options’s #23 (42f701f)
  • command: add support for hidden command’s #22 (1866b75)
  • command: add .getHelp() method to HelpCommand (9b96d10)
  • command: add .name() method and refactor internal name and path handling (#21) (362d8ea)
  • command: make arguments generic (8a153a7)
  • command,flags: make options generic (09a3d00)

Bug Fixes

  • command: environment variables are always invalid (fa131eb)
  • command: separator option is ignored (0405244)
  • command: default option incompatible with standalone option (e9e6aa5)
  • command: depends info is not shown in help output (0e2e860)
  • command,keycode: CLIFFY_DEBUG does not work (4e90d77)
  • flags: standalone option could be combined with options whose value is optional and has a default value (5cd8287)
  • flags: standalone option could be combined with another standalone option (cb91b85)
  • keycode: fix compile error which happened with deno v1.0.1 (dcfa470)
  • keycode: remove doublicate export of IGenericObject (28fd483)

Code Refactoring

  • use encoding/utf8 for text encoding (81d4b04)

Chore

Documentation Updates

  • fix issues link (c64282e)
  • command: add executable example commands (8fbe263)
  • command: add documentation and example’s for hidden command’s and option’s (0c2f400)
  • command: add generic types example and documentation (0998f55)
  • prompt: fix prompt example (90f8595)

BREAKING CHANGES

  • command: rename IFlagsParseResult to IParseResult (eaeb634)

v0.6.1 (2020-05-12)

Bug Fixes

  • add missing entry files and module exports for prompt & keycode module #19 (f16863d)

v0.6.0 (2020-05-11)

Code Refactoring

  • command: make command’s executable without –allow-env flag #11 (03117ed)
  • x: make format executable without –allow-env flag #11 (2db057e)

Chore

  • add support for deno v1.0.0-rc2 (acb84e1)

Documentation Updates

BREAKING CHANGES

  • prompt: prompt requires the –unstable flag to work with deno >= v0.42.0 (6cd9d3f)

v0.5.1 (2020-05-03)

Bug Fixes

  • flags: default option incompatible with depends option and boolean flag’s (b76a9a7)

v0.5.0 (2020-05-03)

Features

Code Refactoring

  • use explicit version of deno std module’s (fcdf97a)
  • use utf8 encoding module instead of TextEncoder for text encoding (b29e1ba)
  • command: use new Table class in help command (5f203d1)

Chore

Documentation Updates

BREAKING CHANGES

  • table: rewrite table module (65988b7)

    Old table method’s like table and renderTable are replaced by the new Table class.

v0.4.0 (2020-04-04)

Features

  • command: add zsh completions support (9493d90, f54d3a2)
  • command: add complete sub-command to completions command (fb63ec7)
  • command: add complete method for custom auto completions (7d5d25e, 9406a84, 5ce209d)
  • command: complete command names on help command (5897be1)
  • command: add action type (164585e)
  • command: add command type (2b9608c)
  • command: add autocompletion for types (16d5237)
  • flags: support method as option default value (ce09421)
  • table: add border option (a785164)

Bug Fixes

  • flags: fix default value (0244b50)

Code Refactoring

  • command: export default types (34fcddd)
  • command: make complete method in custom type class’s optional. (253cd74)
  • command: update completions description (a3c5c72)
  • flags: refactor validateFlags method (2b51730)
  • flags: refactor getOptions method (3927c36)

Chore

  • add support for deno v0.39.0 (d828f0c)
  • license: update copyright (8264b1a)

Unit/Integration Tests

  • command: update sub-command test (0939b6d)
  • command,flags: don’t call Deno.runTests() in test’s (57f3a34)
  • flags: refactor test’s (cf97a15, c021659)
  • flags: add value test (6e3bc57)
  • flags: add default value test (2fbfd54)
  • flags: add collect test (3c14011)

Documentation Updates

BREAKING CHANGES

  • command,flags: rename requires option to depends (c937466)

    To define depending options you have tu use the options depends instead of requires now.

  • command,flags: call parseValue only if the flag has a value (ab5ba30)

    Change type of value param from Type.parse() method from string | false to string

v0.3.0 (2020-03-31)

Features

  • add support for deno v0.38.0 (80d7ba4, 9824899, 26b58be)
  • command: add support for custom type class’s (7006a67)
  • flags: add parse and remove types option to simplify custom types (d1bc510)

Bug Fixes

  • command: suppress Missing argument(s) error for standalone options (47b162e)
  • command: fix IArgumentDetails and IOption interface (52193e5)

Code Refactoring

  • command: change type of commands from Array to Map (52f7e1f)
  • command: refactor sub-command helper methods (d6d1b05)
  • command: refactor internal args handling and add some args helper methods (957347e)

Documentation Updates

v0.2.0 (2020-03-23)

Features

  • command: validate environment variables (179ef30)
  • command: add support for custom types (fbfea55)
  • flags: add parseFlagValue() method (1983bd1)

Code Refactoring

  • command: refactor env() method (a1a3364)
  • command: print help when the completions command is called without arguments (b2c4f91)
  • command: update description of completions command (5feeb77)
  • command: update description of help command (15a3fd5)
  • command: print only first line of description in options and command list (8cf33a1)
  • command: exit program after help and version is printed (05bc677)
  • flags: refactor string type (6900462)
  • flags: refactor boolean type (10997f6)
  • table: refactor table method (8228ac1)

Documentation Updates

v0.1.0 (2020-03-18)

Features

Chore

Documentation Updates