Skip to content
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

Fix traverse script after yargs upgrade #11990

Closed
wants to merge 1 commit into from
Closed

Conversation

foolip
Copy link
Collaborator

@foolip foolip commented Aug 12, 2021

#11916 broke the traverse
script, probably due to yargs/yargs#1992.

The problem now is that for npm run chrome all 90, values
will be ["null", "true", "90"], due to the combining of default and
given argument, where before values would have been ["90"].

We were using arrays for both folder and value, which doesn't really
make sense since only the last positional argument can be variadic:
https://github.com/yargs/yargs/blob/master/docs/advanced.md#variadic-positional-arguments

Since we use comma-separated values, just use strings instead to avoid
the problem.

mdn#11916 broke the traverse
script, probably due to yargs/yargs#1992.

The problem now is that for `npm run chrome all 90`, `values`
will be ["null", "true", "90"], due to the combining of default and
given argument, where before `values` would have been ["90"].

We were using arrays for both folder and value, which doesn't really
make sense since only the last positional argument can be variadic:
https://github.com/yargs/yargs/blob/master/docs/advanced.md#variadic-positional-arguments

Since we use comma-separated values, just use strings instead to avoid
the problem.
@bcoe
Copy link

bcoe commented Aug 13, 2021

@foolip could I bother you to try yargs@17.1.1-candidate.0, which contains a fix from @jly36963.

If it solves the problem we can release ASAP.

@ddbeck
Copy link
Collaborator

ddbeck commented Aug 17, 2021

@bcoe Thanks for the fix. I tested the patch release, which resolved the problem for me, and merged #12013 with the upgrade.

@foolip the regression is undone, but do you think we ought to make this change anyway?

@foolip
Copy link
Collaborator Author

foolip commented Aug 18, 2021

@ddbeck I think what we're doing is a bit weird, but I don't think it's worth making this change when nothing is broken.

@foolip foolip closed this Aug 18, 2021
@foolip foolip deleted the fix-traverse branch August 18, 2021 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scripts 📜 Issues or pull requests regarding the scripts in scripts/.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants