Resolve relative paths to source projects#8
Conversation
eg. `tmsource://../../project.tm2source`
|
I have two main use cases for this:
I am aware that this format will not work in Mapbox Studio Classic. However, resolving relative paths in tilelive would still be a big help. I have tested this locally, but I'm a little nervous about breaking functionality that I don't even know about. Do you have any way to run it through some existing projects, and make sure I'm not breaking anything here? |
| toUri = url.parse(toUri); | ||
|
|
||
| // Url.parse reads the first ".." as the hostname | ||
| const toUriPathName = path.join(toUri.hostname, toUri.path); |
There was a problem hiding this comment.
fromUri should get the same treatment.
|
This is definitely a useful thing, though it has me thinking that having to whitelist is a little bit gnarly (and wouldn't catch nested sources, such as those used by In theory, other modules should be able to resolve relative paths based on I'm wondering if using a special token ( Thoughts? |
|
Thanks for the notes. I agree that the whitelist is a little bit gnarly. There's no way for I see what you're saying about confusion with tilelive implementation which don't use the file system. But it seems to me that if you configure your I would say -- let's always resolve relative paths, and leave it up to the user to configure their project properly. |
eg.
tmsource://../../project.tm2source