flatbuffers icon indicating copy to clipboard operation
flatbuffers copied to clipboard

[TS] BUFIX: Generated typescript imports parent directory

Open hhvrc opened this issue 1 year ago • 11 comments

This fixes something that seems to be an edgecase where the entry file for a directory will include its own parent directory in the childrens relative paths.

Example:

namespace A.B.C;

table MyTable {
  test:string;
}

Output:

a\b\c.ts

// automatically generated by the FlatBuffers compiler, do not modify

/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */

export { MyTable } from './b/c/my-table';

this should be export { MyTable } from './c/my-table';

I'm not quite sure if my fix is the way to go about it but it works for now for my use case.

hhvrc avatar Jun 24 '24 10:06 hhvrc

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.

google-cla[bot] avatar Jun 24 '24 10:06 google-cla[bot]

Also not sure about the fix but I'll let it run through the tests.

bjornharrtell avatar Jun 26 '24 20:06 bjornharrtell

The build failing seems to be unrelated to the PR, there is a file lock error

hhvrc avatar Jun 26 '24 23:06 hhvrc

@bjornharrtell could you re-run the failed pipelines?

hhvrc avatar Jun 27 '24 22:06 hhvrc

@hhvrc nope I'm just a janitor here. 😂

bjornharrtell avatar Jun 28 '24 06:06 bjornharrtell

are you able to bump anyone to re-run failed tests @bjornharrtell ?

hhvrc avatar Jul 01 '24 09:07 hhvrc

Maybe you can re-run the failed tests @dbaileychess ?

hhvrc avatar Jul 02 '24 12:07 hhvrc

@bjornharrtell @dbaileychess bump

hhvrc avatar Jul 10 '24 22:07 hhvrc

@bjornharrtell @dbaileychess any update on this?

hhvrc avatar Sep 17 '24 10:09 hhvrc

@hhvrc I've pressed the button to update this branch so tests are re-run.

bjornharrtell avatar Sep 17 '24 11:09 bjornharrtell

Why are the test's failing for reasons not even remotely related to my PR?

hhvrc avatar Sep 18 '24 11:09 hhvrc

@hhvrc does this mean you think the fix wasn't right or what? Or is it just frustration that this project is very slow at this time?

bjornharrtell avatar Oct 25 '24 10:10 bjornharrtell

I completely forgot I had this PR and deleted a lot of forks I had to clean up my profile, I think its for the better though. The fix I had is not something I would be completely comfortable committing to Google's codebase, the problem is more deeply rooted and needs investigation because it generates some really wrong import paths.

hhvrc avatar Oct 25 '24 10:10 hhvrc

Thanks for the clarification @hhvrc.

bjornharrtell avatar Oct 25 '24 11:10 bjornharrtell