mirror of
https://github.com/apple/pkl.git
synced 2026-01-13 23:23:37 +01:00
[PR #255] [CLOSED] Support Projects loaded from arbitrary URIs #483
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?
📋 Pull Request Information
Original PR: https://github.com/apple/pkl/pull/255
Author: @HT154
Created: 2/26/2024
Status: ❌ Closed
Base:
main← Head:projects-from-any-uri📝 Commits (1)
42224c0Support Projects loaded from arbitrary URIs📊 Changes
33 files changed (+644 additions, -120 deletions)
View changed files
📝
pkl-cli/src/main/kotlin/org/pkl/cli/CliProjectPackager.kt(+42 -11)📝
pkl-core/src/main/java/org/pkl/core/module/ModuleKeys.java(+20 -17)📝
pkl-core/src/main/java/org/pkl/core/module/ProjectDependenciesManager.java(+42 -18)📝
pkl-core/src/main/java/org/pkl/core/packages/Dependency.java(+3 -2)📝
pkl-core/src/main/java/org/pkl/core/project/Project.java(+58 -19)📝
pkl-core/src/main/java/org/pkl/core/resource/ResourceReaders.java(+11 -13)📝
pkl-core/src/main/java/org/pkl/core/runtime/ResourceManager.java(+39 -7)📝
pkl-core/src/main/resources/org/pkl/core/errorMessages.properties(+15 -0)📝
pkl-core/src/test/files/LanguageSnippetTests/input/projects/project1/PklProject(+1 -0)📝
pkl-core/src/test/files/LanguageSnippetTests/input/projects/project1/PklProject.deps.json(+5 -0)📝
pkl-core/src/test/files/LanguageSnippetTests/input/projects/project1/globbing.pkl(+5 -0)📝
pkl-core/src/test/files/LanguageSnippetTests/input/projects/project3/PklProject.deps.json(+5 -0)➕
pkl-core/src/test/files/LanguageSnippetTests/input/projects/project6/PklProject(+8 -0)➕
pkl-core/src/test/files/LanguageSnippetTests/input/projects/project6/PklProject.deps.json(+4 -0)➕
pkl-core/src/test/files/LanguageSnippetTests/input/projects/project6/children.pkl(+1 -0)➕
pkl-core/src/test/files/LanguageSnippetTests/input/projects/project6/children/a.pkl(+1 -0)➕
pkl-core/src/test/files/LanguageSnippetTests/input/projects/project6/children/b.pkl(+1 -0)➕
pkl-core/src/test/files/LanguageSnippetTests/input/projects/project6/children/c.pkl(+1 -0)📝
pkl-core/src/test/files/LanguageSnippetTests/output/projects/badProjectDeps1/bug.err(+1 -1)📝
pkl-core/src/test/files/LanguageSnippetTests/output/projects/badProjectDeps2/bug.err(+1 -1)...and 13 more files
📄 Description
Currently, Pkl assumes that a PklProject file and any declared local dependencies are accessible on the filesystem (i.e. via
file:URIs. For usage of thepklCLI this is sufficient, but for usage of language bindings this presents an obstacle for evaluating Pkl code using projects from sources that are not the filesystem. One compelling use case would be consuming Pkl code using project dependencies from a git repository; usinggo-gitand itsgo-billyfilesystem abstraction, it should be possible to do this completely in-memory. With this change and https://github.com/apple/pkl-go/pull/21 this now works end-to-end.Brief summary of the changes here:
Path projectDirwithURI projectBaseUrithroughoutPklProject.deps.jsonto use resource readerspkl:Projectto accept local dependencies when the scheme and authority are the same, rather than checking forfile:URIs specificallypkl-corefor custom-defined module and resource readerspathElementsinList*Responses🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.