diff --git a/code/lib/create-storybook/src/services/VersionService.test.ts b/code/lib/create-storybook/src/services/VersionService.test.ts index 05fa1f659961..4f7d06f4e156 100644 --- a/code/lib/create-storybook/src/services/VersionService.test.ts +++ b/code/lib/create-storybook/src/services/VersionService.test.ts @@ -156,6 +156,14 @@ describe('VersionService', () => { expect(integration).toBe('create-rsbuild'); }); + it('should NOT detect creatersbuild without separator', () => { + const ancestry = [{ command: 'npx creatersbuild' }]; + + const integration = versionService.getCliIntegrationFromAncestry(ancestry as any); + + expect(integration).toBeUndefined(); + }); + it('should detect @tanstack/start command', () => { const ancestry = [{ command: 'npx @tanstack/start@latest create my-app' }]; diff --git a/code/lib/create-storybook/src/services/VersionService.ts b/code/lib/create-storybook/src/services/VersionService.ts index cd7efbb05dd0..5a5cef89c58e 100644 --- a/code/lib/create-storybook/src/services/VersionService.ts +++ b/code/lib/create-storybook/src/services/VersionService.ts @@ -56,7 +56,7 @@ export class VersionService { return svMatch[1].toLowerCase().includes('add') ? 'sv add' : 'sv create'; } // Check for create-rsbuild or create rsbuild - const rsbuildMatch = ancestor.command?.match(/(?:^|\s)create[\s\-]?rsbuild/i); + const rsbuildMatch = ancestor.command?.match(/(?:^|\s)create[\s\-]rsbuild/i); if (rsbuildMatch) { return 'create-rsbuild'; }