-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Patch #16730 into v0.25.0 preview #16882
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
Conversation
Summary of ChangesHello @chrstnb, 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 focuses on refining the TypeScript configuration for the Highlights
Using Gemini Code AssistThe 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 by creating a comment using either
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 Limitations & Feedback Gemini Code Assist 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. 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
|
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 adds a TypeScript path alias to the core package to allow it to reference itself using its package name. While this can be convenient, it introduces a significant risk of runtime errors because the path alias is not resolved by the Node.js runtime by default. My review includes a comment explaining this issue in detail and suggests removing the alias to prevent potential MODULE_NOT_FOUND errors. It's safer to use relative paths for imports within the same package.
| "types": ["node", "vitest/globals"], | ||
| "baseUrl": ".", | ||
| "paths": { | ||
| "@google/gemini-cli-core": ["./index.ts"] | ||
| } |
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.
Adding a paths alias for a package to reference itself can lead to runtime errors. The paths option in tsconfig.json is a compile-time feature that is not understood by the Node.js runtime by default. This means that while the code will compile successfully, it will fail at runtime with a MODULE_NOT_FOUND error when it tries to import from @google/gemini-cli-core from within the package itself.
This creates a fragile setup that is hard to debug. For robust module resolution, it's better to use relative paths for intra-package imports. If path aliases are a requirement, they must be accompanied by a runtime resolution mechanism, such as the Node.js imports field in package.json.
To prevent potential runtime failures, it's recommended to remove this path alias.
"types": ["node", "vitest/globals"]|
Size Change: -2 B (0%) Total Size: 23 MB ℹ️ View Unchanged
|
46079d9
into
release/v0.25.0-preview.0-pr-16759
Summary
Details
Related Issues
How to Validate
Pre-Merge Checklist