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(deps): update dependency yargs to v16 #2015

Merged
merged 2 commits into from Jan 21, 2021
Merged

fix(deps): update dependency yargs to v16 #2015

merged 2 commits into from Jan 21, 2021

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Sep 9, 2020

WhiteSource Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
yargs (source) 15.4.1 -> 16.2.0 age adoption passing confidence

Release Notes

yargs/yargs

v16.2.0

Compare Source

Features
  • command() now accepts an array of modules (f415388)
Bug Fixes
16.1.1 (2020-11-15)
Bug Fixes

v16.1.1

Compare Source

v16.1.0

Compare Source

Features
Bug Fixes
16.0.3 (2020-09-10)
Bug Fixes
16.0.2 (2020-09-09)
Bug Fixes
16.0.1 (2020-09-09)
Bug Fixes

v16.0.3

Compare Source

v16.0.2

Compare Source

v16.0.1

Compare Source

v16.0.0

Compare Source

⚠ BREAKING CHANGES
  • tweaks to ESM/Deno API surface: now exports yargs function by default; getProcessArgvWithoutBin becomes hideBin; types now exported for Deno.
  • find-up replaced with escalade; export map added (limits importable files in Node >= 12); yarser-parser@19.x.x (new decamelize/camelcase implementation).
  • usage: single character aliases are now shown first in help output
  • rebase helper is no longer provided on yargs instance.
  • drop support for EOL Node 8 (#​1686)
Features
Bug Fixes

Older CHANGELOG Entries


Renovate configuration

📅 Schedule: At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻️ Rebasing: Renovate will not automatically rebase this PR, because other commits have been found.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by WhiteSource Renovate. View repository job log here.

@renovate renovate bot force-pushed the renovate/yargs-16.x branch 3 times, most recently from 3027735 to 679bf96 Compare September 10, 2020 04:16
@rpl
Copy link
Member

rpl commented Sep 17, 2020

This PR requires more changes to be ready to be merged:

  • the tests are currently failing on the flow checks because of a Cannot resolve module yargs/yargs. [cannot-resolve-module] error (due to the code that is trying to import YargsParser from that module in src/program.js):
    https://travis-ci.org/github/mozilla/web-ext/jobs/727989542#L248
  • we need to review more closely the breaking changes in this new major release and make sure we do have enough coverage to avoid regressions related to the command line parsing

@Rob--W
Copy link
Member

Rob--W commented Sep 17, 2020

@rpl

Cannot resolve module yargs/yargs. [cannot-resolve-module

That will be fixed in the next version of yargs (16.0.4?) by yargs/yargs#1747

@renovate renovate bot force-pushed the renovate/yargs-16.x branch 2 times, most recently from 5a985b6 to bcc18ce Compare October 19, 2020 09:20
@renovate renovate bot force-pushed the renovate/yargs-16.x branch 3 times, most recently from ea57ab2 to 1ef822e Compare November 15, 2020 20:04
@renovate renovate bot force-pushed the renovate/yargs-16.x branch 2 times, most recently from 199b8ec to dd1d961 Compare November 20, 2020 14:07
@renovate renovate bot force-pushed the renovate/yargs-16.x branch 3 times, most recently from bce8a6b to 670c186 Compare December 6, 2020 00:05
@renovate renovate bot force-pushed the renovate/yargs-16.x branch 2 times, most recently from 581ba87 to 3cf0e33 Compare December 17, 2020 19:40
@rpl
Copy link
Member

rpl commented Jan 19, 2021

@Rob--W so... I looked again to the issue in this update and unfortunately the only workaround that I did found to don't have to explicitly depend from a separate yargs-parser npm package was to import the yargs parser from the new file that is exporting it, that is yargs/build/index.cjs, unfortunately the workaround does not work on more recent nodejs versions (see details below).

I think that the other option is to add the explicit yargs-parser dependency and import the parser from there.
The main annoyance of this solution is that we will have to make sure yargs and yargs-parser deps does match (in other word that we do use the same yargs-parser version that yargs will be using internally).


Unfortunately this workaround (drafted in b1f2529) does work in nodejs v10, but it does still fail on nodejs v12 and nodejs v14 because that file is not explicitly exported by the yargs package:

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './build/index.cjs' is not defined by "exports" in /home/circleci/web-ext/node_modules/yargs/package.

Link to the failures on circleci jobs:

@Rob--W
Copy link
Member

Rob--W commented Jan 20, 2021

Can't you just use yargs/yargs?

The Parser is intentionally exported (originally via yargs/yargs) to easily get a reference to the used parser, which is tested by https://github.com/yargs/yargs/blob/7ffb5e8ae4f4f94f94ffd10a3aa8b410b2ed2fe4/test/parser.cjs
(and introduced in yargs/yargs#1477). Oddly, the current version of the test doesn't reference yargs.js any more, since in yargs/yargs@ac6d5d1

But yargs/yargs.js is still exported:

... so I think that yargs/yargs should Just Work?

@rpl
Copy link
Member

rpl commented Jan 20, 2021

Can't you just use yargs/yargs?

The Parser is intentionally exported (originally via yargs/yargs) to easily get a reference to the used parser, which is tested by https://github.com/yargs/yargs/blob/7ffb5e8ae4f4f94f94ffd10a3aa8b410b2ed2fe4/test/parser.cjs
(and introduced in yargs/yargs#1477). Oddly, the current version of the test doesn't reference yargs.js any more, since in yargs/yargs@ac6d5d1

But yargs/yargs.js is still exported:

* Node 12.7 and later via https://github.com/yargs/yargs/blob/v16.2.0/package.json#L6-L23

* Earlier node via https://github.com/yargs/yargs/blob/v16.2.0/yargs

... so I think that yargs/yargs should Just Work?

hehe, thanks for pointing out that config, I saw it but while re-looking it I realized that the issue may be just that flow (at least the version being currently used) doesn't read that config from the package.json file and so it complains about it.

I updated the patch with the following changes:

  • restored the yargs/yargs import
  • temporarily supress flowtype error using a $FlowFixMe suppress comment

Flow suppress comments do raise a flowtype error if (e.g. after updating flow to a more recent version) there isn't a flow error to suppress, and that will make us aware that we can remove that suppress comment.

@codecov-io
Copy link

Codecov Report

Merging #2015 (1614e38) into master (c503895) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master     #2015   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           32        32           
  Lines         1567      1567           
=========================================
  Hits          1567      1567           
Impacted Files Coverage Δ
src/program.js 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c503895...1614e38. Read the comment docs.

Copy link
Member

@Rob--W Rob--W left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+c

src/program.js Outdated Show resolved Hide resolved
@rpl rpl merged commit a5b9173 into master Jan 21, 2021
@rpl rpl deleted the renovate/yargs-16.x branch January 21, 2021 11:32
This was referenced Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants