Currently, the only way we know if a library was built using the Kobweb library plugin is to check for the existence of a META-INF/kobweb/frontend.json file. This technically works but feels like we're taking advantage of a side effect. It might also not be future proof -- will we support libraries in the future that are backend support only? Will we support artifacts which are just bundled resources and no code, meant to be shared and consumed by upstream Kobweb applications?
Our proposal is to add a top level file, say META-INF/kobweb/manifest.json, to serve as a consistent indicator file.
In addition to creating this file, there are two important related feature requests:
Version
We should also add a version value in the manifest file, the version of Kobweb the library was built with. This could give us a chance to make major changes in the future and still recover if a newer version of Kobweb tries to load an older library (since we can check the version of the library first and then branch logic based on that).
It could also help us debug some weird user reports. If if a lot of people say a library is busted, we can check its Kobweb version first to see if that's potentially the issue.
KobwebCopySupplementalResourcesTask
Currently, the Kobweb application copies all resources under all dependency artifacts if they are found under their public/ folder. However, random libraries may have a jsMain/resources/public folder by chance, and we don't want to suddenly be copying all of that stuff into the user's site.
Instead, we should only copy these files IF that's true and the META-INF/kobweb/manifest.json exists.
TL;DR:
[ ] Add a new META-INF/kobweb/manifest.json file
[ ] Make sure the manifest has a version value in it
[ ] Update KobwebCopySupplementalResourceTask to check for this file in order to filter out non-Kobweb dependencies
Side note: #260 could possibly be implemented by adding data to this manifest.json file also.
Currently, the only way we know if a library was built using the Kobweb library plugin is to check for the existence of a
META-INF/kobweb/frontend.json
file. This technically works but feels like we're taking advantage of a side effect. It might also not be future proof -- will we support libraries in the future that are backend support only? Will we support artifacts which are just bundled resources and no code, meant to be shared and consumed by upstream Kobweb applications?Our proposal is to add a top level file, say
META-INF/kobweb/manifest.json
, to serve as a consistent indicator file.In addition to creating this file, there are two important related feature requests:
Version
We should also add a version value in the manifest file, the version of Kobweb the library was built with. This could give us a chance to make major changes in the future and still recover if a newer version of Kobweb tries to load an older library (since we can check the version of the library first and then branch logic based on that).
It could also help us debug some weird user reports. If if a lot of people say a library is busted, we can check its Kobweb version first to see if that's potentially the issue.
KobwebCopySupplementalResourcesTask
Currently, the Kobweb application copies all resources under all dependency artifacts if they are found under their
public/
folder. However, random libraries may have ajsMain/resources/public
folder by chance, and we don't want to suddenly be copying all of that stuff into the user's site.Instead, we should only copy these files IF that's true and the
META-INF/kobweb/manifest.json
exists.TL;DR:
META-INF/kobweb/manifest.json
fileSide note: #260 could possibly be implemented by adding data to this
manifest.json
file also.