TS_RS_EXPORT_DIR
quirks
#245
Replies: 4 comments 13 replies
-
Hm, you're right! That's very unintuitive! I think we should definetely change this!
This tripped me up a couple of times as well. I do think the current behaviour is "correct" and how many tools handle this, but it's a bit unintuitive, since exporting to a file without extension is most likely not what any user wants, ever. If we changed this, it would become impossible to export to a file without extension though. Probably not a (common) usecase, but it's still something which would become completely impossible.
Do you have an example for this? |
Beta Was this translation helpful? Give feedback.
-
Ah, thanks for reproducing it! However: If we started with an absolute path (by e.g doing There's std::path::absolute on nightly which does that, but I think we can implement a crappy version ourself. |
Beta Was this translation helpful? Give feedback.
This comment has been hidden.
This comment has been hidden.
-
We saw in this test run (which was fixed by 6c3b0cb) that files without extensions already break exporting when the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey @NyxCode! There are a few things related to the
TS_RS_EXPORT_DIR
environment variable and#[ts(export_to = "...")]
that I'd like to discuss. Almost all of which are breaking changes:..
as that can cause problems indiff_paths
(done in bug:#[ts(export_to = "../path")]
can causediff_paths
to fail #247)TS_RS_EXPORT_DIR
and#[ts(export_to = "...")]
the path in#[ts(export_to = "...")]
is still relative toCargo.toml
, and not toTS_RS_EXPORT_DIR
. Should we change this? (done in Make#[ts(export_to = "...")]
relative toTS_RS_EXPORT_DIR
#250 + Alternative handling of output paths #256)#[ts(export_to = "...")]
is a directory by whether or not it ends in a slash/
. I think we should change this to detect a.ts
file extension instead because:/
as the directory separator (Windows accepts it, but it actually uses the backslash\
)Beta Was this translation helpful? Give feedback.
All reactions