This is a monorepo containing XState, @xstate/store, and related packages.
- Use pnpm to install dependencies
- Run
pnpm testto run the tests in all packages, only for changes that affect mulitple packages. - Run
pnpm test:coreto only run core XState tests. - Run
pnpm test:storeto only run @xstate/store tests. - Run
pnpm lintandpnpm format:checkto check linting and formatting. - Run
pnpm typecheckto make sure that there are no type errors. - Before making a PR, run
pnpm changesetto create a changeset with a short description of the changes, and a code example if applicable. Do not include implementation details; only pertinent details for developers using the package. - For every new feature or behavior change, audit the relevant docs and READMEs and fix missing or inaccurate guidance in the same PR.
- v6 alpha syntax differs from v5 — do not assume v5 patterns (e.g.
{ onDone: { actions } }invoke config is wrong in v6). Verify against the current types/source inpackages/corebefore writing machine configs. - When generated code reads an invoked actor's
onDone.event.output, uses.createInvoke({ src, onDone })or register the source insetup({ actors }). A bare inline invoke cannot correlate the source with its output and may require narrowing. Seedocs/invoke.md. - In Vue examples that hold a machine in reactive state, use
shallowRef(machine)ormarkRaw(machine), especially beforerestoreActor(machine, persisted). Seepackages/xstate-vue/docs/input-and-snapshots.md.