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: 3 additions & 1 deletion code/core/src/core-server/build-dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ export async function resolveOnboardingInitialPath(
}
const onboardingPending = await cache.get('onboarding-pending').catch(() => {});
if (onboardingPending) {
await cache.remove('onboarding-pending').catch(() => {});
try {
await cache.remove('onboarding-pending');
} catch {}
return '/onboarding';
}
return undefined;
Expand Down
2 changes: 1 addition & 1 deletion code/lib/create-storybook/src/initiate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async function checkFeatureSupport(
process.cwd()
);

const aiSetup = FeatureCompatibilityService.supportsAISetupFeature(renderer, builder);
const aiSetup = FeatureCompatibilityService.supportsAISetupFeature(renderer, builder, framework);

return {
isTestFeatureAvailable: result.compatible,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ describe('FeatureCompatibilityService', () => {
expect(
FeatureCompatibilityService.supportsAISetupFeature(
SupportedRenderer.REACT,
SupportedBuilder.VITE
SupportedBuilder.VITE,
SupportedFramework.REACT_VITE
)
).toBe(true);
});
Expand All @@ -58,7 +59,8 @@ describe('FeatureCompatibilityService', () => {
expect(
FeatureCompatibilityService.supportsAISetupFeature(
SupportedRenderer.VUE3,
SupportedBuilder.VITE
SupportedBuilder.VITE,
SupportedFramework.VUE3_VITE
)
).toBe(false);
});
Expand All @@ -67,7 +69,8 @@ describe('FeatureCompatibilityService', () => {
expect(
FeatureCompatibilityService.supportsAISetupFeature(
SupportedRenderer.REACT,
SupportedBuilder.WEBPACK5
SupportedBuilder.WEBPACK5,
SupportedFramework.REACT_WEBPACK5
)
).toBe(false);
});
Expand All @@ -76,14 +79,26 @@ describe('FeatureCompatibilityService', () => {
expect(
FeatureCompatibilityService.supportsAISetupFeature(
SupportedRenderer.ANGULAR,
SupportedBuilder.WEBPACK5
SupportedBuilder.WEBPACK5,
SupportedFramework.ANGULAR
)
).toBe(false);

expect(
FeatureCompatibilityService.supportsAISetupFeature(
SupportedRenderer.SVELTE,
SupportedBuilder.WEBPACK5
SupportedBuilder.WEBPACK5,
null
)
).toBe(false);
});

it('should return false for react-native-web-vite framework', () => {
expect(
FeatureCompatibilityService.supportsAISetupFeature(
SupportedRenderer.REACT,
SupportedBuilder.VITE,
SupportedFramework.REACT_NATIVE_WEB_VITE
)
).toBe(false);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { AddonVitestService, ProjectType } from 'storybook/internal/cli';
import type { JsPackageManager } from 'storybook/internal/common';
import type { SupportedFramework } from 'storybook/internal/types';
import { SupportedBuilder, SupportedRenderer } from 'storybook/internal/types';
import { SupportedBuilder, SupportedFramework, SupportedRenderer } from 'storybook/internal/types';

/** Project types that support the onboarding feature */
const ONBOARDING_PROJECT_TYPES: ProjectType[] = [
Expand Down Expand Up @@ -34,7 +33,14 @@ export class FeatureCompatibilityService {
}

/** Check if AI-assisted setup (storybook ai setup) is supported for this project configuration */
static supportsAISetupFeature(renderer: SupportedRenderer, builder: SupportedBuilder): boolean {
static supportsAISetupFeature(
renderer: SupportedRenderer,
builder: SupportedBuilder,
framework: SupportedFramework | null
): boolean {
if (framework === SupportedFramework.REACT_NATIVE_WEB_VITE) {
return false;
}
return renderer === SupportedRenderer.REACT && builder === SupportedBuilder.VITE;
}

Expand Down
Loading