0.4.16 • Published 8 months ago

@stonecrop/stonecrop v0.4.16

Weekly downloads
-
License
MIT
Repository
github
Last release
8 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

8 months ago

0.4.16

8 months ago

0.4.13

9 months ago

0.4.14

8 months ago

0.4.11

10 months ago

0.4.12

10 months ago

0.4.9

11 months ago

0.4.8

11 months ago

0.4.10

11 months ago

0.4.7

11 months ago

0.2.63

1 year ago

0.2.62

1 year ago

0.2.61

1 year ago

0.2.60

1 year ago

0.2.67

1 year ago

0.2.66

1 year ago

0.2.65

1 year ago

0.2.64

1 year ago

0.2.52

1 year ago

0.2.51

1 year ago

0.2.50

1 year ago

0.2.59

1 year ago

0.2.58

1 year ago

0.2.57

1 year ago

0.2.56

1 year ago

0.2.55

1 year ago

0.2.54

1 year ago

0.2.53

1 year ago

0.3.0

1 year ago

0.3.6

1 year ago

0.3.5

1 year ago

0.3.8

1 year ago

0.3.7

1 year ago

0.3.2

1 year ago

0.3.1

1 year ago

0.3.4

1 year ago

0.3.3

1 year ago

0.3.9

1 year ago

0.2.49

1 year ago

0.2.48

1 year ago

0.3.11

1 year ago

0.3.10

1 year ago

0.4.5

12 months ago

0.4.4

1 year ago

0.4.6

12 months ago

0.4.1

1 year ago

0.4.0

1 year ago

0.4.3

1 year ago

0.4.2

1 year ago

0.2.47

1 year ago

0.2.46

1 year ago

0.2.45

1 year ago

0.2.44

1 year ago

0.2.41

1 year ago

0.2.43

1 year ago

0.2.42

1 year ago

0.2.40

1 year ago

0.2.39

1 year ago

0.2.38

1 year ago

0.2.37

1 year ago

0.2.36

1 year ago

0.2.35

1 year ago

0.2.27

2 years ago

0.2.26

2 years ago

0.2.25

2 years ago

0.2.24

2 years ago

0.2.23

2 years ago

0.2.22

2 years ago

0.2.21

2 years ago

0.2.20

2 years ago

0.2.18

2 years ago

0.2.30

1 year ago

0.2.34

1 year ago

0.2.33

1 year ago

0.2.32

1 year ago

0.2.31

1 year ago

0.2.29

1 year ago

0.2.28

1 year ago

0.2.13

2 years ago

0.2.11

2 years ago

0.2.9

2 years ago

0.2.10

2 years ago

0.2.8

2 years ago

0.2.7

2 years ago

0.2.6

2 years ago

0.2.5

2 years ago