Closed fengpeng closed 1 year ago
I try fix it, but there should be a better way
let relativePath = path.relative(outputPathDir, `${importPath}.proto`).split(path.sep).join(path.posix.sep);
relativePath = relativePath.replace('.proto', '');
Hi @fengpeng , sorry for the late reply. I'm not 100% following what the bug is, although in general I'm not surprised there is some nuance/tricky-ness here.
Even if the bug is in ts-poet, do you mind creating a reproduction in ts-proto? Even if the bug ends up being in ts-poet, I think that would help me best understanding your use case/what is going wrong.
Thanks!
OK~
Maybe there's a problem with the code: https://github.com/stephenh/ts-poet/blob/2b7173b4f9379bb8865f6f57cbffdd58cf6afe5b/src/Import.ts#L377-L390
My proto files directory structure:
The extended_method.proto content:
outputPathDir value is
./zues/attributes
; importPath value also is./zues/attributes
https://github.com/stephenh/ts-poet/blob/2b7173b4f9379bb8865f6f57cbffdd58cf6afe5b/src/Import.ts#L384The result is