Guides
Each guide covers one job, using the factory template and lib-factory. For why the rules are what they are, see the method. For exact signatures, see the lib-factory README.
Build a line
| Guide | The job |
|---|---|
| Write a station | The handler's folder, its config schema, what execute receives and returns |
| Write a station that processes workpieces | Run your code on each workpiece, report outcomes, create workpieces at a line head |
| Connect stations with a conveyor | Pull workpieces from the previous station, a sub-bin, or several bins |
| Start stations | Run stations by hand, on a schedule, or when work arrives |
| Hold a workpiece until someone decides | A waiting station and the lane that releases approved work |
Run a factory
| Guide | The job |
|---|---|
| Lay out a factory repo and push its lines | Line and station files, and pushing them with al-orc |
| Run a factory session | Start, stop and keep a session running; how it finds stations |
| Give stations their credentials | Secrets in .env, never in a station file; one client per outside system |
| Where a station keeps its data | Workpiece files, run files, scratch, and what goes in the run's output |
Report
| Guide | The job |
|---|---|
| Report a run | Attach the run report and supporting documents, and read them |
| Write reports from templates | report.md and other templates next to the station's handler, rendered with renderLocal |
When things go wrong
| Guide | The job |
|---|---|
| Throw errors from a station | Which errors fail a run, how it retries, and why a station must be safe to rerun |
| Run and test a station | Run it locally, and test it in Jest |
| Find out why a workpiece failed, and retry it | Read the error, group failures, and send work back |
| Debug a run | From the run's status to the session log to the usual causes |
| Redo work through the line | Send finished workpieces back through a fixed station |
Recipes
| Guide | The job |
|---|---|
| Call a command-line tool from a station | Wrap a tool so its failures land on the right workpiece |
| Read, render and split PDFs | Text layer, page images for a model, split and rotate |