Hey guys (@farfromrefug @cvietor),
Sorry it has been so long since I've made any updates to this. Been really busy the last month and have been thinking a lot on how to make this better.
What I ended up doing is moving all of the demos into their own submodules. That way we have the exact same demo for all plugins so when we have to make updates we only have to do it once and then just update the submodule hash in every plugin.
The demos in the submodule don't actually contain anything specific to a plugin. It is a generic menu template that is ready to have plugin demo snippets "attached" to it.
To add actual plugin demos to it, I now have a "demo-snippets" directory with a subdirectory for each flavor. Inside each flavor directory is the actual demo code you want to run in the top-level demo. These folders will then by symbolically linked to the demos. Then you can run the demos normally and it will seem like these components are part of the demo, but are not actually committed to that repo.
There is an "install.ts" file in each flavor which contains an "install()" function that is ran on startup and that's where you put any code needed to register the plugin with the demo. It also says what components you want to add to the demo.
You can also add/modify package.json dependencies with the package.json in the "demo-snippets" directory. That way if the plugin needs additional packages that the top-level doesn't have, you can add them.
I am very happy with how this turned out and think this can make life way easier and consistent across community plugins.
When you have some time, please read through the README and test it out. Just remember to clone the repo recursively (--recursive) to download the submodules as well.
Please let me know what you think! I also have been working on a branch of ui-collectionview where I converted it to this seed. If you want to see it in a real example I can push it up. Here's a link to it if you want to see it being used in a real example. https://github.com/nativescript-community/ui-collectionview/tree/feature/plugin_seed
FYI, I removed e2e testing for the time being. I'm still trying to figure out the best way of implementing that. Having a "tools" submodule opens a lot of possibilities because we can make utility scripts to help out with anything.
Hey guys (@farfromrefug @cvietor),
Sorry it has been so long since I've made any updates to this. Been really busy the last month and have been thinking a lot on how to make this better.
What I ended up doing is moving all of the demos into their own submodules. That way we have the exact same demo for all plugins so when we have to make updates we only have to do it once and then just update the submodule hash in every plugin.
The demos in the submodule don't actually contain anything specific to a plugin. It is a generic menu template that is ready to have plugin demo snippets "attached" to it.
To add actual plugin demos to it, I now have a "demo-snippets" directory with a subdirectory for each flavor. Inside each flavor directory is the actual demo code you want to run in the top-level demo. These folders will then by symbolically linked to the demos. Then you can run the demos normally and it will seem like these components are part of the demo, but are not actually committed to that repo.
There is an "install.ts" file in each flavor which contains an "install()" function that is ran on startup and that's where you put any code needed to register the plugin with the demo. It also says what components you want to add to the demo.
You can also add/modify package.json dependencies with the package.json in the "demo-snippets" directory. That way if the plugin needs additional packages that the top-level doesn't have, you can add them.
I am very happy with how this turned out and think this can make life way easier and consistent across community plugins.
When you have some time, please read through the README and test it out. Just remember to clone the repo recursively (--recursive) to download the submodules as well.
Please let me know what you think! I also have been working on a branch of ui-collectionview where I converted it to this seed.
If you want to see it in a real example I can push it up. Here's a link to it if you want to see it being used in a real example. https://github.com/nativescript-community/ui-collectionview/tree/feature/plugin_seedFYI, I removed e2e testing for the time being. I'm still trying to figure out the best way of implementing that. Having a "tools" submodule opens a lot of possibilities because we can make utility scripts to help out with anything.