New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to typescript #265
Comments
I would like to help with this. I reviewed yargs/yargs#1586 and the related pull requests. Based on that, I propose the first step be the initial TypeScript configuration and converting I created a draft PR (#272) with this proposed first step to make feedback/discussion a little easier for any of those changes. Beyond the first step, is there any guidance on how to proceed?
|
If @mleguen is open to the help with the conversion, to me it seems like it would be great to have another person pitching in. |
Thanks @QmarkC for the help! The approach I took (and try to hold) for yargs, is to focus only on switching to TS, and not to refactor at the same time, as it is already difficult enough to review as is. So I would recommend keeping at the moment a single |
Since
|
@bcoe The versions listed are the last before they dropped support for Node 6. The upgrades are not needed after all. The We can import them like so: |
I'd rather we stick to |
@QmarkC as long as those versions have both TypeScript and the definitions upgrading sounds great 👍 edit: one other thing to check, I think that there was a time when camelcase or decamelize shipped with the full unicode library, which increased the package size by a huge amount, try running |
@bcoe The current semver for |
I've been working on switching the rest of yargs-parser to TypeScript. It's pretty much done, mainly just waiting on the couple related open PRs. I did want to get some feedback on a few items while waiting on that. Current Arguments interface: interface Arguments {
/** Non-option arguments */
_: string[];
/** The script name or node command */
$0: string;
/** All remaining options */
[argName: string]: any;
}
There are a few options not covered by the existing types that I wanted to confirm types for:
|
I meet the same kind of problems with @types/yargs-parser in yargs/yargs#1586: it looks like they were not written to match yargs-parser js code (or even use it from typescript), but rather as a submodule of @types/yargs. So I would suggest not to rely to much on the existing @types/yargs. |
Here are the yargs-parser typings I am using at the moment in yargs, but they still may include incorrect or incomplete types. The "source of truth" must be yargs-parser js code. |
this work is done \o/ |
Needed for yargs/yargs#1586
The text was updated successfully, but these errors were encountered: