We are experimenting with storybook in Popups and it's great (T205989)! The only problem is that it's not published on a shared URI and requires node 8 to work. We however have a hard dependency on node 6 while CI uses node 6 (although hopefully that will be fixed by the end of June).
To work around this we've put the storybook code in a separate subfolder of Popups.
storybook outputs documentation as static files when npm run build is run inside this subfolder.
[[ https://netlify.com | Netlify ]]provides a very straightforward deploy process. @jan already did it in a matter of minutes by linking up a github account and entering the bash command to run to make the install happen. It however requires installation of the Netlify app inside Wikimedia's Github account and whether that's allowed is unclear (A similar app with similar permissions Travis CI is already set up there but it's not clear if that poses any issues either). There seems to be no clear policy on how to handle app installs in Github.
Netlify aside, it appears to be possible to do the same documentation generation using Jenkins, but would need config and code review changes: see Documentation generation. The benefit of doing this is we would have a reusable job for documentation outside Popups, in particular of interest in MobileFrontend.
I fear however that we'll need node 8 in CI before we can do any of this.... it would certainly keep things simpler.
Acceptance criteria
- Popups uses node 6 to build assets using npm run build. It must continue to do so while CI is running node 6.
- the subfolder .storybook has its own package.json and needs node 8
- Popups npm run doc would need to be configured to run cd .storybook && npm install && npm run build to have any chance of working
- We'd need to audit the outputted code of storybook to check it doesn't provide any security issues running on the wmflabs.org domain