question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

make yargs' simple types available to community

See original GitHub issue

Problem

If yargs ships its types, which a significantly simpler (by design) from those defined in @types/yargs, it will break the existing TypeScript user-base.

Some users would like access to yargs’ types.

Question

Is there a way we can provide yargs’ types to the community, such that they’re as easy to install as @types/yargs, and can be used as an alternative?

Refs: https://github.com/yargs/yargs/issues/1749, https://github.com/yargs/yargs/issues/1586

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dalcdecommented, Sep 11, 2020

I personally believe this is what semver is designed for.

Ultimately, you are going to break something by doing this. People who didn’t import @types/yargs previously could have incorrectly typed code that now doesn’t compile. And if you are eventually going to make a breaking change, might as well break now.

0reactions
bcoecommented, Sep 11, 2020

@dalcde the “perfect world” generics defined in @types/yargs are much more complex than the types in the library itself.

It would be a huge amount of work to make them match. We started down this path, but it honestly also makes the codebase very hard to read and update – as generics are ugly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

yargs/examples.md at main - GitHub
With yargs, the options be just a hash! · But don't walk the plank just yet! · And booleans, both long, short, and...
Read more >
Building a CLI with Yargs - DEV Community ‍ ‍
Yargs is a great library to build command line apps, simply put, it will make the process of creating an application that runs...
Read more >
Yargs Interactive: Create CLI tools for humans and non-humans
Yargs Interactive is a library that provides interactive, non-interactive and mixed-mode for CLI tools. It helps you to develop a CLI that ...
Read more >
Additional documentation - yargs - JS.ORG
The script name or node command is available at argv. ... extensions : The types of files to look for when requiring command...
Read more >
yargs - npm
yargs the modern, pirate-themed, successor to optimist.. Latest version: 17.6.2, last published: 2 months ago. Start using yargs in your ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found