diff --git a/package-lock.json b/package-lock.json index 84ae011..44fc229 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "generator-bitloops", - "version": "0.3.18", + "version": "0.3.20", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "generator-bitloops", - "version": "0.3.18", + "version": "0.3.20", "license": "MIT", "dependencies": { "yeoman-environment": "^4.4.3", diff --git a/package.json b/package.json index f2be678..4a41c71 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "generator-bitloops", - "version": "0.3.19", + "version": "0.3.20", "description": "Next.js with TypeScript, Tailwind, Storybook and Cypress generator by Bitloops", "license": "MIT", "author": "Bitloops S.A.", diff --git a/setup/index.js b/setup/index.js index 0538db5..624d339 100644 --- a/setup/index.js +++ b/setup/index.js @@ -170,32 +170,16 @@ export default class extends Generator { })[0]; if (!latest90) { - throw new Error('No stable 9.0.x versions found.'); + throw new Error('No stable 9.0.x versions found.'); } - // Log the chosen version (optional) this.log(`Latest stable 9.0 version: ${latest90}`); - - spawnSync('npx', [ - '-y', - `storybook@${latest90}`, - 'init', - '--no-dev', - '--yes', // Skip all prompts - '--type', 'nextjs', // Specify Next.js as the framework - ], { stdio: 'inherit', cwd: this.destinationRoot() }); + //Initializing sb with nextjs+vite + spawnSync('npx', ['-y', 'storybook@latest', 'init', '--no-dev', '--yes', '--type', 'nextjs', '--builder', 'vite'], { stdio: 'inherit', cwd: this.destinationRoot() }); this.log('Storybook installed!'); - this.log('Installing @storybook/react-vite for Vite builder support...'); - spawnSync('npm', [ - 'install', - '--save-dev', - '@storybook/react-vite' - ], { stdio: 'inherit', cwd: this.destinationRoot() }); - this.log('@storybook/react-vite installed!'); - // if (this.options.tailwind && this.options.storybook) { - // Tailwind CSS specific setup for older versions of Storybook - // this.spawnCommandSync('npx', ['storybook@latest', 'add', '@storybook/addon-styling-webpack']); - // } + //Verifies the correct nextjs-vite framework is used + spawnSync('npm', ['install', '--save-dev', '@storybook/nextjs-vite@^9'], { stdio: 'inherit', cwd: this.destinationRoot() }); + this.log('@storybook/nextjs-vite installed!'); } };