-
Notifications
You must be signed in to change notification settings - Fork 7
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
Any news about Storydocs plugin? #19
Comments
I had paused my plans when I recognized the major changes that were planned for nx's Storybook plugin (v6). As the update is now released it would be time to reevaluate my plans - especially if there is an interest 🙂 |
Storybook plugin for NX (https://nx.dev/latest/angular/plugins/storybook/overview) lacks of Storybook Essential addons support (https://storybook.js.org/docs/angular/essentials/introduction). NX by now uses only old the knobs addon which will be substituted by the Storybook Controls some day. Some excerpts from NX:
Also here is the requested Controls query params support feature storybookjs/storybook#12728. I guess it will be released very soon. But it's not enough to migrate to autogenerated Controls. And here is why:
How I configure NX workspace for Angular with Storybook Controls and Storybook Docs and Compodoc:
It's quite complicated to bootstrap this stack and rerun commands but it works at least. While I was writing this workflow I was thinking about the root cause again... What do you think? |
@dobromyslov Thx for the detailed answer 👍 (A) The original idea was to create a wrapper plugin that will add a single architect with storybook & compodoc options and internally executes the 2 builders in order (B) The simplest solution can be a schematic in the compodoc plugin that adds a run-command architect to execute compodoc & storybook in order. (C) The next step could be a custom build that requires separate architects for compodoc & storybook and executes them in parallel while using e.g. nodemon for compodoc to achieve an auto regeneration of the docs metadata. Option B is the solution I use currently at work for the workspace wide storybook. |
@twittwer those are rather good options. (B) combined Compodoc & Storybook command helps a little on first Storybook start. Then it's running and watching for changes. And (C) option is needed to get rid of manual compodoc refresh. I tried to run |
The watch option was not passed to compodoc but that wouldn't work for the json format anyway => compodoc/compodoc#862 I just published version 1.4.0. on the next channel with a watch option as a first POC. It worked in my scenario with the following steps:
"configurations": {
"json": {
"exportFormat": "json"
},
"watch": {
"exportFormat": "json",
"watch": true
}
}
"storydoc": {
"builder": "@nrwl/workspace:run-commands",
"options": {
"commands": [
"nx run <project>:compodoc:watch",
"nx run <project>:storybook"
]
}
} |
Watchmode with json now works: compodoc/compodoc#1087 |
I see you've done a plugin for compodoc which is required for Storybook Docs addon to be used with Angular as described here https://github.com/storybookjs/storybook/tree/master/addons/docs/angular. And looks like there is no another easy way to generate storydocs from Angular directly according to this discussion storybookjs/storybook#8672.
There is a milestone for the storydoc nx plugin in the twittwer/nx-tools readme. Do you have any plans to create it?
The text was updated successfully, but these errors were encountered: