This is the monorepo for Darlean that contains basic npm packages, suite packages and example code.
The following basic packages are part of this monorepo:
- @darlean/base with declarations and basic types needed to write (implement) actors (api-doc)
- @darlean/core with the core framework needed for hosting (running) actors (api-doc)
- @darlean/utils with all kind of utilities that do not directly relate to virtual actors (api-doc)
- @darlean/docgen with a preprocessor for typedoc to generate the documentation the way we like it
- @darlean/webservices with useful classes to handle web gateway requests serverside (api-doc)
The following actor suite packages are part of this monorepo:
- @darlean/actor-lock-suite which contains the implementation of the distributed actor lock. The distributed actor lock ensures that no more than 1 actor of the same type and id are active at the same moment in the cluster. (api-doc)
- @darlean/actor-registry-suite which contains the implementation of the distributed actor registry. The distributed actor registry provides applications in the cluster with information about which actor types run on which applications, and how they should be invoked. (api-doc)
- @darlean/persistence-suite which provides access to the individual persistence implementations. (api-doc)
- @darlean/fs-persistence-suite which provides high performing file-system based persistence. (api-doc)
- @darlean/webgateways-suite which provides a web gateway for invoking actors via HTTP. (api-doc)
- @darlean/websessions-suite which provides persistent HTTP sessions. (api-doc)
We have also included some working examples:
We also have end-to-end (blackbox) tests:
Because we use a monorepo (with multiple packages in one git repo), there apply some special rules:
- All npm commands must be executed from the root of the monorepo using the
-w nameor--workspacesflags to instruct npm to operate on one specific workspace (-w name) or on all workspaces together (--workspaces). - The
-wand--workspacesflags can be combined with--if-presentto ignore warnings when certain commands are not present for all workspaces - The following workspace names are supported:
- base
- core
- utils
- docgen
- examples
- webservices
- suites/actor-lock-suite
- suites/actor-registry-suite
- suites/persistence-suite
- suites/fs-persistence-suite
- suites/webgateways-suite
- suites/websessions-suite
- Every workspace has its own
package.json, but there is only onenode_modulesand onepackage-lock.jsonat the root of the repo - The
npm run install-workspacescommand automatically creates symlinks that allow all packages to see the most recent versions of all other packages, without the need for first committing the changes.
To install everything after a fresh pull:
$ npm run install-workspaces
To install only one specific workspace:
$ npm install -w base
$ npm run build --workspaces
$ npm run build -w base
Do this before every commit!
$ npm run precommit --workspaces
$ npm run precommit -w base
Recommended before every commit!
$ npm run preversion --workspaces
$ npm run preversion -w base
$ npm run test --workspaces --if-present
$ npm run test -w base
Documentation can be regenerated by means of
$ npm run doc
Please ignore all the warnings, that still has to be fixed.
At regular times, the most recently generated documentation is uploaded to https://docs.darlean.io/latest/.
$ npm run npm:version:alpha -w <workspace>
$ npm run npm:publish -w <workspace>
$ npm run update-base-alpha --baseversion=123 // Updates package.json of all libraries that depend on base
$ npm run updated-base-alpha-version // Updates version of all libraries that depend on base
$ npm run updated-base-alpha-publish // Publishes all libraries that depend on base
$ npm run update-core-alpha --coreversion=123 // Updates package.json of all libraries that depend on core