2.0.0 • Published 5 years ago

cia v2.0.0

Weekly downloads
4
License
-
Repository
-
Last release
5 years ago

CLI State Machine

High level Concepts

the state machine is based on actions, which are based on states.

Actions consist of:

  • beforeState: before execute, required State for the Action to be valid
  • execute: a function to execute once prereqs are valid
  • afterState: post execute, what State the action leads to.
  • repeatable: if true, a boolean

States have:

  • getValues: a function that runs (optionally using the config) and gets values to work with
  • asserts: a function that runs on the result of getValue and returns a boolean.

We can run assertions on the requirements at any time. Users should try to get their data from getters instead of directly accessing so that they don't run into inconsistent states and fail. You can run validateState and get back a ValidatedState with two extra fields: value and isValid, for easier coding without excessive execution.

check the comments on src/types.ts for more detailed info.

TSDX Bootstrap

This project was bootstrapped with TSDX.

2.0.0

5 years ago

1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.0

8 years ago

0.0.1

10 years ago