All files / packages/fds-uif/generator-base/src index.ts

0% Statements 0/0
0% Branches 0/0
0% Functions 0/0
0% Lines 0/0

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50                                                                                                   
/**
 * @fds-uif/generator-base
 *
 * Shared utilities for UIF code generators.
 *
 * ## Architecture
 *
 * The transformer pipeline:
 *
 * 1. **Resolved UIF** (from dist/) - Already merged, no parsing needed
 * 2. **Analyze** - Extract props, types, structure → ComponentMetadata
 * 3. **Generate** - Emit library-specific code (implemented by library generators)
 * 4. **Format** - Apply Prettier formatting
 *
 * ## Usage
 *
 * ```typescript
 * import { analyzeUif, formatGeneratedCode } from '@fds-uif/generator-base';
 * import { validateResolved, isGenReady } from '@fds-uif/core';
 *
 * // Load resolved UIF from dist/
 * const uif = JSON.parse(fs.readFileSync('dist/components/badge/badge.slds.uif.json'));
 *
 * // Validate (optional - analyzeUif validates by default)
 * const result = validateResolved(uif);
 *
 * // Analyze
 * const metadata = analyzeUif(uif);
 *
 * // Generate (library-specific)
 * const code = generateReactComponent(metadata);
 *
 * // Format
 * const formatted = await formatGeneratedCode(code);
 * ```
 *
 * @packageDocumentation
 */
 
// Re-export all browser-safe utilities
export * from './shared-exports.js';
 
// Re-export validation and extraction from core for convenience
export {
  validateResolved,
  validateResolvedOrThrow,
  UifResolvedValidationError,
  isGenReady,
} from '@fds-uif/core';