Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(gatsby-cli) better suggestions (#12392)
* chore(gatsby-cli): Add meant dependency (#12078) Who uses `meant`: This package is used by NPM. Implementation: Used to mimic the same UX of giving command suggestions, upon failure to provide correct command Additional Reasons to use package: - Zero Dependencies attached - Only 30 lines of POJO - very lightweight - Very few issues with current versions Please checkout: https://www.npmjs.com/package/meant * feat: implemention of did you mean suggestion (#12078) This code has been duplicated from NPM 6.8.0 with minor tweaks. Tweaks: - Style changes of using string template literals over single quotes - newlines - \n added to the end to line 10 and line 13, to make the code more developer friendly * Modify gatsby-cli include command suggestion (#12078) Line 328 - alter demandCommand - message string `Pass --help ...` will not show, because cli.fail method (330 line) is utilise. Thus message string has been moved to function 285. Another reason it has been moved there is organise al suggestions into one place Line 318 - showHelpOnFail could not get access to `yargs` thus cli.fail function was used instead Line 319 - `recommendCommands`, did not recommend commands were not very accurate, thus cli.fail was used configured more specific commands and show multiple command suggestions * fix(gatsby-cli): demandCommand was changed back to original (#12078)
- Loading branch information