Regenerate twins after the trax machine generate defaults changed
Applies from: Trax 1.63.1.
The defaults of trax machine generate changed when the engine began
shipping inside the tool and on npm as @traxsharp/state-machine:
- Without
--engine-srcthe twin now imports the installed package (--import-style specifier). Earlier versions required--engine-srcand imported the engine by relative path. With--engine-srcthe default is still relative. - The default specifier is
@traxsharp/state-machine. It used to bestate-machinein the@traxscope, which Trax does not own on npm. If you vendor the engine behind another name or path alias, pass it with--specifier <module>. - A specifier twin's header now names the import it was generated with, and its IR records the IR format. Both are new lines in the generated file, so the first regeneration after upgrading shows them as a diff.
Regenerate with the new defaults
- Install
@traxsharp/state-machinein the frontend that imports the twin. - Run
trax machine generatewithout--engine-src, and commit the regenerated twin, IR and corpus. - Run
trax machine checkin CI as before; it fails on a twin left from the previous tool.
Keep generating as before
Pass --import-style relative --engine-src <engine/src> for a relative twin, or
--import-style specifier --specifier <module> for one importing your own name for the engine.
Why the twin records the IR format, and what the installed package checks on load, is in The codegen pipeline.