-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only compile interface and types without runtime code #50
Comments
Thanks for letting us know about your interest, @jvgreenaway! Feel free to come join us in the Pkl community Discord if you want to chat in more detail (both @jackkleeman and I are there, and there's a This is a great question and use-case, and one we've gotten once or twice before. I've also had times where I wanted to use Pkl as a 'lingua franca' for type definitions, that generates types for multiple languages, OpenAPI, etc. And I'm open to the idea of a "type definitions only mode" that doesn't include the evaluator imports. The one issue we've had when discussing this before is that the generated types from Another option if this constraint is unsatisfactory is generating a JSON Schema or OpenAPI spec from your Pkl module, and using code-generators with more customisation options. If that constraint isn't a blocking issue for you, I'll talk over the idea in Discord and see if we think this is a reasonable addition. |
@jasongwartz thank you very much for such an informative and helpful response. I am going to play with the the My use case is primarily to use the I'll come visit the Discord! |
Another update my end - I am going to experiment with https://github.com/gzuidhof/tygo. This could fulfil my use case. |
I am interested in using Pkl to share static typings between Go and Typescript. I don't think I need the "evaluator" part of the code as I'm just interested in consuming the
export interface Config
code.Is there a way to use
pkl-gen-typescript
and omit the imports,loadFromPath
function andload
function?I can see there is a
--settings-file
option but snooping aroundgenerator-settings.pkl
I cannot see anything relevant.Maybe it makes sense to add a "definitions" mode which only generates
.d.ts
files? 🤔Many thanks!
The text was updated successfully, but these errors were encountered: