-
Notifications
You must be signed in to change notification settings - Fork 247
New manifest.json property redirect
#1425
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
base: public
Are you sure you want to change the base?
New manifest.json property redirect
#1425
Conversation
|
I understand the problem you are solving with this. I'm not sure about the solution. The uninclude/include are paired, but they may not appear that way in the manifests. Maybe redirect / replace is another way to think about? "platforms": {
"esp32/*": {
"redirect": {
"from": "./targets/$(SUBPLATFORM)/manifest.json",
"to": "$(SRC)/build/targets/$(SUBPLATFORM)/manifest.json"
}
}
}The That would work for manifests and sources. That could be useful for redirecting to alternate module implementations (like your patches WebSocket client). Paths are usually evaluated relative to the manifest so "from" above would need to be This is just a quick idea for discussion. It may well be flawed. |
|
Thanks for being supportive of a possible change. Redirect is an interesting idea - it unifies the replacement and makes the association of what it is doing more obvious. My original use of I can see needing to adjust other manifest properties in the future, such as "platforms": {
"esp32/*": {
"transform": {
"include": {
"from": "./targets/$(SUBPLATFORM)/manifest.json",
"to": "$(SRC)/build/targets/$(SUBPLATFORM)/manifest.json"
},
"preload": [
{
"remove": "some/preload/path"
},
{
"remove-regex": "^mymodule/.*"
}
]
}
}
}The biggest downside I see is how verbose it is: Perhaps I'm over-thinking this. ;-) |
|
Well, I just hit another issue. Let me work on this a bit... |
|
In brief...
|
…ith `null` wildcard support.
manifest.json property unincludemanifest.json property redirect
|
Take two. Per Peter's suggestion, it's now called
From the updated
|
|
This is complete and ready for review/consideration. I've run it across all my projects (around 15) on |
|
I have merged and tested with latest and this continues to work well for me. Any chance we can give it another look? |
When defining custom subplatforms, the
manifest.jsonforesp32sets the include directory for subplatforms to./targets/$(SUBPLATFORM)/manifest.json. This assumes thetargetdirectory is in the same location as themanifest.jsonfile. However, if you have manymanifest.jsonprojects in different directories, it seems there are two choices:targetdirectory (or symlink it) for each project.manifest.jsonfile(s), and merge on each Moddable release.Unless there's a better/existing approach to solve this, this PR proposes a new
unincludeproperty that can exclude manifests. For example, the following would allow a sharedesp32sub-platform directory for allmanifest.jsonprojects (affecting only theesp32platforms):See
manifest.mdin the PR for documentation on this property.NB: I'm not thrilled with the name
unincludebut I didn't feel like generic names such asremoveorexcludewere appropriate, as they seemed easier to misunderstand.