Skip to content
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

Added an external-docs example to show the basic use case #17807

Merged
merged 18 commits into from Apr 7, 2022
Merged

Conversation

tmeasday
Copy link
Member

@tmeasday tmeasday commented Mar 28, 2022

Demo of an external-docs app w/ a refactored preview (not containing "render to screen") parts.

To try it:

  1. Run yarn start in the external-docs example to see an example of an CRA app that uses doc blocks w/o a full storybook runtime or any kind of build.

  2. Run window.preview.onUpdateArgs({ storyId: 'examples-button--export-0', updatedArgs: {label :'changed' }}) to see an example of a message reaching the preview to update the args (you can use window.preview.channel too).

Of note:

  • The blocks.tsx file only depends on Preview (currently exported by @storybook/preview-web but we may move it to its own package) which doesn't attempt to render the "current story" and has no dependencies on docs (thus react).

@nx-cloud
Copy link

nx-cloud bot commented Mar 28, 2022

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 416bd4d. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tmeasday looking really great except for the version issues

examples/external-docs/package.json Outdated Show resolved Hide resolved
@tmeasday tmeasday marked this pull request as ready for review March 29, 2022 06:35
@shilman
Copy link
Member

shilman commented Mar 29, 2022

@tmeasday

------------------------------
▶️  building: external-docs
------------------------------
info @storybook/react v6.5.0-alpha.51
info 
info => Cleaning outputDir: /tmp/storybook/built-storybooks/external-docs
ERR! Error: No configuration files have been found in your configDir (/tmp/storybook/examples/external-docs/.storybook).
ERR! Storybook needs either a "main" or "config" file.
ERR!     at validateConfigurationFiles (/tmp/storybook/lib/core-common/dist/cjs/utils/validate-configuration-files.js:50:11)
ERR!     at loadCustomPresets (/tmp/storybook/lib/core-common/dist/cjs/utils/load-custom-presets.js:19:62)
ERR!     at loadAllPresets (/tmp/storybook/lib/core-common/dist/cjs/presets.js:346:131)
ERR!     at buildStaticStandalone (/tmp/storybook/lib/core-server/dist/cjs/build-static.js:101:48)
ERR!     at async buildStatic (/tmp/storybook/lib/core-server/dist/cjs/build-static.js:201:5)
ERR!  Error: No configuration files have been found in your configDir (/tmp/storybook/examples/external-docs/.storybook).
ERR! Storybook needs either a "main" or "config" file.
ERR!     at validateConfigurationFiles (/tmp/storybook/lib/core-common/dist/cjs/utils/validate-configuration-files.js:50:11)
ERR!     at loadCustomPresets (/tmp/storybook/lib/core-common/dist/cjs/utils/load-custom-presets.js:19:62)
ERR!     at loadAllPresets (/tmp/storybook/lib/core-common/dist/cjs/presets.js:346:131)
ERR!     at buildStaticStandalone (/tmp/storybook/lib/core-server/dist/cjs/build-static.js:101:48)
ERR!     at async buildStatic (/tmp/storybook/lib/core-server/dist/cjs/build-static.js:201:5)

@shilman shilman added maintenance User-facing maintenance tasks and removed feature request labels Mar 31, 2022
@tmeasday tmeasday merged commit a976122 into next Apr 7, 2022
@tmeasday tmeasday deleted the tech/docs-2-0 branch April 7, 2022 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance User-facing maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants