Add preview-build command to Workbench
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3585055. -->
Reported by: [balintbrews](https://www.drupal.org/user/613760)
Related to !922
>>>
<h3 id="overview">Overview</h3>
<p>Workbench currently serves previews through its Vite runtime, but it does not provide a command to export a standalone preview artifact for a single component or page. That makes it harder to generate portable preview output for review, testing, or downstream tooling without running the full Workbench server.</p>
<p>Add a dedicated <code>canvas-workbench preview-build</code> command that can target either a component metadata file or a page JSON file and write a standalone output directory for that target.</p>
<h3 id="proposed-resolution">Proposed resolution</h3>
<p>Introduce a <code>preview-build</code> command in Workbench with support for <code>--component-path</code> or <code>--page-path</code>, plus <code>--out-dir</code> for the export location. The command should build self-contained HTML preview artifacts, include component mock variants when present, write a manifest that describes the generated files, and print a JSON payload with the request, target, output paths, summary counts, warnings, and errors. Document the command in the Workbench README and user docs, and add test coverage for component and page exports.</p>
<h3 id="ui-changes">User interface changes</h3>
<p>n/a</p>
issue