Skip to content

Commit

Permalink
Merge pull request #19715 from storybookjs/tom/sb-897-update-cli-temp…
Browse files Browse the repository at this point in the history
…late-to-set-autodocspage

CLI: Add docsPage to all Button/Header story templates
  • Loading branch information
shilman authored Nov 2, 2022
2 parents 426c6c0 + fe3396e commit 35610ab
Show file tree
Hide file tree
Showing 27 changed files with 53 additions and 0 deletions.
2 changes: 2 additions & 0 deletions code/frameworks/angular/template/cli/Button.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import Button from './button.component';
const meta: Meta<Button> = {
title: 'Example/Button',
component: Button,
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/angular/writing-docs/docs-page
tags: ['docsPage'],
// More on component templates: https://storybook.js.org/docs/angular/writing-stories/introduction#using-args
render: (args: Button) => ({
props: {
Expand Down
2 changes: 2 additions & 0 deletions code/frameworks/angular/template/cli/Header.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import Header from './header.component';
const meta: Meta<Header> = {
title: 'Example/Header',
component: Header,
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/angular/writing-docs/docs-page
tags: ['docsPage'],
render: (args) => ({ props: args }),
decorators: [
moduleMetadata({
Expand Down
2 changes: 2 additions & 0 deletions code/frameworks/nextjs/template/cli/js/Button.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { Button } from './Button';
export default {
title: 'Example/Button',
component: Button,
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/react/writing-docs/docs-page
tags: ['docsPage'],
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
argTypes: {
backgroundColor: { control: 'color' },
Expand Down
2 changes: 2 additions & 0 deletions code/frameworks/nextjs/template/cli/js/Header.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { Header } from './Header';
export default {
title: 'Example/Header',
component: Header,
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/react/writing-docs/docs-page
tags: ['docsPage'],
parameters: {
// More on Story layout: https://storybook.js.org/docs/react/configure/story-layout
layout: 'fullscreen',
Expand Down
2 changes: 2 additions & 0 deletions code/frameworks/nextjs/template/cli/ts/Button.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { Button } from './Button';
const meta: Meta<typeof Button> = {
title: 'Example/Button',
component: Button,
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/react/writing-docs/docs-page
tags: ['docsPage'],
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
argTypes: {
backgroundColor: {
Expand Down
2 changes: 2 additions & 0 deletions code/frameworks/nextjs/template/cli/ts/Header.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { Header } from './Header';
const meta: Meta<typeof Header> = {
title: 'Example/Header',
component: Header,
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/react/writing-docs/docs-page
tags: ['docsPage'],
parameters: {
// More on Story layout: https://storybook.js.org/docs/react/configure/story-layout
layout: 'fullscreen',
Expand Down
1 change: 1 addition & 0 deletions code/lib/cli/src/generators/baseGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ export async function baseGenerator(

await configureMain({
framework: { name: frameworkInclude, options: options.framework || {} },
docs: { docsPage: true },
addons: pnp ? addons.map(wrapForPnp) : addons,
extensions,
commonJs,
Expand Down
2 changes: 2 additions & 0 deletions code/renderers/html/template/cli/js/Button.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { createButton } from './Button';
// More on default export: https://storybook.js.org/docs/html/writing-stories/introduction#default-export
export default {
title: 'Example/Button',
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/html/writing-docs/docs-page
tags: ['docsPage'],
// More on component templates: https://storybook.js.org/docs/html/writing-stories/introduction#using-args
render: ({ label, ...args }) => {
// You can either use a function to create DOM elements or use a plain html string!
Expand Down
2 changes: 2 additions & 0 deletions code/renderers/html/template/cli/js/Header.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { createHeader } from './Header';

export default {
title: 'Example/Header',
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/html/writing-docs/docs-page
tags: ['docsPage'],
render: (args) => createHeader(args),
parameters: {
// More on Story layout: https://storybook.js.org/docs/html/configure/story-layout
Expand Down
2 changes: 2 additions & 0 deletions code/renderers/html/template/cli/ts/Button.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { createButton } from './Button';
// More on how to set up stories at: https://storybook.js.org/docs/html/writing-stories/introduction#default-export
const meta: Meta<ButtonProps> = {
title: 'Example/Button',
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/html/writing-docs/docs-page
tags: ['docsPage'],
render: (args) => {
// You can either use a function to create DOM elements or use a plain html string!
// return `<div>${label}</div>`;
Expand Down
2 changes: 2 additions & 0 deletions code/renderers/html/template/cli/ts/Header.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { createHeader } from './Header';

const meta: Meta<HeaderProps> = {
title: 'Example/Header',
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/html/writing-docs/docs-page
tags: ['docsPage'],
render: (args) => createHeader(args),
parameters: {
// More on Story layout: https://storybook.js.org/docs/html/configure/story-layout
Expand Down
2 changes: 2 additions & 0 deletions code/renderers/preact/template/cli/Button.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { Button } from './Button';
export default {
title: 'Example/Button',
component: Button,
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/preact/writing-docs/docs-page
tags: ['docsPage'],
// More on argTypes: https://storybook.js.org/docs/preact/api/argtypes
argTypes: {
backgroundColor: { control: 'color' },
Expand Down
2 changes: 2 additions & 0 deletions code/renderers/preact/template/cli/Header.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { Header } from './Header';
export default {
title: 'Example/Header',
component: Header,
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/preact/writing-docs/docs-page
tags: ['docsPage'],
parameters: {
// More on Story layout: https://storybook.js.org/docs/preact/configure/story-layout
layout: 'fullscreen',
Expand Down
2 changes: 2 additions & 0 deletions code/renderers/react/template/cli/js/Button.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { Button } from './Button';
export default {
title: 'Example/Button',
component: Button,
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/react/writing-docs/docs-page
tags: ['docsPage'],
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
argTypes: {
backgroundColor: { control: 'color' },
Expand Down
2 changes: 2 additions & 0 deletions code/renderers/react/template/cli/js/Header.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { Header } from './Header';
export default {
title: 'Example/Header',
component: Header,
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/react/writing-docs/docs-page
tags: ['docsPage'],
parameters: {
// More on Story layout: https://storybook.js.org/docs/react/configure/story-layout
layout: 'fullscreen',
Expand Down
2 changes: 2 additions & 0 deletions code/renderers/react/template/cli/ts/Button.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { Button } from './Button';
const meta: Meta<typeof Button> = {
title: 'Example/Button',
component: Button,
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/react/writing-docs/docs-page
tags: ['docsPage'],
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
argTypes: {
backgroundColor: { control: 'color' },
Expand Down
2 changes: 2 additions & 0 deletions code/renderers/react/template/cli/ts/Header.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { Header } from './Header';
const meta: Meta<typeof Header> = {
title: 'Example/Header',
component: Header,
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/react/writing-docs/docs-page
tags: ['docsPage'],
parameters: {
// More on Story layout: https://storybook.js.org/docs/react/configure/story-layout
layout: 'fullscreen',
Expand Down
2 changes: 2 additions & 0 deletions code/renderers/svelte/template/cli/Button.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import Button from './Button.svelte';
export default {
title: 'Example/Button',
component: Button,
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/svelte/writing-docs/docs-page
tags: ['docsPage'],
// More on component templates: https://storybook.js.org/docs/svelte/writing-stories/introduction#using-args
render: (args) => ({
Component: Button,
Expand Down
2 changes: 2 additions & 0 deletions code/renderers/svelte/template/cli/Header.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import Header from './Header.svelte';
export default {
title: 'Example/Header',
component: Header,
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/svelte/writing-docs/docs-page
tags: ['docsPage'],
render: (args) => ({
Component: Header,
props: args,
Expand Down
2 changes: 2 additions & 0 deletions code/renderers/vue/template/cli/Button.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import MyButton from './Button.vue';
export default {
title: 'Example/Button',
component: MyButton,
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/vue/writing-docs/docs-page
tags: ['docsPage'],
// More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
render: (args, { argTypes }) => ({
props: Object.keys(argTypes),
Expand Down
2 changes: 2 additions & 0 deletions code/renderers/vue/template/cli/Header.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import MyHeader from './Header.vue';
export default {
title: 'Example/Header',
component: MyHeader,
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/vue/writing-docs/docs-page
tags: ['docsPage'],
render: (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: {
Expand Down
2 changes: 2 additions & 0 deletions code/renderers/vue3/template/cli/Button.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import MyButton from './Button.vue';
export default {
title: 'Example/Button',
component: MyButton,
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/vue/writing-docs/docs-page
tags: ['docsPage'],
// More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
render: (args) => ({
// Components used in your story `template` are defined in the `components` object
Expand Down
2 changes: 2 additions & 0 deletions code/renderers/vue3/template/cli/Header.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import MyHeader from './Header.vue';
export default {
title: 'Example/Header',
component: MyHeader,
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/vue/writing-docs/docs-page
tags: ['docsPage'],
render: (args) => ({
// Components used in your story `template` are defined in the `components` object
components: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { Button } from './Button';
// More on default export: https://storybook.js.org/docs/web-components/writing-stories/introduction#default-export
export default {
title: 'Example/Button',
// This component will have an automatically generated docsPage entry: https://storybook.js.org/web-components/vue/writing-docs/docs-page
tags: ['docsPage'],
// More on component templates: https://storybook.js.org/docs/web-components/writing-stories/introduction#using-args
render: (args) => Button(args),
// More on argTypes: https://storybook.js.org/docs/web-components/api/argtypes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { Header } from './Header';

export default {
title: 'Example/Header',
// This component will have an automatically generated docsPage entry: https://storybook.js.org/web-components/vue/writing-docs/docs-page
tags: ['docsPage'],
render: (args) => Header(args),
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { Button } from './Button';
// More on how to set up stories at: https://storybook.js.org/docs/web-components/writing-stories/introduction#default-export
const meta: Meta<ButtonProps> = {
title: 'Example/Button',
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/web-components/writing-docs/docs-page
tags: ['docsPage'],
render: (args) => Button(args),
// More on argTypes: https://storybook.js.org/docs/web-components/api/argtypes
argTypes: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { Header } from './Header';

const meta: Meta<HeaderProps> = {
title: 'Example/Header',
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/web-components/writing-docs/docs-page
tags: ['docsPage'],
render: (args) => Header(args),
};

Expand Down

0 comments on commit 35610ab

Please sign in to comment.