The last step in creating Live Components is publishing your Storybook story to DSM.
Publishing stories to DSM
Publish mode builds your Storybook project and creates the production Storybook bundle. The bundle is then uploaded and hosted in the DSM cloud.
To publish, run the following command in your development environment:
npm run dsm-storybook:publish
After publishing to DSM, you can view the live components in the DSM web view, including any Storybook addons, such as Knobs. Viewers will be able to interact with the components to see how they respond in a live environment.
Preview enables you to view your documentation stories before uploading them to DSM. It starts a local instance of Storybook with a source-code addon to preview stories and sample code snippets. To create a preview, run the following command in your development environment:
npm run dsm-storybook:preview
If you want to preview components in DSM rather than Storybook, you can create a library in DSM to be used for test purposes. Upload a component to the test library via the DSM Sketch tool, and publish your story to that test component. If everything works in your test library, you can publish the story again to your production library.