0.4.16 • Published 2 months ago

@stonecrop/stonecrop v0.4.16

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

Stonecrop

This package is under active development / design.

Design

A context will define schema, workflow and actions.

  • Schema describes the data model and layout of the document.
  • Workflows are the events that are registered on it and will specific to the context. An application might have 'login', 'onAppLoad', 'beforeRouteChange' and 'logout' events. A form/document context might define CRUD events. A table component, nested inside the form component might define its own events. I think we want Events to be FSM
  • Actions are an ordered set of functions, called by Workflow
  • Router integration. Stonecrop setup should expect a router or provide a default implementation

The context will be tree-shaped with a single root. Adding more nodes at the root level isn't a problem, but multiple roots would be disallowed.

Example APIs and paths

app.schema <Record> // immutable
app.workflow <FSM> // immutable
app.actions <OrderedSet> // immutable
app.value <Store> // mutable
app.user // "tyler@agritheory.com"
app.name // "My First Application"
app.doctype.schema <Record> // `app.doctype` lazy loaded by Event in router?
app.doctype.workflow <FSM>
app.doctype.actions <OrderedSet>
app.doctype.actions.value <Store>
app.doctype.schema.field.workflow <FSM>
app.doctype.schema.field.actions <OrderedSet>
app.doctype.schema.field.value <Store>
app.doctype.schema.field.value.field.value <Store> // a "sub-form"
app.doctype.schema.field.value.field[0].value <Store> // also a "sub-form", likely representing a table or list

It may make sense to use automatic injection aliasing at the doctype level

Base Classes

The Doctype aligns with a row, record or object in a database. It is required to specify its schema, a Finite State Machine that informs its workflow and a set of functions that are triggered by that FSM's state transitions.

Registry is a map of all Doctypes, lazy loaded and is responsible for routing within the application

Stem is a composable singleton that wraps Registry and provides application level state management

Story / Network diagram

Doctype | Record Story

  • User is redirected after successful login
  • Base URL is configured at app level to serve a navigation page
  • User navigates to list view of doctype
  • Table component loads existing records of doctype from schema; record-level schema is added to registry with web worker
  • User navigates to specific record of doctype: schema is loaded from registry, data is loaded from server
  • User mutates data, changes are persisted to server / DB per FSM

App Level

  • User is redirected after successful login
  • Base URL is configured at app level to serve a navigation page
  • User opens command palette from lower-right-docked tab interface
  • User can search for doctype by name or other server-enabled capabilities

Low Code

  • User can define doctype and schema from UI
  • Fields are shown as rows in a table
  • FSM is shown as an editable diagram that validates itself
0.4.15

2 months ago

0.4.16

2 months ago

0.4.13

2 months ago

0.4.14

2 months ago

0.4.11

4 months ago

0.4.12

3 months ago

0.4.9

4 months ago

0.4.8

4 months ago

0.4.10

4 months ago

0.4.7

5 months ago

0.2.63

7 months ago

0.2.62

7 months ago

0.2.61

8 months ago

0.2.60

8 months ago

0.2.67

7 months ago

0.2.66

7 months ago

0.2.65

7 months ago

0.2.64

7 months ago

0.2.52

8 months ago

0.2.51

8 months ago

0.2.50

8 months ago

0.2.59

8 months ago

0.2.58

8 months ago

0.2.57

8 months ago

0.2.56

8 months ago

0.2.55

8 months ago

0.2.54

8 months ago

0.2.53

8 months ago

0.3.0

7 months ago

0.3.6

7 months ago

0.3.5

7 months ago

0.3.8

6 months ago

0.3.7

6 months ago

0.3.2

7 months ago

0.3.1

7 months ago

0.3.4

7 months ago

0.3.3

7 months ago

0.3.9

6 months ago

0.2.49

8 months ago

0.2.48

8 months ago

0.3.11

6 months ago

0.3.10

6 months ago

0.4.5

5 months ago

0.4.4

6 months ago

0.4.6

5 months ago

0.4.1

6 months ago

0.4.0

6 months ago

0.4.3

6 months ago

0.4.2

6 months ago

0.2.47

9 months ago

0.2.46

9 months ago

0.2.45

9 months ago

0.2.44

9 months ago

0.2.41

9 months ago

0.2.43

9 months ago

0.2.42

9 months ago

0.2.40

9 months ago

0.2.39

9 months ago

0.2.38

10 months ago

0.2.37

10 months ago

0.2.36

10 months ago

0.2.35

10 months ago

0.2.27

12 months ago

0.2.26

12 months ago

0.2.25

1 year ago

0.2.24

1 year ago

0.2.23

1 year ago

0.2.22

1 year ago

0.2.21

1 year ago

0.2.20

1 year ago

0.2.18

1 year ago

0.2.30

10 months ago

0.2.34

10 months ago

0.2.33

10 months ago

0.2.32

10 months ago

0.2.31

10 months ago

0.2.29

10 months ago

0.2.28

11 months ago

0.2.13

1 year ago

0.2.11

1 year ago

0.2.9

1 year ago

0.2.10

1 year ago

0.2.8

1 year ago

0.2.7

1 year ago

0.2.6

1 year ago

0.2.5

1 year ago