Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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.",
Expand Down
28 changes: 6 additions & 22 deletions setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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!');
}
};

Expand Down