diff --git a/docs/content/1.getting-started/1.setup.md b/docs/content/1.getting-started/1.setup.md index 738b7b91..b77386a8 100644 --- a/docs/content/1.getting-started/1.setup.md +++ b/docs/content/1.getting-started/1.setup.md @@ -11,6 +11,8 @@ description: Using Storybook in your Nuxt project is only one command away ✨ npx nuxi@latest module add storybook ``` +By default, the module comes with the latest version of Storybook preinstalled. So you don't need to add it manually in your project. Similarly, all [essential addons](https://storybook.js.org/docs/essentials) as well as the packages [`@storybook/test`](https://storybook.js.org/docs/writing-tests/component-testing) and [`@storybook/blocks`](https://storybook.js.org/docs/writing-docs/doc-blocks) are included. You can always install additional addons as needed. + 2. Add it to your `modules` section in your `nuxt.config`: ::code-group diff --git a/examples/showcase/package.json b/examples/showcase/package.json index b067d213..26e9a083 100644 --- a/examples/showcase/package.json +++ b/examples/showcase/package.json @@ -20,10 +20,6 @@ "devDependencies": { "@chromatic-com/storybook": "2.0.2", "@nuxtjs/storybook": "latest", - "@storybook/addon-essentials": "8.3.0", - "@storybook/addon-links": "8.3.0", - "@storybook/blocks": "8.3.0", - "@storybook/test": "8.3.0", - "storybook": "8.3.0" + "@storybook/addon-links": "8.3.0" } } diff --git a/examples/starter/package.json b/examples/starter/package.json index 838ce53c..c0f4a009 100644 --- a/examples/starter/package.json +++ b/examples/starter/package.json @@ -18,10 +18,6 @@ "devDependencies": { "@chromatic-com/storybook": "2.0.2", "@nuxtjs/storybook": "latest", - "@storybook/addon-essentials": "8.3.0", - "@storybook/addon-links": "8.3.0", - "@storybook/blocks": "8.3.0", - "@storybook/test": "8.3.0", - "storybook": "8.3.0" + "@storybook/addon-links": "8.3.0" } } diff --git a/examples/tailwind/package.json b/examples/tailwind/package.json index 0e75edcb..83a6a28c 100644 --- a/examples/tailwind/package.json +++ b/examples/tailwind/package.json @@ -19,10 +19,6 @@ "devDependencies": { "@chromatic-com/storybook": "2.0.2", "@nuxtjs/storybook": "latest", - "@storybook/addon-essentials": "8.3.0", - "@storybook/addon-links": "8.3.0", - "@storybook/blocks": "8.3.0", - "@storybook/test": "8.3.0", - "storybook": "8.3.0" + "@storybook/addon-links": "8.3.0" } } diff --git a/packages/nuxt-module/bin/storybook.mjs b/packages/nuxt-module/bin/storybook.mjs new file mode 100644 index 00000000..6ad58e39 --- /dev/null +++ b/packages/nuxt-module/bin/storybook.mjs @@ -0,0 +1,3 @@ +#!/usr/bin/env node + +import 'storybook/internal/cli/bin' diff --git a/packages/nuxt-module/package.json b/packages/nuxt-module/package.json index 2aae55f6..bd7dae00 100644 --- a/packages/nuxt-module/package.json +++ b/packages/nuxt-module/package.json @@ -30,10 +30,14 @@ "require": "./dist/module.cjs" } }, + "bin": { + "storybook": "./bin/storybook.mjs" + }, "main": "./dist/module.cjs", "types": "./dist/types.d.ts", "files": [ - "dist" + "dist", + "bin" ], "engines": { "node": ">=18.0.0" diff --git a/packages/storybook-addon/package.json b/packages/storybook-addon/package.json index 2ba2df07..769557bc 100644 --- a/packages/storybook-addon/package.json +++ b/packages/storybook-addon/package.json @@ -70,7 +70,9 @@ "@nuxt/schema": "^3.13.0", "@nuxt/vite-builder": "^3.13.0", "@rollup/plugin-replace": "^5.0.7", + "@storybook/addon-essentials": "^8.3.0", "@storybook/builder-vite": "^8.3.0", + "@storybook/test": "^8.3.0", "@storybook/vue3": "^8.3.0", "@storybook/vue3-vite": "^8.3.0", "json-stable-stringify": "^1.1.1", diff --git a/playground/package.json b/playground/package.json index 9434d413..d0a7237e 100644 --- a/playground/package.json +++ b/playground/package.json @@ -13,11 +13,9 @@ }, "devDependencies": { "@nuxtjs/storybook": "workspace:*", - "@storybook/addon-essentials": "^8.3.0", "@storybook/addon-interactions": "^8.3.0", "@storybook/addon-links": "^8.3.0", "nuxt": "3.13.1", - "storybook": "^8.3.0", "vite-plugin-inspect": "0.8.7" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e5c2fae5..373e6207 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -109,21 +109,9 @@ importers: '@nuxtjs/storybook': specifier: latest version: link:../../packages/nuxt-module - '@storybook/addon-essentials': - specifier: 8.3.0 - version: 8.3.0(storybook@8.3.0)(webpack-sources@3.2.3) '@storybook/addon-links': specifier: 8.3.0 version: 8.3.0(react@18.3.1)(storybook@8.3.0) - '@storybook/blocks': - specifier: 8.3.0 - version: 8.3.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.3.0) - '@storybook/test': - specifier: 8.3.0 - version: 8.3.0(storybook@8.3.0) - storybook: - specifier: 8.3.0 - version: 8.3.0 examples/starter: dependencies: @@ -143,21 +131,9 @@ importers: '@nuxtjs/storybook': specifier: latest version: link:../../packages/nuxt-module - '@storybook/addon-essentials': - specifier: 8.3.0 - version: 8.3.0(storybook@8.3.0)(webpack-sources@3.2.3) '@storybook/addon-links': specifier: 8.3.0 version: 8.3.0(react@18.3.1)(storybook@8.3.0) - '@storybook/blocks': - specifier: 8.3.0 - version: 8.3.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.3.0) - '@storybook/test': - specifier: 8.3.0 - version: 8.3.0(storybook@8.3.0) - storybook: - specifier: 8.3.0 - version: 8.3.0 examples/tailwind: dependencies: @@ -180,21 +156,9 @@ importers: '@nuxtjs/storybook': specifier: latest version: link:../../packages/nuxt-module - '@storybook/addon-essentials': - specifier: 8.3.0 - version: 8.3.0(storybook@8.3.0)(webpack-sources@3.2.3) '@storybook/addon-links': specifier: 8.3.0 version: 8.3.0(react@18.3.1)(storybook@8.3.0) - '@storybook/blocks': - specifier: 8.3.0 - version: 8.3.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.3.0) - '@storybook/test': - specifier: 8.3.0 - version: 8.3.0(storybook@8.3.0) - storybook: - specifier: 8.3.0 - version: 8.3.0 packages/nuxt-module: dependencies: @@ -256,9 +220,15 @@ importers: '@rollup/plugin-replace': specifier: ^5.0.7 version: 5.0.7(rollup@4.21.0) + '@storybook/addon-essentials': + specifier: ^8.3.0 + version: 8.3.0(storybook@8.3.0)(webpack-sources@3.2.3) '@storybook/builder-vite': specifier: ^8.3.0 version: 8.3.0(storybook@8.3.0)(typescript@5.6.2)(vite@5.4.5(@types/node@22.5.0)(sass@1.77.7)(terser@5.31.6))(webpack-sources@3.2.3) + '@storybook/test': + specifier: ^8.3.0 + version: 8.3.0(storybook@8.3.0) '@storybook/vue3': specifier: ^8.3.0 version: 8.3.0(storybook@8.3.0)(vue@3.5.5(typescript@5.6.2)) @@ -320,9 +290,6 @@ importers: '@nuxtjs/storybook': specifier: workspace:* version: link:../packages/nuxt-module - '@storybook/addon-essentials': - specifier: ^8.3.0 - version: 8.3.0(storybook@8.3.0)(webpack-sources@3.2.3) '@storybook/addon-interactions': specifier: ^8.3.0 version: 8.3.0(storybook@8.3.0) @@ -332,9 +299,6 @@ importers: nuxt: specifier: 3.13.1 version: 3.13.1(@parcel/watcher@2.4.1)(@types/node@22.5.0)(encoding@0.1.13)(eslint@9.10.0(jiti@1.21.6))(ioredis@5.4.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.21.0)(sass@1.77.7)(terser@5.31.6)(typescript@5.6.2)(vite@5.4.5(@types/node@22.5.0)(sass@1.77.7)(terser@5.31.6))(vue-tsc@2.1.6(typescript@5.6.2))(webpack-sources@3.2.3) - storybook: - specifier: ^8.3.0 - version: 8.3.0 vite-plugin-inspect: specifier: 0.8.7 version: 0.8.7(@nuxt/kit@3.13.1(magicast@0.3.5)(rollup@4.21.0)(webpack-sources@3.2.3))(rollup@4.21.0)(vite@5.4.5(@types/node@22.5.0)(sass@1.77.7)(terser@5.31.6))