mirror of
https://github.com/apple/pkl.git
synced 2026-01-13 23:23:37 +01:00
Feature request: Better handling of user-defined modules #346
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Frnd-me on GitHub (Sep 16, 2025).
I'm using the Pkl Java bindings in a runtime system, where Pkl is the basis for a DSL.
For my DSL, I have a standard library, for which it is convenient to add a module like
dsl:Something.The Java bindings support this neatly: internally, the
dsl:scheme gets translated to a classpath resource shipped with the runtime build. However, current support within IDEs and the CLI does not enable ergonomic handling of user-defined modules.It would be very convenient if there were a way to define (globally, for instance, in Pkl settings) the handler for such schemes (for example, pointing to a URL where the same module can be fetched).
As far as I can tell from the documentation, this is currently possible at a project level, but that may not always be desirable; sometimes you want a global setting without needing to create a project.
Currently, the handling of schemes in the IDE plugins and CLI appears to be fairly static.
Full support throughout the toolchain would make user-defined module support more useful.
Proposed solution
This would make user-defined modules a first-class feature in the Pkl ecosystem, improving ergonomics for DSLs and other custom uses of Pkl.