From f5d9dde21c3d86edcc68d673f636e366983569a7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 21 Jan 2026 06:10:12 +0000 Subject: [PATCH 1/2] Initial plan From 6128e73940da7f73e4e50cc4391870b00efc0898 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 21 Jan 2026 06:14:09 +0000 Subject: [PATCH 2/2] Add negative test case for create-rsbuild pattern and fix regex Co-authored-by: shilman <488689+shilman@users.noreply.github.com> --- .../create-storybook/src/services/VersionService.test.ts | 8 ++++++++ code/lib/create-storybook/src/services/VersionService.ts | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) 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'; }