Repository navigation
New package manager: Pkl #45740
sahidvelji
started this conversation in
Suggest an Idea
Replies: 1 comment
|
I am happy if this is implemented in renovate itself. As a workaround, I use custom managers like this in all my repos for now. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Tell us more.
Renovate has no support for Pkl, Apple's configuration language. Pkl modules reference packages by absolute
package://URI, with the version inline:Nothing updates these today — no manager, no datasource, and no existing issue or discussion I could find.
My motivation is hk, a git hooks and project lint runner configured through a Pkl file, which is where the example above comes from. It's also where the gap is most visible, because Renovate already manages half the problem:
hkis first-class in themisemanager, somise.tomlstays current while thehk.pklbeside it never moves. Of the repositories I surveyed that amend a released hk package, every one is behind — two by 48 releases, in the same commit wheremise.tomlis current.hkalone is referenced from 846 files across 300+ public repositories.I've implemented a
pklmanager —/\.pkl$/, extracts package URIs, maps them ontogithub-releases, no new datasource. Unit tests at 100% coverage,pnpm checkandpnpm type-checkgreen. Since it emits the samedepName/packageNameas themisemanager,mise.tomlandhk.pklgroup into a single PR with no user configuration.Would you take a PR for this? Three calls I'd like from you first:
package://pkg.pkl-lang.org/pkl-pantry/pkl.toml@1.0.3never names a repository, so the manager has to choose apackageNameto look up releases in. It infersapple/<project>— every project served under a bare path today is Apple's, and third parties use agithub.com/<owner>/<repo>path instead. A wrong inference fails the lookup rather than producing a bad PR. Would you prefer an explicit allowlist of projects, or apkldatasource that follows the registry's redirect to discover the repository?no-category, liketypst. Acceptable?PklProjectdependencies are excluded: updating them means regeneratingPklProject.deps.jsonin the same commit, so Pkl would have to be added to Containerbase first. I'd suggest doing that as a follow-up rather than holding this back — does that split work for you?New package manager questionnaire
Name / language: Pkl — package support built into the Pkl language and CLI. No competing package manager exists for it.
Popularity: GitHub code search over public repos, which caps result pages, so these are floors: ~10,300
.pklfiles containingamends; ~1,780 files referencingpackage://pkg.pkl-lang.org; ~910 referencingpackage://github.com; 714PklProjectfiles.jdx/hkalone appears in 846 files across ≥302 repositories.Package files: any
.pklmodule can reference packages directly.managerFilePatterns:/\.pkl$/. Users won't need to extend it — the extension is fixed by the language. Most.pklfiles contain no package URIs;extractPackageFilereturnsnullfor those so they're dropped.Parsing: files are parsed independently, no tool is invoked. Line-based matching for the clause and expression forms, then a structural split of the URI following the language reference grammar —
'package://' <host> <path> '@' <semver> ['::sha256:' <checksum>] '#' <asset path>— taking the last@, asPackageUri.javadoes.Dependency types: none; all dependencies are the same.
Versioning: semver — Pkl rejects a package URI whose version isn't valid semver. No range constraints; URIs always pin an exact version.
Lookup: no new datasource, no custom host or registry configuration, no constraints to feed into lookup.
Artifacts: projects use
PklProject.deps.json, which is out of scope as described above. Files matched by this manager have no lock file, so there's nothing to regenerate and no cache to control.What is extracted, and how URIs map to lookups
amends "package://…"/extends "package://…"import "package://…",import* "package://…", with or withoutasimport("package://…")/import*("package://…")expressionspkl:,file:,https:,modulepath:URIsprojectpackage:URIspackage://github.com/<owner>/<repo>/releases/download/<tag>/<name>@<ver><owner>/<repo>extractVersionderived from how the tag wraps the versionpackage://pkg.pkl-lang.org/github.com/<owner>/<repo>[/<name>]@<ver><owner>/<repo><name>@<ver>package://pkg.pkl-lang.org/<project>/<name>@<ver>apple/<project>skipReason: 'unsupported-url'::sha256:skipReason: 'unsupported'Checksum-pinned URIs are skipped because bumping the version invalidates the pinned checksum and Renovate can't recompute it. Modelling it as a
currentDigestwould be the natural follow-up, given a datasource that can return the published<name>@<version>.sha256.I verified the registry redirects rather than assuming them, for
pkl-pantry,pkl-k8s,pkl-go,pkl-spring,pkl-project-commonsand a third-party package. The host mapping also matches whatpklr, an independent Pkl implementation, resolves these URIs to.How I verified it
Beyond unit tests, extraction was run against real files:
jdx/xxhk.pklhkjdx/hk1.48.0(×2 —amendsandimport)jdx/demandhk.pklhkjdx/hk1.19.0jdx/misehk.pklhkjdx/hk1.55.0jdx/aubehk.pklhkjdx/hk1.44.3element-hq/element-x-iosSecrets.pklstaticcodeelement-hq/pkl-tools1.1.0apple/pkl-pantryyaml.pklA
--platform=localdry run on a repository holding anhk.pklpinned at1.48.0next tomise.tomlpinninghk = "1.48.0"put all three dependencies — one frommise, two frompkl— onto a singlerenovate/hk-1.xbranch at1.58.1. Driving those upgrades throughdoAutoReplaceproduced:confirming both lines, and both occurrences of the version within each line, are updated. The version appearing twice per URI is handled by the default
autoReplaceGlobalMatch.Disclosure: this proposal and the implementation behind it were written with Claude Code (Claude Opus). I reviewed everything before posting, and will review anything posted under my name.
All reactions