CodeVetter · Repo Unpack · Extension points
chromaui/chromatic-cli
Extension points are explicit TypeScript tables, interfaces, adapters, and task seams. CLI commands use a dispatch table, configuration uses a strict schema, and renderers consume a common lifecycle interface. Programmatic callbacks expose task progress and cancellation without a separate plugin loader in the inspected flow. TurboSnap's filesystem abstraction and manifest serialization provide particularly clear seams for deterministic implementation and testing.
- New CLI utilities plug into the commands table in bin-src/register.js, following its lazy-import main(argv) handlers and argument slicing; unknown commands currently fall back to the publishing main handler.
- A new shared option spans Flags/Options, parseArguments' meow definitions, getPartialOptions normalization, and possibly configurationSchema; the schema is strict, so unknown configuration keys are rejected.
- Action-facing options require matching action.yml input declarations and getInput/maybe mapping in action-src/main.ts; return-object changes also require synchronization with declared Action outputs.
- TaskConfig defines transitions, extractInput, run, applyOutput, and applyPartial; runTask adapts that business logic to any TaskRenderer implementing start/update/succeed/fail.
- Programmatic integrations can provide experimental_onTaskStart/onTaskError/onTaskProgress/onTaskComplete and experimental_abortSignal; makeReporter fans numeric progress to callbacks and synchronizes reported build state onto Context.
- builders and viewLayers are lookup registries for Storybook builder/framework identities; getStorybookMetadata reads through MainConfigReader and combines independently resolved version, builder, refs, and static-directory information.
- TurboSnap v2 requires an injected ProjectFiles interface for file tests, version resolution, hashing, tree listing, and writes; realProjectFiles is an explicit production adapter, and serializeManifest is shared by disk output and the inspection command.
- Presentation examples extend through .storybook/main.ts's node-src story glob and HTML/Vite framework; preview decorators render ANSI CLI messages or HTML, allowing task/message states to be exercised separately from live publishing.