feat: migrate to pkl-swift 0.8.0 + Pkl 0.31 - #68
Conversation
- Update pkl-swift dependency from 0.7.2 to 0.8.0 - Update Pkl CLI from 0.30.2 to 0.31.0 - Add registerPklTypes() with 41 types for O(N) type scanning bypass - Migrate codegen from pkl-gen-swift to pkl run @pkl.swift/gen.pkl - Replace !isEmpty with isNotEmpty in PKL schemas (Pkl 0.31 builtin) - Regenerate Swift types from updated schemas - Update CLAUDE.md documentation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly updates the project's Pkl integration, bringing it in line with the latest versions of Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request effectively migrates the project to pkl-swift 0.8.0 and Pkl 0.31.0. The changes are comprehensive, including dependency updates, adapting to the new isNotEmpty constraint in PKL schemas, and migrating the codegen script to use pkl run. The introduction of registerPklTypes for performance optimization is a great addition. I've added one suggestion to improve the maintainability of the codegen script in mise.toml.
- Fix misleading doc comment in PKLEvaluator (claimed embedded evaluator, actually spawns pkl CLI subprocess) - Add missing platform checksums in mise.lock (linux, macos-x64, windows) - Remove stale pkl-gen-swift references from CLAUDE.md docs (3 places) - Add registerPklTypes canary test to catch missing type registrations - Make codegen:pkl safer by generating to temp dir before replacing - Fix stale "locator" references in module descriptions - Add clarifying comment at _typeRegistration call site
Document the breaking runtime dependency change: Pkl 0.31+ is now required due to isNotEmpty/isNotBlank constraint builtins in schemas. Include upgrade instructions for mise, Homebrew, and manual installs.
Summary
registerPklTypes()with all 41 generated types — bypasses O(N) type scanning on first evaluationpkl-gen-swiftbinary topkl run @pkl.swift/gen.pkl!isEmptywithisNotEmptyin PKL schemas (Pkl 0.31 builtin constraint)Breaking changes for consumers
No breaking changes for existing users. Consumer
exfig.pklconfigs continue to work as-is.The
isNotEmptyconstraint change only affects PKL schema validation (server-side). Consumer configs that reference the published package URI won't see this until a new package version is published.Test plan
swift build— compiles with pkl-swift 0.8.0./bin/mise run codegen:pkl— new codegen tool produces correct outputswift test --parallel— all 138 tests pass (15 suites)swiftlint lint— 0 violationspkl eval --format json— schemas validate with Pkl 0.31