Closed SatyamMattoo closed 1 month ago
Hey @SatyamMattoo, here's what we'll do here:
cli.ts
into util/
parseArgs
to be the default export of cli.ts
. And maybe call the function cli
(although a default function export doesn't need a name so I'd probably prefer it to be anonymous`start.ts
, update your import and call cli(process.argv)
instead of pargsArgs(process.argv)
I do agree that it's a bit nicer to isolate the yargs stuff in one place. This approach keeps the cli stuff clean and discoverable, but de-prioritises its importance a little. This helps avoid the confusion with how other packages deal with cli.ts
.
Hey @josephjclark I have made the changes accordingly, you can review them at your convenience and let me know if there are any more changes needed.
Best regards.
@SatyamMattoo Thank you for this, it looks great. I'll merge it in and prepare it for release this week.
For future reference, please try to avoid commit messages like requested changes
. You should pretend like I didn't ask for the changes and instead document (broadly) what you did.
Short Description
Disables logging of env variables and populates the args according to their priority.
Related issue
Fixes #604
Implementation Details
Added a to function to populate the
args
in a differentcli.ts
file. Default values are not provided to theyargs
but are added when the function returns the values. This also ensures the env variables are not logged onpnpm start --help
.QA Notes
I have added tests related to this function in
cli.test.ts
file. More tests can be added if needed.Checklist before requesting a review