@tpitre/story-ui 2.6.1 → 2.7.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../cli/deploy.ts"],"names":[],"mappings":"AASA,UAAU,aAAa;IAErB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,QAAQ,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,KAAK,CAAC;IACxC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAqpBD,wBAAsB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAwHzE"}
1
+ {"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../cli/deploy.ts"],"names":[],"mappings":"AASA,UAAU,aAAa;IAErB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,QAAQ,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,KAAK,CAAC;IACxC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAotBD,wBAAsB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAwHzE"}
@@ -373,29 +373,89 @@ async function deployProductionApp(backendUrl, projectName, dryRun) {
373
373
  // Generate the component registry in the user's project context
374
374
  process.chdir(userCwd);
375
375
  await generateComponentRegistry(registryOutputPath);
376
- // 2.5. Generate AI considerations from story-ui-considerations.md (if exists)
377
- console.log('šŸ“ Loading AI considerations...');
376
+ // 2.5. Load ALL design system documentation (story-ui-docs/ AND story-ui-considerations.md)
377
+ console.log('šŸ“š Loading design system documentation...');
378
+ // First, try the full documentation directory (story-ui-docs/)
379
+ const { DocumentationLoader } = await import('../story-generator/documentationLoader.js');
380
+ const docLoader = new DocumentationLoader(userCwd);
381
+ let fullDocumentation = '';
382
+ let documentationTokens = {};
383
+ let documentationPatterns = {};
384
+ let hasFullDocs = false;
385
+ if (docLoader.hasDocumentation()) {
386
+ console.log('šŸ“‚ Found story-ui-docs/ directory, loading all documentation...');
387
+ const docs = await docLoader.loadDocumentation();
388
+ fullDocumentation = docLoader.formatForPrompt(docs);
389
+ documentationTokens = docs.tokens;
390
+ documentationPatterns = docs.patterns;
391
+ hasFullDocs = true;
392
+ console.log(` āœ… Loaded ${docs.guidelines.length} guidelines, ${Object.keys(docs.tokens).length} token categories, ${Object.keys(docs.patterns).length} patterns`);
393
+ }
394
+ // Also load legacy considerations file (story-ui-considerations.md)
378
395
  const { loadConsiderations, considerationsToPrompt } = await import('../story-generator/considerationsLoader.js');
379
396
  const considerations = loadConsiderations(); // Auto-finds in common locations
380
397
  const considerationsPrompt = considerations ? considerationsToPrompt(considerations) : '';
398
+ // Combine both sources - full docs take priority, considerations supplement
399
+ let combinedDocumentation = '';
400
+ if (fullDocumentation) {
401
+ combinedDocumentation = fullDocumentation;
402
+ if (considerationsPrompt) {
403
+ // Add considerations as supplementary rules
404
+ combinedDocumentation += '\n\nšŸ“‹ ADDITIONAL DESIGN SYSTEM RULES:\n' + considerationsPrompt;
405
+ }
406
+ }
407
+ else if (considerationsPrompt) {
408
+ combinedDocumentation = considerationsPrompt;
409
+ }
381
410
  const considerationsOutputPath = path.join(buildDir, 'src/considerations.ts');
382
- // Write considerations to a TypeScript file
411
+ // Write comprehensive documentation to a TypeScript file
383
412
  const considerationsContent = `/**
384
- * AI Considerations - Auto-generated from story-ui-considerations.md
413
+ * AI Design System Documentation - Auto-generated
385
414
  *
386
- * This file contains design-system-specific instructions for the AI
387
- * when generating components. Edit story-ui-considerations.md in your
388
- * project root to customize these rules.
415
+ * This file contains ALL design system documentation for the AI:
416
+ * - Guidelines from story-ui-docs/ directory
417
+ * - Design tokens (colors, spacing, typography, etc.)
418
+ * - Component-specific documentation
419
+ * - Layout patterns
420
+ * - Accessibility rules
421
+ * - Legacy considerations from story-ui-considerations.md
422
+ *
423
+ * To customize:
424
+ * 1. Create a story-ui-docs/ directory with markdown/JSON files
425
+ * 2. And/or edit story-ui-considerations.md in your project root
389
426
  */
390
427
 
391
- export const aiConsiderations = ${JSON.stringify(considerationsPrompt, null, 2)};
428
+ export const aiConsiderations = ${JSON.stringify(combinedDocumentation, null, 2)};
429
+
430
+ export const hasConsiderations = ${(hasFullDocs || considerations) ? 'true' : 'false'};
431
+
432
+ // Design tokens for programmatic access (if needed)
433
+ export const designTokens = ${JSON.stringify(documentationTokens, null, 2)};
392
434
 
393
- export const hasConsiderations = ${considerations ? 'true' : 'false'};
435
+ // Design patterns for programmatic access (if needed)
436
+ export const designPatterns = ${JSON.stringify(documentationPatterns, null, 2)};
437
+
438
+ // Source information
439
+ export const documentationSource = {
440
+ hasFullDocs: ${hasFullDocs},
441
+ hasLegacyConsiderations: ${considerations ? 'true' : 'false'},
442
+ libraryName: ${JSON.stringify(considerations?.libraryName || null)}
443
+ };
394
444
  `;
395
445
  fs.writeFileSync(considerationsOutputPath, considerationsContent);
396
- console.log(considerations
397
- ? `āœ… Loaded AI considerations for: ${considerations.libraryName || 'your component library'}`
398
- : 'āš ļø No story-ui-considerations.md found - using default prompts');
446
+ if (hasFullDocs && considerations) {
447
+ console.log(`āœ… Loaded full documentation + considerations for: ${considerations.libraryName || 'your component library'}`);
448
+ }
449
+ else if (hasFullDocs) {
450
+ console.log('āœ… Loaded full documentation from story-ui-docs/');
451
+ }
452
+ else if (considerations) {
453
+ console.log(`āœ… Loaded considerations for: ${considerations.libraryName || 'your component library'}`);
454
+ }
455
+ else {
456
+ console.log('āš ļø No documentation found - using default prompts');
457
+ console.log(' Create story-ui-docs/ directory or story-ui-considerations.md for better results');
458
+ }
399
459
  process.chdir(buildDir);
400
460
  // 3. Install dependencies
401
461
  console.log('šŸ“¦ Installing dependencies...');
@@ -427,7 +487,7 @@ export const hasConsiderations = ${considerations ? 'true' : 'false'};
427
487
  execSync('npm install', { cwd: buildDir, stdio: 'inherit' });
428
488
  // 4. Create .env file with backend URL
429
489
  console.log('āš™ļø Configuring backend URL...');
430
- fs.writeFileSync(path.join(buildDir, '.env'), `VITE_BACKEND_URL=${backendUrl}\nVITE_APP_TITLE=Story UI\n`);
490
+ fs.writeFileSync(path.join(buildDir, '.env'), `VITE_STORY_UI_SERVER=${backendUrl}\nVITE_APP_TITLE=Story UI\n`);
431
491
  // 5. Build the app
432
492
  console.log('šŸ”Ø Building production app...');
433
493
  execSync('npm run build', { cwd: buildDir, stdio: 'inherit' });
package/dist/cli/index.js CHANGED
@@ -19,7 +19,8 @@ program
19
19
  program
20
20
  .command('init')
21
21
  .description('Initialize Story UI configuration with interactive setup')
22
- .option('-d, --design-system <system>', 'Design system to configure (shadcn, mantine, chakra, antd, mui)')
22
+ .option('-d, --design-system <system>', 'Design system to configure (mantine, vuetify, angular-material, skeleton-ui, shoelace)')
23
+ .option('-l, --llm-provider <provider>', 'LLM provider to use (claude, openai, gemini)')
23
24
  .option('-y, --yes', 'Skip interactive prompts and use defaults')
24
25
  .option('--skip-install', 'Skip package installation')
25
26
  .action(async (options) => {
@@ -1 +1 @@
1
- {"version":3,"file":"enhancedComponentDiscovery.d.ts","sourceRoot":"","sources":["../../story-generator/enhancedComponentDiscovery.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAItD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,KAAK,GAAG,OAAO,GAAG,iBAAiB,GAAG,YAAY,CAAC;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,iBAAkB,SAAQ,mBAAmB;IAC5D,MAAM,EAAE,eAAe,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,qBAAa,0BAA0B;IACrC,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,oBAAoB,CAA6C;IACzE,OAAO,CAAC,2BAA2B,CAA0B;gBAEjD,MAAM,EAAE,aAAa;IAIjC;;;OAGG;IACG,WAAW,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC;IA2CjD;;;OAGG;IACH,OAAO,CAAC,yBAAyB;IAyCjC;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAWvB;;GAED;IACH,OAAO,CAAC,cAAc;IAmBtB;;OAEG;IACH,OAAO,CAAC,eAAe;IA6GvB;;;OAGG;IACH,OAAO,CAAC,uBAAuB;IAI/B;;OAEG;IACH,OAAO,CAAC,wBAAwB;IA6B9B;;KAEC;YACW,sBAAsB;IAsEpC;;;OAGG;IACH,OAAO,CAAC,8BAA8B;IAmJtC;;OAEG;YACW,sBAAsB;IAsCpC;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAe1B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAmB3B;;OAEG;IACH,OAAO,CAAC,kBAAkB;IA6B1B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAgB5B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IA0B5B;;OAEG;IACH,OAAO,CAAC,YAAY;IAiBpB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAkC3B;;OAEG;YACW,0BAA0B;IAmCxC;;OAEG;IACH,OAAO,CAAC,2BAA2B;IAcnC;;OAEG;YACW,sBAAsB;IAMpC;;OAEG;IACH,OAAO,CAAC,yBAAyB;IA4CjC;;OAEG;IACG,sBAAsB,CAAC,cAAc,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;QAC9D,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB,OAAO,EAAE,MAAM,EAAE,CAAC;QAClB,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAClC,CAAC;IAwCF;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAwC5B;;OAEG;IACH,0BAA0B,IAAI,MAAM,EAAE;CAMvC"}
1
+ {"version":3,"file":"enhancedComponentDiscovery.d.ts","sourceRoot":"","sources":["../../story-generator/enhancedComponentDiscovery.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAItD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,KAAK,GAAG,OAAO,GAAG,iBAAiB,GAAG,YAAY,CAAC;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,iBAAkB,SAAQ,mBAAmB;IAC5D,MAAM,EAAE,eAAe,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,EAA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GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAClC,CAAC;IAwCF;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAwC5B;;OAEG;IACH,0BAA0B,IAAI,MAAM,EAAE;CAMvC"}
@@ -365,7 +365,7 @@ export class EnhancedComponentDiscovery {
365
365
  const mantineComponents = [
366
366
  // Layout
367
367
  'Container', 'SimpleGrid', 'Grid', 'Group', 'Stack', 'Flex', 'Center', 'Space', 'Divider',
368
- 'AspectRatio', 'Box', 'AppShell', 'MediaQuery', 'Paper',
368
+ 'AspectRatio', 'Box', 'AppShell', 'Paper',
369
369
  // Typography
370
370
  'Text', 'Title', 'Anchor', 'Blockquote', 'Code', 'Highlight', 'Mark', 'List',
371
371
  // Buttons & Actions
@@ -374,7 +374,7 @@ export class EnhancedComponentDiscovery {
374
374
  'TextInput', 'NumberInput', 'PasswordInput', 'Textarea', 'Select', 'MultiSelect',
375
375
  'Autocomplete', 'Checkbox', 'Switch', 'Radio', 'Slider', 'RangeSlider', 'Rating',
376
376
  'SegmentedControl', 'ColorInput', 'ColorPicker', 'FileInput', 'JsonInput', 'PinInput',
377
- 'Chip', 'TransferList', 'NativeSelect',
377
+ 'Chip', 'NativeSelect',
378
378
  // Navigation
379
379
  'Anchor', 'Breadcrumbs', 'Burger', 'NavLink', 'Pagination', 'Stepper', 'Tabs',
380
380
  // Data Display
@@ -382,13 +382,11 @@ export class EnhancedComponentDiscovery {
382
382
  'Kbd', 'Spoiler', 'Table', 'ThemeIcon', 'Timeline', 'ColorSwatch',
383
383
  // Overlays
384
384
  'Dialog', 'Drawer', 'Modal', 'LoadingOverlay', 'Popover', 'Tooltip', 'Menu',
385
- 'HoverCard', 'Affix', 'Overlay',
385
+ 'HoverCard', 'Overlay',
386
386
  // Feedback
387
387
  'Alert', 'Loader', 'Notification', 'Progress', 'RingProgress', 'Skeleton',
388
388
  // Misc
389
- 'Portal', 'Transition', 'ScrollArea', 'FocusTrap', 'Input', 'InputWrapper',
390
- // Dates (from @mantine/dates)
391
- 'Calendar', 'DateInput', 'DatePicker', 'DateTimePicker', 'MonthPicker', 'YearPicker'
389
+ 'Portal', 'Transition', 'ScrollArea', 'FocusTrap', 'Input', 'InputWrapper'
392
390
  ];
393
391
  return mantineComponents.map(name => ({
394
392
  name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tpitre/story-ui",
3
- "version": "2.6.1",
3
+ "version": "2.7.0",
4
4
  "description": "AI-powered Storybook story generator with dynamic component discovery",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",