/xstate-codegen

A codegen tool for 100% TS type-safety in XState

Primary LanguageTypeScript

xstate-codegen

A Typescript codegen CLI for XState.

Birthed from a twitter rant. Read this to get an idea of what you're getting yourself in for.

This repository is EXPERIMENTAL. I'm yet even to do readme-driven development. Changes are subject to break things.

Usage

yarn global add xstate-codegen

xstate-codegen "src/**/**.machine.ts"

Watches any file with a machine.ts extension and adds typings for it.

Currently only works with React, but we plan to support other frameworks soon.

Enjoy!