From 948c65699b3e79d8cb873e87662bc5aa98b91559 Mon Sep 17 00:00:00 2001 From: chakAs3 Date: Tue, 1 Aug 2023 15:02:52 +0400 Subject: [PATCH] export template for cli --- README.md | 2 +- build.config.ts | 3 ++ package.json | 6 ++-- template/cli/js/MyNuxtWelcome.stories.js | 24 ++++++++++++++++ template/cli/js/MyWelcome.vue | 4 +++ template/cli/ts-3-8/MyNuxtWelcome.stories.ts | 29 ++++++++++++++++++++ template/cli/ts-3-8/MyWelcome.vue | 4 +++ template/cli/ts-4-9/MyNuxtWelcome.stories.ts | 29 ++++++++++++++++++++ template/cli/ts-4-9/MyWelcome.vue | 4 +++ 9 files changed, 102 insertions(+), 3 deletions(-) create mode 100644 template/cli/js/MyNuxtWelcome.stories.js create mode 100644 template/cli/js/MyWelcome.vue create mode 100644 template/cli/ts-3-8/MyNuxtWelcome.stories.ts create mode 100644 template/cli/ts-3-8/MyWelcome.vue create mode 100644 template/cli/ts-4-9/MyNuxtWelcome.stories.ts create mode 100644 template/cli/ts-4-9/MyWelcome.vue diff --git a/README.md b/README.md index 361e7dc..9dff23a 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/build.config.ts b/build.config.ts index b625069..4ff3ee3 100644 --- a/build.config.ts +++ b/build.config.ts @@ -11,6 +11,9 @@ export default defineBuildConfig({ { input: 'src/preview', ext: 'ts' ,format: 'esm' }, ], + files :[ + 'template/**/*', + ], hooks: { 'mkdist:entry:options' (_ctx, _entry, mkdistOptions) { diff --git a/package.json b/package.json index 3c55caf..b398330 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/template/cli/js/MyNuxtWelcome.stories.js b/template/cli/js/MyNuxtWelcome.stories.js new file mode 100644 index 0000000..2869282 --- /dev/null +++ b/template/cli/js/MyNuxtWelcome.stories.js @@ -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: { }, +} + + diff --git a/template/cli/js/MyWelcome.vue b/template/cli/js/MyWelcome.vue new file mode 100644 index 0000000..c65172b --- /dev/null +++ b/template/cli/js/MyWelcome.vue @@ -0,0 +1,4 @@ + diff --git a/template/cli/ts-3-8/MyNuxtWelcome.stories.ts b/template/cli/ts-3-8/MyNuxtWelcome.stories.ts new file mode 100644 index 0000000..e619dc0 --- /dev/null +++ b/template/cli/ts-3-8/MyNuxtWelcome.stories.ts @@ -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; + +export default meta; +type Story = StoryObj; +/* + *👇 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: { }, +} + + diff --git a/template/cli/ts-3-8/MyWelcome.vue b/template/cli/ts-3-8/MyWelcome.vue new file mode 100644 index 0000000..c65172b --- /dev/null +++ b/template/cli/ts-3-8/MyWelcome.vue @@ -0,0 +1,4 @@ + diff --git a/template/cli/ts-4-9/MyNuxtWelcome.stories.ts b/template/cli/ts-4-9/MyNuxtWelcome.stories.ts new file mode 100644 index 0000000..e619dc0 --- /dev/null +++ b/template/cli/ts-4-9/MyNuxtWelcome.stories.ts @@ -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; + +export default meta; +type Story = StoryObj; +/* + *👇 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: { }, +} + + diff --git a/template/cli/ts-4-9/MyWelcome.vue b/template/cli/ts-4-9/MyWelcome.vue new file mode 100644 index 0000000..c65172b --- /dev/null +++ b/template/cli/ts-4-9/MyWelcome.vue @@ -0,0 +1,4 @@ +