Skip to content

Commit

Permalink
export template for cli
Browse files Browse the repository at this point in the history
  • Loading branch information
chakAs3 committed Aug 1, 2023
1 parent a647f44 commit 948c656
Show file tree
Hide file tree
Showing 9 changed files with 102 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ or try it on [Stackblitz](https://stackblitz.com/~/github.com/storybook-vue/sto
Follow the prompts after running this command in your Nuxt project's root directory:

```bash
npx storybook@latest init
npx storybook-nuxt init
```

[More on getting started with Storybook](https://storybook.js.org/docs/vue3/get-started/install)
Expand Down
3 changes: 3 additions & 0 deletions build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ export default defineBuildConfig({
{ input: 'src/preview', ext: 'ts' ,format: 'esm' },

],
files :[
'template/**/*',
],

hooks: {
'mkdist:entry:options' (_ctx, _entry, mkdistOptions) {
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"name": "@storybook-vue/nuxt",
"version": "0.0.1-rc.3",
"version": "0.0.1-rc.5",
"description": "Storybook for Nuxt and Vite: Develop Vue3 components in isolation with Hot Reloading.",
"keywords": [
"storybook",
"nuxt"
"nuxt",
"vite",
"vue3"
],
"homepage": "https://github.com/storybook-vue/nuxt",
"bugs": {
Expand Down
24 changes: 24 additions & 0 deletions template/cli/js/MyNuxtWelcome.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import MyNuxtWelcome from './MyWelcome.vue'

// More on how to set up stories at: https://storybook.js.org/docs/vue/writing-stories/introduction
const meta = {
title: 'Example/NuxtWelcome Story',
component: MyNuxtWelcome,
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/vue/writing-docs/autodocs
tags: ['autodocs'],

}

export default meta;

/*
*👇 Render functions are a framework specific feature to allow you control on how the component renders.
* See https://storybook.js.org/docs/vue/api/csf
* to learn how to use render functions.
*/

export const NuxtWelcomeStory = {
args: { },
}


4 changes: 4 additions & 0 deletions template/cli/js/MyWelcome.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<template>
<h1> Welcome Nuxt to Storybook : </h1>
<NuxtWelcome/>
</template>
29 changes: 29 additions & 0 deletions template/cli/ts-3-8/MyNuxtWelcome.stories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import type { Meta, StoryObj } from '@storybook/vue3';



import MyNuxtWelcome from './MyWelcome.vue'

// More on how to set up stories at: https://storybook.js.org/docs/vue/writing-stories/introduction

const meta = {
title: 'Example/NuxtWelcome Story',
component: MyNuxtWelcome,
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/vue/writing-docs/autodocs
tags: ['autodocs'],

} satisfies Meta<typeof MyNuxtWelcome>;

export default meta;
type Story = StoryObj<typeof meta>;
/*
*👇 Render functions are a framework specific feature to allow you control on how the component renders.
* See https://storybook.js.org/docs/vue/api/csf
* to learn how to use render functions.
*/

export const NuxtWelcomeStory : Story = {
args: { },
}


4 changes: 4 additions & 0 deletions template/cli/ts-3-8/MyWelcome.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<template>
<h1> Welcome Nuxt to Storybook : </h1>
<NuxtWelcome/>
</template>
29 changes: 29 additions & 0 deletions template/cli/ts-4-9/MyNuxtWelcome.stories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import type { Meta, StoryObj } from '@storybook/vue3';



import MyNuxtWelcome from './MyWelcome.vue'

// More on how to set up stories at: https://storybook.js.org/docs/vue/writing-stories/introduction

const meta = {
title: 'Example/NuxtWelcome Story',
component: MyNuxtWelcome,
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/vue/writing-docs/autodocs
tags: ['autodocs'],

} satisfies Meta<typeof MyNuxtWelcome>;

export default meta;
type Story = StoryObj<typeof meta>;
/*
*👇 Render functions are a framework specific feature to allow you control on how the component renders.
* See https://storybook.js.org/docs/vue/api/csf
* to learn how to use render functions.
*/

export const NuxtWelcomeStory : Story = {
args: { },
}


4 changes: 4 additions & 0 deletions template/cli/ts-4-9/MyWelcome.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<template>
<h1> Welcome Nuxt to Storybook : </h1>
<NuxtWelcome/>
</template>

0 comments on commit 948c656

Please sign in to comment.