Closed SelfhostedPro closed 4 weeks ago
I'm not sure to understand how it relates to jiti itself. runCommand
is a citty utility that accepts cwd argument. (i welcome any ideas how to improve it)
jiti.import()
is just same as import()
Regarding typing, i also did little research. Supporting auto inference of types still needs a typescript feature for dynamic import(T)
support.
Tracker: https://github.com/microsoft/TypeScript/issues/31090
Closing issue in meanwhile as is not something we could plan to do on jiti side. please feel free to comment or open another more clear issue.
Yeah, that’s fair. I had a fundamental misunderstanding of how things were working. Sorry for the ticket but thanks for the information.
I think part of the issue was seeing examples of running code from jiti via the cli and thinking it was an easy way of running other arbitrary scripts/code in a programmatic way. (End goal for what I’m writing is a runtime plugin/module/layer architecture for nuxt projects and at least jiti helps with dynamically importing things)
Describe the feature
Being able to define the working directory and commands could be very useful as I found the current way of doing it feeling a bit "hacky" as I'm relying on the arguments of the command I'm calling.
This is what it looks like to build a nuxt module programmatically right now and feels like it could use some improvement. I think it would be nice to have cwd as an option or to have the debug tag at least mention it. It also feels wrong to type things this way but they do work.
Additional information