Skip to content

fix(core): Add rootDir to tsconfig.json to resolve TS5055 error#12274

Merged
mattKorwel merged 5 commits into
mainfrom
d-ts-fix
Oct 30, 2025
Merged

fix(core): Add rootDir to tsconfig.json to resolve TS5055 error#12274
mattKorwel merged 5 commits into
mainfrom
d-ts-fix

Conversation

@mattKorwel

@mattKorwel mattKorwel commented Oct 30, 2025

Copy link
Copy Markdown
Collaborator

This change fixes a build failure that was occurring in the release CI pipeline.

The build was failing with the error: TS5055: Cannot write file ... because it would overwrite input file.

This error was caused by an ambiguity in the TypeScript configuration for the @google/gemini-cli-core package. The index.ts file at the package root re-exports symbols from src/index.ts, which confuses the TypeScript compiler when it tries to determine the project's file structure for generating declaration files.

This change resolves the issue by adding \rootDir\: \.\ to the compilerOptions in packages/core/tsconfig.json. This explicitly tells the compiler to treat the entire package directory as the source root, removing the ambiguity and allowing the build to complete successfully. It also changes the globbing includes to limit it expliclity to the SRC dir. This was the actual fix.

Pre change repo steps

  1. npm run clean
  2. npm ci
  3. npm run build
  4. touch a random file in core e.g. add a zero in constants.ts
  5. npm run build again. this time the build will fail

After fix

Repeat above steps with no errors.

@mattKorwel mattKorwel requested a review from a team as a code owner October 30, 2025 01:21
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @mattKorwel, 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 addresses a critical build failure in the release CI pipeline. The issue stemmed from an ambiguity in the TypeScript configuration for the @google/gemini-cli-core package, specifically related to how index.ts re-exports symbols, leading to a TS5055 error. The change explicitly sets the rootDir in the tsconfig.json to clarify the project's file structure for the TypeScript compiler, ensuring successful builds.

Highlights

  • Build Fix: Resolves a TS5055 error that was causing build failures in the release CI pipeline for the @google/gemini-cli-core package.
  • TypeScript Configuration: Adds "rootDir": "." to the compilerOptions in packages/core/tsconfig.json to explicitly define the source root, thereby resolving ambiguity for the TypeScript compiler.
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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 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

  1. 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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 addresses a TypeScript build failure (TS5055) by adding "rootDir": "." to the tsconfig.json for the @google/gemini-cli-core package. The change is correct and directly resolves the ambiguity in the project structure that caused the build error, which arises from having source files at both the package root and within the src directory. The fix is appropriate and I see no issues with it.

@github-actions

github-actions Bot commented Oct 30, 2025

Copy link
Copy Markdown

Size Change: -2 B (0%)

Total Size: 20.3 MB

ℹ️ View Unchanged
Filename Size Change
./bundle/gemini.js 20.2 MB -2 B (0%)
./bundle/sandbox-macos-permissive-closed.sb 1.03 kB 0 B
./bundle/sandbox-macos-permissive-open.sb 890 B 0 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB 0 B
./bundle/sandbox-macos-restrictive-closed.sb 3.29 kB 0 B
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB 0 B

compressed-size-action

@mattKorwel mattKorwel requested a review from a team as a code owner October 30, 2025 02:38
@mattKorwel mattKorwel merged commit 42c79c6 into main Oct 30, 2025
33 of 35 checks passed
@mattKorwel mattKorwel deleted the d-ts-fix branch October 30, 2025 06:17
@mattKorwel

Copy link
Copy Markdown
Collaborator Author

/patch preview

@github-actions

Copy link
Copy Markdown

Patch workflow(s) dispatched successfully!

📋 Details:

  • Channels: preview
  • Commit: 42c79c64d72100ebeea189b6f356796108b3b98b
  • Workflows Created: 1

🔗 Track Progress:

@github-actions

Copy link
Copy Markdown

🚀 Patch PR Created!

📋 Patch Details:

📝 Next Steps:

  1. Review and approve the hotfix PR: #12283
  2. Once merged, the patch release will automatically trigger
  3. You'll receive updates here when the release completes

🔗 Track Progress:

@github-actions

Copy link
Copy Markdown

🚀 Patch Release Started!

📋 Release Details:

  • Environment: prod
  • Channel: preview → publishing to npm tag preview
  • Version: v0.12.0-preview.0
  • Hotfix PR: Merged ✅
  • Release Branch: release/v0.12.0-preview.0-pr-12274

⏳ Status: The patch release is now running. You'll receive another update when it completes.

🔗 Track Progress:

@github-actions

Copy link
Copy Markdown

Patch Release Failed!

📋 Details:

  • Version: 0.12.0-preview.1
  • Channel: preview
  • Error: The patch release workflow encountered an error

🔍 Next Steps:

  1. Check the workflow logs for detailed error information
  2. The maintainers have been notified via automatic issue creation
  3. You may need to retry the patch once the issue is resolved

🔗 Troubleshooting:

2 similar comments
@github-actions

Copy link
Copy Markdown

Patch Release Failed!

📋 Details:

  • Version: 0.12.0-preview.1
  • Channel: preview
  • Error: The patch release workflow encountered an error

🔍 Next Steps:

  1. Check the workflow logs for detailed error information
  2. The maintainers have been notified via automatic issue creation
  3. You may need to retry the patch once the issue is resolved

🔗 Troubleshooting:

@github-actions

Copy link
Copy Markdown

Patch Release Failed!

📋 Details:

  • Version: 0.12.0-preview.1
  • Channel: preview
  • Error: The patch release workflow encountered an error

🔍 Next Steps:

  1. Check the workflow logs for detailed error information
  2. The maintainers have been notified via automatic issue creation
  3. You may need to retry the patch once the issue is resolved

🔗 Troubleshooting:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/xs An extra small PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants