So far I still manually trigger a regeneration but it's only a matter of time till it just runs automatically on any update.
The main problem has been with Puppeteer, there is a chance it will just randomly crash at any point and it feels like there are a million little race conditions where you need to wait or keep retrying to access an element after it says a page has loaded so I have a lot of ugly code in my puppeteer-helper like:
while (true) {
try {
element = await active.$('#element')
} catch (error) {
}
if (!element) {
sleep(100)
continue
}
break
}
Another issue only pertained to getting the simulated device screenshots, switching the viewport configuration reloads the page which for me makes any state like "yes, you just deleted x" be an "x does not exist" error so at the moment I get around that by doing each device independently which takes a fair bit longer where slow APIs are involved.
This is one of the 'recipes' -
https://github.com/userdashboard/userdashboard.github.io/blo... with some glue for Puppeteer v1 so a bit WIP still - https://github.com/userdashboard/userdashboard.github.io/blo...
The end result I think is really cool:
https://userdashboard.github.io/administrators/stripe-subscr...
In the final incarnation people using my software will be able to point the screenshot generator at their own website and regenerate all the screenshots so they can reuse the documentation.