Skip to content

Latest commit

 

History

History
21 lines (15 loc) · 1.56 KB

AGENTS.md

File metadata and controls

21 lines (15 loc) · 1.56 KB

This is a monorepo containing XState, @xstate/store, and related packages.

Dev environment

  • Use pnpm to install dependencies

PR instructions

  • Run pnpm test to run the tests in all packages, only for changes that affect mulitple packages.
  • Run pnpm test:core to only run core XState tests.
  • Run pnpm test:store to only run @xstate/store tests.
  • Run pnpm lint and pnpm format:check to check linting and formatting.
  • Run pnpm typecheck to make sure that there are no type errors.
  • Before making a PR, run pnpm changeset to 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.

XState v6 (alpha)

  • 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 in packages/core before writing machine configs.
  • When generated code reads an invoked actor's onDone.event.output, use s.createInvoke({ src, onDone }) or register the source in setup({ actors }). A bare inline invoke cannot correlate the source with its output and may require narrowing. See docs/invoke.md.
  • In Vue examples that hold a machine in reactive state, use shallowRef(machine) or markRaw(machine), especially before restoreActor(machine, persisted). See packages/xstate-vue/docs/input-and-snapshots.md.