Skip to content

Support --report flag for single export commands (colors, icons, images, typography) #2

@alexey1312

Description

@alexey1312

Context

ExFig CLI branch feat/export-report (PR #66) adds --report flag for single export commands (colors, icons, images, typography). Currently exfig-action only supports --report for batch mode.

What needs to change

1. buildCommand() — extend --report to all export commands

Currently (line 491-496):

if (inputs.command === 'batch') {
  reportPath = inputs.report || path.join(os.tmpdir(), 'exfig-report.json');
  args.push('--report', reportPath);
}

Should also cover colors, icons, images, typography.

2. types.ts — add ExportReport interface

New report schema differs from BatchReport. Single-command report structure:

interface ExportReport {
  version: number;
  command: string;
  config: string;
  startTime: string;
  endTime: string;
  duration: number;
  success: boolean;
  error: string | null;
  stats: { colors: number; icons: number; images: number; typography: number };
  warnings: string[];
  manifest: AssetManifest | null;
}

interface AssetManifest {
  outputDirectory: string;
  files: AssetManifestFile[];
  deleted: string[];
}

interface AssetManifestFile {
  path: string;
  assetType: string;
}

3. parseReportFile() — handle both report formats

Detect report type (batch vs single) and parse accordingly. Batch has results[] array, single has command field.

4. action.yml — update report input description

Remove "(batch mode)" from: 'Path to write JSON report file (batch mode)'

5. Report output for single commands

Set report_json output for single export commands too (currently only set in batch mode).

Notes

  • Backward-compatible: without these changes, action falls back to regex parsing for single commands — nothing breaks
  • Blocked on ExFig CLI release that includes feat/export-report

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions