mirror of
https://github.com/apple/pkl.git
synced 2026-09-13 21:31:52 +02:00
Normalize asset paths in local dependencies (#1737)
This changes local asset path resolution so that `..` segments at the dependency root just resolves to the dependency root. This makes import resolution work the same between local and remote dependencies.
This commit is contained in:
+3
@@ -0,0 +1,3 @@
|
||||
// `..` at the package root stays in the package root
|
||||
res1 = import("@project2/../penguin.pkl")
|
||||
res2 = import("@project2/foo/../../penguin.pkl")
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
res1 = read*("@project2/../*").keys
|
||||
res2 = read*("@project2/../../*").keys
|
||||
res3 = read("@project2/../../").text
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
res1 {
|
||||
bird {
|
||||
name = "Penguin"
|
||||
favoriteFruit {
|
||||
name = "Ice Fruit"
|
||||
}
|
||||
}
|
||||
}
|
||||
res2 {
|
||||
bird {
|
||||
name = "Penguin"
|
||||
favoriteFruit {
|
||||
name = "Ice Fruit"
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
res1 = Set("@project2/../PklProject", "@project2/../PklProject.deps.json", "@project2/../penguin.pkl")
|
||||
res2 = Set("@project2/../../PklProject", "@project2/../../PklProject.deps.json", "@project2/../../penguin.pkl")
|
||||
res3 = """
|
||||
penguin.pkl
|
||||
PklProject
|
||||
PklProject.deps.json
|
||||
|
||||
"""
|
||||
Reference in New Issue
Block a user