@patterkit/ops
v0.17.1
Published
The shared operations layer: every project operation (load, validate, export, format, play, ...) as a pure function, consumed by the patter CLI and Patterpad alike.
Readme
@patterkit/ops
Every operation on a Patter project as a plain function: loading, validating, exporting, formatting,
playing in the terminal, reports, localisation, script exports, packing, merging, and more. The patter
command line tool and the Patterpad editor are both thin front-ends over this package, so they behave the
same way by construction.
Most people won't need to install this directly. To play Patter dialogue in a game or web page, use
@patterkit/runtime; to work with Patter projects from
a terminal or a build script, use @patterkit/cli.
How it works
The functions don't print, prompt, or exit, and the ones that change files don't write them. They return
the writes they plan, and the caller applies them (applyWrites, or its own route through version
control), so a front-end decides how changes reach the disk.
What's in it
- Loading and checking:
loadProject,runValidate, andrunFormat. - Exporting:
runExportfor the.pattercbundle,runExportHtmlandrunExportWebfor playable pages, andrunPlayfor a playthrough in the terminal. - Scripts: the readable script as
.docxor.pdf(runScriptDoc,scriptToDocx,scriptToPdf), the voice script, and the editable script round trip (exportEditableScript,readEditableDocx, andplanEditableImport), which sends a script to an editor in Word or Google Docs and brings their changes back as suggestions. - Localisation:
extractLocandapplyLoc, with JSON, PO, and Excel formats. - Review and production: reports, coverage tests, search and replace, suggestions, and voice and audio status.
- Sharing:
runPackandrunUnpackfor.patterpackfiles, andrunMergefor merging changes made in two places.
npm install @patterkit/opsPart of Patter
Patter is a branching dialogue format with its own editor (Patterpad), command line
tool (patter), and runtimes for JavaScript, Unity, Unreal, and Godot. This package is one layer of the
JavaScript tooling, and the other @patterkit packages build on it. How it fits
together shows where each piece sits, and the source is in the
patter repository.
Licence
MIT
