Fix spelling errors (#846)

Also: change checksums due to filename and content changes, and fix language snippet test output to produce correct error messages
This commit is contained in:
Josh Soref
2024-12-23 15:49:56 -05:00
committed by GitHub
parent a014e8d1d1
commit d9c65d484a
53 changed files with 153 additions and 153 deletions
@@ -75,7 +75,7 @@ requestId: Int
/// API version of the CLI's `--allowed-modules` flag /// API version of the CLI's `--allowed-modules` flag
allowedModules: Listing<String>? allowedModules: Listing<String>?
/// Regex patterns to dettermine which resources are allowed to be read. /// Regex patterns to determine which resources are allowed to be read.
/// ///
/// API version of the CLI's `--allowed-resources` flag /// API version of the CLI's `--allowed-resources` flag
allowedResources: Listing<String>? allowedResources: Listing<String>?
@@ -130,7 +130,7 @@ class ClientResourceReader {
/// The URI scheme this reader is responsible for reading. /// The URI scheme this reader is responsible for reading.
scheme: String scheme: String
/// Tells whether the path part of ths URI has a /// Tells whether the path part of this URI has a
/// [hier-part](https://datatracker.ietf.org/doc/html/rfc3986#section-3). /// [hier-part](https://datatracker.ietf.org/doc/html/rfc3986#section-3).
/// ///
/// An example of a hierarchical URI is `file:///path/to/my/file`, where /// An example of a hierarchical URI is `file:///path/to/my/file`, where
@@ -148,7 +148,7 @@ class ClientModuleReader {
/// The URI scheme this reader is responsible for reading. /// The URI scheme this reader is responsible for reading.
scheme: String scheme: String
/// Tells whether the path part of ths URI has a /// Tells whether the path part of this URI has a
/// [hier-part](https://datatracker.ietf.org/doc/html/rfc3986#section-3). /// [hier-part](https://datatracker.ietf.org/doc/html/rfc3986#section-3).
/// ///
/// An example of a hierarchical URI is `file:///path/to/my/file`, where /// An example of a hierarchical URI is `file:///path/to/my/file`, where
@@ -427,7 +427,7 @@ evaluatorId: Int
/// The contents of the resource. /// The contents of the resource.
contents: Binary? // <1> contents: Binary? // <1>
/// The description of the error that occured when reading this resource. /// The description of the error that occurred when reading this resource.
error: String? error: String?
typealias Binary = Any // <1> typealias Binary = Any // <1>
@@ -478,7 +478,7 @@ evaluatorId: Int
/// The string contents of the module. /// The string contents of the module.
contents: String? contents: String?
/// The description of the error that occured when reading this resource. /// The description of the error that occurred when reading this resource.
error: String? error: String?
---- ----
@@ -528,7 +528,7 @@ evaluatorId: Int
/// The elements at the provided base path. /// The elements at the provided base path.
pathElements: Listing<PathElement>? pathElements: Listing<PathElement>?
/// The description of the error that occured when listing elements. /// The description of the error that occurred when listing elements.
error: String? error: String?
class PathElement { class PathElement {
@@ -586,7 +586,7 @@ evaluatorId: Int
/// The elements at the provided base path. /// The elements at the provided base path.
pathElements: Listing<PathElement>? pathElements: Listing<PathElement>?
/// The description of the error that occured when listing elements. /// The description of the error that occurred when listing elements.
error: String? error: String?
class PathElement { class PathElement {
+2 -2
View File
@@ -1,6 +1,6 @@
= Java Code Generator = Java Code Generator
include::ROOT:partial$component-attributes.adoc[] include::ROOT:partial$component-attributes.adoc[]
:uri-pkl-codgen-java-maven-module: {uri-maven-docsite}/artifact/org.pkl-lang/pkl-codegen-java :uri-pkl-codegen-java-maven-module: {uri-maven-docsite}/artifact/org.pkl-lang/pkl-codegen-java
The Java source code generator takes Pkl class definitions as an input, and generates corresponding Java classes with equally named properties. The Java source code generator takes Pkl class definitions as an input, and generates corresponding Java classes with equally named properties.
@@ -23,7 +23,7 @@ See xref:pkl-gradle:index.adoc#installation[Installation] in the Gradle plugin c
[[install-library]] [[install-library]]
=== Java Library === Java Library
The `pkl-codegen-java` library is available {uri-pkl-codgen-java-maven-module}[from Maven Central]. The `pkl-codegen-java` library is available {uri-pkl-codegen-java-maven-module}[from Maven Central].
It requires Java 17 or higher. It requires Java 17 or higher.
ifndef::is-release-version[] ifndef::is-release-version[]
@@ -2573,7 +2573,7 @@ the following security checks are performed:
* The target module URI is checked against the module allowlist (`--allowed-modules`). * The target module URI is checked against the module allowlist (`--allowed-modules`).
* The source and target modules' _trust levels_ are determined and compared. * The source and target modules' _trust levels_ are determined and compared.
For access to be granted, the source module's trust level must be higher than or equal to the target module's trust level. For access to be granted, the source module's trust level must be greater than or equal to the target module's trust level.
By default, there are five trust levels, listed from highest to lowest: By default, there are five trust levels, listed from highest to lowest:
. `repl:` modules (code evaluated in the REPL) . `repl:` modules (code evaluated in the REPL)
@@ -3353,9 +3353,9 @@ swiftHatchlings = typedProperty.listHatchlings(new { "Poppy"; "Chirpy" }) // <8>
<2> Assignment to an undeclared property in module context, amending `new Dynamic {}`. <2> Assignment to an undeclared property in module context, amending `new Dynamic {}`.
<3> `Listing` element creation, amending implicit `default`, `new Bird {}`. <3> `Listing` element creation, amending implicit `default`, `new Bird {}`.
<4> `Listing` element creation, amending implicit `default`, `new Dynamic {}`. <4> `Listing` element creation, amending implicit `default`, `new Dynamic {}`.
<5> `Mapping` value assignment, amdending the result of applying `default` to `"Saltmarsh Sparrow"`, `new Bird { name = "Saltmarsh Sparrow" }`. <5> `Mapping` value assignment, amending the result of applying `default` to `"Saltmarsh Sparrow"`, `new Bird { name = "Saltmarsh Sparrow" }`.
<6> `Mapping` value assignment _replacing_ the parent's entry, amending the result of applying `default` to `"Saltmarsh Sparrow"`, `new Bird { name = "Saltmarsh Sparrow" }`. <6> `Mapping` value assignment _replacing_ the parent's entry, amending the result of applying `default` to `"Saltmarsh Sparrow"`, `new Bird { name = "Saltmarsh Sparrow" }`.
<7> Admending the property default value `new Listing { new Bird { name = "Osprey" } }`; the result contains both birds. <7> Amending the property default value `new Listing { new Bird { name = "Osprey" } }`; the result contains both birds.
<8> Error: Cannot tell which parent to amend. <8> Error: Cannot tell which parent to amend.
[[let-expressions]] [[let-expressions]]
@@ -5475,7 +5475,7 @@ Readers are implemented as ordinary executables and use Pkl's xref:bindings-spec
The xref:swift:ROOT:index.adoc[Swift] and xref:go:ROOT:index.adoc[Go] language binding libraries provide an `ExternalReaderRuntime` type to facilitate implementing external readers. The xref:swift:ROOT:index.adoc[Swift] and xref:go:ROOT:index.adoc[Go] language binding libraries provide an `ExternalReaderRuntime` type to facilitate implementing external readers.
External readers are configured separately for modules and resources. External readers are configured separately for modules and resources.
They are registered by mapping their URI scheme to the executable to run and additonal arguments to pass. They are registered by mapping their URI scheme to the executable to run and additional arguments to pass.
This is done on the command line by passing `--external-resource-reader` and `--external-module-reader` flags, which may both be passed multiple times. This is done on the command line by passing `--external-resource-reader` and `--external-module-reader` flags, which may both be passed multiple times.
[source,text] [source,text]
+2 -2
View File
@@ -12,7 +12,7 @@ This release brings Windows support, improvements to controlling how Pkl talks o
The next release (0.27) is scheduled for October 10th, 2024. The next release (0.27) is scheduled for October 10th, 2024.
Please send feedback and questions to https://github.com/apple/pkl/discussions[GitHub Discussions], or submit an issue on https://github.com/apple/pkl/issues/new[Github]. + Please send feedback and questions to https://github.com/apple/pkl/discussions[GitHub Discussions], or submit an issue on https://github.com/apple/pkl/issues/new[GitHub]. +
[small]#Pkl is hosted on https://github.com/apple/pkl[GitHub]. [small]#Pkl is hosted on https://github.com/apple/pkl[GitHub].
To get started, follow xref:pkl-cli:index.adoc#installation[Installation].# To get started, follow xref:pkl-cli:index.adoc#installation[Installation].#
@@ -460,7 +460,7 @@ To mitigate, the package's version needs to be bumped, even if package contents
== Miscellaneous [small]#🐸# == Miscellaneous [small]#🐸#
The following changes have been made that are not new features, nor breaking changes. The following changes have been made that are neither new features nor breaking changes.
* Pkl's user-agent header for HTTP requests has been tweaked to add a semicolon (https://github.com/apple/pkl/pull/221[#221]). Here is an example difference: * Pkl's user-agent header for HTTP requests has been tweaked to add a semicolon (https://github.com/apple/pkl/pull/221[#221]). Here is an example difference:
+ +
+2 -2
View File
@@ -12,7 +12,7 @@ This release brings improvements in typechecking of `Listing` and `Mapping`, the
The next release (0.28) is scheduled for February 2025. The next release (0.28) is scheduled for February 2025.
Please send feedback and questions to https://github.com/apple/pkl/discussions[GitHub Discussions], or submit an issue on https://github.com/apple/pkl/issues/new[Github]. + Please send feedback and questions to https://github.com/apple/pkl/discussions[GitHub Discussions], or submit an issue on https://github.com/apple/pkl/issues/new[GitHub]. +
[small]#Pkl is hosted on https://github.com/apple/pkl[GitHub]. [small]#Pkl is hosted on https://github.com/apple/pkl[GitHub].
To get started, follow xref:pkl-cli:index.adoc#installation[Installation].# To get started, follow xref:pkl-cli:index.adoc#installation[Installation].#
@@ -121,7 +121,7 @@ A new API has been added to analyze the import graph of Pkl modules (https://git
This API comes in four forms: This API comes in four forms:
1. A standard library module: `pkl:analyze` 1. A standard library module: `pkl:analyze`
2. A CLI command: `pkl anaylze imports` 2. A CLI command: `pkl analyze imports`
3. A Java API: `org.pkl.core.Analyzer` 3. A Java API: `org.pkl.core.Analyzer`
4. A Gradle API: `org.pkl.gradle.task.AnalyzeImportsTask` 4. A Gradle API: `org.pkl.gradle.task.AnalyzeImportsTask`
+1 -1
View File
@@ -10,7 +10,7 @@ Pkl {version} was released on {release-date}. +
The next release (0.XX) is scheduled for ???.. The next release (0.XX) is scheduled for ???..
Please send feedback and questions to https://github.com/apple/pkl/discussions[GitHub Discussions], or submit an issue on https://github.com/apple/pkl/issues/new[Github]. + Please send feedback and questions to https://github.com/apple/pkl/discussions[GitHub Discussions], or submit an issue on https://github.com/apple/pkl/issues/new[GitHub]. +
[small]#Pkl is hosted on https://github.com/apple/pkl[GitHub]. [small]#Pkl is hosted on https://github.com/apple/pkl[GitHub].
To get started, follow xref:pkl-cli:index.adoc#installation[Installation].# To get started, follow xref:pkl-cli:index.adoc#installation[Installation].#
+1 -1
View File
@@ -12,7 +12,7 @@ XXX
The next release (XXX) is scheduled for XXX (e.g., August 2, 2021). The next release (XXX) is scheduled for XXX (e.g., August 2, 2021).
Please send feedback and questions to https://github.com/apple/pkl/discussions[GitHub Discussions], or submit an issue on https://github.com/apple/pkl/issues/new[Github]. + Please send feedback and questions to https://github.com/apple/pkl/discussions[GitHub Discussions], or submit an issue on https://github.com/apple/pkl/issues/new[GitHub]. +
[small]#Pkl is hosted on https://github.com/apple/pkl[GitHub]. [small]#Pkl is hosted on https://github.com/apple/pkl[GitHub].
To get started, follow xref:pkl-cli:index.adoc#installation[Installation].# To get started, follow xref:pkl-cli:index.adoc#installation[Installation].#
+1 -1
View File
@@ -356,7 +356,7 @@ myString = #"foo \ bar \ baz"#
myString = "foo \\ bar \\ baz" myString = "foo \\ bar \\ baz"
---- ----
NOTE: Sometimes, using custom string delimiters makes source code harder to read. For example, the `+\#+` literal reads better using escapes (`"\\#"`) than using custom string delimimters (`+##"\#"##+`). NOTE: Sometimes, using custom string delimiters makes source code harder to read. For example, the `+\#+` literal reads better using escapes (`"\\#"`) than using custom string delimiters (`+##"\#"##+`).
=== Interpolation === Interpolation
@@ -40,7 +40,7 @@ class AnalyzeCommand(helpLink: String) :
ModulesCommand( ModulesCommand(
name = "imports", name = "imports",
helpLink = helpLink, helpLink = helpLink,
help = "Prints the the graph of modules imported by the input module(s)." help = "Prints the graph of modules imported by the input module(s)."
) { ) {
private val outputPath: Path? by private val outputPath: Path? by
@@ -1242,7 +1242,7 @@ result = someLib.x
} }
@Test @Test
fun `gives decent error message if certificate file is emtpy`(@TempDir tempDir: Path) { fun `gives decent error message if certificate file is empty`(@TempDir tempDir: Path) {
val emptyCerts = tempDir.writeEmptyFile("empty.pem") val emptyCerts = tempDir.writeEmptyFile("empty.pem")
val err = assertThrows<CliException> { evalModuleThatImportsPackage(emptyCerts) } val err = assertThrows<CliException> { evalModuleThatImportsPackage(emptyCerts) }
assertThat(err).hasMessageContaining("CA certificate file `${emptyCerts.pathString}` is empty.") assertThat(err).hasMessageContaining("CA certificate file `${emptyCerts.pathString}` is empty.")
@@ -1313,7 +1313,7 @@ result = someLib.x
val options = val options =
CliEvaluatorOptions( CliEvaluatorOptions(
CliBaseOptions( CliBaseOptions(
sourceModules = listOf(URI("package://localhost:1/birds@0.5.0#/catalog/Ostritch.pkl")), sourceModules = listOf(URI("package://localhost:1/birds@0.5.0#/catalog/Ostrich.pkl")),
noCache = true, noCache = true,
httpProxy = URI(wwRuntimeInfo.httpBaseUrl), httpProxy = URI(wwRuntimeInfo.httpBaseUrl),
caCertificates = listOf(FileTestUtils.selfSignedCertificate), caCertificates = listOf(FileTestUtils.selfSignedCertificate),
@@ -1324,7 +1324,7 @@ result = someLib.x
assertThat(output) assertThat(output)
.isEqualTo( .isEqualTo(
""" """
name = "Ostritch" name = "Ostrich"
favoriteFruit { favoriteFruit {
name = "Orange" name = "Orange"
@@ -1,6 +1,6 @@
amends "../Bird.pkl" amends "../Bird.pkl"
name = "Ostritch" name = "Ostrich"
favoriteFruit { favoriteFruit {
name = "Orange" name = "Orange"
@@ -46,7 +46,7 @@ import org.pkl.commons.deleteRecursively
*/ */
class PackageServer : AutoCloseable { class PackageServer : AutoCloseable {
companion object { companion object {
const val BIRDS_SHA = "bfaf5281613d170a740505cc87561041f4e0cad1f0e6938bf94f7609f9a4673d" const val BIRDS_SHA = "6f18af649b47986530cd6dc39abe17888db2701bc5381c385fb86a32fda2685e"
const val FRUIT_SHA = "34a15b02346e6acb85da5bd71d8b0738a79008b38a7fc805e5869d9129ad27d2" const val FRUIT_SHA = "34a15b02346e6acb85da5bd71d8b0738a79008b38a7fc805e5869d9129ad27d2"
const val FRUIT_1_1_SHA = "8d982761d182f2185e4180c82190791d9a60c721cb3393bb2e946fab90131e8c" const val FRUIT_1_1_SHA = "8d982761d182f2185e4180c82190791d9a60c721cb3393bb2e946fab90131e8c"
@@ -61,7 +61,7 @@ fun shlex(input: String): List<String> {
quote = null quote = null
lastCloseQuoteIndex = idx lastCloseQuoteIndex = idx
} }
// if not in a quote and encounter a quote charater, enter a quote // if not in a quote and encounter a quote character, enter a quote
quote == null && (char == '\'' || char == '"') -> { quote == null && (char == '\'' || char == '"') -> {
quote = char quote = char
} }
@@ -245,7 +245,7 @@ public final class ConfigEvaluatorBuilder {
/** /**
* Sets the set of URI patterns to be allowed when importing modules. * Sets the set of URI patterns to be allowed when importing modules.
* *
* <p>This is a convenieince method that delegates to the underlying evaluator builder. * <p>This is a convenience method that delegates to the underlying evaluator builder.
* *
* @throws IllegalStateException if {@link #setSecurityManager(SecurityManager)} was also called. * @throws IllegalStateException if {@link #setSecurityManager(SecurityManager)} was also called.
*/ */
@@ -257,7 +257,7 @@ public final class ConfigEvaluatorBuilder {
/** /**
* Returns the set of patterns to be allowed when importing modules. * Returns the set of patterns to be allowed when importing modules.
* *
* <p>This is a convenieince method that delegates to the underlying evaluator builder. * <p>This is a convenience method that delegates to the underlying evaluator builder.
*/ */
public List<Pattern> getAllowedModules() { public List<Pattern> getAllowedModules() {
return evaluatorBuilder.getAllowedModules(); return evaluatorBuilder.getAllowedModules();
@@ -266,7 +266,7 @@ public final class ConfigEvaluatorBuilder {
/** /**
* Sets the set of URI patterns to be allowed when reading resources. * Sets the set of URI patterns to be allowed when reading resources.
* *
* <p>This is a convenieince method that delegates to the underlying evaluator builder. * <p>This is a convenience method that delegates to the underlying evaluator builder.
* *
* @throws IllegalStateException if {@link #setSecurityManager(SecurityManager)} was also called. * @throws IllegalStateException if {@link #setSecurityManager(SecurityManager)} was also called.
*/ */
@@ -278,7 +278,7 @@ public final class ConfigEvaluatorBuilder {
/** /**
* Returns the set of patterns to be allowed when reading resources. * Returns the set of patterns to be allowed when reading resources.
* *
* <p>This is a convenieince method that delegates to the underlying evaluator builder. * <p>This is a convenience method that delegates to the underlying evaluator builder.
*/ */
public List<Pattern> getAllowedResources() { public List<Pattern> getAllowedResources() {
return evaluatorBuilder.getAllowedResources(); return evaluatorBuilder.getAllowedResources();
@@ -288,7 +288,7 @@ public final class ConfigEvaluatorBuilder {
* Sets the root directory, which restricts access to file-based modules and resources located * Sets the root directory, which restricts access to file-based modules and resources located
* under this directory. * under this directory.
* *
* <p>This is a convenieince method that delegates to the underlying evaluator builder. * <p>This is a convenience method that delegates to the underlying evaluator builder.
*/ */
public ConfigEvaluatorBuilder setRootDir(@Nullable Path rootDir) { public ConfigEvaluatorBuilder setRootDir(@Nullable Path rootDir) {
evaluatorBuilder.setRootDir(rootDir); evaluatorBuilder.setRootDir(rootDir);
@@ -298,7 +298,7 @@ public final class ConfigEvaluatorBuilder {
/** /**
* Returns the currently set root directory, if set. * Returns the currently set root directory, if set.
* *
* <p>This is a convenieince method that delegates to the underlying evaluator builder. * <p>This is a convenience method that delegates to the underlying evaluator builder.
*/ */
public @Nullable Path getRootDir() { public @Nullable Path getRootDir() {
return evaluatorBuilder.getRootDir(); return evaluatorBuilder.getRootDir();
@@ -41,8 +41,8 @@ public class PObjectToDataObjectTest {
EnumSet.of(Hobby.SURFING, Hobby.SWIMMING), EnumSet.of(Hobby.SURFING, Hobby.SWIMMING),
new Address("sesame street", 94105)); new Address("sesame street", 94105));
private static final PersonConstructoProperties pigeon2 = private static final PersonConstructorProperties pigeon2 =
new PersonConstructoProperties( new PersonConstructorProperties(
"pigeon", "pigeon",
40, 40,
EnumSet.of(Hobby.SURFING, Hobby.SWIMMING), EnumSet.of(Hobby.SURFING, Hobby.SWIMMING),
@@ -63,7 +63,7 @@ public class PObjectToDataObjectTest {
@Test @Test
public void ex1_constructor_properties() { public void ex1_constructor_properties() {
var ex1 = module.getProperty("ex1"); var ex1 = module.getProperty("ex1");
assertThat(mapper.map(ex1, PersonConstructoProperties.class)).isEqualTo(pigeon2); assertThat(mapper.map(ex1, PersonConstructorProperties.class)).isEqualTo(pigeon2);
} }
@Test @Test
@@ -149,14 +149,14 @@ public class PObjectToDataObjectTest {
} }
} }
static class PersonConstructoProperties { static class PersonConstructorProperties {
final String name; final String name;
final int age; final int age;
final Set<Hobby> hobbies; final Set<Hobby> hobbies;
final Address address; final Address address;
@ConstructorProperties({"name", "age", "hobbies", "address"}) @ConstructorProperties({"name", "age", "hobbies", "address"})
PersonConstructoProperties(String name, int age, Set<Hobby> hobbies, Address address) { PersonConstructorProperties(String name, int age, Set<Hobby> hobbies, Address address) {
this.name = name; this.name = name;
this.age = age; this.age = age;
this.hobbies = hobbies; this.hobbies = hobbies;
@@ -166,7 +166,7 @@ public class PObjectToDataObjectTest {
@Override @Override
public boolean equals(@Nullable Object obj) { public boolean equals(@Nullable Object obj) {
if (this == obj) return true; if (this == obj) return true;
if (!(obj instanceof PersonConstructoProperties other)) return false; if (!(obj instanceof PersonConstructorProperties other)) return false;
return name.equals(other.name) return name.equals(other.name)
&& age == other.age && age == other.age
&& hobbies.equals(other.hobbies) && hobbies.equals(other.hobbies)
@@ -170,7 +170,7 @@ public interface Evaluator extends AutoCloseable {
String evaluateExpressionString(ModuleSource moduleSource, String expression); String evaluateExpressionString(ModuleSource moduleSource, String expression);
/** /**
* Evalautes the module's schema, which describes the properties, methods, and classes of a * Evaluates the module's schema, which describes the properties, methods, and classes of a
* module. * module.
* *
* @throws PklException if an error occurs during evaluation * @throws PklException if an error occurs during evaluation
@@ -16,7 +16,7 @@
package org.pkl.core; package org.pkl.core;
/** /**
* Indicates that a non-existent property was requested for a {@link Composite}. To check if a * Indicates that a nonexistent property was requested for a {@link Composite}. To check if a
* property exists, use {@link Composite#hasProperty(String)}. * property exists, use {@link Composite#hasProperty(String)}.
*/ */
public final class NoSuchPropertyException extends RuntimeException { public final class NoSuchPropertyException extends RuntimeException {
@@ -106,7 +106,7 @@ public final class ClassNode extends ExpressionNode {
new VmTyped( new VmTyped(
frame.materialize(), frame.materialize(),
null, // initialized later by VmClass null, // initialized later by VmClass
null, // initialized later by Vmclass null, // initialized later by VmClass
prototypeMembers); prototypeMembers);
} }
@@ -114,7 +114,7 @@ public abstract class TypeNode extends PklNode {
} }
/** /**
* Visit child type nodes; but not paramaterized types (does not visit {@code String} in {@code * Visit child type nodes; but not parameterized types (does not visit {@code String} in {@code
* Listing<String>}). * Listing<String>}).
*/ */
protected abstract boolean acceptTypeNode(TypeNodeConsumer consumer); protected abstract boolean acceptTypeNode(TypeNodeConsumer consumer);
@@ -534,7 +534,7 @@ public final class ModuleKeys {
conn.connect(); conn.connect();
if (conn instanceof JarURLConnection && IoUtils.isWindows()) { if (conn instanceof JarURLConnection && IoUtils.isWindows()) {
// On Windows, opening a JarURLConnection prevents the jar file from being deleted, unless // On Windows, opening a JarURLConnection prevents the jar file from being deleted, unless
// cacheing is disabled. // caching is disabled.
// See https://bugs.openjdk.org/browse/JDK-8239054 // See https://bugs.openjdk.org/browse/JDK-8239054
conn.setUseCaches(false); conn.setUseCaches(false);
} }
@@ -333,7 +333,7 @@ final class PackageResolvers {
throw fileIsADirectory(); throw fileIsADirectory();
} }
var entries = cachedEntries.get(packageUri); var entries = cachedEntries.get(packageUri);
// need to normalize here but not in `doListElments` nor `doHasElement` because // need to normalize here but not in `doListElements` nor `doHasElement` because
// `TreePathElement.getElement` does normalization already. // `TreePathElement.getElement` does normalization already.
var path = IoUtils.toNormalizedPathString(Path.of(uri.getAssetPath()).normalize()); var path = IoUtils.toNormalizedPathString(Path.of(uri.getAssetPath()).normalize());
return entries.get(path).array(); return entries.get(path).array();
@@ -434,7 +434,7 @@ public final class GlobResolver {
} }
} }
/** Split a glob pattern into the base, non-wildard parts, and the wildcard parts. */ /** Split a glob pattern into the base, non-wildcard parts, and the wildcard parts. */
private static Pair<String, String[]> splitGlobPatternIntoBaseAndWildcards( private static Pair<String, String[]> splitGlobPatternIntoBaseAndWildcards(
ReaderBase reader, String globPattern, boolean hasAbsoluteGlob) { ReaderBase reader, String globPattern, boolean hasAbsoluteGlob) {
var effectiveGlobPattern = globPattern; var effectiveGlobPattern = globPattern;
@@ -483,8 +483,8 @@ public final class IoUtils {
start++; start++;
} }
var uriPartsRemaining = uriParts.subList(start, uriParts.size()); var uriPartsRemaining = uriParts.subList(start, uriParts.size());
var basePartsRemainig = baseParts.subList(start, baseParts.size()); var basePartsRemaining = baseParts.subList(start, baseParts.size());
if (basePartsRemainig.isEmpty()) { if (basePartsRemaining.isEmpty()) {
return new URI( return new URI(
null, null,
null, null,
@@ -495,7 +495,7 @@ public final class IoUtils {
uri.getFragment()); uri.getFragment());
} }
var resultingPath = var resultingPath =
"../".repeat(basePartsRemainig.size()) + String.join("/", uriPartsRemaining); "../".repeat(basePartsRemaining.size()) + String.join("/", uriPartsRemaining);
return new URI(null, null, null, -1, resultingPath, uri.getQuery(), uri.getFragment()); return new URI(null, null, null, -1, resultingPath, uri.getQuery(), uri.getFragment());
} catch (URISyntaxException e) { } catch (URISyntaxException e) {
// Impossible; started from a valid URI to begin with. // Impossible; started from a valid URI to begin with.
@@ -716,7 +716,7 @@ public final class IoUtils {
* URI#resolve(URI)} * URI#resolve(URI)}
*/ */
public static URI fixTripleSlashUri(URI baseUri, URI newUri) { public static URI fixTripleSlashUri(URI baseUri, URI newUri) {
// `getHost()` is erroroneously `null` when parsing triple-slash URIs. // `getHost()` is erroneously `null` when parsing triple-slash URIs.
// Ensure that they are preserved during resolution. // Ensure that they are preserved during resolution.
if (baseUri.getScheme() != null if (baseUri.getScheme() != null
&& baseUri.getScheme().equalsIgnoreCase(newUri.getScheme()) && baseUri.getScheme().equalsIgnoreCase(newUri.getScheme())
@@ -32,7 +32,7 @@ import org.pkl.core.util.Nullable;
/** /**
* Parser for JSON. * Parser for JSON.
* *
* <p>JSON types are paresd into the following Java types: * <p>JSON types are parsed into the following Java types:
* *
* <table> * <table>
* <thead> * <thead>
@@ -675,7 +675,7 @@ invalidGlobInvalidCharacterInCharacterClass=\
The character `{0}` is not valid in a character class. The character `{0}` is not valid in a character class.
invalidGlobExtGlob=\ invalidGlobExtGlob=\
Extebded globbing features are not supported. Extended globbing features are not supported.
invalidGlobNestedSubpattern=\ invalidGlobNestedSubpattern=\
Sub-patterns cannot be nested. To fix, remove or escape the inner `{` character. Sub-patterns cannot be nested. To fix, remove or escape the inner `{` character.
@@ -750,7 +750,7 @@ Failed to resolve type required for rendering protobuf.\n\
Consider adding a type annotation. Consider adding a type annotation.
cannotRenderSubtypeForProtobuf=\ cannotRenderSubtypeForProtobuf=\
Can not render subtype {0} of specified type {1} in protobuf. Cannot render subtype {0} of specified type {1} in protobuf.
cannotExportValue=\ cannotExportValue=\
A value of type `{0}` cannot be exported. A value of type `{0}` cannot be exported.
@@ -1079,7 +1079,7 @@ Certificates can only be loaded from `jar:` or `file:` URLs, but got:\n\
cannotFindBuiltInCertificates=\ cannotFindBuiltInCertificates=\
Cannot find Pkl's trusted CA certificates on the class path.\n\ Cannot find Pkl's trusted CA certificates on the class path.\n\
To fix this problem, add dependendy `org.pkl:pkl-certs`. To fix this problem, add dependency `org.pkl:pkl-certs`.
# suppress inspection "HttpUrlsUsage" # suppress inspection "HttpUrlsUsage"
malformedProxyAddress=\ malformedProxyAddress=\
@@ -15,21 +15,21 @@ parrot {
new { new {
// multiline string that is a property within an element // multiline string that is a property within an element
lastName = """ lastName = """
Flinstone Flintstone
Flinstone Flintstone
""" """
""" """
Flinstone Flintstone
Flinstone Flintstone
""" """
} }
// multiline string that is an element // multiline string that is an element
""" """
Flistone Flintstone
Flistone Flintstone
""" """
} }
@@ -8,5 +8,5 @@ class Person {
person = new Person { person = new Person {
name = "Pigeon" name = "Pigeon"
// typo // typo
adress = "Howdy St." address_ = "Howdy St."
} }
@@ -26,14 +26,14 @@ examples {
module.catch(() -> l[0]) module.catch(() -> l[0])
} }
["type check: local paramaterized property type, unparamaterized new with explicit parent"] { ["type check: local parameterized property type, unparameterized new with explicit parent"] {
local m: Listing<String> = new Listing { local m: Listing<String> = new Listing {
1 1
} }
module.catch(() -> m[0]) module.catch(() -> m[0])
} }
["type check: local unparameterized property type, paramaterized new with explicit parent"] { ["type check: local unparameterized property type, parameterized new with explicit parent"] {
local m: Listing = new Listing<String> { local m: Listing = new Listing<String> {
1 1
} }
@@ -105,7 +105,7 @@ examples {
"Ba" // fails `length.isOdd` "Ba" // fails `length.isOdd`
"bar" // fails `this == capitalize()` "bar" // fails `this == capitalize()`
} }
// type check String(length.isOdd) should be propagated to the listing via a paramater type // type check String(length.isOdd) should be propagated to the listing via a parameter type
// annotation // annotation
local function func1(listing: Listing<String(length.isOdd)>) = listing local function func1(listing: Listing<String(length.isOdd)>) = listing
// type check String(length.isOdd) should be propagated to the listing via a return type // type check String(length.isOdd) should be propagated to the listing via a return type
@@ -35,7 +35,7 @@ local x7 = new Listing {
} }
local x8 = new Listing<String> { local x8 = new Listing<String> {
throw("element unneccessarily evaluated") throw("element unnecessarily evaluated")
} }
res5 = x4.length == 1 res5 = x4.length == 1
@@ -1 +1 @@
res = import("package://localhost:0/badImportsWithinPackage@1.0.0#/unknownDependencyReaad.pkl") res = import("package://localhost:0/badImportsWithinPackage@1.0.0#/unknownDependencyRead.pkl")
@@ -1 +1 @@
res = import("package://localhost:0/badImportsWithinPackage@1.0.0#/invalidPathReaad.pkl") res = import("package://localhost:0/badImportsWithinPackage@1.0.0#/invalidPathRead.pkl")
@@ -13,14 +13,14 @@ examples {
} }
} }
import("package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl") import("package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl")
import("package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl") import("package://localhost:0/birds@0.5.0#/catalog/Ostrich.pkl")
} }
["importing while specifying checksum"] { ["importing while specifying checksum"] {
import("package://localhost:0/birds@0.5.0::sha256:bfaf5281613d170a740505cc87561041f4e0cad1f0e6938bf94f7609f9a4673d#/catalog/Swallow.pkl") import("package://localhost:0/birds@0.5.0::sha256:6f18af649b47986530cd6dc39abe17888db2701bc5381c385fb86a32fda2685e#/catalog/Swallow.pkl")
} }
["reads"] { ["reads"] {
read("package://localhost:0/birds@0.5.0#/Bird.pkl") read("package://localhost:0/birds@0.5.0#/Bird.pkl")
read("package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl") read("package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl")
read("package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl") read("package://localhost:0/birds@0.5.0#/catalog/Ostrich.pkl")
} }
} }
@@ -20,6 +20,6 @@ examples {
import("package://localhost:0/birds@0.5.0#/allFruit.pkl").fruitFiles import("package://localhost:0/birds@0.5.0#/allFruit.pkl").fruitFiles
} }
["glob import while specifying checksum"] { ["glob import while specifying checksum"] {
import*("package://localhost:0/birds@0.5.0::sha256:bfaf5281613d170a740505cc87561041f4e0cad1f0e6938bf94f7609f9a4673d#/catalog/*.pkl") import*("package://localhost:0/birds@0.5.0::sha256:6f18af649b47986530cd6dc39abe17888db2701bc5381c385fb86a32fda2685e#/catalog/*.pkl")
} }
} }
@@ -1,11 +1,11 @@
amends ".../snippetTest.pkl" amends ".../snippetTest.pkl"
import "@birds/catalog/Ostritch.pkl" import "@birds/catalog/Ostrich.pkl"
import "@birds/catalog/Swallow.pkl" import "@birds/catalog/Swallow.pkl"
examples { examples {
["import package"] { ["import package"] {
Ostritch Ostrich
Swallow Swallow
} }
@@ -11,19 +11,19 @@ barnOwl {
parrot { parrot {
new { new {
lastName = """ lastName = """
Flinstone Flintstone
Flinstone Flintstone
""" """
""" """
Flinstone Flintstone
Flinstone Flintstone
""" """
} }
""" """
Flistone Flintstone
Flistone Flintstone
""" """
} }
@@ -199,7 +199,7 @@ examples {
foo: "renders" foo: "renders"
} }
""" """
"Can not render subtype protobuf#Foo of specified type protobuf#Bar in protobuf." "Cannot render subtype protobuf#Foo of specified type protobuf#Bar in protobuf."
""" """
myFoo: { myFoo: {
foo: "renders" foo: "renders"
@@ -84,8 +84,8 @@ examples {
} }
["package"] { ["package"] {
new { new {
["package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"] { ["package://localhost:0/birds@0.5.0#/catalog/Ostrich.pkl"] {
name = "Ostritch" name = "Ostrich"
favoriteFruit { favoriteFruit {
name = "Orange" name = "Orange"
} }
@@ -101,7 +101,7 @@ examples {
"package://localhost:0/birds@0.5.0#/Bird.pkl" "package://localhost:0/birds@0.5.0#/Bird.pkl"
"package://localhost:0/birds@0.5.0#/allFruit.pkl" "package://localhost:0/birds@0.5.0#/allFruit.pkl"
"package://localhost:0/birds@0.5.0#/catalog.pkl" "package://localhost:0/birds@0.5.0#/catalog.pkl"
"package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl" "package://localhost:0/birds@0.5.0#/catalog/Ostrich.pkl"
"package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl" "package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
"package://localhost:0/birds@0.5.0#/some/dir/Bird.pkl" "package://localhost:0/birds@0.5.0#/some/dir/Bird.pkl"
} }
@@ -116,8 +116,8 @@ examples {
} }
["package glob and up one level"] { ["package glob and up one level"] {
new { new {
["package://localhost:0/birds@0.5.0#/catalog/../catalog/Ostritch.pkl"] { ["package://localhost:0/birds@0.5.0#/catalog/../catalog/Ostrich.pkl"] {
name = "Ostritch" name = "Ostrich"
favoriteFruit { favoriteFruit {
name = "Orange" name = "Orange"
} }
@@ -156,19 +156,19 @@ examples {
""" """
base64 = "bW9kdWxlIGJpcmRzLmNhdGFsb2cKCmNhdGFsb2cgPSBpbXBvcnQqKCJjYXRhbG9nLyoucGtsIikKY2F0YWxvZ0ZpbGVzID0gcmVhZCooImNhdGFsb2cvKi5wa2wiKQo=" base64 = "bW9kdWxlIGJpcmRzLmNhdGFsb2cKCmNhdGFsb2cgPSBpbXBvcnQqKCJjYXRhbG9nLyoucGtsIikKY2F0YWxvZ0ZpbGVzID0gcmVhZCooImNhdGFsb2cvKi5wa2wiKQo="
} }
["package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"] { ["package://localhost:0/birds@0.5.0#/catalog/Ostrich.pkl"] {
uri = "package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl" uri = "package://localhost:0/birds@0.5.0#/catalog/Ostrich.pkl"
text = """ text = """
amends "../Bird.pkl" amends "../Bird.pkl"
name = "Ostritch" name = "Ostrich"
favoriteFruit { favoriteFruit {
name = "Orange" name = "Orange"
} }
""" """
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cml0Y2giCgpmYXZvcml0ZUZydWl0IHsKICBuYW1lID0gIk9yYW5nZSIKfQo=" base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cmljaCIKCmZhdm9yaXRlRnJ1aXQgewogIG5hbWUgPSAiT3JhbmdlIgp9Cg=="
} }
["package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"] { ["package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"] {
uri = "package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl" uri = "package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
@@ -1,8 +1,8 @@
–– Pkl Error –– –– Pkl Error ––
Cannot find property `adress` in object of type `class3#Person`. Cannot find property `address_` in object of type `class3#Person`.
xx | adress = "Howdy St." xx | address_ = "Howdy St."
^^^^^^ ^^^^^^^^
at class3#person (file:///$snippetsDir/input/classes/class3.pkl) at class3#person (file:///$snippetsDir/input/classes/class3.pkl)
Did you mean any of the following? Did you mean any of the following?
@@ -10,10 +10,10 @@ examples {
["type check: local new with inferred parent"] { ["type check: local new with inferred parent"] {
"Expected value of type `String`, but got type `Int`. Value: 1" "Expected value of type `String`, but got type `Int`. Value: 1"
} }
["type check: local paramaterized property type, unparamaterized new with explicit parent"] { ["type check: local parameterized property type, unparameterized new with explicit parent"] {
"Expected value of type `String`, but got type `Int`. Value: 1" "Expected value of type `String`, but got type `Int`. Value: 1"
} }
["type check: local unparameterized property type, paramaterized new with explicit parent"] { ["type check: local unparameterized property type, parameterized new with explicit parent"] {
"Expected value of type `String`, but got type `Int`. Value: 1" "Expected value of type `String`, but got type `Int`. Value: 1"
} }
["amending listings does not require type checks on amending object members"] { ["amending listings does not require type checks on amending object members"] {
@@ -1,9 +1,9 @@
–– Pkl Error –– –– Pkl Error ––
Cannot find module `package://localhost:0/badImportsWithinPackage@1.0.0#/unknownDependencyReaad.pkl`. Cannot find dependency named `notapackage`, because it was not declared in package `package://localhost:0/badImportsWithinPackage@1.0.0`.
x | res = import("package://localhost:0/badImportsWithinPackage@1.0.0#/unknownDependencyReaad.pkl") x | res = read("@notapackage/Foo.txt")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
at badRead8.error#res (file:///$snippetsDir/input/packages/badRead8.error.pkl) at unknownDependencyRead#res (package://localhost:0/badImportsWithinPackage@1.0.0#/unknownDependencyRead.pkl)
xxx | text = renderer.renderDocument(value) xxx | text = renderer.renderDocument(value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -1,9 +1,9 @@
–– Pkl Error –– –– Pkl Error ––
Cannot find module `package://localhost:0/badImportsWithinPackage@1.0.0#/invalidPathReaad.pkl`. I/O error reading resource `package://localhost:0/badImportsWithinPackage@1.0.0#/not/a/valid/path.txt`.
x | res = import("package://localhost:0/badImportsWithinPackage@1.0.0#/invalidPathReaad.pkl") x | res = read("not/a/valid/path.txt")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
at badRead9.error#res (file:///$snippetsDir/input/packages/badRead9.error.pkl) at invalidPathRead#res (package://localhost:0/badImportsWithinPackage@1.0.0#/invalidPathRead.pkl)
xxx | text = renderer.renderDocument(value) xxx | text = renderer.renderDocument(value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -13,7 +13,7 @@ examples {
} }
} }
new { new {
name = "Ostritch" name = "Ostrich"
favoriteFruit { favoriteFruit {
name = "Orange" name = "Orange"
} }
@@ -57,18 +57,18 @@ examples {
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCmltcG9ydCAiQGZydWl0aWVzL2NhdGFsb2cvYXBwbGUucGtsIgoKbmFtZSA9ICJTd2FsbG93IgoKZmF2b3JpdGVGcnVpdCA9IGFwcGxlCg==" base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCmltcG9ydCAiQGZydWl0aWVzL2NhdGFsb2cvYXBwbGUucGtsIgoKbmFtZSA9ICJTd2FsbG93IgoKZmF2b3JpdGVGcnVpdCA9IGFwcGxlCg=="
} }
new { new {
uri = "package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl" uri = "package://localhost:0/birds@0.5.0#/catalog/Ostrich.pkl"
text = """ text = """
amends "../Bird.pkl" amends "../Bird.pkl"
name = "Ostritch" name = "Ostrich"
favoriteFruit { favoriteFruit {
name = "Orange" name = "Orange"
} }
""" """
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cml0Y2giCgpmYXZvcml0ZUZydWl0IHsKICBuYW1lID0gIk9yYW5nZSIKfQo=" base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cmljaCIKCmZhdm9yaXRlRnJ1aXQgewogIG5hbWUgPSAiT3JhbmdlIgp9Cg=="
} }
} }
} }
@@ -1,8 +1,8 @@
examples { examples {
["glob import"] { ["glob import"] {
new { new {
["package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"] { ["package://localhost:0/birds@0.5.0#/catalog/Ostrich.pkl"] {
name = "Ostritch" name = "Ostrich"
favoriteFruit { favoriteFruit {
name = "Orange" name = "Orange"
} }
@@ -17,8 +17,8 @@ examples {
} }
["glob import within package"] { ["glob import within package"] {
new { new {
["catalog/Ostritch.pkl"] { ["catalog/Ostrich.pkl"] {
name = "Ostritch" name = "Ostrich"
favoriteFruit { favoriteFruit {
name = "Orange" name = "Orange"
} }
@@ -40,19 +40,19 @@ examples {
} }
["glob read"] { ["glob read"] {
new { new {
["package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"] { ["package://localhost:0/birds@0.5.0#/catalog/Ostrich.pkl"] {
uri = "package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl" uri = "package://localhost:0/birds@0.5.0#/catalog/Ostrich.pkl"
text = """ text = """
amends "../Bird.pkl" amends "../Bird.pkl"
name = "Ostritch" name = "Ostrich"
favoriteFruit { favoriteFruit {
name = "Orange" name = "Orange"
} }
""" """
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cml0Y2giCgpmYXZvcml0ZUZydWl0IHsKICBuYW1lID0gIk9yYW5nZSIKfQo=" base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cmljaCIKCmZhdm9yaXRlRnJ1aXQgewogIG5hbWUgPSAiT3JhbmdlIgp9Cg=="
} }
["package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"] { ["package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"] {
uri = "package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl" uri = "package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
@@ -72,19 +72,19 @@ examples {
} }
["glob read within package"] { ["glob read within package"] {
new { new {
["catalog/Ostritch.pkl"] { ["catalog/Ostrich.pkl"] {
uri = "package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl" uri = "package://localhost:0/birds@0.5.0#/catalog/Ostrich.pkl"
text = """ text = """
amends "../Bird.pkl" amends "../Bird.pkl"
name = "Ostritch" name = "Ostrich"
favoriteFruit { favoriteFruit {
name = "Orange" name = "Orange"
} }
""" """
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cml0Y2giCgpmYXZvcml0ZUZydWl0IHsKICBuYW1lID0gIk9yYW5nZSIKfQo=" base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cmljaCIKCmZhdm9yaXRlRnJ1aXQgewogIG5hbWUgPSAiT3JhbmdlIgp9Cg=="
} }
["catalog/Swallow.pkl"] { ["catalog/Swallow.pkl"] {
uri = "package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl" uri = "package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
@@ -118,13 +118,13 @@ examples {
} }
["glob import while specifying checksum"] { ["glob import while specifying checksum"] {
new { new {
["package://localhost:0/birds@0.5.0::sha256:bfaf5281613d170a740505cc87561041f4e0cad1f0e6938bf94f7609f9a4673d#/catalog/Ostritch.pkl"] { ["package://localhost:0/birds@0.5.0::sha256:6f18af649b47986530cd6dc39abe17888db2701bc5381c385fb86a32fda2685e#/catalog/Ostrich.pkl"] {
name = "Ostritch" name = "Ostrich"
favoriteFruit { favoriteFruit {
name = "Orange" name = "Orange"
} }
} }
["package://localhost:0/birds@0.5.0::sha256:bfaf5281613d170a740505cc87561041f4e0cad1f0e6938bf94f7609f9a4673d#/catalog/Swallow.pkl"] { ["package://localhost:0/birds@0.5.0::sha256:6f18af649b47986530cd6dc39abe17888db2701bc5381c385fb86a32fda2685e#/catalog/Swallow.pkl"] {
name = "Swallow" name = "Swallow"
favoriteFruit { favoriteFruit {
name = "Apple" name = "Apple"
@@ -16,7 +16,7 @@ facts {
examples { examples {
["import package"] { ["import package"] {
new { new {
name = "Ostritch" name = "Ostrich"
favoriteFruit { favoriteFruit {
name = "Orange" name = "Orange"
} }
@@ -40,11 +40,11 @@ examples {
new { new {
uri = "projectpackage://localhost:0/birds@0.5.0#/catalog" uri = "projectpackage://localhost:0/birds@0.5.0#/catalog"
text = """ text = """
Ostritch.pkl Ostrich.pkl
Swallow.pkl Swallow.pkl
""" """
base64 = "T3N0cml0Y2gucGtsClN3YWxsb3cucGtsCg==" base64 = "T3N0cmljaC5wa2wKU3dhbGxvdy5wa2wK"
} }
new { new {
uri = "projectpackage://localhost:0/birds@0.5.0#/" uri = "projectpackage://localhost:0/birds@0.5.0#/"
@@ -1,8 +1,8 @@
examples { examples {
["glob-import within package"] { ["glob-import within package"] {
new { new {
["catalog/Ostritch.pkl"] { ["catalog/Ostrich.pkl"] {
name = "Ostritch" name = "Ostrich"
favoriteFruit { favoriteFruit {
name = "Orange" name = "Orange"
} }
@@ -17,8 +17,8 @@ examples {
} }
["glob-import absolute package uri"] { ["glob-import absolute package uri"] {
new { new {
["package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"] { ["package://localhost:0/birds@0.5.0#/catalog/Ostrich.pkl"] {
name = "Ostritch" name = "Ostrich"
favoriteFruit { favoriteFruit {
name = "Orange" name = "Orange"
} }
@@ -44,25 +44,25 @@ examples {
} }
} }
["glob-import using dependency notation"] { ["glob-import using dependency notation"] {
Set("@birds/catalog/Ostritch.pkl", "@birds/catalog/Swallow.pkl") Set("@birds/catalog/Ostrich.pkl", "@birds/catalog/Swallow.pkl")
Set("@birds/Bird.pkl", "@birds/allFruit.pkl", "@birds/catalog.pkl") Set("@birds/Bird.pkl", "@birds/allFruit.pkl", "@birds/catalog.pkl")
Set("@birds/Bird.pkl", "@birds/allFruit.pkl", "@birds/catalog.pkl", "@birds/catalog/Ostritch.pkl", "@birds/catalog/Swallow.pkl", "@birds/some/dir/Bird.pkl") Set("@birds/Bird.pkl", "@birds/allFruit.pkl", "@birds/catalog.pkl", "@birds/catalog/Ostrich.pkl", "@birds/catalog/Swallow.pkl", "@birds/some/dir/Bird.pkl")
} }
["glob-read using dependency notation"] { ["glob-read using dependency notation"] {
new { new {
["@birds/catalog/Ostritch.pkl"] { ["@birds/catalog/Ostrich.pkl"] {
uri = "projectpackage://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl" uri = "projectpackage://localhost:0/birds@0.5.0#/catalog/Ostrich.pkl"
text = """ text = """
amends "../Bird.pkl" amends "../Bird.pkl"
name = "Ostritch" name = "Ostrich"
favoriteFruit { favoriteFruit {
name = "Orange" name = "Orange"
} }
""" """
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cml0Y2giCgpmYXZvcml0ZUZydWl0IHsKICBuYW1lID0gIk9yYW5nZSIKfQo=" base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cmljaCIKCmZhdm9yaXRlRnJ1aXQgewogIG5hbWUgPSAiT3JhbmdlIgp9Cg=="
} }
["@birds/catalog/Swallow.pkl"] { ["@birds/catalog/Swallow.pkl"] {
uri = "projectpackage://localhost:0/birds@0.5.0#/catalog/Swallow.pkl" uri = "projectpackage://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
@@ -154,19 +154,19 @@ examples {
""" """
base64 = "bW9kdWxlIGJpcmRzLmNhdGFsb2cKCmNhdGFsb2cgPSBpbXBvcnQqKCJjYXRhbG9nLyoucGtsIikKY2F0YWxvZ0ZpbGVzID0gcmVhZCooImNhdGFsb2cvKi5wa2wiKQo=" base64 = "bW9kdWxlIGJpcmRzLmNhdGFsb2cKCmNhdGFsb2cgPSBpbXBvcnQqKCJjYXRhbG9nLyoucGtsIikKY2F0YWxvZ0ZpbGVzID0gcmVhZCooImNhdGFsb2cvKi5wa2wiKQo="
} }
["@birds/catalog/Ostritch.pkl"] { ["@birds/catalog/Ostrich.pkl"] {
uri = "projectpackage://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl" uri = "projectpackage://localhost:0/birds@0.5.0#/catalog/Ostrich.pkl"
text = """ text = """
amends "../Bird.pkl" amends "../Bird.pkl"
name = "Ostritch" name = "Ostrich"
favoriteFruit { favoriteFruit {
name = "Orange" name = "Orange"
} }
""" """
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cml0Y2giCgpmYXZvcml0ZUZydWl0IHsKICBuYW1lID0gIk9yYW5nZSIKfQo=" base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cmljaCIKCmZhdm9yaXRlRnJ1aXQgewogIG5hbWUgPSAiT3JhbmdlIgp9Cg=="
} }
["@birds/catalog/Swallow.pkl"] { ["@birds/catalog/Swallow.pkl"] {
uri = "projectpackage://localhost:0/birds@0.5.0#/catalog/Swallow.pkl" uri = "projectpackage://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
@@ -200,19 +200,19 @@ examples {
} }
["glob-read within package"] { ["glob-read within package"] {
new { new {
["catalog/Ostritch.pkl"] { ["catalog/Ostrich.pkl"] {
uri = "projectpackage://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl" uri = "projectpackage://localhost:0/birds@0.5.0#/catalog/Ostrich.pkl"
text = """ text = """
amends "../Bird.pkl" amends "../Bird.pkl"
name = "Ostritch" name = "Ostrich"
favoriteFruit { favoriteFruit {
name = "Orange" name = "Orange"
} }
""" """
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cml0Y2giCgpmYXZvcml0ZUZydWl0IHsKICBuYW1lID0gIk9yYW5nZSIKfQo=" base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cmljaCIKCmZhdm9yaXRlRnJ1aXQgewogIG5hbWUgPSAiT3JhbmdlIgp9Cg=="
} }
["catalog/Swallow.pkl"] { ["catalog/Swallow.pkl"] {
uri = "projectpackage://localhost:0/birds@0.5.0#/catalog/Swallow.pkl" uri = "projectpackage://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
@@ -232,19 +232,19 @@ examples {
} }
["glob-read absolute package uri"] { ["glob-read absolute package uri"] {
new { new {
["package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"] { ["package://localhost:0/birds@0.5.0#/catalog/Ostrich.pkl"] {
uri = "package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl" uri = "package://localhost:0/birds@0.5.0#/catalog/Ostrich.pkl"
text = """ text = """
amends "../Bird.pkl" amends "../Bird.pkl"
name = "Ostritch" name = "Ostrich"
favoriteFruit { favoriteFruit {
name = "Orange" name = "Orange"
} }
""" """
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cml0Y2giCgpmYXZvcml0ZUZydWl0IHsKICBuYW1lID0gIk9yYW5nZSIKfQo=" base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cmljaCIKCmZhdm9yaXRlRnJ1aXQgewogIG5hbWUgPSAiT3JhbmdlIgp9Cg=="
} }
["package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"] { ["package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"] {
uri = "package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl" uri = "package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
@@ -407,7 +407,7 @@ class EvaluatorTest {
.trimIndent() .trimIndent()
} else } else
""" """
birds = import("@birds/catalog/Ostritch.pkl") birds = import("@birds/catalog/Ostrich.pkl")
""" """
.trimIndent() .trimIndent()
@@ -152,7 +152,7 @@ class PackageResolversTest {
assertThat(elements) assertThat(elements)
.isEqualTo( .isEqualTo(
setOf( setOf(
PathElement("Ostritch.pkl", false), PathElement("Ostrich.pkl", false),
PathElement("Swallow.pkl", false), PathElement("Swallow.pkl", false),
) )
) )
@@ -39,7 +39,7 @@
<dt class="">Dependencies:</dt> <dt class="">Dependencies:</dt>
<dd><a href="https://example.com/fruit-docs">fruit:1.0.5</a></dd> <dd><a href="https://example.com/fruit-docs">fruit:1.0.5</a></dd>
<dt class="">Checksum:</dt> <dt class="">Checksum:</dt>
<dd>bfaf5281613d170a740505cc87561041f4e0cad1f0e6938bf94f7609f9a4673d</dd> <dd>6f18af649b47986530cd6dc39abe17888db2701bc5381c385fb86a32fda2685e</dd>
<dt class="runtime-data hidden">Known usages:</dt> <dt class="runtime-data hidden">Known usages:</dt>
<dd id="known-usages" class="runtime-data hidden"></dd> <dd id="known-usages" class="runtime-data hidden"></dd>
<dt class="runtime-data hidden">All versions:</dt> <dt class="runtime-data hidden">All versions:</dt>
+1 -1
View File
@@ -74,7 +74,7 @@ val prepareHistoricalDistributions by
val distributionDir = outputDir.get().asFile.toPath().also(Files::createDirectories) val distributionDir = outputDir.get().asFile.toPath().also(Files::createDirectories)
for (file in pklHistoricalDistributions.files) { for (file in pklHistoricalDistributions.files) {
val target = distributionDir.resolve(file.name) val target = distributionDir.resolve(file.name)
// Create normal files on Windows, symlink on macOS/linux (need admin priveleges to create // Create normal files on Windows, symlink on macOS/linux (need admin privileges to create
// symlinks on Windows) // symlinks on Windows)
if (buildInfo.os.isWindows) { if (buildInfo.os.isWindows) {
if (!Files.isRegularFile(target, LinkOption.NOFOLLOW_LINKS)) { if (!Files.isRegularFile(target, LinkOption.NOFOLLOW_LINKS)) {
@@ -267,7 +267,7 @@ final class EmbeddedExecutor implements Executor {
if (clazz == null) { if (clazz == null) {
if (name.startsWith("org.pkl.executor.spi.")) { if (name.startsWith("org.pkl.executor.spi.")) {
try { try {
// give pkl-executor a chance to load the SPI clasa // give pkl-executor a chance to load the SPI class
clazz = pklExecutorClassLoader.loadClass(name); clazz = pklExecutorClassLoader.loadClass(name);
} catch (ClassNotFoundException ignored) { } catch (ClassNotFoundException ignored) {
// The SPI class exists in this distribution but not in pkl-executor, // The SPI class exists in this distribution but not in pkl-executor,
+1 -1
View File
@@ -172,7 +172,7 @@ class ExternalReader {
/// On macOS, Linux, and Windows platforms, this may be: /// On macOS, Linux, and Windows platforms, this may be:
/// ///
/// * An absolute path /// * An absolute path
/// * A relative path (to the currrent working directory) /// * A relative path (to the current working directory)
/// * The name of the executable, to be resolved against the `PATH` environment variable /// * The name of the executable, to be resolved against the `PATH` environment variable
executable: String executable: String
+1 -1
View File
@@ -52,7 +52,7 @@ class ImportGraph {
/// ///
/// Dependency-notation imports, such as `"@myPackage/myModule.pkl"`, are represented as /// Dependency-notation imports, such as `"@myPackage/myModule.pkl"`, are represented as
/// in-language URIs with scheme `projectpackage:`. /// in-language URIs with scheme `projectpackage:`.
/// In the case of local project dependenecies, they will be local URIs resolved from the project /// In the case of local project dependencies, they will be local URIs resolved from the project
/// file URI (in normal cases, `file:` URIs). /// file URI (in normal cases, `file:` URIs).
resolvedImports: Map<Uri, Uri>(keys == imports.keys) resolvedImports: Map<Uri, Uri>(keys == imports.keys)
} }