-
Notifications
You must be signed in to change notification settings - Fork 8k
Update to yargs v18 #3759
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
Update to yargs v18 #3759
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @swissspidy, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request aims to successfully upgrade the yargs
dependency to version 18, addressing a previous failed attempt. The core change involves resolving a module import conflict and updating the project's Node.js version requirements to align with the new yargs
version's compatibility.
Highlights
- Dependency Upgrade: Upgraded the
yargs
command-line argument parser library from version 17.7.2 to 18.0.0. - Module Import Conflict Resolution: Fixed a specific issue where
createRequire
was being imported twice, causing an error, by renaming the local import inesbuild.config.js
. - Node.js Version Alignment: Updated the minimum Node.js version requirement across the project to 20.19.0, as mandated by
yargs
v18. - ESM Compatibility: Confirmed that the
gemini
build's existing ESM nature is compatible withyargs
v18's ESM-only distribution.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request aims to upgrade yargs
to v18 and adjust the required Node.js version accordingly. The change in esbuild.config.js
to handle a name collision is a good catch. However, I've found a critical issue where the yargs
dependency in the main @google/gemini-cli
package was not updated, which undermines the goal of this PR. Please see my detailed comment.
Code Coverage Summary
CLI Package - Full Text Report
Core Package - Full Text Report
For detailed HTML reports, please see the 'coverage-reports-22.x' artifact from the main CI run. |
3668706
to
12315da
Compare
@swissspidy I feel like: Are there any big wins by updating yargs? |
I haven‘t mapped the changelog against the usage here, so not sure which bug fixes are relevant. Otherwise primarily it‘s a tech debt thing, keeping everything nice and tidy. Besides, we already require 20.19 for development because of vitest. 20.19 is the big require(esm) release. We might even upgrade without bumping the requirement, but then users would probably get warnings. |
Just tested and it actually works fine with Node 20.18. Only when contributing you will get: $ npm i
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE package: '[email protected]',
npm warn EBADENGINE required: { node: '^20.19.0 || >=22.12.0' },
npm warn EBADENGINE current: { node: 'v20.18.3', npm: '10.8.2' }
npm warn EBADENGINE }
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE package: '[email protected]',
npm warn EBADENGINE required: { node: '^20.19.0 || ^22.12.0 || >=23' },
npm warn EBADENGINE current: { node: 'v20.18.3', npm: '10.8.2' }
npm warn EBADENGINE }
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE package: '[email protected]',
npm warn EBADENGINE required: { node: '^20.19.0 || ^22.12.0 || >=23' },
npm warn EBADENGINE current: { node: 'v20.18.3', npm: '10.8.2' }
npm warn EBADENGINE } So I removed the version requirement bump again. |
@NTaylorMullen please take another look :) |
This reverts commit 2862ae7.
TLDR
This updates
yargs
to version 18Dive Deeper
This update was originally reverted again in #3608 without actually addressing the root cause:
The custom build config in
esbuild.config.js
importscreateRequire
, butyargs
does so too, so it was imported twice, which caused an error. Simply renaming the import works around this.Notable changes:
package.json
were adjusted accordingly.Reviewer Test Plan
Tested with:
npm run bundle && node bundle/gemini.js
Works like a charm.
Testing Matrix
Linked issues / bugs
Related: