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

Missing docs #4448

Merged
merged 3 commits into from
Oct 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 16 additions & 15 deletions ADDONS_SUPPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@

| | [React](app/react)|[React Native](app/react-native)|[Vue](app/vue)|[Angular](app/angular)| [Polymer](app/polymer)| [Mithril](app/mithril)| [HTML](app/html)| [Marko](app/marko)| [Svelte](app/svelte)| [Riot](app/riot)| [Ember](app/ember)|
| ----------- |:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|
|[a11y](addons/a11y) |+| |+|+|+|+|+|+| | |+|
|[actions](addons/actions) |+|+|+|+|+|+|+|+|+|+|+|
|[backgrounds](addons/backgrounds)|+|*|+|+|+|+|+|+|+|+|+|
|[centered](addons/centered) |+| |+|+| |+|+| |+| |+|
|[events](addons/events) |+| |+|+|+|+|+|+| | |+|
|[graphql](addons/graphql) |+| | | | | | | | | | |
|[info](addons/info) |+| | | | | | | | | | |
|[jest](addons/jest) |+| | |+| | |+| | | | |
|[knobs](addons/knobs) |+|+*|+|+|+|+|+|+|+|+|+|
|[links](addons/links) |+|+|+|+|+|+|+| |+|+|+|
|[notes](addons/notes) |+|+*|+|+|+|+|+| |+|+|+|
|[options](addons/options) |+|+|+|+|+|+|+| |+|+|+|
|[storyshots](addons/storyshots) |+|+|+|+| | |+| |+|+| |
|[storysource](addons/storysource)|+| |+|+|+|+|+|+|+|+|+|
|[viewport](addons/viewport) |+| |+|+|+|+|+|+|+|+|+|
|[a11y](addons/a11y) |+| |+|+|+|+|+|+| | |+|
|[actions](addons/actions) |+|+|+|+|+|+|+|+|+|+|+|
|[backgrounds](addons/backgrounds) |+|*|+|+|+|+|+|+|+|+|+|
|[centered](addons/centered) |+| |+|+| |+|+| |+| |+|
|[events](addons/events) |+| |+|+|+|+|+|+| | |+|
|[graphql](addons/graphql) |+| | | | | | | | | | |
|[google-analytics](addons/google-analytics) |+|+|+|+|+|+|+|+|+|+|+|
|[info](addons/info) |+| | | | | | | | | | |
|[jest](addons/jest) |+| | |+| | |+| | | | |
|[knobs](addons/knobs) |+|+*|+|+|+|+|+|+|+|+|+|
|[links](addons/links) |+|+|+|+|+|+|+| |+|+|+|
|[notes](addons/notes) |+|+*|+|+|+|+|+| |+|+|+|
|[options](addons/options) |+|+|+|+|+|+|+| |+|+|+|
|[storyshots](addons/storyshots) |+|+|+|+| | |+| |+|+| |
|[storysource](addons/storysource) |+| |+|+|+|+|+|+|+|+|+|
|[viewport](addons/viewport) |+| |+|+|+|+|+|+|+|+|+|

`*` - React Native on device addon (addons/onDevice-\<name>)
35 changes: 18 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,23 +100,24 @@ For additional help, join us [in our Slack](https://now-examples-slackin-rrirkqo

### Addons

| Addons | |
| ---------------------------------- | -------------------------------------------------------------------------- |
| [a11y](addons/a11y/) | Test components for user accessibility in Storybook |
| [actions](addons/actions/) | Log actions as users interact with components in the Storybook UI |
| [backgrounds](addons/backgrounds/) | Let users choose backgrounds in the Storybook UI |
| [centered](addons/centered/) | Center the alignment of your components within the Storybook UI |
| [events](addons/events/) | Interactively fire events to components that respond to EventEmitter |
| [graphql](addons/graphql/) | Query a GraphQL server within Storybook stories |
| [info](addons/info/) | Annotate stories with extra component usage information |
| [jest](addons/jest/) | View the results of components' unit tests in Storybook |
| [knobs](addons/knobs/) | Interactively edit component prop data in the Storybook UI |
| [links](addons/links/) | Create links between stories |
| [notes](addons/notes/) | Annotate Storybook stories with notes |
| [options](addons/options/) | Customize the Storybook UI in code |
| [storyshots](addons/storyshots/) | Easy snapshot testing for components in Storybook |
| [storysource](addons/storysource/) | View the code of your stories within the Storybook UI |
| [viewport](addons/viewport/) | Change display sizes and layouts for responsive components using Storybook |
| Addons | |
| ------------------------------------------- | -------------------------------------------------------------------------- |
| [a11y](addons/a11y/) | Test components for user accessibility in Storybook |
| [actions](addons/actions/) | Log actions as users interact with components in the Storybook UI |
| [backgrounds](addons/backgrounds/) | Let users choose backgrounds in the Storybook UI |
| [centered](addons/centered/) | Center the alignment of your components within the Storybook UI |
| [events](addons/events/) | Interactively fire events to components that respond to EventEmitter |
| [graphql](addons/graphql/) | Query a GraphQL server within Storybook stories |
| [google-analytics](addons/google-analytics) | Reports google analytics on stories |
| [info](addons/info/) | Annotate stories with extra component usage information |
| [jest](addons/jest/) | View the results of components' unit tests in Storybook |
| [knobs](addons/knobs/) | Interactively edit component prop data in the Storybook UI |
| [links](addons/links/) | Create links between stories |
| [notes](addons/notes/) | Annotate Storybook stories with notes |
| [options](addons/options/) | Customize the Storybook UI in code |
| [storyshots](addons/storyshots/) | Easy snapshot testing for components in Storybook |
| [storysource](addons/storysource/) | View the code of your stories within the Storybook UI |
| [viewport](addons/viewport/) | Change display sizes and layouts for responsive components using Storybook |

See [Addon / Framework Support Table](ADDONS_SUPPORT.md)

Expand Down
1 change: 1 addition & 0 deletions docs/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module.exports = {
'/configurations/env-vars/',
'/configurations/theming/',
'/configurations/cli-options/',
'/configurations/standalone-options/',
],
testing: [
'/testing/react-ui-testing/',
Expand Down
89 changes: 89 additions & 0 deletions docs/src/pages/configurations/standalone-options/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
id: 'standalone-options'
title: 'Standalone Options'
---

There is also an API for running Storybook from the Node.

```js
const storybook = require('@storybook/{APP}/standalone');

storybook({
// options
});
```

Where the APP is one fo the supported apps. For example:

```js
const storybook = require('@storybook/react/standalone');

storybook({
// options
});
```

## Mode

Mode is defining what Storybook mode will be applied:

dev - run Storybook in a dev mode - similar to "start-storybook" in CLI

```js
const storybook = require('@storybook/react/standalone');

storybook({
mode: 'dev',
// other options
});
```

prod - build static version of Storybook - similar to "build-storybook" in CLI

```js
const storybook = require('@storybook/react/standalone');

storybook({
mode: 'prod',
// other options
});
```

Other options are similar to those in the CLI.

## For "dev" mode:

Options:

port [number] Port to run Storybook
host [string] Host to run Storybook
staticDir <dir-names> Directory where to load static files from, array of strings
configDir [dir-name] Directory where to load Storybook configurations from
https Serve Storybook over HTTPS. Note: You must provide your own certificate information.
sslCa <ca> Provide an SSL certificate authority. (Optional with "https", required if using a self-signed certificate)
sslCert <cert> Provide an SSL certificate. (Required with "https")
sslKey <key> Provide an SSL key. (Required with "https")
smokeTest Exit after successful start
ci CI mode (skip interactive prompts, don't open browser)
quiet Suppress verbose build output

## For "prod" mode:

Options:

staticDir <dir-names> Directory where to load static files from, array of strings
outputDir [dir-name] Directory where to store built files
configDir [dir-name] Directory where to load Storybook configurations from
watch Enable watch mode

Example:

```js
const storybook = require('@storybook/angular/standalone');

storybook({
mode: 'dev',
port: 9009,
configDir: './.storybook',
});
```
5 changes: 4 additions & 1 deletion lib/core/src/server/standalone.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ async function build(options = {}, frameworkOptions = {}) {
const commonOptions = {
...options,
...frameworkOptions,
frameworkPresets: [...options.frameworkPresets, ...(frameworkOptions.frameworkPresets || [])],
frameworkPresets: [
...(options.frameworkPresets || []),
...(frameworkOptions.frameworkPresets || []),
],
};

if (mode === 'dev') {
Expand Down