Skip to content

Commit 24530a9

Browse files
authored
Merge pull request #7 from threeguts/D2C-1644-storybook-cannot-load-doesn-t-run
2 parents 1ff0c6a + 4f0ee66 commit 24530a9

File tree

3 files changed

+9
-25
lines changed

3 files changed

+9
-25
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "generator-bitloops",
3-
"version": "0.3.19",
3+
"version": "0.3.20",
44
"description": "Next.js with TypeScript, Tailwind, Storybook and Cypress generator by Bitloops",
55
"license": "MIT",
66
"author": "Bitloops S.A.",

setup/index.js

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -170,32 +170,16 @@ export default class extends Generator {
170170
})[0];
171171

172172
if (!latest90) {
173-
throw new Error('No stable 9.0.x versions found.');
173+
throw new Error('No stable 9.0.x versions found.');
174174
}
175175

176-
// Log the chosen version (optional)
177176
this.log(`Latest stable 9.0 version: ${latest90}`);
178-
179-
spawnSync('npx', [
180-
'-y',
181-
`storybook@${latest90}`,
182-
'init',
183-
'--no-dev',
184-
'--yes', // Skip all prompts
185-
'--type', 'nextjs', // Specify Next.js as the framework
186-
], { stdio: 'inherit', cwd: this.destinationRoot() });
177+
//Initializing sb with nextjs+vite
178+
spawnSync('npx', ['-y', 'storybook@latest', 'init', '--no-dev', '--yes', '--type', 'nextjs', '--builder', 'vite'], { stdio: 'inherit', cwd: this.destinationRoot() });
187179
this.log('Storybook installed!');
188-
this.log('Installing @storybook/react-vite for Vite builder support...');
189-
spawnSync('npm', [
190-
'install',
191-
'--save-dev',
192-
'@storybook/react-vite'
193-
], { stdio: 'inherit', cwd: this.destinationRoot() });
194-
this.log('@storybook/react-vite installed!');
195-
// if (this.options.tailwind && this.options.storybook) {
196-
// Tailwind CSS specific setup for older versions of Storybook
197-
// this.spawnCommandSync('npx', ['storybook@latest', 'add', '@storybook/addon-styling-webpack']);
198-
// }
180+
//Verifies the correct nextjs-vite framework is used
181+
spawnSync('npm', ['install', '--save-dev', '@storybook/nextjs-vite@^9'], { stdio: 'inherit', cwd: this.destinationRoot() });
182+
this.log('@storybook/nextjs-vite installed!');
199183
}
200184
};
201185

0 commit comments

Comments
 (0)