ddd-ts-kit 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/dist/check/canonical/roles.d.ts.map +1 -1
- package/dist/check/canonical/roles.js +18 -0
- package/dist/check/canonical/roles.js.map +1 -1
- package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
- package/dist/check/catalogue/architecture-rules.js +4 -0
- package/dist/check/catalogue/architecture-rules.js.map +1 -1
- package/dist/check/explain/lifecycle-docs.d.ts +3 -0
- package/dist/check/explain/lifecycle-docs.d.ts.map +1 -0
- package/dist/check/explain/lifecycle-docs.js +33 -0
- package/dist/check/explain/lifecycle-docs.js.map +1 -0
- package/dist/check/explain/rule-docs.d.ts.map +1 -1
- package/dist/check/explain/rule-docs.js +2 -0
- package/dist/check/explain/rule-docs.js.map +1 -1
- package/dist/check/fixtures/fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/fixtures.js +2 -0
- package/dist/check/fixtures/fixtures.js.map +1 -1
- package/dist/check/fixtures/lifecycle-fixtures.d.ts +3 -0
- package/dist/check/fixtures/lifecycle-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/lifecycle-fixtures.js +90 -0
- package/dist/check/fixtures/lifecycle-fixtures.js.map +1 -0
- package/dist/check/lifecycle/is-aggregate-file.d.ts +4 -0
- package/dist/check/lifecycle/is-aggregate-file.d.ts.map +1 -0
- package/dist/check/lifecycle/is-aggregate-file.js +6 -0
- package/dist/check/lifecycle/is-aggregate-file.js.map +1 -0
- package/dist/check/lifecycle/machines-imported.d.ts +4 -0
- package/dist/check/lifecycle/machines-imported.d.ts.map +1 -0
- package/dist/check/lifecycle/machines-imported.js +11 -0
- package/dist/check/lifecycle/machines-imported.js.map +1 -0
- package/dist/check/lifecycle/shorthand-status-writes.d.ts +7 -0
- package/dist/check/lifecycle/shorthand-status-writes.d.ts.map +1 -0
- package/dist/check/lifecycle/shorthand-status-writes.js +34 -0
- package/dist/check/lifecycle/shorthand-status-writes.js.map +1 -0
- package/dist/check/lifecycle/status-writes.d.ts +14 -0
- package/dist/check/lifecycle/status-writes.d.ts.map +1 -0
- package/dist/check/lifecycle/status-writes.js +29 -0
- package/dist/check/lifecycle/status-writes.js.map +1 -0
- package/dist/check/rules/lifecycle-status-through-machine.d.ts +3 -0
- package/dist/check/rules/lifecycle-status-through-machine.d.ts.map +1 -0
- package/dist/check/rules/lifecycle-status-through-machine.js +55 -0
- package/dist/check/rules/lifecycle-status-through-machine.js.map +1 -0
- package/dist/check/rules/process-sends-commands-only.d.ts +3 -0
- package/dist/check/rules/process-sends-commands-only.d.ts.map +1 -0
- package/dist/check/rules/process-sends-commands-only.js +39 -0
- package/dist/check/rules/process-sends-commands-only.js.map +1 -0
- package/dist/commands/generate.js +2 -0
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +1 -0
- package/dist/commands/init.js.map +1 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +1 -1
- package/dist/config/index.js.map +1 -1
- package/dist/config/parse-stack.d.ts.map +1 -1
- package/dist/config/parse-stack.js +2 -1
- package/dist/config/parse-stack.js.map +1 -1
- package/dist/config/stack.d.ts +10 -0
- package/dist/config/stack.d.ts.map +1 -1
- package/dist/config/stack.js +1 -0
- package/dist/config/stack.js.map +1 -1
- package/dist/declared/declared-role.d.ts.map +1 -1
- package/dist/declared/declared-role.js +1 -0
- package/dist/declared/declared-role.js.map +1 -1
- package/dist/describe/context-description.d.ts +6 -0
- package/dist/describe/context-description.d.ts.map +1 -1
- package/dist/describe/describe-context.d.ts.map +1 -1
- package/dist/describe/describe-context.js +3 -0
- package/dist/describe/describe-context.js.map +1 -1
- package/dist/describe/format-description.d.ts.map +1 -1
- package/dist/describe/format-description.js +13 -1
- package/dist/describe/format-description.js.map +1 -1
- package/dist/docs/background-job-facts.d.ts +7 -0
- package/dist/docs/background-job-facts.d.ts.map +1 -0
- package/dist/docs/background-job-facts.js +2 -0
- package/dist/docs/background-job-facts.js.map +1 -0
- package/dist/docs/context-facts.d.ts +9 -0
- package/dist/docs/context-facts.d.ts.map +1 -1
- package/dist/docs/object-properties.d.ts +11 -0
- package/dist/docs/object-properties.d.ts.map +1 -0
- package/dist/docs/object-properties.js +21 -0
- package/dist/docs/object-properties.js.map +1 -0
- package/dist/docs/process-facts.d.ts +8 -0
- package/dist/docs/process-facts.d.ts.map +1 -0
- package/dist/docs/process-facts.js +2 -0
- package/dist/docs/process-facts.js.map +1 -0
- package/dist/docs/read-background-jobs.d.ts +5 -0
- package/dist/docs/read-background-jobs.d.ts.map +1 -0
- package/dist/docs/read-background-jobs.js +16 -0
- package/dist/docs/read-background-jobs.js.map +1 -0
- package/dist/docs/read-context.d.ts.map +1 -1
- package/dist/docs/read-context.js +6 -0
- package/dist/docs/read-context.js.map +1 -1
- package/dist/docs/read-processes.d.ts +5 -0
- package/dist/docs/read-processes.d.ts.map +1 -0
- package/dist/docs/read-processes.js +22 -0
- package/dist/docs/read-processes.js.map +1 -0
- package/dist/docs/read-state-machines.d.ts +10 -0
- package/dist/docs/read-state-machines.d.ts.map +1 -0
- package/dist/docs/read-state-machines.js +81 -0
- package/dist/docs/read-state-machines.js.map +1 -0
- package/dist/docs/read-vocabularies.d.ts +4 -0
- package/dist/docs/read-vocabularies.d.ts.map +1 -0
- package/dist/docs/read-vocabularies.js +14 -0
- package/dist/docs/read-vocabularies.js.map +1 -0
- package/dist/docs/refresh-context-doc.d.ts +1 -1
- package/dist/docs/refresh-context-doc.d.ts.map +1 -1
- package/dist/docs/refresh-context-doc.js +32 -3
- package/dist/docs/refresh-context-doc.js.map +1 -1
- package/dist/docs/state-machine-facts.d.ts +18 -0
- package/dist/docs/state-machine-facts.d.ts.map +1 -0
- package/dist/docs/state-machine-facts.js +2 -0
- package/dist/docs/state-machine-facts.js.map +1 -0
- package/dist/docs/state-machine-lines.d.ts +8 -0
- package/dist/docs/state-machine-lines.d.ts.map +1 -0
- package/dist/docs/state-machine-lines.js +32 -0
- package/dist/docs/state-machine-lines.js.map +1 -0
- package/dist/generate/kind.d.ts +2 -0
- package/dist/generate/kind.d.ts.map +1 -1
- package/dist/generate/kinds/background/background-job-vars.d.ts +7 -0
- package/dist/generate/kinds/background/background-job-vars.d.ts.map +1 -0
- package/dist/generate/kinds/background/background-job-vars.js +29 -0
- package/dist/generate/kinds/background/background-job-vars.js.map +1 -0
- package/dist/generate/kinds/background/job-import.d.ts +8 -0
- package/dist/generate/kinds/background/job-import.d.ts.map +1 -0
- package/dist/generate/kinds/background/job-import.js +17 -0
- package/dist/generate/kinds/background/job-import.js.map +1 -0
- package/dist/generate/kinds/background/payload-field.d.ts +18 -0
- package/dist/generate/kinds/background/payload-field.d.ts.map +1 -0
- package/dist/generate/kinds/background/payload-field.js +52 -0
- package/dist/generate/kinds/background/payload-field.js.map +1 -0
- package/dist/generate/kinds/background/require-container.d.ts +7 -0
- package/dist/generate/kinds/background/require-container.d.ts.map +1 -0
- package/dist/generate/kinds/background/require-container.js +13 -0
- package/dist/generate/kinds/background/require-container.js.map +1 -0
- package/dist/generate/kinds/background-job-kind.d.ts +3 -0
- package/dist/generate/kinds/background-job-kind.d.ts.map +1 -0
- package/dist/generate/kinds/background-job-kind.js +49 -0
- package/dist/generate/kinds/background-job-kind.js.map +1 -0
- package/dist/generate/kinds/job/command-input.d.ts +11 -0
- package/dist/generate/kinds/job/command-input.d.ts.map +1 -0
- package/dist/generate/kinds/job/command-input.js +13 -0
- package/dist/generate/kinds/job/command-input.js.map +1 -0
- package/dist/generate/kinds/job/granted-in-spec.d.ts +6 -0
- package/dist/generate/kinds/job/granted-in-spec.d.ts.map +1 -0
- package/dist/generate/kinds/job/granted-in-spec.js +18 -0
- package/dist/generate/kinds/job/granted-in-spec.js.map +1 -0
- package/dist/generate/kinds/job/job-vars.d.ts.map +1 -1
- package/dist/generate/kinds/job/job-vars.js +1 -17
- package/dist/generate/kinds/job/job-vars.js.map +1 -1
- package/dist/generate/kinds/job/read-sent-command.d.ts +8 -2
- package/dist/generate/kinds/job/read-sent-command.d.ts.map +1 -1
- package/dist/generate/kinds/job/read-sent-command.js +18 -12
- package/dist/generate/kinds/job/read-sent-command.js.map +1 -1
- package/dist/generate/kinds/job/sent-command.d.ts +4 -1
- package/dist/generate/kinds/job/sent-command.d.ts.map +1 -1
- package/dist/generate/kinds/process-kind.d.ts +3 -0
- package/dist/generate/kinds/process-kind.d.ts.map +1 -0
- package/dist/generate/kinds/process-kind.js +39 -0
- package/dist/generate/kinds/process-kind.js.map +1 -0
- package/dist/generate/kinds/state-machine/parse-transitions.d.ts +4 -0
- package/dist/generate/kinds/state-machine/parse-transitions.d.ts.map +1 -0
- package/dist/generate/kinds/state-machine/parse-transitions.js +24 -0
- package/dist/generate/kinds/state-machine/parse-transitions.js.map +1 -0
- package/dist/generate/kinds/state-machine/requested-transition.d.ts +9 -0
- package/dist/generate/kinds/state-machine/requested-transition.d.ts.map +1 -0
- package/dist/generate/kinds/state-machine/requested-transition.js +2 -0
- package/dist/generate/kinds/state-machine/requested-transition.js.map +1 -0
- package/dist/generate/kinds/state-machine/state-machine-vars.d.ts +12 -0
- package/dist/generate/kinds/state-machine/state-machine-vars.d.ts.map +1 -0
- package/dist/generate/kinds/state-machine/state-machine-vars.js +44 -0
- package/dist/generate/kinds/state-machine/state-machine-vars.js.map +1 -0
- package/dist/generate/kinds/state-machine/status-vocabulary.d.ts +9 -0
- package/dist/generate/kinds/state-machine/status-vocabulary.d.ts.map +1 -0
- package/dist/generate/kinds/state-machine/status-vocabulary.js +26 -0
- package/dist/generate/kinds/state-machine/status-vocabulary.js.map +1 -0
- package/dist/generate/kinds/state-machine-kind.d.ts +3 -0
- package/dist/generate/kinds/state-machine-kind.d.ts.map +1 -0
- package/dist/generate/kinds/state-machine-kind.js +33 -0
- package/dist/generate/kinds/state-machine-kind.js.map +1 -0
- package/dist/generate/kinds.d.ts.map +1 -1
- package/dist/generate/kinds.js +6 -0
- package/dist/generate/kinds.js.map +1 -1
- package/dist/generate/vocabulary/held-entries.d.ts +4 -0
- package/dist/generate/vocabulary/held-entries.d.ts.map +1 -0
- package/dist/generate/vocabulary/held-entries.js +6 -0
- package/dist/generate/vocabulary/held-entries.js.map +1 -0
- package/dist/generate/vocabulary/vocabulary-text.d.ts.map +1 -1
- package/dist/generate/vocabulary/vocabulary-text.js +2 -2
- package/dist/generate/vocabulary/vocabulary-text.js.map +1 -1
- package/dist/help/usage.d.ts +1 -1
- package/dist/help/usage.d.ts.map +1 -1
- package/dist/help/usage.js +1 -1
- package/dist/init/manifest/dependencies-for.d.ts.map +1 -1
- package/dist/init/manifest/dependencies-for.js +2 -0
- package/dist/init/manifest/dependencies-for.js.map +1 -1
- package/dist/init/manifest/versions.js +24 -24
- package/dist/init/stack/resolve-queue.d.ts +13 -0
- package/dist/init/stack/resolve-queue.d.ts.map +1 -0
- package/dist/init/stack/resolve-queue.js +25 -0
- package/dist/init/stack/resolve-queue.js.map +1 -0
- package/dist/init/stack/resolve-stack.d.ts.map +1 -1
- package/dist/init/stack/resolve-stack.js +2 -0
- package/dist/init/stack/resolve-stack.js.map +1 -1
- package/dist/init/stack/stack-options.d.ts +2 -0
- package/dist/init/stack/stack-options.d.ts.map +1 -1
- package/dist/stack/stack-vars.d.ts.map +1 -1
- package/dist/stack/stack-vars.js +13 -0
- package/dist/stack/stack-vars.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/templates/background-job/background-job.declared.ts.tpl +26 -0
- package/templates/background-job/background-job.spec.ts.tpl +63 -0
- package/templates/background-job/background-job.ts.tpl +24 -0
- package/templates/background-job/wiring.tsyringe.tpl +5 -0
- package/templates/context/CONTEXT.md.tpl +15 -0
- package/templates/init/platform/database/persistence-over.drizzle.ts.tpl +20 -1
- package/templates/init/platform/database/persistence-over.knex.ts.tpl +18 -1
- package/templates/init/platform/database/persistence.orm.ts.tpl +12 -1
- package/templates/init/platform/database/schema.drizzle.ts.tpl +12 -2
- package/templates/init/platform/database/schema.knex.ts.tpl +7 -1
- package/templates/init/platform/platform.module.tsyringe.ts.tpl +43 -3
- package/templates/init/platform/redis/open-redis.ts.tpl +37 -1
- package/templates/init/rules/application.md.tpl +3 -2
- package/templates/init/rules/domain.md.tpl +1 -0
- package/templates/pipeline/package-scripts.json +1 -1
- package/templates/process/process.spec.ts.tpl +44 -0
- package/templates/process/process.ts.tpl +41 -0
- package/templates/process/timeout-job.declared.ts.tpl +18 -0
- package/templates/process/timeout-job.spec.ts.tpl +43 -0
- package/templates/process/timeout-job.ts.tpl +16 -0
- package/templates/process/timeout-job.wiring.tsyringe.tpl +5 -0
- package/templates/state-machine/state-machine.spec.ts.tpl +16 -0
- package/templates/state-machine/state-machine.ts.tpl +16 -0
package/README.md
CHANGED
|
@@ -51,7 +51,7 @@ ddd-ts-kit init [--http express|fastify|nest|none]
|
|
|
51
51
|
[--style declared|explicit] [--assembly barrel|discovery]
|
|
52
52
|
[--dependencies signature|listed] [--refusals factories|classes]
|
|
53
53
|
[--routes controllers|functions] [--value-objects throwing|result]
|
|
54
|
-
[--literals named|free] [--tenancy none|shared-table]
|
|
54
|
+
[--literals named|free] [--tenancy none|shared-table] [--queue database|redis|memory]
|
|
55
55
|
[--package-manager npm|pnpm]
|
|
56
56
|
[--allow-no-outbox "<reason>"] [--import-alias '$<name>/']
|
|
57
57
|
[--import-extension none|js] [--sdk]
|
|
@@ -195,6 +195,7 @@ config, `docsUi`, `ci` and `logger` included.
|
|
|
195
195
|
| `src/platform/auth/` | `create-authenticator.ts` (`--authn jwt`: `JwtAuthenticator` on `AUTH_ISSUER`, `AUTH_AUDIENCE`, `AUTH_JWKS_URI`; `--authn keycloak`: `keycloakAuthenticator` on `KEYCLOAK_URL`, `KEYCLOAK_REALM`, `KEYCLOAK_AUDIENCE` and the optional `KEYCLOAK_CLIENT_ID`; `--authn none`: `development-header-authenticator.ts`, which reads `x-development-actor` and throws in production), `principal-of.ts`, `security-schemes.ts`, `offline-authenticator.ts`, `http-boundary.ts` (`resolvePrincipal` answering a `Session`, `executionScope`, `errorMapper` and `onError`, spread into the mount options: every request runs inside the execution scope, with its correlation id), `create-authorizer.ts` and the files of the model (`roles.ts`, with the role `system` every system actor holds; `attribute-policies.ts`; `relationship-schema.ts`, `create-tuple-store.ts` and its contract spec, `relation-tuples.ts`, `relate-system-actors.ts`, `permission-mapping.ts` and `permissions.ts`; `custom-authorizer.ts`, its `authorizerContract` spec and `permissions.ts`), `authorization.ts` (`authorizationModule` with tsyringe) or `use-case-protection.ts` (the guard of the hand-wired buses), `access-policies.ts`, and with `--audit off` `log-decisions.ts` (one log entry per decision, ids and codes only). Without an HTTP stack there is no authenticator and no boundary |
|
|
196
196
|
| `--audit on` | `src/platform/audit/`: `create-audit.ts` (the trail, the `onDecision` of the authorization, the refusals of the guards at the edge given to the HTTP boundary as `onGuardRefusal`, the middleware before the unit of work, the integration events subscribed under the consumer name `audit`), `audited-events.ts` (the registry `generate integration-event` adds to), `audit.module.ts`, and with an HTTP stack the read side: `audit.permissions.ts` (`audit:trail.read`), `search-audit-entries.query.ts`, its handler, `search-audit-entries.route.ts` (`GET /audit/entries`: cursor pages, filters `actorId`, `action`, `outcome`, `correlationId`). It is a capability of the platform, not a bounded context: no model, one protected query over the `AuditReader` port, bounded by the tenant of the actor (with `--tenancy shared-table`, by the tenant of the work through `TenantAuditReader`: platform staff read across tenants only inside `acrossTenants`). The refusals of a caller without a credential are not recorded. A scheduled job is audited like a request: origin `schedule`, actor `system:<context>.<job>`. With knex the two tables and their append-only triggers are created by the first migration; with drizzle the tables are in `schema.ts` and `npm run db:audit-guard` prints the trigger statements for a custom migration; with prisma, typeorm, `custom` or no ORM the trail is an `InMemoryAuditTrail` behind a `TODO(platform)`. The test databases leave the audit schema out of `reset()` |
|
|
197
197
|
| `--tenancy shared-table` | recorded as `stack.tenancy`; Knex or Drizzle only. Every `generate repository` is tenant-scoped (as `--tenant-scoped`), through `tenantTable` and `ownTenantTable` or `tenantCondition` and `ownTenantCondition`; the outbox keeps the tenant of each event (`createOutboxTables(knex, { tenant: true })` and `KnexOutboxStore`'s `tenant: true`, or `tenantOutboxTable`), so consumers run in it; `tenancy/scoped-statement` judges the adapters. Row-level security, schema per tenant and database per tenant are refused, with what to wire by hand ([Multitenancy](../../docs/concepts/multitenancy.md)) |
|
|
198
|
+
| `--queue database\|redis\|memory` | recorded as `stack.queue`. `database` (the default on Knex or Drizzle with tsyringe): `createJobTable` and `createProcessTable`, or `jobsTable` and `processesTable`, in the `messaging` schema, `Persistence` gains `jobs` and `processes`, and the platform module rebinds `JobStore` and `ProcessStore` to them, so a job enqueued by a command is written in its transaction; `redis` (with `--cache redis`): `RedisJobStore` on the connection of the cache, the processes in the database; `memory` (the default otherwise): nothing is written, the kernel module keeps both in the process. Refused off tsyringe, `database` with another ORM, `redis` without the cache |
|
|
198
199
|
| `--cache redis` | `src/platform/redis/open-redis.ts` (`RedisServices`: the cache bound to the kernel `Cache`, the limiter to `RateLimiter`, the lock to `Lock`, which keeps a scheduled job to one instance, the relay signal as the `wakeOn` of the outbox relay with `relayWakeUpMiddleware` on the command bus), `http/refusal-for.ts` (one sliding window per caller address, 429 `application/problem+json` with `retry-after`; `RATE_LIMIT_MAX`, `RATE_LIMIT_WINDOW_MS`), `GET /health/ready` on the HTTP server, `REDIS_URL` validated, a compose service `cache` running Dragonfly with a healthcheck. Without a server (tools, tests without `REDIS_URL`) the same ports stay in the memory of the process |
|
|
199
200
|
| `--errors sentry` | unexpected failures reported to Sentry or GlitchTip (one protocol, only the DSN differs) through the kernel `ErrorReporter`, bound to `@ddd-ts-kit/sentry`. `src/platform/errors.ts` (`initSentry` on the validated configuration, then `reportProcessFailures`), the second import of `main.ts`, of `apps/<context>/main.ts` and of `apps/worker/main.ts`, right after `tracing.ts`; `errors` handed to `composeApplication`, which gives it to the kernel module on tsyringe (`errorReporter`, flushed by `container.stop()` before the logger, `errorReportingMiddleware` first on both buses, the default scheduler observing with `reportFailedRuns`) or to `createPlatform` by hand (the same middleware, `onRun: reportFailedRuns(errors)`, `platform.errors`, flushed two seconds at most when the application stops); `reportHttpErrors` in `auth/http-boundary.ts` for every request answered 5xx; `DeadLetterReports` on the `onFailure` hook of a provided broker (`createEventProvider(config, errors)`, with `observing` around each consumer) and of the outbox relay. `SENTRY_DSN`, `SENTRY_ENVIRONMENT` (default: `NODE_ENV`), `SENTRY_RELEASE` and `SENTRY_SCRUB_MESSAGES` validated in `config/load-config.ts` as `errorReporting`: without a DSN the application starts and reports nothing; a DSN that is not a URL refuses the start. Dependencies `@ddd-ts-kit/sentry` and `@sentry/node`. A compose profile `errors` running GlitchTip 6.2.6 with its own PostgreSQL and Valkey (`GLITCHTIP_PORT`, loopback only, development bootstrap), and a section of the generated README saying how to read its DSN. The tools and the tests compose the application without a reporter. It goes with every other choice of the stack; with `--errors none` nothing of this is written |
|
|
200
201
|
| `--authn keycloak` | a compose service `keycloak` (Keycloak 26.8.0, `start-dev --import-realm`, profile `identity`) and `docker/keycloak/<project>-realm.json`: the API client, a public client `<project>-local` with the direct grant, its audience and `tenant_id` mappers, the realm role `admin`, and the demo users `demo-admin` and `demo-user`, for local development only |
|
|
@@ -269,6 +270,7 @@ ddd-ts-kit generate --help --json
|
|
|
269
270
|
| `error` (`refusal`) | `<context> <Concept> <refusal> [--code CODE] [--term ...]...` | a static factory `<refusal>` on `domain/errors/<concept>.error.ts`, the class of the errors of that concept (created when absent, extending `ConceptError`), and its case in `test/unit/<concept>.error.spec.ts`. The factory is added after the last one; run again, the command changes nothing. `<Concept>` is a term of the glossary (`--term` adds it). The code is the name of the refusal in constant case, with the concept before it when the name is one word or a code of the kit (`Appointment notFound` sets `APPOINTMENT_NOT_FOUND`); `--code` takes one of the forms `errors/factory-name` accepts. Refused: a name such as `create` or `error1`, and a code already set in the context |
|
|
270
271
|
| `domain-error` | `<context> <Name> [--code CODE]` | one class per error with a stable code, spec: the form of a project whose config says `"stack.refusals": "classes"` or nothing. Refused under `factories`, with the `generate error` command to run instead |
|
|
271
272
|
| `domain-service` | `<context> <Name>` | service, spec |
|
|
273
|
+
| `state-machine` | `<context> <Aggregate> [--value <state>]... [--transition "<intention>:<from>[,<from>]...[><to>]"]...` | the vocabulary `<Aggregate>Status` (created from `--value`, two states at least, or given the values it misses), `domain/state-machines/<aggregate>.state-machine.ts` (`<aggregate>Lifecycle`: every value a state, the first one initial, the transitions asked, a `TODO(domain)` for the refusal of the concept error) and `test/unit/<aggregate>.state-machine.spec.ts` (each transition where it leads, a refusal from a state it does not leave); the aggregate is left to use it |
|
|
272
274
|
| `repository` | `<context> <Aggregate> [--tenant-scoped]` | the port `domain/repositories/<name>.repository.ts` (`abstract class <Name>Repository extends Repository<<Name>>`), the adapter of the project's ORM (`implements` the port) with its mapper and table (or model), a fake, one `repositoryContract` spec run on both, registration |
|
|
273
275
|
| `command` | `<context> <UseCaseName> (--permission <aggregate>.<action> \| --public) [--aggregate <Name>]` | `<use-case>.command.ts` on `AuthorizedCommand` (plain `Command` when public), `<use-case>.handler.ts` (it builds the aggregate, saves it and answers: the events leave with the save), spec through the bus with the refusal of an actor who lacks the permission, registration with `.requires(...)` or `.public()` (and the repository when missing). A generated command answers `void` or the identifier of its aggregate, so no `<use-case>.result.ts` is written |
|
|
274
276
|
| `query` | `<context> <UseCaseName> (--permission <aggregate>.<action> \| --public) [--search]` | `<use-case>.query.ts` on `AuthorizedQuery` (plain `Query` when public), `<use-case>.result.ts`, `<use-case>.handler.ts`, the read port `application/ports/<use-case>-reader.port.ts` (an abstract class), its in-memory adapter, fake, spec, registration on the query bus. With `--search` (needs `--permission`): a kernel `PageRequest` in the query, the item, the sort and `Page<Item>` in the result file, a handler that asks `Access.scope` and hands the scope to the read port, an in-memory reader paging by offset or cursor |
|
|
@@ -282,6 +284,8 @@ ddd-ts-kit generate --help --json
|
|
|
282
284
|
| `event-handler` | `<context> <Aggregate> <Fact> [--phase after-commit]` | reaction to a domain event of the context, spec, subscription; before the commit of the unit of work by default, after it with `--phase after-commit` (an effect no transaction covers, at most once), and the spec runs the reaction in that phase |
|
|
283
285
|
| `projection` (`projector`) | `<context> <Name> <event-type>` | a projector in `application/projections/<name>.projection.ts`, declared with `@Projection('<context>.<name>')` and one `@On(definition)` method for the integration event, which the context itself or a declared upstream publishes, and its spec; declared style only. It keeps one read model: its port is received in the constructor |
|
|
284
286
|
| `job` | `<context> <Name> (--every <duration> \| --cron "<expression>" [--time-zone <zone>]) --command <UseCaseName>` | `application/scheduling/<name>.job.ts`, a class `<Name>Job implements ScheduledJob` that sends the command, as `systemActor('<context>.<name>')` when it is protected, with `execution.scheduledAt` when the command takes it; `test/unit/<name>.job.spec.ts`, which runs the job (by name on tsyringe, `application.jobs.runNow`; `job.run(occurrence)` with hand wiring) and asserts the command it sent; its registration; its switch in `platform/job-settings.ts`; the grant of its system actor (below) |
|
|
287
|
+
| `background-job` | `<context> <Name> --command <UseCaseName>` | `application/background/<name>.background-job.ts`, a class `<Name>BackgroundJob implements BackgroundJob<<Name>Payload>` named by its static `jobName` `<context>.<name>`, that sends the command as `execution.actor` when it is protected, followed by one field of `<Name>Payload` per other parameter of the constructor of the command (strings, numbers, booleans, literals and lists of them as written, a `Date` as its ISO text; anything else is refused); `test/unit/<name>.background-job.spec.ts`, which enqueues it with a payload of every field as a user holding the permission and runs what is due; its registration (`@Background()`, or `builder.backgroundJob(..)` in the module file). `--di tsyringe` only |
|
|
288
|
+
| `process` (`process-manager`) | `<context> <Name>` | `application/processes/<name>.process.ts` (its state, `processName`, `timeoutJob`, `isState`, a first step that arms a deadline, a step that ends it in time, the step of the deadline), `application/background/<name>-timeout.background-job.ts`, which delivers its timeouts through `ProcessRunner`, and the specs of both (`givenProcess`, the queue of the test application). `--di tsyringe` only |
|
|
285
289
|
| `acl` | `<context> <upstreamOrSystemName>` | translator in `infrastructure/anti-corruption/`, spec |
|
|
286
290
|
| `e2e` | `<context> <UseCaseName>` | `test/e2e/<use-case>.e2e.spec.ts` driving the route of the use case: 401 without a credential, 403 without the permission, the documented status with it; for a command, one more test asserts the trace of the request, exact on names and structure, with `installTestTracing()` and `expectSpanTree(storyOf(trace), [...])` of `@ddd-ts-kit/tracing/testing` (`POST /invoices`, then `command IssueInvoiceCommand`, then `repository InvoiceRepository.save`); needs the route |
|
|
287
291
|
| `policy` | `<context> <Name> --permission <aggregate>.<action>` | `application/authorization/<name>.policy.ts`, spec; declared: the class carries `@Policy(permission, { name })` and nothing else is written; explicit: registration in `platform/auth/access-policies.ts` |
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../../../src/check/canonical/roles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC,qEAAqE;AACrE,eAAO,MAAM,KAAK,EAAE,SAAS,IAAI,
|
|
1
|
+
{"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../../../src/check/canonical/roles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC,qEAAqE;AACrE,eAAO,MAAM,KAAK,EAAE,SAAS,IAAI,EAqFhC,CAAC"}
|
|
@@ -9,6 +9,12 @@ export const ROLES = [
|
|
|
9
9
|
{ directory: 'domain/errors', suffixes: ['.error.ts'] },
|
|
10
10
|
{ directory: 'domain/repositories', suffixes: ['.repository.ts'] },
|
|
11
11
|
{ directory: 'domain/services', suffixes: ['.service.ts'], specFor: ['.service.ts'] },
|
|
12
|
+
{
|
|
13
|
+
directory: 'domain/state-machines',
|
|
14
|
+
suffixes: ['.state-machine.ts'],
|
|
15
|
+
oneConcept: true,
|
|
16
|
+
specFor: ['.state-machine.ts'],
|
|
17
|
+
},
|
|
12
18
|
{
|
|
13
19
|
directory: 'application/commands/*',
|
|
14
20
|
suffixes: ['.command.ts', '.handler.ts', '.result.ts'],
|
|
@@ -30,6 +36,18 @@ export const ROLES = [
|
|
|
30
36
|
specFor: ['.event-handler.ts'],
|
|
31
37
|
},
|
|
32
38
|
{ directory: 'application/scheduling', suffixes: ['.job.ts'], oneConcept: true, specFor: ['.job.ts'] },
|
|
39
|
+
{
|
|
40
|
+
directory: 'application/processes',
|
|
41
|
+
suffixes: ['.process.ts'],
|
|
42
|
+
oneConcept: true,
|
|
43
|
+
specFor: ['.process.ts'],
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
directory: 'application/background',
|
|
47
|
+
suffixes: ['.background-job.ts'],
|
|
48
|
+
oneConcept: true,
|
|
49
|
+
specFor: ['.background-job.ts'],
|
|
50
|
+
},
|
|
33
51
|
{
|
|
34
52
|
directory: 'application/projections',
|
|
35
53
|
suffixes: ['.projection.ts'],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roles.js","sourceRoot":"","sources":["../../../src/check/canonical/roles.ts"],"names":[],"mappings":"AAEA,qEAAqE;AACrE,MAAM,CAAC,MAAM,KAAK,GAAoB;IACpC,EAAE,SAAS,EAAE,oBAAoB,EAAE,QAAQ,EAAE,EAAE,EAAE;IACjD,EAAE,SAAS,EAAE,mBAAmB,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,eAAe,CAAC,EAAE;IAC7G,EAAE,SAAS,EAAE,iBAAiB,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE;IAC5E,EAAE,SAAS,EAAE,sBAAsB,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,QAAQ,CAAC,EAAE;IAClG,EAAE,SAAS,EAAE,qBAAqB,EAAE,QAAQ,EAAE,CAAC,gBAAgB,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE;IACpF,EAAE,SAAS,EAAE,eAAe,EAAE,QAAQ,EAAE,CAAC,WAAW,C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AAE,SAAS,EAAE,yBAAyB,EAAE,QAAQ,EAAE,EAAE,EAAE;IACtD,EAAE,SAAS,EAAE,gCAAgC,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC7D,EAAE,SAAS,EAAE,mBAAmB,EAAE,QAAQ,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,SAAS,CAAC,EAAE;IACtG,EAAE,SAAS,EAAE,0BAA0B,EAAE,QAAQ,EAAE,CAAC,WAAW,CAAC,EAAE;IAClE,EAAE,SAAS,EAAE,0BAA0B,EAAE,QAAQ,EAAE,EAAE,EAAE;IACvD;QACE,SAAS,EAAE,uBAAuB;QAClC,QAAQ,EAAE;YACR,gBAAgB;YAChB,YAAY;YACZ,WAAW;YACX,aAAa;YACb,UAAU;YACV,cAAc;YACd,YAAY;YACZ,UAAU;YACV,YAAY;YACZ,gBAAgB;SACjB;KACF;IACD,EAAE,SAAS,EAAE,kBAAkB,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC/C,EAAE,SAAS,EAAE,eAAe,EAAE,QAAQ,EAAE,CAAC,aAAa,CAAC,EAAE;CAC1D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"architecture-rules.d.ts","sourceRoot":"","sources":["../../../src/check/catalogue/architecture-rules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"architecture-rules.d.ts","sourceRoot":"","sources":["../../../src/check/catalogue/architecture-rules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AA6E7C,gHAAgH;AAChH,eAAO,MAAM,kBAAkB,EAAE,SAAS,IAAI,EA4E7C,CAAC"}
|
|
@@ -44,6 +44,7 @@ import { languageDeclaredVocabulary } from '../rules/language-declared-vocabular
|
|
|
44
44
|
import { languageGlossaryTerm } from '../rules/language-glossary-term.js';
|
|
45
45
|
import { languageNoTechnicalName } from '../rules/language-no-technical-name.js';
|
|
46
46
|
import { layerApplicationInward } from '../rules/layer-application-inward.js';
|
|
47
|
+
import { lifecycleStatusThroughMachine } from '../rules/lifecycle-status-through-machine.js';
|
|
47
48
|
import { layerDomainPurity } from '../rules/layer-domain-purity.js';
|
|
48
49
|
import { layerInfrastructureNoPresentation } from '../rules/layer-infrastructure-no-presentation.js';
|
|
49
50
|
import { layerPresentationNoInfrastructure } from '../rules/layer-presentation-no-infrastructure.js';
|
|
@@ -57,6 +58,7 @@ import { portsImplementsNeverExtends } from '../rules/ports-implements-never-ext
|
|
|
57
58
|
import { portsNoConcreteDependency } from '../rules/ports-no-concrete-dependency.js';
|
|
58
59
|
import { portsNoTokenConstant } from '../rules/ports-no-token-constant.js';
|
|
59
60
|
import { portsValueImport } from '../rules/ports-value-import.js';
|
|
61
|
+
import { processSendsCommandsOnly } from '../rules/process-sends-commands-only.js';
|
|
60
62
|
import { purityNoAmbientRandomness } from '../rules/purity-no-ambient-randomness.js';
|
|
61
63
|
import { purityNoEnvironment } from '../rules/purity-no-environment.js';
|
|
62
64
|
import { purityNoSystemClock } from '../rules/purity-no-system-clock.js';
|
|
@@ -137,6 +139,8 @@ export const ARCHITECTURE_RULES = [
|
|
|
137
139
|
portsNoConcreteDependency,
|
|
138
140
|
portsValueImport,
|
|
139
141
|
schedulingJobTriggersUseCase,
|
|
142
|
+
lifecycleStatusThroughMachine,
|
|
143
|
+
processSendsCommandsOnly,
|
|
140
144
|
schedulingJobName,
|
|
141
145
|
importsAliasOnly,
|
|
142
146
|
importsExtension,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"architecture-rules.js","sourceRoot":"","sources":["../../../src/check/catalogue/architecture-rules.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,aAAa,EA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E,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,gHAAgH;AAChH,MAAM,CAAC,MAAM,kBAAkB,GAAoB;IACjD,iBAAiB;IACjB,sBAAsB;IACtB,iCAAiC;IACjC,iCAAiC;IACjC,4BAA4B;IAC5B,2BAA2B;IAC3B,mCAAmC;IACnC,cAAc;IACd,UAAU;IACV,cAAc;IACd,YAAY;IACZ,uBAAuB;IACvB,mBAAmB;IACnB,gBAAgB;IAChB,gBAAgB;IAChB,gCAAgC;IAChC,WAAW;IACX,mBAAmB;IACnB,oBAAoB;IACpB,oBAAoB;IACpB,uBAAuB;IACvB,0BAA0B;IAC1B,mBAAmB;IACnB,yBAAyB;IACzB,mBAAmB;IACnB,aAAa;IACb,iBAAiB;IACjB,uBAAuB;IACvB,mBAAmB;IACnB,kBAAkB;IAClB,mBAAmB;IACnB,kBAAkB;IAClB,eAAe;IACf,WAAW;IACX,qBAAqB;IACrB,aAAa;IACb,oBAAoB;IACpB,wBAAwB;IACxB,4BAA4B;IAC5B,qCAAqC;IACrC,yBAAyB;IACzB,sBAAsB;IACtB,kCAAkC;IAClC,mCAAmC;IACnC,6BAA6B;IAC7B,kBAAkB;IAClB,aAAa;IACb,kBAAkB;IAClB,kBAAkB;IAClB,gBAAgB;IAChB,mBAAmB;IACnB,sBAAsB;IACtB,2BAA2B;IAC3B,2BAA2B;IAC3B,uBAAuB;IACvB,wBAAwB;IACxB,yBAAyB;IACzB,gCAAgC;IAChC,kBAAkB;IAClB,2BAA2B;IAC3B,oBAAoB;IACpB,yBAAyB;IACzB,gBAAgB;IAChB,4BAA4B;IAC5B,iBAAiB;IACjB,gBAAgB;IAChB,gBAAgB;IAChB,oBAAoB;IACpB,gBAAgB;IAChB,eAAe;IACf,2BAA2B;IAC3B,wBAAwB;IACxB,qBAAqB;CACtB,CAAC"}
|
|
1
|
+
{"version":3,"file":"architecture-rules.js","sourceRoot":"","sources":["../../../src/check/catalogue/architecture-rules.ts"],"names":[],"mappings":"AACA,OAA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B;IAC7B,wBAAwB;IACxB,iBAAiB;IACjB,gBAAgB;IAChB,gBAAgB;IAChB,oBAAoB;IACpB,gBAAgB;IAChB,eAAe;IACf,2BAA2B;IAC3B,wBAAwB;IACxB,qBAAqB;CACtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle-docs.d.ts","sourceRoot":"","sources":["../../../src/check/explain/lifecycle-docs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA+B5D,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export const LIFECYCLE_DOCS = {
|
|
2
|
+
'lifecycle/status-through-machine': {
|
|
3
|
+
why: 'A state machine says once which status follows which, and what refuses a forbidden transition with a static factory of the concept error. An aggregate that also writes its status by hand keeps a second, silent copy of its lifecycle: a transition the machine forbids happens anyway, and the diagram of CONTEXT.md, drawn from the machine, lies. So an aggregate whose machine exists (domain/state-machines/<aggregate>.state-machine.ts) imports it once it writes a status, and writes its status only from machine.next(..) or machine.start(..), or copies a status it read.',
|
|
4
|
+
bad: `// domain/aggregates/appointment.aggregate.ts
|
|
5
|
+
confirm(now: Date): void {
|
|
6
|
+
if (this.state.status !== 'requested') {
|
|
7
|
+
throw AppointmentError.alreadyConfirmed(this.id);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
this.state = { ...this.state, changedAt: now, status: 'booked' };
|
|
11
|
+
}`,
|
|
12
|
+
good: `// domain/aggregates/appointment.aggregate.ts
|
|
13
|
+
confirm(now: Date): void {
|
|
14
|
+
this.state = { ...this.state, changedAt: now, status: appointmentLifecycle.next(this.state.status, 'confirm') };
|
|
15
|
+
}`,
|
|
16
|
+
},
|
|
17
|
+
'process/sends-commands-only': {
|
|
18
|
+
why: 'A process manager coordinates: it reacts to events, keeps its own state and decides what happens next. When it also loads and saves aggregates, of its context or another, or calls an outside system, it becomes a use case nobody can send, with no permission, no audit, and a transaction that spans what it should only coordinate. Its steps answer a decision whose commands do the work, each in its own handler; a file of application/processes/*.process.ts imports no aggregate, entity, repository, domain service, port or infrastructure.',
|
|
19
|
+
bad: `// application/processes/appointment-reminder.process.ts
|
|
20
|
+
import { ReminderRepository } from '@/contexts/notification/domain/repositories/reminder.repository';
|
|
21
|
+
|
|
22
|
+
export class AppointmentReminderProcess {
|
|
23
|
+
constructor(private readonly reminders: ReminderRepository) {}
|
|
24
|
+
}`,
|
|
25
|
+
good: `// application/processes/appointment-reminder.process.ts
|
|
26
|
+
export class AppointmentReminderProcess implements ProcessManager<ReminderProcessState> {
|
|
27
|
+
booked(event: AppointmentBookedV1, current: ReminderProcessState | undefined) {
|
|
28
|
+
return { state: { appointmentId: event.payload.appointmentId, stage: 'waiting' }, commands: [new PlanReminderCommand(/* ... */)] };
|
|
29
|
+
}
|
|
30
|
+
}`,
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=lifecycle-docs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle-docs.js","sourceRoot":"","sources":["../../../src/check/explain/lifecycle-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAsC;IAC/D,kCAAkC,EAAE;QAClC,GAAG,EAAE,yjBAAyjB;QAC9jB,GAAG,EAAE;;;;;;;EAOP;QACE,IAAI,EAAE;;;EAGR;KACC;IACD,6BAA6B,EAAE;QAC7B,GAAG,EAAE,0hBAA0hB;QAC/hB,GAAG,EAAE;;;;;EAKP;QACE,IAAI,EAAE;;;;;EAKR;KACC;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rule-docs.d.ts","sourceRoot":"","sources":["../../../src/check/explain/rule-docs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"rule-docs.d.ts","sourceRoot":"","sources":["../../../src/check/explain/rule-docs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAoBpD,oGAAoG;AACpG,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAmBvD,CAAC"}
|
|
@@ -8,6 +8,7 @@ import { IMPORTS_DOCS } from './imports-docs.js';
|
|
|
8
8
|
import { LANGUAGE_DOCS } from './language-docs.js';
|
|
9
9
|
import { LAYER_DOCS } from './layer-docs.js';
|
|
10
10
|
import { LAYOUT_DOCS } from './layout-docs.js';
|
|
11
|
+
import { LIFECYCLE_DOCS } from './lifecycle-docs.js';
|
|
11
12
|
import { PERSISTENCE_DOCS } from './persistence-docs.js';
|
|
12
13
|
import { PORTS_DOCS } from './ports-docs.js';
|
|
13
14
|
import { SCHEDULING_DOCS } from './scheduling-docs.js';
|
|
@@ -27,6 +28,7 @@ export const RULE_DOCS = {
|
|
|
27
28
|
...LANGUAGE_DOCS,
|
|
28
29
|
...LAYER_DOCS,
|
|
29
30
|
...LAYOUT_DOCS,
|
|
31
|
+
...LIFECYCLE_DOCS,
|
|
30
32
|
...PERSISTENCE_DOCS,
|
|
31
33
|
...PORTS_DOCS,
|
|
32
34
|
...SCHEDULING_DOCS,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rule-docs.js","sourceRoot":"","sources":["../../../src/check/explain/rule-docs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,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":"","sources":["../../../src/check/fixtures/fixtures.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/fixtures.ts"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,SAAS,OAAO,EAqCtC,CAAC"}
|
|
@@ -22,6 +22,7 @@ import { LANGUAGE_FIXTURES } from './language-fixtures.js';
|
|
|
22
22
|
import { VOCABULARY_FIXTURES } from './vocabulary-fixtures.js';
|
|
23
23
|
import { LAYER_FIXTURES } from './layer-fixtures.js';
|
|
24
24
|
import { LAYOUT_FIXTURES } from './layout-fixtures.js';
|
|
25
|
+
import { LIFECYCLE_FIXTURES } from './lifecycle-fixtures.js';
|
|
25
26
|
import { NAMING_FIXTURES } from './naming-fixtures.js';
|
|
26
27
|
import { OUTBOX_FIXTURES } from './outbox-fixtures.js';
|
|
27
28
|
import { PERSISTENCE_FIXTURES } from './persistence-fixtures.js';
|
|
@@ -63,6 +64,7 @@ export const FIXTURES = [
|
|
|
63
64
|
...VOCABULARY_FIXTURES,
|
|
64
65
|
...LAYER_FIXTURES,
|
|
65
66
|
...LAYOUT_FIXTURES,
|
|
67
|
+
...LIFECYCLE_FIXTURES,
|
|
66
68
|
...NAMING_FIXTURES,
|
|
67
69
|
...OUTBOX_FIXTURES,
|
|
68
70
|
...PERSISTENCE_FIXTURES,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixtures.js","sourceRoot":"","sources":["../../../src/check/fixtures/fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,q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;IAClB,GAAG,eAAe;IAClB,GAAG,oBAAoB;IACvB,GAAG,cAAc;IACjB,GAAG,eAAe;IAClB,GAAG,mBAAmB;IACtB,GAAG,iBAAiB;IACpB,GAAG,gBAAgB;IACnB,GAAG,aAAa;IAChB,GAAG,gBAAgB;IACnB,GAAG,aAAa;CACjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle-fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/lifecycle-fixtures.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAwB5C,eAAO,MAAM,kBAAkB,EAAE,SAAS,OAAO,EAqFhD,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { aggregate } from './aggregate.js';
|
|
2
|
+
import { PATHS } from './paths.js';
|
|
3
|
+
import { project } from './project.js';
|
|
4
|
+
import { SAMPLES } from './samples.js';
|
|
5
|
+
const { AGGREGATE, BILLING } = PATHS;
|
|
6
|
+
const MACHINE = `${BILLING}/domain/state-machines/invoice.state-machine.ts`;
|
|
7
|
+
const MACHINE_SPEC = `${BILLING}/test/unit/invoice.state-machine.spec.ts`;
|
|
8
|
+
const PROCESS = `${BILLING}/application/processes/dunning.process.ts`;
|
|
9
|
+
const PROCESS_SPEC = `${BILLING}/test/unit/dunning.process.spec.ts`;
|
|
10
|
+
const MACHINE_FILES = {
|
|
11
|
+
[MACHINE]: "import { defineStateMachine } from '@ddd-ts-kit/kernel';\n\nexport const invoiceLifecycle = defineStateMachine({\n states: ['draft', 'issued'],\n initial: ['draft'],\n transitions: { issue: { from: ['draft'], to: 'issued' } },\n refused: () => new Error('refused'),\n});\n",
|
|
12
|
+
[MACHINE_SPEC]: SAMPLES.SPEC,
|
|
13
|
+
};
|
|
14
|
+
const IMPORT = "import { invoiceLifecycle } from '@/contexts/billing/domain/state-machines/invoice.state-machine.js';\n";
|
|
15
|
+
const invoice = (body, imports = IMPORT) => `${imports}\nexport class Invoice {\n private state = { total: 0, status: 'draft' };\n\n${body}\n}\n`;
|
|
16
|
+
export const LIFECYCLE_FIXTURES = [
|
|
17
|
+
{
|
|
18
|
+
ruleId: 'lifecycle/status-through-machine',
|
|
19
|
+
name: 'an aggregate that asks its state machine for its status, or copies one it read',
|
|
20
|
+
expect: 'pass',
|
|
21
|
+
files: project({
|
|
22
|
+
...MACHINE_FILES,
|
|
23
|
+
...aggregate(invoice(" issue(): void {\n this.state = { ...this.state, status: invoiceLifecycle.next(this.state.status, 'issue') };\n }\n\n restore(state: { total: number; status: string }): void {\n this.state = { total: state.total, status: state.status };\n }")),
|
|
24
|
+
}),
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
ruleId: 'lifecycle/status-through-machine',
|
|
28
|
+
name: 'an aggregate that writes its status by hand next to its state machine',
|
|
29
|
+
expect: { file: AGGREGATE },
|
|
30
|
+
files: project({
|
|
31
|
+
...MACHINE_FILES,
|
|
32
|
+
...aggregate(invoice(" issue(): void {\n this.state = { ...this.state, status: 'issued' };\n }")),
|
|
33
|
+
}),
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
ruleId: 'lifecycle/status-through-machine',
|
|
37
|
+
name: 'an aggregate that names the status its machine answers, then writes it as a shorthand',
|
|
38
|
+
expect: 'pass',
|
|
39
|
+
files: project({
|
|
40
|
+
...MACHINE_FILES,
|
|
41
|
+
...aggregate(invoice(" issue(): void {\n const status = invoiceLifecycle.next(this.state.status, 'issue');\n\n this.state = { ...this.state, status };\n }\n\n isIssued(): boolean {\n const { status } = this.state;\n\n return status === 'issued';\n }")),
|
|
42
|
+
}),
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
ruleId: 'lifecycle/status-through-machine',
|
|
46
|
+
name: 'an aggregate that names a status by hand, then writes it as a shorthand',
|
|
47
|
+
expect: { file: AGGREGATE },
|
|
48
|
+
files: project({
|
|
49
|
+
...MACHINE_FILES,
|
|
50
|
+
...aggregate(invoice(" issue(): void {\n const status = 'issued';\n\n this.state = { ...this.state, status };\n }")),
|
|
51
|
+
}),
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
ruleId: 'lifecycle/status-through-machine',
|
|
55
|
+
name: 'an aggregate whose state machine exists and is not imported',
|
|
56
|
+
expect: { file: AGGREGATE },
|
|
57
|
+
files: project({
|
|
58
|
+
...MACHINE_FILES,
|
|
59
|
+
...aggregate(invoice(" issue(): void {\n this.state = { ...this.state, status: 'issued' };\n }", '')),
|
|
60
|
+
}),
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
ruleId: 'lifecycle/status-through-machine',
|
|
64
|
+
name: 'an aggregate that writes no status yet next to its new state machine',
|
|
65
|
+
expect: 'pass',
|
|
66
|
+
files: project({
|
|
67
|
+
...MACHINE_FILES,
|
|
68
|
+
...aggregate(invoice(' total(): number {\n return this.state.total;\n }', '')),
|
|
69
|
+
}),
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
ruleId: 'process/sends-commands-only',
|
|
73
|
+
name: 'a process that decides commands from its state',
|
|
74
|
+
expect: 'pass',
|
|
75
|
+
files: project({
|
|
76
|
+
[PROCESS]: "import type { IssueInvoiceCommand } from '@/contexts/billing/application/commands/issue-invoice/issue-invoice.command.js';\n\nexport class DunningProcess {\n readonly sends: IssueInvoiceCommand[] = [];\n}\n",
|
|
77
|
+
[PROCESS_SPEC]: SAMPLES.SPEC,
|
|
78
|
+
}),
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
ruleId: 'process/sends-commands-only',
|
|
82
|
+
name: 'a process that saves an aggregate itself',
|
|
83
|
+
expect: { file: PROCESS },
|
|
84
|
+
files: project({
|
|
85
|
+
[PROCESS]: "import type { InvoiceRepository } from '@/contexts/billing/domain/repositories/invoice.repository.js';\n\nexport class DunningProcess {\n readonly invoices: InvoiceRepository[] = [];\n}\n",
|
|
86
|
+
[PROCESS_SPEC]: SAMPLES.SPEC,
|
|
87
|
+
}),
|
|
88
|
+
},
|
|
89
|
+
];
|
|
90
|
+
//# sourceMappingURL=lifecycle-fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle-fixtures.js","sourceRoot":"","sources":["../../../src/check/fixtures/lifecycle-fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;AAErC,MAAM,OAAO,GAAG,GAAG,OAAO,iDAAiD,CAAC;AAC5E,MAAM,YAAY,GAAG,GAAG,OAAO,0CAA0C,CAAC;AAC1E,MAAM,OAAO,GAAG,GAAG,OAAO,2CAA2C,CAAC;AACtE,MAAM,YAAY,GAAG,GAAG,OAAO,oCAAoC,CAAC;AAEpE,MAAM,aAAa,GAAG;IACpB,CAAC,OAAO,CAAC,EACP,sRAAsR;IACxR,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC,IAAI;CAC7B,CAAC;AAEF,MAAM,MAAM,GACV,yGAAyG,CAAC;AAE5G,MAAM,OAAO,GAAG,CAAC,IAAY,EAAE,OAAO,GAAG,MAAM,EAAU,EAAE,CACzD,GAAG,OAAO,iFAAiF,IAAI,OAAO,CAAC;AAEzG,MAAM,CAAC,MAAM,kBAAkB,GAAuB;IACpD;QACE,MAAM,EAAE,kCAAkC;QAC1C,IAAI,EAAE,gFAAgF;QACtF,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,OAAO,CAAC;YACb,GAAG,aAAa;YAChB,GAAG,SAAS,CACV,OAAO,CACL,4PAA4P,CAC7P,CACF;SACF,CAAC;KACH;IACD;QACE,MAAM,EAAE,kCAAkC;QAC1C,IAAI,EAAE,uEAAuE;Q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AAC,IAAI;SAC7B,CAAC;KACH;IACD;QACE,MAAM,EAAE,6BAA6B;QACrC,IAAI,EAAE,0CAA0C;QAChD,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;QACzB,KAAK,EAAE,OAAO,CAAC;YACb,CAAC,OAAO,CAAC,EACP,8LAA8L;YAChM,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC,IAAI;SAC7B,CAAC;KACH;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-aggregate-file.d.ts","sourceRoot":"","sources":["../../../src/check/lifecycle/is-aggregate-file.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1D,8DAA8D;AAC9D,wBAAgB,eAAe,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAMzD"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** A production file of `domain/aggregates/` of a context. */
|
|
2
|
+
export function isAggregateFile(file) {
|
|
3
|
+
const { location } = file;
|
|
4
|
+
return (!file.isTest && location.area === 'context' && location.layer === 'domain' && location.inside[0] === 'aggregates');
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=is-aggregate-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-aggregate-file.js","sourceRoot":"","sources":["../../../src/check/lifecycle/is-aggregate-file.ts"],"names":[],"mappings":"AAEA,8DAA8D;AAC9D,MAAM,UAAU,eAAe,CAAC,IAAgB;IAC9C,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IAE1B,OAAO,CACL,CAAC,IAAI,CAAC,MAAM,IAAI,QAAQ,CAAC,IAAI,KAAK,SAAS,IAAI,QAAQ,CAAC,KAAK,KAAK,QAAQ,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,YAAY,CAClH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"machines-imported.d.ts","sourceRoot":"","sources":["../../../src/check/lifecycle/machines-imported.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1D,kFAAkF;AAClF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,EAAE,CAU3D"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** The names a file binds from the state machines of `domain/state-machines/`. */
|
|
2
|
+
export function machinesImported(file) {
|
|
3
|
+
return file.imports.flatMap(({ target, names }) => {
|
|
4
|
+
if (target.kind !== 'file' || target.location.area !== 'context') {
|
|
5
|
+
return [];
|
|
6
|
+
}
|
|
7
|
+
const { layer, inside } = target.location;
|
|
8
|
+
return layer === 'domain' && inside[0] === 'state-machines' ? [...names] : [];
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=machines-imported.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"machines-imported.js","sourceRoot":"","sources":["../../../src/check/lifecycle/machines-imported.ts"],"names":[],"mappings":"AAEA,kFAAkF;AAClF,MAAM,UAAU,gBAAgB,CAAC,IAAgB;IAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE;QAChD,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YACjE,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC;QAE1C,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,gBAAgB,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAChF,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SourceFile } from '../model/source-file.js';
|
|
2
|
+
/**
|
|
3
|
+
* The offsets of `status` written as a shorthand property of an object literal, `{ ...this.state,
|
|
4
|
+
* status }`, leaving out a destructuring, `const { status } = this.state`, which reads it.
|
|
5
|
+
*/
|
|
6
|
+
export declare function shorthandStatusWrites(file: SourceFile): number[];
|
|
7
|
+
//# sourceMappingURL=shorthand-status-writes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shorthand-status-writes.d.ts","sourceRoot":"","sources":["../../../src/check/lifecycle/shorthand-status-writes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAM1D;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,EAAE,CAUhE"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { BRACKETS } from '../text/brackets.js';
|
|
2
|
+
const SHORTHAND = /(?<![\w$.'"])status\s*(?=[,}])/g;
|
|
3
|
+
const DECLARED_BEFORE = /\b(?:const|let|var)\s*$/;
|
|
4
|
+
/**
|
|
5
|
+
* The offsets of `status` written as a shorthand property of an object literal, `{ ...this.state,
|
|
6
|
+
* status }`, leaving out a destructuring, `const { status } = this.state`, which reads it.
|
|
7
|
+
*/
|
|
8
|
+
export function shorthandStatusWrites(file) {
|
|
9
|
+
const { code } = file.scan;
|
|
10
|
+
return [...code.matchAll(SHORTHAND)]
|
|
11
|
+
.map(({ index }) => index)
|
|
12
|
+
.filter((index) => {
|
|
13
|
+
const opening = enclosingBrace(code, index);
|
|
14
|
+
return opening !== -1 && !DECLARED_BEFORE.test(code.slice(Math.max(0, opening - 16), opening));
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
/** The `{` of the object the offset is in, at its depth; -1 when it is in none. */
|
|
18
|
+
function enclosingBrace(code, from) {
|
|
19
|
+
let depth = 0;
|
|
20
|
+
for (let i = from - 1; i >= 0; i -= 1) {
|
|
21
|
+
const char = code.charAt(i);
|
|
22
|
+
if (BRACKETS.closers.includes(char)) {
|
|
23
|
+
depth += 1;
|
|
24
|
+
}
|
|
25
|
+
else if (BRACKETS.openers.includes(char)) {
|
|
26
|
+
if (depth === 0) {
|
|
27
|
+
return char === '{' ? i : -1;
|
|
28
|
+
}
|
|
29
|
+
depth -= 1;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return -1;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=shorthand-status-writes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shorthand-status-writes.js","sourceRoot":"","sources":["../../../src/check/lifecycle/shorthand-status-writes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,MAAM,SAAS,GAAG,iCAAiC,CAAC;AACpD,MAAM,eAAe,GAAG,yBAAyB,CAAC;AAElD;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAAgB;IACpD,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC;IAE3B,OAAO,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;SACjC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC;SACzB,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;QAChB,MAAM,OAAO,GAAG,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAE5C,OAAO,OAAO,KAAK,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,GAAG,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;IACjG,CAAC,CAAC,CAAC;AACP,CAAC;AAED,mFAAmF;AACnF,SAAS,cAAc,CAAC,IAAY,EAAE,IAAY;IAChD,IAAI,KAAK,GAAG,CAAC,CAAC;IAEd,KAAK,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAE5B,IAAI,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YACpC,KAAK,IAAI,CAAC,CAAC;QACb,CAAC;aAAM,IAAI,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAC3C,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;gBAChB,OAAO,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC/B,CAAC;YAED,KAAK,IAAI,CAAC,CAAC;QACb,CAAC;IACH,CAAC;IAED,OAAO,CAAC,CAAC,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { SourceFile } from '../model/source-file.js';
|
|
2
|
+
/**
|
|
3
|
+
* One place a member writes the status: `status: <value>` in an object, `<target>.status =
|
|
4
|
+
* <value>`, or the shorthand `{ ...this.state, status }`, whose value is that of the local
|
|
5
|
+
* `const status = <value>` when the file declares one.
|
|
6
|
+
*/
|
|
7
|
+
export interface StatusWrite {
|
|
8
|
+
readonly line: number;
|
|
9
|
+
/** The value as written, literals included. */
|
|
10
|
+
readonly value: string;
|
|
11
|
+
}
|
|
12
|
+
/** Every write of the status inside the bodies of the members of the classes of a file. */
|
|
13
|
+
export declare function statusWrites(file: SourceFile): StatusWrite[];
|
|
14
|
+
//# sourceMappingURL=status-writes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-writes.d.ts","sourceRoot":"","sources":["../../../src/check/lifecycle/status-writes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAI1D;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,+CAA+C;IAC/C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAOD,2FAA2F;AAC3F,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,WAAW,EAAE,CAoB5D"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { endAtDepthZero } from '../text/end-at-depth-zero.js';
|
|
2
|
+
import { shorthandStatusWrites } from './shorthand-status-writes.js';
|
|
3
|
+
const LOCAL = /\b(?:const|let)\s+status\s*(?::[^=]+)?=(?![=>])/g;
|
|
4
|
+
const PROPERTY = /(?<![\w$.])(['"]?)status\1\s*:(?!:)/g;
|
|
5
|
+
const ASSIGNMENT = /\.\s*status\s*=(?![=>])/g;
|
|
6
|
+
/** Every write of the status inside the bodies of the members of the classes of a file. */
|
|
7
|
+
export function statusWrites(file) {
|
|
8
|
+
const bodies = file.structure.classes.flatMap((shape) => shape.methods.map(({ bodyStart, end }) => ({ bodyStart, end })));
|
|
9
|
+
const inBody = (index) => bodies.some(({ bodyStart, end }) => index > bodyStart && index < end);
|
|
10
|
+
const written = [PROPERTY, ASSIGNMENT].flatMap((pattern) => [...file.scan.code.matchAll(pattern)]
|
|
11
|
+
.filter(({ index }) => inBody(index))
|
|
12
|
+
.map((match) => writeAt(file, match.index + match[0].length)));
|
|
13
|
+
const locals = [...file.scan.code.matchAll(LOCAL)].map((match) => writeAt(file, match.index + match[0].length));
|
|
14
|
+
const shorthands = shorthandStatusWrites(file)
|
|
15
|
+
.filter(inBody)
|
|
16
|
+
.flatMap((index) => shorthandAt(file, index, locals));
|
|
17
|
+
return [...written, ...shorthands];
|
|
18
|
+
}
|
|
19
|
+
/** A shorthand takes the values of the local bindings of the file; without one, it copies a status read. */
|
|
20
|
+
function shorthandAt(file, index, locals) {
|
|
21
|
+
const line = file.scan.lineAt(index);
|
|
22
|
+
return locals.length === 0 ? [{ line, value: 'status' }] : locals.map(({ value }) => ({ line, value }));
|
|
23
|
+
}
|
|
24
|
+
function writeAt(file, valueStart) {
|
|
25
|
+
const { code } = file.scan;
|
|
26
|
+
const end = Math.min(endAtDepthZero(code, valueStart, ','), endAtDepthZero(code, valueStart, ';'));
|
|
27
|
+
return { line: file.scan.lineAt(valueStart), value: file.text.slice(valueStart, end).trim() };
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=status-writes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-writes.js","sourceRoot":"","sources":["../../../src/check/lifecycle/status-writes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAarE,MAAM,KAAK,GAAG,kDAAkD,CAAC;AAEjE,MAAM,QAAQ,GAAG,sCAAsC,CAAC;AACxD,MAAM,UAAU,GAAG,0BAA0B,CAAC;AAE9C,2FAA2F;AAC3F,MAAM,UAAU,YAAY,CAAC,IAAgB;IAC3C,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CACtD,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC,CAChE,CAAC;IAEF,MAAM,MAAM,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,KAAK,GAAG,SAAS,IAAI,KAAK,GAAG,GAAG,CA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