Strata · API

createUpgrader

createUpgrader takes every grammar sequence the code supports and a transform function that evaluates a step’s transform, and returns { stamp, upgrade, locate, behind }. Strata does not depend on Prism: the evaluator is passed in as the transform option. stamp has one version per grammar, equal to the number of migrations in that grammar.

Call
await createUpgrader([NOVA_SEQUENCE, PRISM_SEQUENCE, KIT], { transform: evaluate })
KIT (descriptions only)
{
  id: 'theatre.kit',
  migrations: [
    'Button: label is now text',
    'Button: tone is now variant',
    'Card is now Tile',
  ],
}
Upgrader stamp
{ nisc.nova: 2, nisc.prism: 3, theatre.kit: 3 }
Output matches the expected value

Runs in this page on the installed package. The input and the expected output are defined by the example.