/**
 * cli:scaffold-component — validate.ts
 */
import { ScaffoldComponentInputSchema, type ValidationResult } from './types.js'

export function validate(raw: unknown): ValidationResult {
  const result = ScaffoldComponentInputSchema.safeParse(raw)
  if (result.success) {
    return { valid: true, errors: [], warnings: [] }
  }
  return {
    valid: false,
    errors: result.error.issues.map(i => `[${i.path.join('.')}] ${i.message}`),
    warnings: [],
  }
}
