Skip to content
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

Support type imports from other packages, instead of re-generating well-known types #9

Open
jasongwartz opened this issue Mar 2, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@jasongwartz
Copy link
Contributor

via @bioball on Discord:

something to think about WRT codegen: sometimes, you might import a Pkl module that comes from some external library. in that case, maybe the generated code should import that library, instead of genearting new code

And then from @jackkleeman:

its a similar problem as in the crd generation where we added a converters field to allow saying that the object at this path should be treated as this external pkl library type
lets say there is a well known typescript library for k8s types, and i have pkl code that refers to k8s types. i might want to set those objects as being the k8s typescript library instead of generating typescript types for the pkl types

TLDR: when a Pkl property is of a type that has an existing TypeScript definition (like a k8s type), we could provide a way (an option during codegen) to use an import of the TypeScript type, instead of doing codegen of the equivalent Pkl type.

@jasongwartz jasongwartz added the enhancement New feature or request label Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant