diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ff64a168..86bc4a266 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,108 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [17.0.0](https://github.com/rivy-js/yargs/compare/v16.1.0...v17.0.0) (2022-07-27) + + +### ⚠ BREAKING CHANGES + +* **node:** drop Node 10 (#1919) +* implicitly private methods are now actually private +* deprecated reset() method is now private (call yargs() instead). +* **yargs-factory:** refactor yargs-factory to use class (#1895) +* .positional() now allowed at root level of yargs. +* **coerce:** coerce is now applied before validation. +* **async:** yargs now returns a promise if async or check are asynchronous. +* **middleware:** global middleware now applied when no command is configured. +* #1823 contains the following breaking API changes: + * now returns a promise if handler is async. + * onFinishCommand removed, in favor of being able to await promise. + * getCompletion now invokes callback with err and `completions, returns promise of completions. + +### Features + +* add browser.d.ts and check for existence of Error.captureStackTrace() ([#2144](https://github.com/rivy-js/yargs/issues/2144)) ([6192990](https://github.com/rivy-js/yargs/commit/6192990509cf793c4b10b88884d626893dee89df)) +* add commands alias (similar to options function) ([#1850](https://github.com/rivy-js/yargs/issues/1850)) ([00b74ad](https://github.com/rivy-js/yargs/commit/00b74adcb30ab89b4450ef7105ef1ad32d820ebf)) +* add parseSync/parseAsync method ([#1898](https://github.com/rivy-js/yargs/issues/1898)) ([6130ad8](https://github.com/rivy-js/yargs/commit/6130ad89b85dc49e34190e596e14a2fd3e668781)) +* add support for `showVersion`, similar to `showHelp` ([#1831](https://github.com/rivy-js/yargs/issues/1831)) ([1a1e2d5](https://github.com/rivy-js/yargs/commit/1a1e2d554dca3566bc174584394419be0120d207)) +* adds support for async builder ([#1888](https://github.com/rivy-js/yargs/issues/1888)) ([ade29b8](https://github.com/rivy-js/yargs/commit/ade29b864abecaa8c4f8dcc3493f5eb24fb73d84)), closes [#1042](https://github.com/rivy-js/yargs/issues/1042) +* allow calling standard completion function from custom one ([#1855](https://github.com/rivy-js/yargs/issues/1855)) ([31765cb](https://github.com/rivy-js/yargs/commit/31765cbdce812ee5c16aaae70ab523a2c7e0fcec)) +* allow default completion to be referenced and modified, in custom completion ([#1878](https://github.com/rivy-js/yargs/issues/1878)) ([01619f6](https://github.com/rivy-js/yargs/commit/01619f6191a3ab16bf6b77456d4e9dfa80533907)) +* **async:** add support for async check and coerce ([#1872](https://github.com/rivy-js/yargs/issues/1872)) ([8b95f57](https://github.com/rivy-js/yargs/commit/8b95f57bb2a49b098c6bf23cea88c6f900a34f89)) +* autocomplete choices for options ([#2018](https://github.com/rivy-js/yargs/issues/2018)) ([01b2c6a](https://github.com/rivy-js/yargs/commit/01b2c6a99167d826d3d1e6f6b94f18382a17d47e)) +* command() now accepts an array of modules ([f415388](https://github.com/rivy-js/yargs/commit/f415388cc454d02786c65c50dd6c7a0cf9d8b842)) +* **completion:** choices will now work for all possible aliases of an option and not just the default long option ([30edd50](https://github.com/rivy-js/yargs/commit/30edd5067111b2b59387dcc47f4e7af93b9054f3)) +* **completion:** positional arguments completion ([#2090](https://github.com/rivy-js/yargs/issues/2090)) ([00e4ebb](https://github.com/rivy-js/yargs/commit/00e4ebbe3acd438e73fdb101e75b4f879eb6d345)) +* fallback to default bash completion ([74c0ba5](https://github.com/rivy-js/yargs/commit/74c0ba5cfcc59afa5538de821fad70e1a76a354e)) +* improve support for async/await ([#1823](https://github.com/rivy-js/yargs/issues/1823)) ([169b815](https://github.com/rivy-js/yargs/commit/169b815df7ae190965f04030f28adc3ab92bb4b5)) +* **locale:** add Ukrainian locale ([#1893](https://github.com/rivy-js/yargs/issues/1893)) ([c872dfc](https://github.com/rivy-js/yargs/commit/c872dfc1d87ebaa7fcc79801f649318a16195495)) +* **locales:** Added Uzbek translation ([#2024](https://github.com/rivy-js/yargs/issues/2024)) ([ee047b9](https://github.com/rivy-js/yargs/commit/ee047b9cd6260ce90d845e7e687228e617c8a30d)) +* **middleware:** async middleware can now be used before validation. ([e0f9363](https://github.com/rivy-js/yargs/commit/e0f93636e04fa7e02a2c3b1fe465b6a14aa1f06d)) +* **middleware:** global middleware now applied when no command is configured. ([e0f9363](https://github.com/rivy-js/yargs/commit/e0f93636e04fa7e02a2c3b1fe465b6a14aa1f06d)) +* **node:** drop Node 10 ([#1919](https://github.com/rivy-js/yargs/issues/1919)) ([5edeb9e](https://github.com/rivy-js/yargs/commit/5edeb9ea17b1f0190a3590508f2e7911b5f70659)) +* update Levenshtein to Damerau-Levenshtein ([#1973](https://github.com/rivy-js/yargs/issues/1973)) ([d2c121b](https://github.com/rivy-js/yargs/commit/d2c121b00f2e1eb2ea8cc3a23a5039b3a4425bea)) + + +### Bug Fixes + +* add missing entries to published files ([#2185](https://github.com/rivy-js/yargs/issues/2185)) ([5685382](https://github.com/rivy-js/yargs/commit/5685382d18dc05f2ec66098d90ab16f31b622753)) +* add package.json to module exports ([#1818](https://github.com/rivy-js/yargs/issues/1818)) ([d783a49](https://github.com/rivy-js/yargs/commit/d783a49a7f21c9bbd4eec2990268f3244c4d5662)), closes [#1817](https://github.com/rivy-js/yargs/issues/1817) +* address bug when strict and async middleware used together ([#2164](https://github.com/rivy-js/yargs/issues/2164)) ([cbc2eb7](https://github.com/rivy-js/yargs/commit/cbc2eb726efc1d688ad484e8cbe4d233b212a046)) +* always cache help message when running commands ([#1865](https://github.com/rivy-js/yargs/issues/1865)) ([d57ca77](https://github.com/rivy-js/yargs/commit/d57ca7751d533d7e0f216cd9fbf7c2b0ec98f791)), closes [#1853](https://github.com/rivy-js/yargs/issues/1853) +* **async:** don't call parse callback until async ops complete ([#1896](https://github.com/rivy-js/yargs/issues/1896)) ([a93f5ff](https://github.com/rivy-js/yargs/commit/a93f5ff35d7c09b01e0ca93d7d855d2b26593165)), closes [#1888](https://github.com/rivy-js/yargs/issues/1888) +* avoid legacy accessors ([#2013](https://github.com/rivy-js/yargs/issues/2013)) ([adb0d11](https://github.com/rivy-js/yargs/commit/adb0d11e02c613af3d9427b3028cc192703a3869)) +* boolean option should work with strict ([#1996](https://github.com/rivy-js/yargs/issues/1996)) ([e9379e2](https://github.com/rivy-js/yargs/commit/e9379e27d49820f4db842f22cda6410bbe2bff10)) +* **builder:** apply default builder for showHelp/getHelp ([#1913](https://github.com/rivy-js/yargs/issues/1913)) ([395bb67](https://github.com/rivy-js/yargs/commit/395bb67749787d269cabe80ffc3133c2f6958aeb)), closes [#1912](https://github.com/rivy-js/yargs/issues/1912) +* **builder:** nested builder is now awaited ([#1925](https://github.com/rivy-js/yargs/issues/1925)) ([b5accd6](https://github.com/rivy-js/yargs/commit/b5accd64ccbd3ffb800517fb40d0f59382515fbb)) +* **build:** Node 12 is now minimum version ([#1936](https://github.com/rivy-js/yargs/issues/1936)) ([0924566](https://github.com/rivy-js/yargs/commit/09245666e57facb140e0b45a9e45ca704883e5dd)) +* cast error types as TypeScript 4.4 infers them as unknown instead of any ([#2016](https://github.com/rivy-js/yargs/issues/2016)) ([01b2c6a](https://github.com/rivy-js/yargs/commit/01b2c6a99167d826d3d1e6f6b94f18382a17d47e)) +* coerce middleware should be applied once ([#1978](https://github.com/rivy-js/yargs/issues/1978)) ([14bd6be](https://github.com/rivy-js/yargs/commit/14bd6bebc3027ae929106b20dd198b9dccdeec31)) +* coerce pollutes argv ([#2161](https://github.com/rivy-js/yargs/issues/2161)) ([2d1136d](https://github.com/rivy-js/yargs/commit/2d1136d303ea805685a973ded62f52efd49b78b9)) +* **coerce:** options using coerce now displayed in help ([#1911](https://github.com/rivy-js/yargs/issues/1911)) ([d2128cc](https://github.com/rivy-js/yargs/commit/d2128cc4ffd411eed7111e6a3c561948330e4f6f)), closes [#1909](https://github.com/rivy-js/yargs/issues/1909) +* completion script name clashing on bash ([#1903](https://github.com/rivy-js/yargs/issues/1903)) ([8f62d9a](https://github.com/rivy-js/yargs/commit/8f62d9a9e8bebf86f988c100ad3c417dc32b2471)) +* **completion:** changed the check for option arguments to match options that begin with '-', instead of '--', to include short options ([30edd50](https://github.com/rivy-js/yargs/commit/30edd5067111b2b59387dcc47f4e7af93b9054f3)) +* **completion:** correct zsh installation instructions ([22e9af2](https://github.com/rivy-js/yargs/commit/22e9af28bb7a7101aeeac80b5bfd0c18f7e6226f)) +* **completion:** don't show positional args choices with option choices ([#2148](https://github.com/rivy-js/yargs/issues/2148)) ([b58b5bc](https://github.com/rivy-js/yargs/commit/b58b5bc2cda7fc15acf559ae4a6a0eda0be06044)) +* **completion:** fix for completions that contain non-leading hyphens ([30edd50](https://github.com/rivy-js/yargs/commit/30edd5067111b2b59387dcc47f4e7af93b9054f3)) +* **completion:** support for default flags ([db35423](https://github.com/rivy-js/yargs/commit/db354232705623bbcd8fad362f6a4d6d59650be5)) +* conflicts and strip-dashed ([#1998](https://github.com/rivy-js/yargs/issues/1998)) ([59a86fb](https://github.com/rivy-js/yargs/commit/59a86fb83cfeb8533c6dd446c73cf4166cc455f2)) +* **deno:** get yargs working on deno@1.5.x ([#1799](https://github.com/rivy-js/yargs/issues/1799)) ([cb01c98](https://github.com/rivy-js/yargs/commit/cb01c98c44e30f55c2dc9434caef524ae433d9a4)) +* **deno:** use actual names for keys instead of inferring ([#1891](https://github.com/rivy-js/yargs/issues/1891)) ([b96ef01](https://github.com/rivy-js/yargs/commit/b96ef01b16bc5377b79d7914dd5495068037fe7b)) +* **deps:** update dependency yargs-parser to v21 ([#2063](https://github.com/rivy-js/yargs/issues/2063)) ([76c1951](https://github.com/rivy-js/yargs/commit/76c19518d74ca94c0edcd450e5c0ef9efeee369d)) +* **docs:** stop advertising .argv property ([#2036](https://github.com/rivy-js/yargs/issues/2036)) ([4f5ecc1](https://github.com/rivy-js/yargs/commit/4f5ecc1427ed6c83f23ea90ee6da75ce0c332f7a)), closes [#2035](https://github.com/rivy-js/yargs/issues/2035) +* don't fail if "fileURLToPath(import.meta.url)" throws ([3a44796](https://github.com/rivy-js/yargs/commit/3a44796c84e3cb60769841d5883448a396227ade)) +* emit warning on version name collision ([#1986](https://github.com/rivy-js/yargs/issues/1986)) ([d0e8292](https://github.com/rivy-js/yargs/commit/d0e829239580bd44873bbde65de2ed7671aa2ab0)) +* exclude positionals from default completion ([#1881](https://github.com/rivy-js/yargs/issues/1881)) ([0175677](https://github.com/rivy-js/yargs/commit/0175677b79ffe50a9c5477631288ae10120b8a32)) +* expose helpers for legacy versions of Node.js ([#1801](https://github.com/rivy-js/yargs/issues/1801)) ([107deaa](https://github.com/rivy-js/yargs/commit/107deaa4f68b7bc3f2386041e1f4fe0272b29c0a)) +* failed command usage string is missing arg descriptions and optional args ([#2105](https://github.com/rivy-js/yargs/issues/2105)) ([d6e342d](https://github.com/rivy-js/yargs/commit/d6e342d8ef2c488f438c32770ba2209cf8223342)) +* handle multiple node_modules folders determining mainFilename for ESM ([#2123](https://github.com/rivy-js/yargs/issues/2123)) ([e0823dd](https://github.com/rivy-js/yargs/commit/e0823dd7e6ced7eaf1d7d1e67f77374f4ef5cbce)) +* help command spacing when scriptName is empty ([#1994](https://github.com/rivy-js/yargs/issues/1994)) ([d33e997](https://github.com/rivy-js/yargs/commit/d33e9972291406490cd8fdad0b3589be234e0f12)) +* hide hidden options from completion ([#2143](https://github.com/rivy-js/yargs/issues/2143)) ([e086dfa](https://github.com/rivy-js/yargs/commit/e086dfad7ff11956b1e8779c00cf2351a4cc3b03)), closes [#2142](https://github.com/rivy-js/yargs/issues/2142) +* https://github.com/yargs/yargs/issues/1841#issuecomment-804770453 ([b96ef01](https://github.com/rivy-js/yargs/commit/b96ef01b16bc5377b79d7914dd5495068037fe7b)) +* implies should not fail when implied key's value is 0, false or empty string ([#1985](https://github.com/rivy-js/yargs/issues/1985)) ([8010472](https://github.com/rivy-js/yargs/commit/80104727d5f2ec4c5b491c1bdec4c94b2db95d9c)) +* import yargs/yargs in esm projects ([#2151](https://github.com/rivy-js/yargs/issues/2151)) ([95aed1c](https://github.com/rivy-js/yargs/commit/95aed1c175ec82e585003883bda1b6b75d5493ce)) +* **lang:** add missing terms to Russian translation ([#2181](https://github.com/rivy-js/yargs/issues/2181)) ([1c331f2](https://github.com/rivy-js/yargs/commit/1c331f22c71496e3d50cf103a1b21f4a05d97aac)) +* positional array defaults should not be combined with provided values ([#2006](https://github.com/rivy-js/yargs/issues/2006)) ([832222d](https://github.com/rivy-js/yargs/commit/832222d7777da49e5c9da6c5801c2dd90d7fa6a2)) +* positionals should not overwrite options ([#1992](https://github.com/rivy-js/yargs/issues/1992)) ([9d84309](https://github.com/rivy-js/yargs/commit/9d84309e53ce1d30b1c61035ed5c78827a89df86)) +* prevent infinite loop with empty locale ([#2179](https://github.com/rivy-js/yargs/issues/2179)) ([b672e70](https://github.com/rivy-js/yargs/commit/b672e709e4fc45f50d77f54e42025a5fa7c66a42)) +* re-add options to check callback ([#2079](https://github.com/rivy-js/yargs/issues/2079)) ([e75319d](https://github.com/rivy-js/yargs/commit/e75319d99142a048b0abe9856499730fd4bc004c)) +* show message when showHelpOnFail is chained globally ([#2154](https://github.com/rivy-js/yargs/issues/2154)) ([ad9fcac](https://github.com/rivy-js/yargs/commit/ad9fcacb001a7eb842924408f3a06865a7c7a3b6)) +* showHelp() and .getHelp() now return same output for commands as --help ([#1826](https://github.com/rivy-js/yargs/issues/1826)) ([36abf26](https://github.com/rivy-js/yargs/commit/36abf26919b5a19f3adec08598539851c34b7086)) +* strict should fail unknown arguments ([#1977](https://github.com/rivy-js/yargs/issues/1977)) ([c804f0d](https://github.com/rivy-js/yargs/commit/c804f0db78e56b44341cc7a91878c27b1b68b9f2)) +* **translations:** correct Korean translation ([#2095](https://github.com/rivy-js/yargs/issues/2095)) ([c7c2b9e](https://github.com/rivy-js/yargs/commit/c7c2b9eb340754ddac7bdd1687c7951332c5ebba)) +* veriadic arguments override array provided in config (the same as multiple dash arguments). ([4dac5b8](https://github.com/rivy-js/yargs/commit/4dac5b8c2f03488c31d40f075075d2ac43134412)) +* wrap unknown args in quotes ([#2092](https://github.com/rivy-js/yargs/issues/2092)) ([6a29778](https://github.com/rivy-js/yargs/commit/6a2977867bd58dbd8bb550f7b0b4c4c298835597)) +* wrap(null) no longer causes strange indentation behavior ([#1988](https://github.com/rivy-js/yargs/issues/1988)) ([e1871aa](https://github.com/rivy-js/yargs/commit/e1871aa792de219b221179417d410931af70d405)) +* zsh completion is now autoloadable ([#1856](https://github.com/rivy-js/yargs/issues/1856)) ([d731f9f](https://github.com/rivy-js/yargs/commit/d731f9f9adbc11f918e918443c5bff4149fc6681)) + + +### Code Refactoring + +* **coerce:** coerce is now applied before validation. ([8b95f57](https://github.com/rivy-js/yargs/commit/8b95f57bb2a49b098c6bf23cea88c6f900a34f89)) +* deprecated reset() method is now private (call yargs() instead). ([376f892](https://github.com/rivy-js/yargs/commit/376f89242733dcd4ecb8040685c40ae1d622931d)) +* implicitly private methods are now actually private ([376f892](https://github.com/rivy-js/yargs/commit/376f89242733dcd4ecb8040685c40ae1d622931d)) +* **yargs-factory:** refactor yargs-factory to use class ([#1895](https://github.com/rivy-js/yargs/issues/1895)) ([376f892](https://github.com/rivy-js/yargs/commit/376f89242733dcd4ecb8040685c40ae1d622931d)) + ### [17.5.1](https://github.com/yargs/yargs/compare/v17.5.0...v17.5.1) (2022-05-16) diff --git a/package.json b/package.json index 2d48e590e..80dcfad09 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "yargs", - "version": "17.5.1", + "version": "17.0.0", "description": "yargs the modern, pirate-themed, successor to optimist.", "main": "./index.cjs", "exports": {