Replies: 3 comments
-
First of all, thanks for reaching out and more importantly: trying out Phero! 🥳 To make me understand your problem a bit better, can you elaborate on what you're trying to do? With Phero, it shouldn't be a problem to organise your types and functions in any way that you'd like. One very important thing about this though is that a Phero-server-project should always start with a file at Small sidetone on this: We're working on a feature that makes it possible to export any type from your Phero-file and use it in your client, even if it isn't used in any of your services/functions, but we aren't there yet. For now: All types that are used by your functions should end up in the client. So, before going into extra tools like dts-bundle or anything like that, I'd like to know: How does your Phero-file looks like, and what external type specifically is causing parser-limitations? |
Beta Was this translation helpful? Give feedback.
-
My bad I just realize that I was doing export default on every file and when changed it to export only everything works ^^ |
Beta Was this translation helpful? Give feedback.
-
Ah great! Let us know if we can help with anything else 😊 |
Beta Was this translation helpful? Give feedback.
-
Hi
When I first try phero
I immediately wanted to organise my services into many sub files.
for me it was
then of course import each other when needed
But I ran into limitation (for now) by your parser implementation.
So I made a few researches on bundler
And I manage to make a P.O.C. with tsc & dts-bundle
https://github.com/parweb/phero-export-imported-types/
the main point is this in
packages.json
-> scriptsexport
tsc --emitDeclarationOnly --outDir dist && dts-bundle --name=generated --main=dist/sample/index.d.ts
then see
./dist/sample/generated.d.ts
I also try to export imported types from node_modules
like prisma
but my knowledge on bundler fail short :-)
to automatically include types from external library without the need to specify which packages I want in
tsconfig.json
I hope it will start a public debate on this subject ;-)
Beta Was this translation helpful? Give feedback.
All reactions