-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve relative paths to source projects #8
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fromUri
should get the same treatment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
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