import chalk from 'chalk' import type { Action } from '../reconciler.js' export function printPlan(actions: Action[]) { if (actions.length === 0) { console.log(chalk.green('No changes needed. Everything is up to date.')) return } console.log(chalk.bold(`\nPlan: ${actions.length} action(s)\n`)) for (const action of actions) { const icon = action.type === 'create' ? chalk.green('+') : chalk.yellow('~') const verb = action.type === 'create' ? chalk.green('create') : chalk.yellow('update') const name = action.resource.name const kind = action.resource.kind console.log(` ${icon} ${verb} ${kind}: ${chalk.bold(name)}`) if (action.existingId) { console.log(chalk.gray(` (id: ${action.existingId})`)) } } console.log() }