trufflesuite / ganache

:warning: The Truffle Suite is being sunset. For information on ongoing support, migration options and FAQs, visit the Consensys blog. Thank you for all the support over the years.
https://consensys.io/blog/consensys-announces-the-sunset-of-truffle-and-ganache-and-new-hardhat?utm_source=github&utm_medium=referral&utm_campaign=2023_Sep_truffle-sunset-2023_announcement_
MIT License
2.62k stars 676 forks source link

feat: improved user experience for detached instances with prefix matching and suggestions #4199

Open jeffsmale90 opened 1 year ago

jeffsmale90 commented 1 year ago

Detached instances are pretty awesome, but they have long names that you have to type all the time!

With fuzzy matching (and some helpful suggestions), you can get by without typing so much:

$ ganache instances stop hot_lim_cheesecacke

hot_lim_cheesecacke found.

Did you mean:
 - hot_lime_cheesecake
 - hot_lemon_loaf

$ ganache instances stop hot_li
hot_lime_cheesecake stopped

note: now you only need to enter the unique prefix of the instance name. Ganache will use this prefix to identify the instance.

jeffsmale90 commented 1 year ago

This will have more thorough testing added after #3735 is merged

leeoniya commented 1 year ago

maybe a bit late for a pitch, but https://github.com/leeoniya/uFuzzy#a-biased-appraisal-of-similar-work

jeffsmale90 commented 1 year ago

https://github.com/leeoniya/uFuzzy#a-biased-appraisal-of-similar-work

Thanks for the suggestion! I intentionally didn't introduce a library for this feature, in an effort to limit the impact on the bundle size.

In addition, I'm not sure this is a good fit for your library, based on your comment "match a relatively short search phrase (needle) against a large list of short-to-medium phrases (haystack)" whereas this use case is a very short search phrase against a small list of very short phrases.

I'll keep it in mind for future work though.

cloudflare-pages[bot] commented 1 year ago

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4ce7169
Status: ✅  Deploy successful!
Preview URL: https://e4fca558.ganache.pages.dev
Branch Preview URL: https://feat-detach-fuzzy-matching.ganache.pages.dev

View logs