diff --git a/packages/storybook-nuxt/.storybook/tsconfig.json b/packages/storybook-nuxt/.storybook/tsconfig.json index 36758a00..a39c57a2 100644 --- a/packages/storybook-nuxt/.storybook/tsconfig.json +++ b/packages/storybook-nuxt/.storybook/tsconfig.json @@ -13,28 +13,17 @@ "esModuleInterop": true, "isolatedModules": true, "strictBindCallApply": true, - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], + "lib": ["dom", "dom.iterable", "esnext"], "noUnusedLocals": true, - + "strict": true }, - "exclude": [ - "dist", - "**/dist", - "node_modules", - "**/node_modules" - ], + "exclude": ["dist", "**/dist", "node_modules", "**/node_modules"], "ts-node": { "transpileOnly": true, "files": true, "compilerOptions": { - "types": [ - "node" - ] + "types": ["node"] } } -} \ No newline at end of file +} diff --git a/packages/storybook-nuxt/CHANGELOG.md b/packages/storybook-nuxt/CHANGELOG.md index bb81e5f6..aa5952fa 100644 --- a/packages/storybook-nuxt/CHANGELOG.md +++ b/packages/storybook-nuxt/CHANGELOG.md @@ -1,6 +1,5 @@ # Changelog - ## v0.2.6 [compare changes](https://github.com/storybook-vue/storybook-nuxt/compare/v0.2.6-alpha.0...v0.2.6) @@ -44,4 +43,3 @@ ## v0.1.3 [compare changes](https://github.com/storybook-vue/storybook-nuxt/compare/v0.1.3-alpha.0...v0.1.3) - diff --git a/packages/storybook-nuxt/README.md b/packages/storybook-nuxt/README.md index ab2e1301..42b6bba6 100644 --- a/packages/storybook-nuxt/README.md +++ b/packages/storybook-nuxt/README.md @@ -1,17 +1,11 @@ # Storybook for Nuxt framework - ![sb-nuxt (2)](https://github.com/storybook-vue/nuxt/assets/711292/6cd06c77-1b6e-4a45-9666-a97d091a27c0) - -Storybook package for [**Nuxt framework**](https://nuxt.com/) with zero configs. seamless integration supporting all Nuxt fancy features - - +Storybook package for [**Nuxt framework**](https://nuxt.com/) with zero configs. seamless integration supporting all Nuxt fancy features https://github.com/storybook-vue/nuxt/assets/711292/e66a1899-ab7c-42dd-b358-59e22ff0f609 - - ## Supported Features 👉 [Nuxt Modules](#nuxts-image-component) @@ -38,20 +32,17 @@ https://github.com/storybook-vue/nuxt/assets/711292/e66a1899-ab7c-42dd-b358-59e2 👉 [Nuxt DevTools](https://devtools.nuxtjs.org/) : finally as Bonus, Nuxt DevTools works amazingly with your Storybook, full features - https://github.com/storybook-vue/nuxt/assets/711292/63cc1fb3-ec6b-4df2-ad61-d87e5692f385 - - ## Requirements - [Nuxt](https://nuxt.com/) >= 3.x - [Storybook](https://storybook.js.org/) >= 7.x -## Demo +## Demo Checkout the demo repo [storybook7-nuxt3-demo](https://github.com/storybook-vue/storybook-nuxt-demo) -or try it on [Stackblitz](https://stackblitz.com/~/github.com/storybook-vue/storybook-nuxt-demo) +or try it on [Stackblitz](https://stackblitz.com/~/github.com/storybook-vue/storybook-nuxt-demo) ## Getting Started @@ -69,8 +60,6 @@ npx storybook-nuxt init When running the `upgrade` command above, you should get a prompt asking you to migrate to `@storybook-vue/nuxt`, which should handle everything for you. In case auto-migration does not work for your project, refer to the manual migration below. - - Update your `main.js` to change the framework property: ```js @@ -99,4 +88,3 @@ This repository is licensed under the [MIT License](LICENSE). Feel free to use t 💬 Discord: ChakAs3 🐦‍⬛ Twitter: [@ChakirQatab](https://twitter.com/ChakirQatab) - diff --git a/packages/storybook-nuxt/build.config.ts b/packages/storybook-nuxt/build.config.ts index 6cc514c9..11079893 100644 --- a/packages/storybook-nuxt/build.config.ts +++ b/packages/storybook-nuxt/build.config.ts @@ -7,9 +7,11 @@ export default defineBuildConfig({ { input: 'src/preview' }, { input: 'src/preset', outDir: 'dist/', format: 'cjs', ext: 'js' }, { - input: 'src/runtime/', outDir: 'dist/runtime', format: 'esm', ext: 'js', + input: 'src/runtime/', + outDir: 'dist/runtime', + format: 'esm', + ext: 'js', }, - ], rollup: { diff --git a/packages/storybook-nuxt/playground/.storybook/main.ts b/packages/storybook-nuxt/playground/.storybook/main.ts index fa1b0316..42b6f33b 100644 --- a/packages/storybook-nuxt/playground/.storybook/main.ts +++ b/packages/storybook-nuxt/playground/.storybook/main.ts @@ -1,24 +1,23 @@ -import type { StorybookConfig } from "@storybook-vue/nuxt"; - +import type { StorybookConfig } from '@storybook-vue/nuxt' const config: StorybookConfig = { stories: [ - "../stories/**/*.mdx", - "../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)", + '../stories/**/*.mdx', + '../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)', ], addons: [ - "@storybook/addon-links", - "@storybook/addon-essentials", - "@storybook/addon-interactions", + '@storybook/addon-links', + '@storybook/addon-essentials', + '@storybook/addon-interactions', ], framework: { - name: "@storybook-vue/nuxt", - options: { - docgen :"vue-component-meta" + name: '@storybook-vue/nuxt', + options: { + docgen: 'vue-component-meta', }, }, docs: { - autodocs: "tag", + autodocs: 'tag', }, -}; -export default config; +} +export default config diff --git a/packages/storybook-nuxt/playground/.storybook/preview.ts b/packages/storybook-nuxt/playground/.storybook/preview.ts index 6a891e72..19a70c67 100644 --- a/packages/storybook-nuxt/playground/.storybook/preview.ts +++ b/packages/storybook-nuxt/playground/.storybook/preview.ts @@ -1,8 +1,8 @@ -import { type Preview } from "@storybook/vue3"; +import { type Preview } from '@storybook/vue3' const preview: Preview = { parameters: { - actions: { argTypesRegex: "^on[A-Z].*" }, + actions: { argTypesRegex: '^on[A-Z].*' }, controls: { matchers: { color: /(background|color)$/i, @@ -10,7 +10,6 @@ const preview: Preview = { }, }, }, - -}; +} console.log('.storybook Preview =============') -export default preview; +export default preview diff --git a/packages/storybook-nuxt/playground/app.vue b/packages/storybook-nuxt/playground/app.vue index ec738a1c..c78a2270 100644 --- a/packages/storybook-nuxt/playground/app.vue +++ b/packages/storybook-nuxt/playground/app.vue @@ -1,6 +1,6 @@ diff --git a/packages/storybook-nuxt/playground/components/MyButton.vue b/packages/storybook-nuxt/playground/components/MyButton.vue index a4bb6408..d2f940e5 100644 --- a/packages/storybook-nuxt/playground/components/MyButton.vue +++ b/packages/storybook-nuxt/playground/components/MyButton.vue @@ -4,27 +4,29 @@ import { computed } from 'vue' type Sizes = 'small' | 'medium' | 'large' | 'xlarge' -const props = withDefaults(defineProps<{ - /** - * The label of the button - */ - label?: string - /** - * primary or secondary button - */ - primary?: boolean - /** - * size of the button - */ - size?: Sizes - /** - * background color of the button - */ - backgroundColor?: string - - union?: string | number | boolean - -}>(), { primary: false }) +const props = withDefaults( + defineProps<{ + /** + * The label of the button + */ + label?: string + /** + * primary or secondary button + */ + primary?: boolean + /** + * size of the button + */ + size?: Sizes + /** + * background color of the button + */ + backgroundColor?: string + + union?: string | number | boolean + }>(), + { primary: false }, +) const emit = defineEmits<{ (e: 'click', id: number): void diff --git a/packages/storybook-nuxt/playground/components/MyComposable.vue b/packages/storybook-nuxt/playground/components/MyComposable.vue index faacdbd5..124bcd16 100644 --- a/packages/storybook-nuxt/playground/components/MyComposable.vue +++ b/packages/storybook-nuxt/playground/components/MyComposable.vue @@ -3,7 +3,7 @@ const { config } = useMyComposable() diff --git a/packages/storybook-nuxt/playground/components/MyNuxtImage.vue b/packages/storybook-nuxt/playground/components/MyNuxtImage.vue index d4326c7b..561033d6 100644 --- a/packages/storybook-nuxt/playground/components/MyNuxtImage.vue +++ b/packages/storybook-nuxt/playground/components/MyNuxtImage.vue @@ -7,10 +7,8 @@ height="200" class="rounded" /> -
-

- responsive image with nuxt-image component: -

+
+

responsive image with nuxt-image component:

- + diff --git a/packages/storybook-nuxt/playground/components/vuetify/index.vue b/packages/storybook-nuxt/playground/components/vuetify/index.vue index 7a4ccdae..5d33f313 100644 --- a/packages/storybook-nuxt/playground/components/vuetify/index.vue +++ b/packages/storybook-nuxt/playground/components/vuetify/index.vue @@ -14,13 +14,10 @@ defineProps({ rounded="lg" >
- - @invictus.codes/nuxt-vuetify by - invictus.codes -   + + @invictus.codes/nuxt-vuetify by + + invictus.codes  
@@ -29,26 +26,17 @@ defineProps({ - Storybook Nuxt + Storybook Nuxt - Storybook Nuxt + Storybook Nuxt - Storybook Nuxt + Storybook Nuxt diff --git a/packages/storybook-nuxt/playground/nuxt.config.ts b/packages/storybook-nuxt/playground/nuxt.config.ts index cc414dfc..6493d566 100644 --- a/packages/storybook-nuxt/playground/nuxt.config.ts +++ b/packages/storybook-nuxt/playground/nuxt.config.ts @@ -1,10 +1,6 @@ // https://nuxt.com/docs/api/configuration/nuxt-config export default defineNuxtConfig({ - modules: [ - '@nuxt/image', - '@pinia/nuxt', - 'vuetify-nuxt-module', - ], + modules: ['@nuxt/image', '@pinia/nuxt', 'vuetify-nuxt-module'], runtimeConfig: { app: { name: 'Nuxt', @@ -20,5 +16,4 @@ export default defineNuxtConfig({ imports: { dirs: ['./stores'], }, - }) diff --git a/packages/storybook-nuxt/playground/pages/about.vue b/packages/storybook-nuxt/playground/pages/about.vue index 4e8b5f03..307277c8 100644 --- a/packages/storybook-nuxt/playground/pages/about.vue +++ b/packages/storybook-nuxt/playground/pages/about.vue @@ -5,9 +5,7 @@ defineProps({