From d398c7484a1f22fe618881e354d29c640fb5b4f4 Mon Sep 17 00:00:00 2001 From: Frank de Jonge Date: Tue, 30 Aug 2022 21:42:08 +0200 Subject: [PATCH 1/5] WIP --- docs/_data/menu.yml | 6 ++-- .../1-creating-an-aggregate-root.md | 1 - .../2-create-events-and-commands.md | 1 - .../event-sourcing/3-configure-persistence.md | 1 - docs/docs/event-sourcing/4-bootstrap.md | 1 - .../docs/getting-started/0-getting-started.md | 29 +++++++++++++++++++ .../1-create-your-aggregate-root.md | 22 ++++++++++++++ 7 files changed, 53 insertions(+), 8 deletions(-) create mode 100644 docs/docs/getting-started/0-getting-started.md create mode 100644 docs/docs/getting-started/1-create-your-aggregate-root.md diff --git a/docs/_data/menu.yml b/docs/_data/menu.yml index 13556a58..932f4a59 100644 --- a/docs/_data/menu.yml +++ b/docs/_data/menu.yml @@ -13,10 +13,8 @@ Stop Russia's Aggression: Support Ukraine: https://savelife.in.ua/en/ Getting Started: - 1. Create an Aggregate Root: '/docs/event-sourcing/create-an-aggregate-root/' - 2. Create Events and Commands: '/docs/event-sourcing/create-events-and-commands/' - 3. Configure Persistence: '/docs/event-sourcing/configure-persistence/' - 4. Bootstrap: '/docs/event-sourcing/bootstrap/' + Intro and install: '/docs/getting-started/introduction/' + 1. Create an Aggregate Root: '/docs/getting-started/create-aggregate-root/' Serialization: Object Mapper: '/docs/serialization/object-mapper/' diff --git a/docs/docs/event-sourcing/1-creating-an-aggregate-root.md b/docs/docs/event-sourcing/1-creating-an-aggregate-root.md index 5cb6031c..bfe265ba 100644 --- a/docs/docs/event-sourcing/1-creating-an-aggregate-root.md +++ b/docs/docs/event-sourcing/1-creating-an-aggregate-root.md @@ -1,6 +1,5 @@ --- permalink: /docs/event-sourcing/create-an-aggregate-root/ -redirect_from: /docs/getting-started/create-an-aggregate-root/ title: Creating an Aggregate Root --- diff --git a/docs/docs/event-sourcing/2-create-events-and-commands.md b/docs/docs/event-sourcing/2-create-events-and-commands.md index db642f4d..9edddd0b 100644 --- a/docs/docs/event-sourcing/2-create-events-and-commands.md +++ b/docs/docs/event-sourcing/2-create-events-and-commands.md @@ -1,6 +1,5 @@ --- permalink: /docs/event-sourcing/create-events-and-commands/ -redirect_from: /docs/getting-started/create-events-and-commands/ title: Create events and commands --- diff --git a/docs/docs/event-sourcing/3-configure-persistence.md b/docs/docs/event-sourcing/3-configure-persistence.md index 2a271179..f7e6a837 100644 --- a/docs/docs/event-sourcing/3-configure-persistence.md +++ b/docs/docs/event-sourcing/3-configure-persistence.md @@ -1,6 +1,5 @@ --- permalink: /docs/event-sourcing/configure-persistence/ -redirect_from: /docs/getting-started/configure-persistence/ title: Configure Persistence --- diff --git a/docs/docs/event-sourcing/4-bootstrap.md b/docs/docs/event-sourcing/4-bootstrap.md index fb7eac34..a687a788 100644 --- a/docs/docs/event-sourcing/4-bootstrap.md +++ b/docs/docs/event-sourcing/4-bootstrap.md @@ -1,6 +1,5 @@ --- permalink: /docs/event-sourcing/bootstrap/ -redirect_from: /docs/getting-started/bootstrap/ title: Bootstrap alternate_title: Bootstrapping EventSauce --- diff --git a/docs/docs/getting-started/0-getting-started.md b/docs/docs/getting-started/0-getting-started.md new file mode 100644 index 00000000..c5a4131a --- /dev/null +++ b/docs/docs/getting-started/0-getting-started.md @@ -0,0 +1,29 @@ +--- +permalink: /docs/getting-started/introduction/ +redirect_from: /docs/getting-started/ +title: Getting Started +--- + +EventSauce is a pragmatic yet robust event sourcing library for PHP. At the heart of the library +are a set of simple interfaces that make it easy to adapt many types of infrastructure. A set of +ready-made components is there to speed up implementation. This guide will walk you through +the steps needed to set yourself up to start event sourcing. The guide will only focus on +what is relevant to setting up the library. Although there are some framework bindings available, +this guide will use a framework-agnostic point of view. You are expected to make the translation +on how to configure this in your framework of choice. + +In this guide we'll walk to initial setup, setting up tests for your aggregates, and wiring it +to infrastructure. Let's get started! + +## Installation + +To get started, first install EventSauce into your PHP project using +[composer](https://getcomposer.org). + +```bash +composer require eventsauce/eventsauce +``` + +This package contains the core of EventSauce, the interfaces, and generic tools. + +Next up, create your first [aggregate root](/docs/getting-started/create-aggregate-root/)! diff --git a/docs/docs/getting-started/1-create-your-aggregate-root.md b/docs/docs/getting-started/1-create-your-aggregate-root.md new file mode 100644 index 00000000..c2c49741 --- /dev/null +++ b/docs/docs/getting-started/1-create-your-aggregate-root.md @@ -0,0 +1,22 @@ +--- +permalink: /docs/getting-started/create-aggregate-root/ +title: Create an Aggregate Root +--- + +Our first step is to create an event-sourced aggregate root. This is the software model +we'll create that internally uses events. The aggregate root has functionality to rebuild +itself from stored events. It also has functionality to record and expose new events. + +EventSauce represents an aggregate root internally as an interface. Your model will be an +implementation of that interface. To make it easy, a default implementation is supplied in +the form of a trait, preventing you from having to write some boilerplate code. + +```php +use EventSauce\EventSourcing\AggregateRoot; +use EventSauce\EventSourcing\AggregateRootBehaviour; + +class YourAggregateRoot implements AggregateRoot +{ + use AggregateRootBehaviour; +} +``` From d25fa4f76b7f1e62a23f344e2c12de5673236c98 Mon Sep 17 00:00:00 2001 From: Frank de Jonge Date: Wed, 28 Sep 2022 08:22:09 +0200 Subject: [PATCH 2/5] change menu --- docs/_data/menu.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/_data/menu.yml b/docs/_data/menu.yml index 932f4a59..dac9b09d 100644 --- a/docs/_data/menu.yml +++ b/docs/_data/menu.yml @@ -13,8 +13,8 @@ Stop Russia's Aggression: Support Ukraine: https://savelife.in.ua/en/ Getting Started: - Intro and install: '/docs/getting-started/introduction/' - 1. Create an Aggregate Root: '/docs/getting-started/create-aggregate-root/' + 1. Intro and install: '/docs/getting-started/introduction/' + 2. Create an Aggregate Root: '/docs/getting-started/create-aggregate-root/' Serialization: Object Mapper: '/docs/serialization/object-mapper/' From 0e7697e64589c4527edfdc434c645b64a61221f3 Mon Sep 17 00:00:00 2001 From: Frank de Jonge Date: Sat, 15 Oct 2022 23:24:17 +0200 Subject: [PATCH 3/5] reword docs --- .../docs/getting-started/1-create-your-aggregate-root.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/docs/getting-started/1-create-your-aggregate-root.md b/docs/docs/getting-started/1-create-your-aggregate-root.md index c2c49741..73259a86 100644 --- a/docs/docs/getting-started/1-create-your-aggregate-root.md +++ b/docs/docs/getting-started/1-create-your-aggregate-root.md @@ -3,9 +3,12 @@ permalink: /docs/getting-started/create-aggregate-root/ title: Create an Aggregate Root --- -Our first step is to create an event-sourced aggregate root. This is the software model -we'll create that internally uses events. The aggregate root has functionality to rebuild -itself from stored events. It also has functionality to record and expose new events. +Our first step is to create an event-sourced aggregate root. This is the domain model +we'll create that internally uses events. An aggregate root constructs itself from a +series of historical events. Inset of mutating properties directly, it uses events to +capture what is happening. + +Simplified, you can say that a `historical events => model` and `model + action = new events`. EventSauce represents an aggregate root internally as an interface. Your model will be an implementation of that interface. To make it easy, a default implementation is supplied in From 73aa24a6efb01fefb011087a9a24e2972f287ed0 Mon Sep 17 00:00:00 2001 From: Frank de Jonge Date: Sat, 13 May 2023 16:20:50 +0200 Subject: [PATCH 4/5] WIP --- docs/_data/menu.yml | 4 +- .../1-create-your-aggregate-root.md | 8 +- docs/package-lock.json | 627 ++++++++++++++++++ docs/package.json | 6 +- docs/static/prism.css | 2 +- src/AggregateRootBehaviour.php | 8 +- ...ventSourcedAggregateRootRepositoryTest.php | 2 +- .../TestingAggregates/DummyAggregate.php | 2 + 8 files changed, 649 insertions(+), 10 deletions(-) diff --git a/docs/_data/menu.yml b/docs/_data/menu.yml index dac9b09d..6668c276 100644 --- a/docs/_data/menu.yml +++ b/docs/_data/menu.yml @@ -9,12 +9,10 @@ EventSauce: Changelog: '/docs/changelog/' Github: 'https://github.com/eventsaucephp/eventsauce' -Stop Russia's Aggression: - Support Ukraine: https://savelife.in.ua/en/ - Getting Started: 1. Intro and install: '/docs/getting-started/introduction/' 2. Create an Aggregate Root: '/docs/getting-started/create-aggregate-root/' + 3. Implement your first method: '/docs/getting-started/implement-your-first-method/' Serialization: Object Mapper: '/docs/serialization/object-mapper/' diff --git a/docs/docs/getting-started/1-create-your-aggregate-root.md b/docs/docs/getting-started/1-create-your-aggregate-root.md index 73259a86..8ad1dc55 100644 --- a/docs/docs/getting-started/1-create-your-aggregate-root.md +++ b/docs/docs/getting-started/1-create-your-aggregate-root.md @@ -15,11 +15,17 @@ implementation of that interface. To make it easy, a default implementation is s the form of a trait, preventing you from having to write some boilerplate code. ```php +namespace YourCompany\YourBusinessProcess; + use EventSauce\EventSourcing\AggregateRoot; use EventSauce\EventSourcing\AggregateRootBehaviour; -class YourAggregateRoot implements AggregateRoot +/** + +class AccountCreation implements AggregateRoot { use AggregateRootBehaviour; } ``` + +Next up, implement your first [method](/docs/getting-started/implement-your-first-method/)! diff --git a/docs/package-lock.json b/docs/package-lock.json index d5c4453e..43a87293 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -7,6 +7,7 @@ "devDependencies": { "autoprefixer": "^10.4.14", "clean-webpack-plugin": "^4.0.0", + "concurrently": "^8.0.1", "css-loader": "^6.7.3", "cssnano": "^6.0.1", "mini-css-extract-plugin": "^2.7.5", @@ -68,6 +69,18 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/runtime": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.21.5.tgz", + "integrity": "sha512-8jI69toZqqcsnqGGqwGS4Qb1VwLOEp4hz+CXPywcvjs60u3B4Pom/U/7rm4W8tMOYEB+E9wgD0mW1l3r8qlI9Q==", + "dev": true, + "dependencies": { + "regenerator-runtime": "^0.13.11" + }, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@discoveryjs/json-ext": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.2.tgz", @@ -517,6 +530,15 @@ "ajv": "^6.9.1" } }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", @@ -827,6 +849,20 @@ "webpack": ">=4.0.0 <6.0.0" } }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/clone-deep": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", @@ -883,6 +919,118 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, + "node_modules/concurrently": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-8.0.1.tgz", + "integrity": "sha512-Sh8bGQMEL0TAmAm2meAXMjcASHZa7V0xXQVDBLknCPa9TPtkY9yYs+0cnGGgfdkW0SV1Mlg+hVGfXcoI8d3MJA==", + "dev": true, + "dependencies": { + "chalk": "^4.1.2", + "date-fns": "^2.29.3", + "lodash": "^4.17.21", + "rxjs": "^7.8.0", + "shell-quote": "^1.8.0", + "spawn-command": "0.0.2-1", + "supports-color": "^8.1.1", + "tree-kill": "^1.2.2", + "yargs": "^17.7.1" + }, + "bin": { + "conc": "dist/bin/concurrently.js", + "concurrently": "dist/bin/concurrently.js" + }, + "engines": { + "node": "^14.13.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/open-cli-tools/concurrently?sponsor=1" + } + }, + "node_modules/concurrently/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/concurrently/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/concurrently/node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/concurrently/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/concurrently/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/concurrently/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/concurrently/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, "node_modules/cosmiconfig": { "version": "8.1.3", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.1.3.tgz", @@ -1114,6 +1262,22 @@ "integrity": "sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==", "dev": true }, + "node_modules/date-fns": { + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", + "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.21.0" + }, + "engines": { + "node": ">=0.11" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/date-fns" + } + }, "node_modules/del": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/del/-/del-4.1.1.tgz", @@ -1205,6 +1369,12 @@ "integrity": "sha512-eRMq6Cf4PhjB14R9U6QcXM/VRQ54Gc3OL9LKnFugUIh2AXm3KJlOizlSfVIgjH76bII4zHGK4t0PVTE5qq8dZg==", "dev": true }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, "node_modules/emojis-list": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", @@ -1455,6 +1625,15 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, "node_modules/glob": { "version": "7.1.7", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", @@ -1653,6 +1832,15 @@ "node": ">=0.10.0" } }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -1891,6 +2079,12 @@ "node": ">=8" } }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, "node_modules/lodash.memoize": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", @@ -3044,6 +3238,21 @@ "node": ">= 10.13.0" } }, + "node_modules/regenerator-runtime": { + "version": "0.13.11", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", + "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==", + "dev": true + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/require-from-string": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", @@ -3145,6 +3354,15 @@ "queue-microtask": "^1.2.2" } }, + "node_modules/rxjs": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", + "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", + "dev": true, + "dependencies": { + "tslib": "^2.1.0" + } + }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -3240,6 +3458,15 @@ "node": ">=8" } }, + "node_modules/shell-quote": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", + "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/source-list-map": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", @@ -3274,6 +3501,38 @@ "source-map": "^0.6.0" } }, + "node_modules/spawn-command": { + "version": "0.0.2-1", + "resolved": "https://registry.npmjs.org/spawn-command/-/spawn-command-0.0.2-1.tgz", + "integrity": "sha512-n98l9E2RMSJ9ON1AKisHzz7V42VDiBQGY6PB1BwRglz99wpVsSuGzQ+jOi6lFXBGVTCrRpltvjm+/XA+tpeJrg==", + "dev": true + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/style-loader": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-3.3.2.tgz", @@ -3543,12 +3802,27 @@ "node": ">=8.0" } }, + "node_modules/tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "dev": true, + "bin": { + "tree-kill": "cli.js" + } + }, "node_modules/ts-interface-checker": { "version": "0.1.13", "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", "dev": true }, + "node_modules/tslib": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==", + "dev": true + }, "node_modules/update-browserslist-db": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", @@ -3816,12 +4090,71 @@ "integrity": "sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==", "dev": true }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", @@ -3836,6 +4169,33 @@ "engines": { "node": ">= 14" } + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "engines": { + "node": ">=12" + } } }, "dependencies": { @@ -3871,6 +4231,15 @@ "js-tokens": "^4.0.0" } }, + "@babel/runtime": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.21.5.tgz", + "integrity": "sha512-8jI69toZqqcsnqGGqwGS4Qb1VwLOEp4hz+CXPywcvjs60u3B4Pom/U/7rm4W8tMOYEB+E9wgD0mW1l3r8qlI9Q==", + "dev": true, + "requires": { + "regenerator-runtime": "^0.13.11" + } + }, "@discoveryjs/json-ext": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.2.tgz", @@ -4253,6 +4622,12 @@ "dev": true, "requires": {} }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", @@ -4463,6 +4838,17 @@ "del": "^4.1.1" } }, + "cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + } + }, "clone-deep": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", @@ -4513,6 +4899,85 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, + "concurrently": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-8.0.1.tgz", + "integrity": "sha512-Sh8bGQMEL0TAmAm2meAXMjcASHZa7V0xXQVDBLknCPa9TPtkY9yYs+0cnGGgfdkW0SV1Mlg+hVGfXcoI8d3MJA==", + "dev": true, + "requires": { + "chalk": "^4.1.2", + "date-fns": "^2.29.3", + "lodash": "^4.17.21", + "rxjs": "^7.8.0", + "shell-quote": "^1.8.0", + "spawn-command": "0.0.2-1", + "supports-color": "^8.1.1", + "tree-kill": "^1.2.2", + "yargs": "^17.7.1" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "cosmiconfig": { "version": "8.1.3", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.1.3.tgz", @@ -4675,6 +5140,15 @@ } } }, + "date-fns": { + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", + "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", + "dev": true, + "requires": { + "@babel/runtime": "^7.21.0" + } + }, "del": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/del/-/del-4.1.1.tgz", @@ -4745,6 +5219,12 @@ "integrity": "sha512-eRMq6Cf4PhjB14R9U6QcXM/VRQ54Gc3OL9LKnFugUIh2AXm3KJlOizlSfVIgjH76bII4zHGK4t0PVTE5qq8dZg==", "dev": true }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, "emojis-list": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", @@ -4934,6 +5414,12 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, "glob": { "version": "7.1.7", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", @@ -5084,6 +5570,12 @@ "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", "dev": true }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, "is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -5261,6 +5753,12 @@ "p-locate": "^4.1.0" } }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, "lodash.memoize": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", @@ -6012,6 +6510,18 @@ "resolve": "^1.20.0" } }, + "regenerator-runtime": { + "version": "0.13.11", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", + "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==", + "dev": true + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true + }, "require-from-string": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", @@ -6076,6 +6586,15 @@ "queue-microtask": "^1.2.2" } }, + "rxjs": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", + "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", + "dev": true, + "requires": { + "tslib": "^2.1.0" + } + }, "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -6135,6 +6654,12 @@ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, + "shell-quote": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", + "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", + "dev": true + }, "source-list-map": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", @@ -6163,6 +6688,32 @@ "source-map": "^0.6.0" } }, + "spawn-command": { + "version": "0.0.2-1", + "resolved": "https://registry.npmjs.org/spawn-command/-/spawn-command-0.0.2-1.tgz", + "integrity": "sha512-n98l9E2RMSJ9ON1AKisHzz7V42VDiBQGY6PB1BwRglz99wpVsSuGzQ+jOi6lFXBGVTCrRpltvjm+/XA+tpeJrg==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, "style-loader": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-3.3.2.tgz", @@ -6343,12 +6894,24 @@ "is-number": "^7.0.0" } }, + "tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "dev": true + }, "ts-interface-checker": { "version": "0.1.13", "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", "dev": true }, + "tslib": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==", + "dev": true + }, "update-browserslist-db": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", @@ -6518,12 +7081,55 @@ "integrity": "sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==", "dev": true }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + } + } + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true + }, "yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", @@ -6535,6 +7141,27 @@ "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.2.2.tgz", "integrity": "sha512-CBKFWExMn46Foo4cldiChEzn7S7SRV+wqiluAb6xmueD/fGyRHIhX8m14vVGgeFWjN540nKCNVj6P21eQjgTuA==", "dev": true + }, + "yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "requires": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + } + }, + "yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true } } } diff --git a/docs/package.json b/docs/package.json index 0b857c38..25dfc775 100644 --- a/docs/package.json +++ b/docs/package.json @@ -3,11 +3,15 @@ "scripts": { "prod": "NODE_ENV=production npx webpack", "dev": "NODE_ENV=development npx webpack", - "watch": "NODE_ENV=development npx webpack --watch" + "watch": "NODE_ENV=development npx webpack --watch", + "watch:prod": "NODE_ENV=production npx webpack --watch", + "jekyll:serve": "bundle exec jekyll serve", + "start": "concurrently --kill-others \"npm run watch:prod\" \"npm run jekyll:serve\"" }, "devDependencies": { "autoprefixer": "^10.4.14", "clean-webpack-plugin": "^4.0.0", + "concurrently": "^8.0.1", "css-loader": "^6.7.3", "cssnano": "^6.0.1", "mini-css-extract-plugin": "^2.7.5", diff --git a/docs/static/prism.css b/docs/static/prism.css index df60b0e9..773d250b 100644 --- a/docs/static/prism.css +++ b/docs/static/prism.css @@ -77,7 +77,7 @@ pre[class*="language-"] { .token.prolog, .token.doctype, .token.cdata { - color: #cccccc; + color: #858585; } .token.punctuation { diff --git a/src/AggregateRootBehaviour.php b/src/AggregateRootBehaviour.php index 3b3f51a5..cd04059d 100644 --- a/src/AggregateRootBehaviour.php +++ b/src/AggregateRootBehaviour.php @@ -48,10 +48,12 @@ public function aggregateRootVersion(): int return $this->aggregateRootVersion; } - protected function recordThat(object $event): void + protected function recordThat(object ...$events): void { - $this->apply($event); - $this->recordedEvents[] = $event; + foreach ($events as $event) { + $this->apply($event); + $this->recordedEvents[] = $event; + } } /** diff --git a/src/EventSourcedAggregateRootRepositoryTest.php b/src/EventSourcedAggregateRootRepositoryTest.php index eca904dc..2b0ecb98 100644 --- a/src/EventSourcedAggregateRootRepositoryTest.php +++ b/src/EventSourcedAggregateRootRepositoryTest.php @@ -17,8 +17,8 @@ class EventSourcedAggregateRootRepositoryTest extends TestCase public function aggregate_versions_are_incremented_per_event(): void { $messageRepository = new InMemoryMessageRepository(); + /** @var AggregateRootRepository $repository */ $repository = new EventSourcedAggregateRootRepository(DummyAggregate::class, $messageRepository); - /** @var DummyAggregate $aggregate */ $aggregateRootId = DummyAggregateRootId::generate(); $aggregate = $repository->retrieve($aggregateRootId); $aggregate->increment(); diff --git a/src/TestUtilities/TestingAggregates/DummyAggregate.php b/src/TestUtilities/TestingAggregates/DummyAggregate.php index 29985cc7..4d5e8147 100644 --- a/src/TestUtilities/TestingAggregates/DummyAggregate.php +++ b/src/TestUtilities/TestingAggregates/DummyAggregate.php @@ -10,6 +10,8 @@ /** * @testAsset + * + * @implements AggregateRoot */ final class DummyAggregate implements AggregateRoot { From 3cb3761ad7beca5e31154ae30564035ed2629db6 Mon Sep 17 00:00:00 2001 From: Frank de Jonge Date: Sun, 14 May 2023 10:43:53 +0200 Subject: [PATCH 5/5] WIP --- .../2-implement-your-first-method.md | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 docs/docs/getting-started/2-implement-your-first-method.md diff --git a/docs/docs/getting-started/2-implement-your-first-method.md b/docs/docs/getting-started/2-implement-your-first-method.md new file mode 100644 index 00000000..01e740d1 --- /dev/null +++ b/docs/docs/getting-started/2-implement-your-first-method.md @@ -0,0 +1,83 @@ +--- +permalink: /docs/getting-started/implement-your-first-method/ +title: Implement your first method +--- + +In event sourcing, actions performed on entities (aggregate roots) record events +to capture the outcome of said action. The event captures the intent of the moment +in time, along with any relevant context. In EventSauce events are represented as +simple PHP classes/objects. + +As an example, let's implement an account creation flow. The flow is a multistep process +that results in an account being created. Our flow is short and simple, but you can imagine +more elaborate flows being modelled in a similar manner. In this example, our flow consists +of: + +1. starting the account creation process +2. specifying login credentials +3. accepting the terms and finalizing the process + +The code below is the body of our `AccountCreation` class. +```php +private string|null $email = null; +private string|null $passwordHash = null; +private bool $finalized = false; +private bool $credentialsProvided = false; + +// start the creation process +public static function startAccountCreation(ApplicationId $id): AccountCreation +{ + $process = new AccountCreation($id); + $process->recordThat(AccountCreationHasStarted()); + + return $process; +} + +public function useLoginCredentials( + string $email, + string $password, + PasswordEncoder $passwordEncoder, +): void { + $this->guardAgainstChangingFinalizedAccount(); + + if (strlen($password) < 8) { + throw InvalidPasswordProvided::becauseItIsTooShort($password); + } + + $passwordHash = $passwordEncoder->encodePassword($password); + + $this->recordThat( + new LoginCredentialsWereProvided($email, $passwordHash) + ); +} + +protected function applyLoginCredentialsWereProvided( + LoginCredentialsWereProvided $event +) { + $this->credentialProvided = true; + $this->email = $event->email(); + $this->passwordHash = $event->passwordHash(); +} + +public function finalizeAccount( + bool $acceptTerms, + AccountRepository $accounts, +): void { + $this->guardAgainstChangingFinalizedAccount(); + + if ( ! $acceptTerms) { + throw UnableToFinalizeAccount::termsWereNotAccepted(); + } + + if ( ! $this->credentialsProvided) { + throw UnableToFinalizeAccount::credentialsWereNotProvided(); + } +} + +private function guardAgainstChangingFinalizedAccount(): void +{ + if ($this->finalized) { + throw new UnableToChangeFinalizedAccount(); + } +} +```