google / flatbuffers

FlatBuffers: Memory Efficient Serialization Library
https://flatbuffers.dev/
Apache License 2.0
22.52k stars 3.19k forks source link

[TS] BUFIX: Generated typescript imports parent directory #8338

Open hhvrc opened 1 week ago

hhvrc commented 1 week ago

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.

google-cla[bot] commented 1 week ago

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 commented 1 week ago

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

hhvrc commented 1 week ago

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

hhvrc commented 6 days ago

@bjornharrtell could you re-run the failed pipelines?

bjornharrtell commented 6 days ago

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

hhvrc commented 2 days ago

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

hhvrc commented 1 day ago

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