@tpitre/story-ui 2.0.0 → 2.0.1
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 +39 -0
- package/package.json +1 -1
package/dist/cli/setup.js
CHANGED
|
@@ -28,6 +28,43 @@ async function findAvailablePort(startPort) {
|
|
|
28
28
|
}
|
|
29
29
|
return port;
|
|
30
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* Clean up default Storybook template components that could conflict with design system discovery
|
|
33
|
+
*/
|
|
34
|
+
function cleanupDefaultStorybookComponents() {
|
|
35
|
+
const storiesDir = path.join(process.cwd(), 'src', 'stories');
|
|
36
|
+
// Common default Storybook files that cause conflicts
|
|
37
|
+
const defaultFiles = [
|
|
38
|
+
'Button.stories.ts',
|
|
39
|
+
'Button.stories.tsx',
|
|
40
|
+
'Header.stories.ts',
|
|
41
|
+
'Header.stories.tsx',
|
|
42
|
+
'Page.stories.ts',
|
|
43
|
+
'Page.stories.tsx',
|
|
44
|
+
'button.css',
|
|
45
|
+
'header.css',
|
|
46
|
+
'page.css',
|
|
47
|
+
'Button.tsx',
|
|
48
|
+
'Header.tsx',
|
|
49
|
+
'Page.tsx'
|
|
50
|
+
];
|
|
51
|
+
let cleanedFiles = 0;
|
|
52
|
+
for (const fileName of defaultFiles) {
|
|
53
|
+
const filePath = path.join(storiesDir, fileName);
|
|
54
|
+
if (fs.existsSync(filePath)) {
|
|
55
|
+
try {
|
|
56
|
+
fs.unlinkSync(filePath);
|
|
57
|
+
cleanedFiles++;
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
console.warn(`Could not remove ${fileName}: ${error}`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (cleanedFiles > 0) {
|
|
65
|
+
console.log(chalk.green(`✅ Cleaned up ${cleanedFiles} default Storybook template files to prevent conflicts`));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
31
68
|
// Design system installation configurations
|
|
32
69
|
const DESIGN_SYSTEM_CONFIGS = {
|
|
33
70
|
antd: {
|
|
@@ -454,6 +491,8 @@ export async function setupCommand() {
|
|
|
454
491
|
console.log(chalk.green(`✅ Updated .gitignore with Story UI patterns`));
|
|
455
492
|
}
|
|
456
493
|
}
|
|
494
|
+
// Clean up default Storybook template components to prevent conflicts
|
|
495
|
+
cleanupDefaultStorybookComponents();
|
|
457
496
|
// Update package.json with convenience scripts
|
|
458
497
|
if (packageJson) {
|
|
459
498
|
const scripts = packageJson.scripts || {};
|