-
Notifications
You must be signed in to change notification settings - Fork 237
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
New manifest.json
property redirect
#1425
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 uninclude
manifest.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 |
When defining custom subplatforms, the
manifest.json
foresp32
sets the include directory for subplatforms to./targets/$(SUBPLATFORM)/manifest.json
. This assumes thetarget
directory is in the same location as themanifest.json
file. However, if you have manymanifest.json
projects in different directories, it seems there are two choices:target
directory (or symlink it) for each project.manifest.json
file(s), and merge on each Moddable release.Unless there's a better/existing approach to solve this, this PR proposes a new
uninclude
property that can exclude manifests. For example, the following would allow a sharedesp32
sub-platform directory for allmanifest.json
projects (affecting only theesp32
platforms):See
manifest.md
in the PR for documentation on this property.NB: I'm not thrilled with the name
uninclude
but I didn't feel like generic names such asremove
orexclude
were appropriate, as they seemed easier to misunderstand.