Skip to content

[TS] Fix relative import paths of generated TypeScript code#8880

Open
auschi-shieldai wants to merge 16 commits intogoogle:masterfrom
auschi-shieldai:fix-ts-relative-import-paths
Open

[TS] Fix relative import paths of generated TypeScript code#8880
auschi-shieldai wants to merge 16 commits intogoogle:masterfrom
auschi-shieldai:fix-ts-relative-import-paths

Conversation

@auschi-shieldai
Copy link

@auschi-shieldai auschi-shieldai commented Dec 22, 2025

This PR fixes two issues:

  • Resolves an issue where relative import paths are not generated correctly for dependents with no namespace
  • Refactors how relative imports are generated, removing the need to back out multiple, unnecessary directory levels
image

A new test suite has been added to validate relative import paths, as well as the fix itself.

This PR also sneaks a couple linting/formatting fixes in for unrelated parts of the idl_gen_ts.cp file.

@google-cla
Copy link

google-cla bot commented Dec 22, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

bjornharrtell
bjornharrtell previously approved these changes Dec 22, 2025
Copy link
Collaborator

@bjornharrtell bjornharrtell left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@jtdavis777 jtdavis777 added the ready-for-merge This PR has been approved by a maintainer and is ready for merge by a code owner label Dec 22, 2025
@bjornharrtell
Copy link
Collaborator

@auschi-shieldai sorry this has been taking so long but I'd like to help get this moving now... however, it now needs resolve conflicts with main. Is that something you can do?

@auschi-shieldai
Copy link
Author

@auschi-shieldai sorry this has been taking so long but I'd like to help get this moving now... however, it now needs resolve conflicts with main. Is that something you can do?

@bjornharrtell no worries at all!

I'll get the merge conflicts resolved here in the next couple of hours and re-request your review once changes are pushed up.

Thank you!

bjornharrtell
bjornharrtell previously approved these changes Feb 4, 2026
@bjornharrtell bjornharrtell enabled auto-merge (squash) February 4, 2026 15:22
@bjornharrtell
Copy link
Collaborator

@auschi-shieldai sorry but seems something isn't right (see test failures)

@auschi-shieldai
Copy link
Author

@bjornharrtell I'm a little swamped today, so I plan on taking a look and getting it fixed later tonight. I imagine something got a little funky after resolving those merge conflicts

auto-merge was automatically disabled February 16, 2026 01:52

Head branch was pushed to by a user without write access

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

Labels

c++ codegen Involving generating code from schema javascript json python ready-for-merge This PR has been approved by a maintainer and is ready for merge by a code owner typescript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants