Skip to content

Commit fa9e055

Browse files
authored
fix(add): storybook is back to using @latest version (#833)
1 parent 6004a22 commit fa9e055

File tree

3 files changed

+8
-16
lines changed

3 files changed

+8
-16
lines changed

.changeset/metal-schools-listen.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'sv': patch
3+
---
4+
5+
fix(add): storybook is back to using `@latest` version

packages/addons/_tests/_setup/global.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,14 @@ import type { TestProject } from 'vitest/node';
44
import process from 'node:process';
55
import { exec } from 'tinyexec';
66

7-
import { STORYBOOK_VERSION } from '../../storybook/index.ts';
8-
97
const TEST_DIR = fileURLToPath(new URL('../../../../.test-output/addons/', import.meta.url));
108
const variants: ProjectVariant[] = ['kit-js', 'kit-ts', 'vite-js', 'vite-ts'];
119
const CI = Boolean(process.env.CI);
1210

1311
export default async function ({ provide }: TestProject) {
1412
if (CI) {
1513
// prefetch the storybook cli during ci to reduce fetching errors in tests
16-
const { stdout } = await exec('pnpm', [
17-
'dlx',
18-
`create-storybook@${STORYBOOK_VERSION}`,
19-
'--version'
20-
]);
14+
const { stdout } = await exec('pnpm', ['dlx', `create-storybook@latest`, '--version']);
2115
console.info('storybook version:', stdout);
2216
}
2317

packages/addons/storybook/index.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import process from 'node:process';
22
import { defineAddon } from '@sveltejs/cli-core';
33
import { getNodeTypesVersion } from '../common.ts';
44

5-
export const STORYBOOK_VERSION = '10.1.0';
6-
75
export default defineAddon({
86
id: 'storybook',
97
shortDescription: 'frontend workshop',
@@ -14,15 +12,10 @@ export default defineAddon({
1412
runsAfter('eslint');
1513
},
1614
run: async ({ sv }) => {
17-
const args = [
18-
`create-storybook@${STORYBOOK_VERSION}`,
19-
'--skip-install',
20-
'--no-dev',
21-
'--no-features'
22-
];
15+
const args = [`create-storybook@latest`, '--skip-install', '--no-dev'];
2316

2417
// skips the onboarding prompt during tests
25-
if (process.env.NODE_ENV?.toLowerCase() === 'test') args.push('--yes');
18+
if (process.env.NODE_ENV?.toLowerCase() === 'test') args.push(...['--no-features', '--yes']);
2619

2720
await sv.execute(args, 'inherit');
2821
sv.devDependency(`@types/node`, getNodeTypesVersion());

0 commit comments

Comments
 (0)