604 Commits

Author SHA1 Message Date
Daniel Chao
98ab741c54 Bump Kotlin to 2.2.20, minimum Kotlin to 2.1 (#1232)
The current version of the kotlin-gradle plugin is not compatible with
Gradle 9.1, causing error `java.lang.NoSuchMethodError:
 'org.gradle.api.Project org.gradle.api.artifacts.ProjectDependency.getDependencyProject()'`

Also, the Kotlin 2.0 language target is deprecated as of Kotlin 2.2.
2025-10-08 21:40:35 -07:00
Jen Basch
ffa3c14fb3 Pass trace mode from CLI/PklProject to the evaluator (#1230) 2025-10-08 10:49:55 -07:00
Jen Basch
e230fcf1a9 Follow up for trace pretty printing (#1227) 2025-10-08 09:36:42 -07:00
Daniel Chao
cf9d87373d Bump Gradle to 9.1.0 (#1228)
* Bump Gradle to 9.1.0
* Bump foojay resolver to 1.0.0
* Fix build logic on windows

Also, remove support for kotlin gradle plugin less than 1.8.x, because:

* Class `org.gradle.api.plugins.Convention` is no longer available in the classpath in Gradle
* Continued support for legacy plugin would require heavy reflection, which is brittle and hard to verify
* Kotlin 1.7 is 3 years old and no longer updated
2025-10-08 08:54:43 -07:00
Daniel Chao
55eac2088b Bump GraalVM to 25.0.0 (#1226)
* Migrate shadow plugin to org.gradleup to correctly bundle Truffle in
  a fat jar
* Switch to GraalVM Community Edition
2025-10-07 21:23:15 -07:00
Steve Salevan
cecaf39aff Adds traceMode evaluator setting to support trace() pretty printing (#1100) 2025-10-07 12:31:16 -07:00
Daniel Chao
d03a074f63 Bump dependencies (#1225)
* byte-buddy to 1.17.7
* commonmark to 0.26

And also test dependencies (junit, assertj)
2025-10-04 13:59:54 -07:00
Daniel Chao
c585a40601 Fix pkl-doc native test (#1224) 2025-10-03 17:15:14 -07:00
Daniel Chao
2e77d44877 Disable multi-jdk testing when running on Windows ARM (#1223)
Gradle does not support Java toolchains on Windows ARM right now.
To enable running the project in this os/arch, we must omit multi-jdk
test tasks.
2025-10-03 10:36:25 -07:00
Daniel Chao
5d90cf8f4e Introduce pkl-doc model version 2 (#1169)
Currently, in order to update a pkl-doc documentation site,
almost the entire existing site is read in order to update metadata
like known versions, known subtypes, and more.

For example, adding a new version of a package requires that the
existing runtime data of all existing versions be updated.
Eventually, this causes the required storage size to balloon
exponentially to the number of versions.

This addresses these limitations by:

1. Updating the runtime data structure to move "known versions" metadata
   to the package level (the same JSON file is used for all versions).
2. Eliminating known subtype and known usage information at a
   cross-package level.
3. Generating the search index by consuming the previously generated
   search index.
4. Generating the main page by consuming the search index.

Because this changes how runtime data is stored, an existing docsite
needs to be migrated.

This also introduces a new migration command, `pkl-doc --migrate`,
which transforms an older version of the website into a newer version.
2025-09-29 16:10:44 -07:00
Jen Basch
63f89fb679 Expose collected superclass properties/methods in pkl:reflect (#1106) 2025-09-19 12:23:57 -07:00
Simon Rüegg
d1171db3d5 Only format changed files (#1217) 2025-09-19 15:16:32 +02:00
Simon Rüegg
f327c8e086 Allow formatting multiple files/directories (#1215)
This makes it easier to work with tools which return a list of file to
format, e.g. to only handle files which have changed in a PR.
2025-09-19 15:13:22 +02:00
Islon Scherer
618c6243c5 Fix bug in format apply (#1211) 2025-09-19 11:28:40 +02:00
Islon Scherer
222741dccd Fix broken test (#1208) 2025-09-17 13:53:15 -07:00
Islon Scherer
fdc501a35c Implement canonical formatter (#1107)
CLI commands also added: `pkl format check` and `pkl format apply`.
2025-09-17 11:12:04 +02:00
Vladimir Matveev
6a06ab7caa Fixed fallback certificates not working in certain classloader setups (#1198)
In the original implementation the `org/pkl/commons/cli/PklCARoots.pem` resource is resolved relatively to the classloader associated with the class returned by `javaClass`. However, since this is an extension method for `HttpClient.Builder`, it means calling `javaClass` on the builder instance, which is actually defined in the system classpath.

Because of this, if the Pkl class is loaded by a different classloader compared to the one which contains JDK classes, which is totally possible in certain scenarios (e.g. with Gradle), then this resource resolution will fail.

The solution is to resolve `javaClass` against `this@CliCommand`, to use the classloader which loaded the jar with the `CliCommand` class to find the CA resource.
2025-09-04 15:49:43 -07:00
Daniel Chao
a66ac0eb35 Refine documentation for class Any (#1194) 2025-09-02 08:19:39 -07:00
Jen Basch
bef0375285 Improve interrupt handling in pkl repl (#1188) 2025-08-29 13:39:49 -07:00
Jen Basch
44cc154501 Prepare 0.29.1 release (#1192)
Co-authored-by: Daniel Chao <dan.chao@apple.com>
2025-08-27 14:33:25 -07:00
Artem Yarmoliuk
af7057b75f Fix shell completion for paths (#1161) 2025-08-26 10:46:54 -07:00
Jen Basch
a8806416b9 Correctly handle EOF after unmatched backtick (#1187) 2025-08-25 14:31:26 -07:00
Jen Basch
b32039a4f1 Add me as a maintainer (#1185) 2025-08-25 13:17:53 -07:00
Daniel Chao
a779316cc2 Update dependencies (#1184)
Bump test dependencies, and also commonmark
2025-08-21 21:32:56 -07:00
Daniel Chao
d9db939bdc Fix missing resources in native pkldoc, and disable test mode (#1175)
This fixes two issues:

1. Test mode is enabled in pkldoc without the ability to turn it off
2. Native pkldoc is missing required resources

This also adds tests for both `jpkldoc` and `pkldoc`.
2025-08-21 06:44:13 -07:00
Jen Basch
ae5f02b285 Allow trailing commas in comma-separated syntax elements (#1137) 2025-08-21 06:43:38 -07:00
Daniel Chao
3f2f0c3a2b Add docs for installing via winget (#1171) 2025-08-11 17:22:30 -07:00
Daniel Chao
7d50aaeec9 Fix escaping in yaml strings (#1165)
The backslash needs to be escaped when rendering double-quoted YAML strings.

In addition, this escapes the following characters:

* next line (0x85)
* nbsp (0xa0)
2025-08-06 07:57:52 -07:00
Daniel Chao
78ba6bf758 Fix download links (#1162)
* Snapshot repo has changed
* Fix a bug where pkl-codegen-java download link points to Sonatype instead of GitHub

Not in the PR: we also need to fix the snapshot download location;
but haven't figured out yet what the correct link is.
2025-07-31 08:43:24 -07:00
Daniel Chao
20e7e251ec Fix encoding for mapping with local members (#1152)
Fixes an issue where local members are included in
the mapping entry count.

Also: avoid re-computing Mapping.length
2025-07-28 10:13:45 -07:00
Islon Scherer
a3cc2f0ea6 Start next dev iteration 2025-07-24 20:06:01 +02:00
Islon Scherer
e12c655f5c Prepare 0.29.0 release 2025-07-24 20:06:01 +02:00
Daniel Chao
efee9f3801 Disable publishing jpkl (#1147)
This is causing a breakage in our release pipeline right now.
2025-07-24 10:04:46 -07:00
Daniel Chao
8e88133248 Disable publishing native executables to Maven Central (#1146)
Attempts to publish these artifacts is resulting in errors like
"No Archiver found for the stream signature"

Also, add to release notes
2025-07-24 09:21:02 -07:00
Daniel Chao
b38b15ba71 Remove duplicate block ids (#1145)
We can't repeat these block ids multiple times in the same page.
2025-07-24 17:19:29 +02:00
Daniel Chao
1c4fbe7c1c Fix: use http.rewrites to configure the evaluator in message passing API (#1141)
This is a bugfix, where the `rewrites` option is currently ignored.

Also: return any illegal argument errors from creating the evaluator as
an error in the CreateEvaluatorResponse
2025-07-24 07:30:31 -07:00
Daniel Chao
ae046a804b Add release notes for 0.29 (#1140)
Co-authored-by: Jen Basch <421772+HT154@users.noreply.github.com>
2025-07-24 07:30:04 -07:00
Daniel Chao
53f6951d81 Add bytesType to pkl:reflect (#1144)
Just like other data types on the base module, the mirror for `Bytes`
should be available directly on `pkl:reflect`.
2025-07-24 06:21:10 -07:00
Daniel Chao
7c8c4438d5 Defer noProxy to settings.pkl or PklProject if not set explicitly (#1143)
Fixes an issue where `http.noProxy` settings are ignored.
2025-07-23 10:57:31 -07:00
Daniel Chao
bdf6aa6b60 Un-deprecate Resource.base64, compute bytes/base64 in terms of each other (#1138)
This makes changes to avoid a needless breaking change.
It preserves code like `new Resource { base64 = someValue }.sha256`,
and also code that renders `Resource` into static formats.

Co-authored-by: Islon Scherer <islonscherer@gmail.com>
2025-07-23 06:25:49 -07:00
Daniel Chao
03d8e01801 Bump GraalVM JDK version to 21.0.8 (#1139) 2025-07-23 05:22:17 -07:00
Jen Basch
85e4f133a4 Add getOrDefault method to Listing and Mapping (#1053)
This PR adds methods to Listing and Mapping that can be used to retrieve members. If the member for the index/key isn't present, it applies default to the index/key. In both cases, this is essentially sugar for getOrNull(<index/key>) ?? default.apply(<index/key>).

Co-authored-by: Daniel Chao <daniel.h.chao@gmail.com>
2025-07-22 15:45:49 -07:00
Daniel Chao
306a3b0fc2 Polish http rewrites (#1133)
* Polish rewrite docs
* Add documentation comments, add missing evaluator options
* Add ability to set HTTP builder in ConfigEvaluatorBuilder
* Add ability to set rewrites in executor API
2025-07-22 15:42:07 -07:00
Daniel Chao
fe064960b4 Bump Gradle to 8.14.3 (#1129) 2025-07-18 11:03:38 -07:00
Daniel Chao
6cd73227a1 Update dependencies (#1128) 2025-07-18 09:29:44 -07:00
Islon Scherer
ba82c5c6d6 Only allow shebangs in the beginning of a module (#1126) 2025-07-18 11:18:45 +02:00
Daniel Chao
decb4ea66e Improve message passing api docs (#1127)
1. Change `Binary` to `Bytes` (new type representing binary data)
2. Add documentation for `http.rewrites` option
2025-07-17 07:57:48 -07:00
Daniel Chao
99020bb79d Add support for HTTP rewrites (#1062)
This adds a new configuration option for the HTTP client to replace URI prefixes when making outbound calls.

Follows the design of https://github.com/apple/pkl-evolution/pull/17
2025-07-16 15:53:31 -07:00
Daniel Chao
fea031a138 Switch publishing to sonatype central (#1121)
OSSRH is now EOL, so we need to publish to this new repository.
2025-07-11 05:48:31 -07:00
Daniel Chao
48ad4386c8 Add Kotlin support for "addGeneratedAnnotation" flag (#1115)
This adds logic so that the Kotlin code generator also supports the
"addGeneratedAnnotation" flag.

Also:
* Add Antora documentation
* Adjust names (generated-annotation -> add-generated-annotation)
* Adjust doc comments
2025-07-08 14:05:15 -07:00