@tpitre/story-ui 2.1.3 → 2.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/setup.js
CHANGED
|
@@ -337,9 +337,9 @@ export async function setupCommand() {
|
|
|
337
337
|
message: 'Which design system are you using?',
|
|
338
338
|
choices: [
|
|
339
339
|
{ name: '🤖 Auto-detect from package.json', value: 'auto' },
|
|
340
|
-
{ name: '🐜 Ant Design (antd) - Install & Configure', value: 'antd' },
|
|
341
|
-
{ name: '🎯 Mantine (@mantine/core) - Install & Configure', value: 'mantine' },
|
|
342
|
-
{ name: '⚡ Chakra UI (@chakra-ui/react) - Install & Configure', value: 'chakra' },
|
|
340
|
+
{ name: '🐜 Ant Design (antd) - Automatic Install & Configure', value: 'antd' },
|
|
341
|
+
{ name: '🎯 Mantine (@mantine/core) - Automatic Install & Configure', value: 'mantine' },
|
|
342
|
+
{ name: '⚡ Chakra UI (@chakra-ui/react) - Automatic Install & Configure', value: 'chakra' },
|
|
343
343
|
{ name: '🔧 Custom/Other', value: 'custom' }
|
|
344
344
|
],
|
|
345
345
|
default: autoDetected ? 'auto' : 'custom'
|
|
@@ -351,7 +351,8 @@ export async function setupCommand() {
|
|
|
351
351
|
const systemName = answers.designSystem === 'antd' ? 'Ant Design' :
|
|
352
352
|
answers.designSystem === 'mantine' ? 'Mantine' :
|
|
353
353
|
answers.designSystem === 'chakra' ? 'Chakra UI' : 'the design system';
|
|
354
|
-
|
|
354
|
+
const config = DESIGN_SYSTEM_CONFIGS[answers.designSystem];
|
|
355
|
+
return `🚨 IMPORTANT: Would you like to install ${systemName} packages now?\n Required packages: ${config.packages.join(', ')}\n (Without these packages, Story UI and Storybook will not work properly)`;
|
|
355
356
|
},
|
|
356
357
|
when: (answers) => ['antd', 'mantine', 'chakra'].includes(answers.designSystem),
|
|
357
358
|
default: true
|
package/package.json
CHANGED
|
@@ -145,15 +145,33 @@ const syncWithActualStories = async (): Promise<ChatSession[]> => {
|
|
|
145
145
|
// Delete story and chat
|
|
146
146
|
const deleteStoryAndChat = async (chatId: string): Promise<boolean> => {
|
|
147
147
|
try {
|
|
148
|
+
// Remove .stories.tsx extension if present to get the actual story ID
|
|
149
|
+
const storyId = chatId.replace(/\.stories\.tsx$/, '');
|
|
150
|
+
console.log(`Attempting to delete story: chatId="${chatId}", storyId="${storyId}"`);
|
|
151
|
+
|
|
148
152
|
// First try to delete from backend
|
|
149
|
-
const response = await fetch(`${DELETE_API_BASE}/${
|
|
153
|
+
const response = await fetch(`${DELETE_API_BASE}/${storyId}`, {
|
|
150
154
|
method: 'DELETE',
|
|
151
155
|
headers: { 'Content-Type': 'application/json' }
|
|
152
156
|
});
|
|
153
157
|
|
|
154
158
|
if (!response.ok) {
|
|
155
|
-
console.error('Failed to delete story from backend');
|
|
156
|
-
|
|
159
|
+
console.error('Failed to delete story from backend, trying legacy endpoint');
|
|
160
|
+
|
|
161
|
+
// Try legacy endpoint as fallback
|
|
162
|
+
const legacyResponse = await fetch(`http://localhost:${getApiPort()}/story-ui/delete`, {
|
|
163
|
+
method: 'POST',
|
|
164
|
+
headers: { 'Content-Type': 'application/json' },
|
|
165
|
+
body: JSON.stringify({
|
|
166
|
+
chatId: storyId,
|
|
167
|
+
storyId: storyId
|
|
168
|
+
})
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
if (!legacyResponse.ok) {
|
|
172
|
+
console.error('Legacy delete endpoint also failed');
|
|
173
|
+
return false;
|
|
174
|
+
}
|
|
157
175
|
}
|
|
158
176
|
|
|
159
177
|
// Check if response is JSON
|