Closed damischa1 closed 4 weeks ago
What about making an independent npm module with transformation mode, and make NestJS to import it?
I can try something like this. Not tried yet. Anyways it seems a little backwards, since the template file and (and the generated file) are using the types defined in the NextJS project. So the typia-module would have to have access to the source tree of the NextJS ptoject.
I was actually thinking something like this would be usefult.
More limited template file, with only typia function generator invocations. In template file nothing would be exported. But the generator would add export keywords to the generated file.
Then there would be nothing to import from the template file and not possible to have such issues.
Add the template path to the exclude
of the tsconfig.json
.
Tried adding exclude
in tsconfig.json
.
IntelliJ Idea is suggesting still the two options: the template export and generated export.
This might be intended behaviour from the IDE, because the exclude
does not exclude files from build if they are explicitly included from some another file. So importing from excluded files is perfectly valid:
https://www.typescriptlang.org/tsconfig#exclude
@damischa1
how about using unpluin-typia
We can close this issue because we have unpluin-typia
Hello,
thanks for great type checking tool.
I am starting to use typia with NextJS. I was wondering if there is some fresh idea how to prevent co-developers from importing the functions from the template file instead of the generation result?
I have tried moving the template file out of the hierarchy for the project, but ide still seems to give two suggestions: the template file and the actual implementation generated from template... Just worried of what happens if someone is using the version from template file.