ddd-ts-kit 0.4.1 → 0.5.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 +19 -9
- package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
- package/dist/check/catalogue/architecture-rules.js +2 -0
- package/dist/check/catalogue/architecture-rules.js.map +1 -1
- package/dist/check/configuration/config-inspection.d.ts +4 -0
- package/dist/check/configuration/config-inspection.d.ts.map +1 -1
- package/dist/check/configuration/config-inspection.js +10 -1
- package/dist/check/configuration/config-inspection.js.map +1 -1
- package/dist/check/explain/persistence-docs.d.ts +3 -0
- package/dist/check/explain/persistence-docs.d.ts.map +1 -0
- package/dist/check/explain/persistence-docs.js +14 -0
- package/dist/check/explain/persistence-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/persistence-fixtures.d.ts +3 -0
- package/dist/check/fixtures/persistence-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/persistence-fixtures.js +72 -0
- package/dist/check/fixtures/persistence-fixtures.js.map +1 -0
- package/dist/check/migrations/drizzle-history-findings.d.ts +9 -0
- package/dist/check/migrations/drizzle-history-findings.d.ts.map +1 -0
- package/dist/check/migrations/drizzle-history-findings.js +70 -0
- package/dist/check/migrations/drizzle-history-findings.js.map +1 -0
- package/dist/check/migrations/drizzle-migrations.d.ts +23 -0
- package/dist/check/migrations/drizzle-migrations.d.ts.map +1 -0
- package/dist/check/migrations/drizzle-migrations.js +2 -0
- package/dist/check/migrations/drizzle-migrations.js.map +1 -0
- package/dist/check/migrations/drizzle-out-folder.d.ts +3 -0
- package/dist/check/migrations/drizzle-out-folder.d.ts.map +1 -0
- package/dist/check/migrations/drizzle-out-folder.js +18 -0
- package/dist/check/migrations/drizzle-out-folder.js.map +1 -0
- package/dist/check/migrations/migration-folder.d.ts +13 -0
- package/dist/check/migrations/migration-folder.d.ts.map +1 -0
- package/dist/check/migrations/migration-folder.js +2 -0
- package/dist/check/migrations/migration-folder.js.map +1 -0
- package/dist/check/migrations/migration-name-findings.d.ts +9 -0
- package/dist/check/migrations/migration-name-findings.d.ts.map +1 -0
- package/dist/check/migrations/migration-name-findings.js +32 -0
- package/dist/check/migrations/migration-name-findings.js.map +1 -0
- package/dist/check/migrations/read-drizzle-migrations.d.ts +4 -0
- package/dist/check/migrations/read-drizzle-migrations.d.ts.map +1 -0
- package/dist/check/migrations/read-drizzle-migrations.js +67 -0
- package/dist/check/migrations/read-drizzle-migrations.js.map +1 -0
- package/dist/check/migrations/read-migration-folder.d.ts +5 -0
- package/dist/check/migrations/read-migration-folder.d.ts.map +1 -0
- package/dist/check/migrations/read-migration-folder.js +38 -0
- package/dist/check/migrations/read-migration-folder.js.map +1 -0
- package/dist/check/rules/config-valid.d.ts.map +1 -1
- package/dist/check/rules/config-valid.js +3 -1
- package/dist/check/rules/config-valid.js.map +1 -1
- package/dist/check/rules/persistence-migration-history.d.ts +3 -0
- package/dist/check/rules/persistence-migration-history.d.ts.map +1 -0
- package/dist/check/rules/persistence-migration-history.js +24 -0
- package/dist/check/rules/persistence-migration-history.js.map +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +10 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/commit/is-derived.d.ts.map +1 -1
- package/dist/commit/is-derived.js +5 -7
- package/dist/commit/is-derived.js.map +1 -1
- package/dist/config/ci-extra-problems.d.ts +4 -0
- package/dist/config/ci-extra-problems.d.ts.map +1 -0
- package/dist/config/ci-extra-problems.js +27 -0
- package/dist/config/ci-extra-problems.js.map +1 -0
- package/dist/config/ci-extras.d.ts +13 -0
- package/dist/config/ci-extras.d.ts.map +1 -0
- package/dist/config/ci-extras.js +13 -0
- package/dist/config/ci-extras.js.map +1 -0
- package/dist/config/config.d.ts +23 -0
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/index.d.ts +4 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +3 -0
- package/dist/config/index.js.map +1 -1
- package/dist/config/open-api-problems.d.ts +4 -0
- package/dist/config/open-api-problems.d.ts.map +1 -0
- package/dist/config/open-api-problems.js +87 -0
- package/dist/config/open-api-problems.js.map +1 -0
- package/dist/config/openapi-formats.d.ts +3 -0
- package/dist/config/openapi-formats.d.ts.map +1 -0
- package/dist/config/openapi-formats.js +3 -0
- package/dist/config/openapi-formats.js.map +1 -0
- package/dist/config/parse-ci.d.ts +4 -0
- package/dist/config/parse-ci.d.ts.map +1 -0
- package/dist/config/parse-ci.js +7 -0
- package/dist/config/parse-ci.js.map +1 -0
- package/dist/config/parse-config.d.ts.map +1 -1
- package/dist/config/parse-config.js +4 -0
- package/dist/config/parse-config.js.map +1 -1
- package/dist/config/parse-open-api.d.ts +4 -0
- package/dist/config/parse-open-api.d.ts.map +1 -0
- package/dist/config/parse-open-api.js +20 -0
- package/dist/config/parse-open-api.js.map +1 -0
- package/dist/config/restack-config-text.d.ts +1 -1
- package/dist/config/restack-config-text.d.ts.map +1 -1
- package/dist/config/restack-config-text.js +9 -2
- package/dist/config/restack-config-text.js.map +1 -1
- package/dist/config/serialize-config.js +8 -0
- package/dist/config/serialize-config.js.map +1 -1
- package/dist/contracts/contract-format.d.ts +3 -0
- package/dist/contracts/contract-format.d.ts.map +1 -0
- package/dist/contracts/contract-format.js +11 -0
- package/dist/contracts/contract-format.js.map +1 -0
- package/dist/contracts/stringify-contract.d.ts +3 -0
- package/dist/contracts/stringify-contract.d.ts.map +1 -0
- package/dist/contracts/stringify-contract.js +6 -0
- package/dist/contracts/stringify-contract.js.map +1 -0
- package/dist/contracts.d.ts +9 -0
- package/dist/contracts.d.ts.map +1 -0
- package/dist/contracts.js +9 -0
- package/dist/contracts.js.map +1 -0
- package/dist/describe/describe-context.d.ts.map +1 -1
- package/dist/describe/describe-context.js +14 -3
- package/dist/describe/describe-context.js.map +1 -1
- package/dist/docs/open-api-documents-file.d.ts +4 -0
- package/dist/docs/open-api-documents-file.d.ts.map +1 -0
- package/dist/docs/open-api-documents-file.js +5 -0
- package/dist/docs/open-api-documents-file.js.map +1 -0
- package/dist/docs/render-open-api-documents.d.ts +13 -0
- package/dist/docs/render-open-api-documents.d.ts.map +1 -0
- package/dist/docs/render-open-api-documents.js +42 -0
- package/dist/docs/render-open-api-documents.js.map +1 -0
- package/dist/docs/write-docs.d.ts.map +1 -1
- package/dist/docs/write-docs.js +2 -0
- package/dist/docs/write-docs.js.map +1 -1
- package/dist/docs/write-open-api-documents.d.ts +9 -0
- package/dist/docs/write-open-api-documents.d.ts.map +1 -0
- package/dist/docs/write-open-api-documents.js +33 -0
- package/dist/docs/write-open-api-documents.js.map +1 -0
- package/dist/help/commands-guide-region.d.ts +3 -0
- package/dist/help/commands-guide-region.d.ts.map +1 -0
- package/dist/help/commands-guide-region.js +12 -0
- package/dist/help/commands-guide-region.js.map +1 -0
- package/dist/help/notes.d.ts +3 -0
- package/dist/help/notes.d.ts.map +1 -0
- package/dist/help/notes.js +24 -0
- package/dist/help/notes.js.map +1 -0
- package/dist/help/reference-text.d.ts +3 -0
- package/dist/help/reference-text.d.ts.map +1 -0
- package/dist/help/reference-text.js +14 -0
- package/dist/help/reference-text.js.map +1 -0
- package/dist/help/usage.d.ts +3 -0
- package/dist/help/usage.d.ts.map +1 -0
- package/dist/help/usage.js +37 -0
- package/dist/help/usage.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/init/files/persistence-files.js +1 -1
- package/dist/init/files/persistence-files.js.map +1 -1
- package/dist/init/files/pipeline-files.d.ts.map +1 -1
- package/dist/init/files/pipeline-files.js +4 -2
- package/dist/init/files/pipeline-files.js.map +1 -1
- package/dist/init/manifest/database-scripts.d.ts.map +1 -1
- package/dist/init/manifest/database-scripts.js +5 -4
- package/dist/init/manifest/database-scripts.js.map +1 -1
- package/dist/init/manifest/versions.js +23 -23
- package/dist/init/run-init.d.ts.map +1 -1
- package/dist/init/run-init.js +3 -0
- package/dist/init/run-init.js.map +1 -1
- package/dist/init/stack/resolve-ci-extras.d.ts +8 -0
- package/dist/init/stack/resolve-ci-extras.d.ts.map +1 -0
- package/dist/init/stack/resolve-ci-extras.js +31 -0
- package/dist/init/stack/resolve-ci-extras.js.map +1 -0
- package/dist/init/stack/resolve-stack.d.ts.map +1 -1
- package/dist/init/stack/resolve-stack.js +3 -1
- 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/init/template-vars.d.ts.map +1 -1
- package/dist/init/template-vars.js +14 -0
- package/dist/init/template-vars.js.map +1 -1
- package/dist/init/write-agent-settings.js +2 -2
- package/dist/init/write-agent-settings.js.map +1 -1
- package/dist/init/write-contracts.d.ts.map +1 -1
- package/dist/init/write-contracts.js +7 -3
- package/dist/init/write-contracts.js.map +1 -1
- package/dist/progress/format-progress.d.ts.map +1 -1
- package/dist/progress/format-progress.js +3 -1
- package/dist/progress/format-progress.js.map +1 -1
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +2 -63
- package/dist/run.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/yaml/to-yaml.d.ts +8 -0
- package/dist/yaml/to-yaml.d.ts.map +1 -0
- package/dist/yaml/to-yaml.js +132 -0
- package/dist/yaml/to-yaml.js.map +1 -0
- package/package.json +2 -2
- package/templates/docs/integration-readme.md.tpl +2 -2
- package/templates/init/CLAUDE.md.tpl +2 -1
- package/templates/init/README.md.tpl +37 -11
- package/templates/init/platform/database/data-source.typeorm.ts.tpl +1 -1
- package/templates/init/platform/database/drizzle.config.ts.tpl +2 -0
- package/templates/init/platform/database/knexfile.js.tpl +9 -3
- package/templates/init/platform/database/schema.drizzle.ts.tpl +1 -1
- package/templates/init/platform/database/schema.knex.ts.tpl +2 -2
- package/templates/init/platform/http/with-documentation.ts.tpl +13 -9
- package/templates/init/rules/presentation.md.tpl +1 -1
- package/templates/init/scripts/events.ts.tpl +16 -5
- package/templates/init/scripts/openapi.ts.tpl +49 -20
- package/templates/pipeline/github/branch-protection.md +8 -7
- package/templates/pipeline/github/workflows/{ci.yml → ci.yml.tpl} +3 -0
- package/templates/pipeline/gitlab/gitlab-ci.yml.tpl +11 -0
- package/templates/pipeline/gitlab/merge-request-settings.md +7 -6
- package/templates/pipeline/package-scripts.json +1 -1
- package/templates/repository/drizzle/table.tpl +2 -2
- package/templates/repository/prisma/model.tpl +1 -1
- package/templates/repository/typeorm/table.tpl +1 -1
package/README.md
CHANGED
|
@@ -23,7 +23,9 @@ npx ddd-ts-kit check
|
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
`init` ends by saying what to run next: `pnpm install`, then `pnpm run verify` (`npm install`,
|
|
26
|
-
then `npm run verify` with `--package-manager npm`)
|
|
26
|
+
then `npm run verify` with `--package-manager npm`), then the recommended steps of the method, in
|
|
27
|
+
order ([methodology](../../docs/guides/methodology.md)); [which command, when](../../docs/guides/commands.md)
|
|
28
|
+
gives the command of each moment of a project and the reference of every flag. A new project passes that whole gate before
|
|
27
29
|
anything is generated, with no context, with one and with several: the end-to-end suite installs
|
|
28
30
|
it for real and runs it, on both package managers and on every proven stack. After the install the
|
|
29
31
|
CLI is the one the project pins: `pnpm exec ddd-ts-kit <command>`, or `npx ddd-ts-kit <command>`.
|
|
@@ -42,7 +44,7 @@ ddd-ts-kit init [--http express|fastify|nest|none]
|
|
|
42
44
|
[--orm drizzle|knex|prisma|typeorm|custom|none]
|
|
43
45
|
[--database postgres|mysql|sqlite|none]
|
|
44
46
|
[--events in-memory|outbox] [--docs-ui swagger|scalar|redoc|none]
|
|
45
|
-
[--ci github|gitlab|both|none]
|
|
47
|
+
[--ci github|gitlab|both|none] [--ci-extras <extra>,...|none]
|
|
46
48
|
[--authn jwt|keycloak|none] [--authz rbac|abac|rebac|custom]
|
|
47
49
|
[--broker none|rabbitmq|kafka|nats|redis|custom] [--cache none|redis] [--audit on|off]
|
|
48
50
|
[--errors none|sentry] [--logger stdout|pino|winston]
|
|
@@ -59,8 +61,9 @@ ddd-ts-kit init [--http express|fastify|nest|none]
|
|
|
59
61
|
Works in an empty directory or an existing project. An existing file is never replaced without
|
|
60
62
|
`--force`; it is reported as skipped. `init` also writes the generated contracts as the scripts
|
|
61
63
|
of the project write them for a project without a route or an integration event of its own
|
|
62
|
-
(`openapi/openapi.
|
|
63
|
-
|
|
64
|
+
(`openapi/openapi.yaml`, `docs/integration/asyncapi.yaml` and `event-catalog.md`; JSON under
|
|
65
|
+
`"openapi": { "format": "json" }` of the config), so that the first commit holds them and
|
|
66
|
+
`docs:check` passes at once; a contract that is already there is
|
|
64
67
|
left alone, `--force` included. An existing `package.json` is merged: missing scripts and
|
|
65
68
|
dependencies are added, yours are kept and mentioned in the notes. Run again later, `init` keeps
|
|
66
69
|
the stack recorded in the config.
|
|
@@ -75,6 +78,13 @@ are wired into them again; what another generator had added to a file of the pla
|
|
|
75
78
|
value of a gateway, the settings of a job) is not, and a note says so. A config that cannot be
|
|
76
79
|
read is replaced.
|
|
77
80
|
|
|
81
|
+
The pipeline uses free tools only. `--ci-extras` adds jobs that need a paid plan on a private
|
|
82
|
+
repository, or report into a merge request only in a paid tier: `codeql`, `dependency-review`
|
|
83
|
+
(GitHub), `gitlab-sast`, `gitlab-secret-detection`, `gitlab-dependency-scanning` (GitLab). The
|
|
84
|
+
list is recorded as `ci.extras` in the config; an unknown name, or a job of a platform `--ci` does
|
|
85
|
+
not cover, is refused. The table of every tool and its conditions:
|
|
86
|
+
[pipeline/README.md](../../pipeline/README.md#free-by-default-paid-on-request).
|
|
87
|
+
|
|
78
88
|
An import of a file of the project is written without an extension
|
|
79
89
|
(`@/contexts/billing/domain/aggregates/invoice.aggregate`): `init` records
|
|
80
90
|
`"importExtension": "none"`, and `--import-extension js` asks for the `.js` of the emitted file
|
|
@@ -172,7 +182,7 @@ config, `docsUi`, `ci` and `logger` included.
|
|
|
172
182
|
| `package.json` | scripts and dependencies of the stack (below); `build` is the compiler, then `ddd-ts-kit build-aliases` |
|
|
173
183
|
| `tsconfig.json`, `tsconfig.build.json` | strict, NodeNext, `rootDir` `.` and `outDir` `dist`, and `paths`: the one declaration of the import alias (`@/*` to `./src/*`, `$test/*`, `$scripts/*`, and `$generated/*` with Prisma), derived from `importAlias` (`--import-alias '$<name>/'`, `@/` by default; `#<name>/` and `@<name>/` are refused with the reason); the build config extends the other and declares no `paths`; `experimentalDecorators` (and `emitDecoratorMetadata`) only for nest or class-validator, whose decorators are legacy ones: the declarations and the aspects serve both modes |
|
|
174
184
|
| `src/main.ts` | composition root: tracing first (error reporting second with `--errors sentry`), config, persistence, application (`log`, `traceConsumers: config.tracing.consumers`, `resilience`, `jobs: { start: config.runJobs, settings: jobSettings(process.env) }`), outbox relay, HTTP server; on `SIGTERM` or `SIGINT` it closes the server, stops the relay, stops the application, closes the persistence and shuts the tracing down |
|
|
175
|
-
| `src/platform/` | one export per file, each named after it, in one folder per concern. At its root: `tracing.ts`, `compose-application.ts` and `job-settings.ts` (`jobSettings(environment, context?)`: one line per job, `JOB_<CONTEXT>_<JOB>_ENABLED=false` switches one off). `config/` (`app-config.ts`, `load-config.ts`, `config-error.ts`, `read-tracing.ts`: fail-fast on `DATABASE_URL`, `LOG_LEVEL`, `LOG_FORMAT`, `LOG_SCRUB_MESSAGES`, the `OUTBOUND_*` policy, `RUN_JOBS` and the tracing variables below); `observability/` (`create-logger.ts`, see `--logger`; `create-metrics.ts`: a `NoopMetrics` behind a `TODO(platform)`); `resilience/` (`resilience-settings.ts`, `default-resilience.ts`, `adapter-aspects.ts`: retry with backoff and a timeout for `external` and `gateway`, `own-policy.ts` for an adapter that states its own, `self-governed.ts`); `events/`, `database/`, `auth/`, `audit/`, `redis/` (below); `http/` (`start-http-server.ts`, `with-documentation.ts`: `/docs` and `/openapi.json`, off in production unless `API_DOCS=true`). With `--di tsyringe`: `compose-application.ts` (`composeApplication(persistence, options, contexts?)`: `kernelModule({...})`, the platform module, the authorization module, the contexts; installs the aspect runtime), `lay-foundations.ts` (one execution scope, clock, id generator, logger, metrics, instrumentation and audit, built before any module), `platform.module.ts` (what replaces the in-process defaults of the kernel: unit of work, processed-event store, the storage class, `OutboxStore`, `EventSubscribers` behind a broker, `ErrorMapper`, and `builder.around(['external', 'gateway'], ...)`, the resilience of every adapter that leaves the process), `platform-test.module.ts` (what a handler spec lists next to its context: the storage class bound to a factory that throws), `buses/create-command-bus.ts` and `create-query-bus.ts` (outermost first: `errorReportingMiddleware`, `loggingMiddleware`, `metricsMiddleware`, the permission, the span of the use case, the audit entry, then the unit of work of a command). With `--di manual` or `nest`: `compose-application.ts`, `platform.ts` (`interface Platform`, with `jobs: JobScheduler` and `adapter`, which wraps what a module file instantiates), `create-platform.ts`, `jobs/configured-job-scheduler.ts` (applies `job-settings.ts` to what a module registers) |
|
|
185
|
+
| `src/platform/` | one export per file, each named after it, in one folder per concern. At its root: `tracing.ts`, `compose-application.ts` and `job-settings.ts` (`jobSettings(environment, context?)`: one line per job, `JOB_<CONTEXT>_<JOB>_ENABLED=false` switches one off). `config/` (`app-config.ts`, `load-config.ts`, `config-error.ts`, `read-tracing.ts`: fail-fast on `DATABASE_URL`, `LOG_LEVEL`, `LOG_FORMAT`, `LOG_SCRUB_MESSAGES`, the `OUTBOUND_*` policy, `RUN_JOBS` and the tracing variables below); `observability/` (`create-logger.ts`, see `--logger`; `create-metrics.ts`: a `NoopMetrics` behind a `TODO(platform)`); `resilience/` (`resilience-settings.ts`, `default-resilience.ts`, `adapter-aspects.ts`: retry with backoff and a timeout for `external` and `gateway`, `own-policy.ts` for an adapter that states its own, `self-governed.ts`); `events/`, `database/`, `auth/`, `audit/`, `redis/` (below); `http/` (`start-http-server.ts`, `with-documentation.ts`: `/docs` and `/openapi.json`, or `/openapi/<name>.json` per document of a split contract, off in production unless `API_DOCS=true`; `openapi-documents.ts`, the split written by `ddd-ts-kit docs` from `openapi.documents`). With `--di tsyringe`: `compose-application.ts` (`composeApplication(persistence, options, contexts?)`: `kernelModule({...})`, the platform module, the authorization module, the contexts; installs the aspect runtime), `lay-foundations.ts` (one execution scope, clock, id generator, logger, metrics, instrumentation and audit, built before any module), `platform.module.ts` (what replaces the in-process defaults of the kernel: unit of work, processed-event store, the storage class, `OutboxStore`, `EventSubscribers` behind a broker, `ErrorMapper`, and `builder.around(['external', 'gateway'], ...)`, the resilience of every adapter that leaves the process), `platform-test.module.ts` (what a handler spec lists next to its context: the storage class bound to a factory that throws), `buses/create-command-bus.ts` and `create-query-bus.ts` (outermost first: `errorReportingMiddleware`, `loggingMiddleware`, `metricsMiddleware`, the permission, the span of the use case, the audit entry, then the unit of work of a command). With `--di manual` or `nest`: `compose-application.ts`, `platform.ts` (`interface Platform`, with `jobs: JobScheduler` and `adapter`, which wraps what a module file instantiates), `create-platform.ts`, `jobs/configured-job-scheduler.ts` (applies `job-settings.ts` to what a module registers) |
|
|
176
186
|
| tracing | wired once, by the platform (`tracing/platform-only`): no `decorate` hook, no `decorate-bindings.ts`. `tracing.ts` starts `initTracing` of `@ddd-ts-kit/tracing/node` before any other module, on what `config/read-tracing.ts` validates: `OTEL_EXPORTER_OTLP_ENDPOINT` (a URL; left out, no span leaves the process), `TRACE_SAMPLE_RATIO` (0 to 1) and `TRACE_CONSUMERS` (`continue`, the default: a consumed event stays in the trace of its publication; `link`: each delivery starts a trace linked to it). With `--di tsyringe`: `lay-foundations.ts` builds `traceApplication({ consumers })`, `compose-application.ts` hands it to `kernelModule({ instrumentation })` (one span per use case, repository call, domain event, publication, consumer and job) and gives the outbox relay `tracedPublisher(bus)`. With hand wiring: `create-platform.ts` applies the members of `traceApplication()` itself (`useCase` on both buses, `domainEvents`, `publisher`, `binding` around every adapter, `job`, `executionScope`, `errorReporter`), with `tracedSubscriber` and `tracedPublisher` around the provider. With an HTTP stack, in both families, `auth/http-boundary.ts` sets `around: tracedRoutes()`: one `SERVER` span per request, named by its route |
|
|
177
187
|
| `--logger` | `src/platform/observability/create-logger.ts`, one per choice: `stdout` (the default) is the `StdoutLogger` of `@ddd-ts-kit/aspects`, JSON lines, credentials not redacted; `pino` is `createPinoLogger` of `@ddd-ts-kit/pino` (dependencies `pino` and `pino-pretty`); `winston` is `createWinstonLogger` of `@ddd-ts-kit/winston`; these two redact the credential keys of the kernel. Every entry carries `traceLogFields(scope)`: the correlation id, origin, actor and tenant of the work in progress and the ids of the active trace. `LOG_LEVEL`, `LOG_FORMAT` (`json`, the default, or `pretty`; with `stdout`, which has no pretty format, `pretty` is refused when the configuration is loaded) and `LOG_SCRUB_MESSAGES` (`[message removed]` in place of the message of a logged error that is not a `DomainError`) are validated in `config/load-config.ts`. Stopping the application flushes the error reporter, then the logger, last: `container.stop()` does it on tsyringe, `compose-application.ts` flushes explicitly with hand wiring. The tools and the tests compose the application without `log` and write nothing |
|
|
178
188
|
| `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 |
|
|
@@ -182,8 +192,8 @@ config, `docsUi`, `ci` and `logger` included.
|
|
|
182
192
|
| `--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 |
|
|
183
193
|
| `src/platform/events/` | `event-provider.ts` (`bus`, `forConsumer(name)`, `start()`, `close()`), `in-process-events.ts`, and for `--broker` `create-event-provider.ts`: `RabbitMqEventBus` (`AMQP_URL`), `KafkaEventBus` (`KAFKA_BROKERS`, with `aggregate-key-of.ts` for per-aggregate order), `NatsEventBus` (`NATS_URL`) or `RedisStreamsEventBus` of `@ddd-ts-kit/redis/event-bus` (`REDIS_URL`: Redis, Dragonfly or Valkey), each with one subscriber per consuming context (`forConsumer`), `assertTopology` at start, its address validated and a compose service with a healthcheck; or `custom-event-bus.ts` with its `eventBusContract` spec. `start-outbox-relay.ts` with the outbox. `--broker redis` with `--cache redis` is one server and one compose service, `cache`; alone, the service is `streams` |
|
|
184
194
|
| `src/platform/database/` | `persistence.ts` (`interface Persistence`: unit of work, outbox and processed-event stores of the ORM package, the storage handle), `open-persistence.ts`, `persistence-over.ts`, `inert-persistence.ts`, the connection (`connect-to-database.ts`, `create-client.ts` or `create-data-source.ts`), `schema.ts`, `open-test-database.ts` (PostgreSQL in process, or the server named by a URL). The storage class a repository adapter names in its dependency list: `database.ts` with drizzle and prisma (`abstract class Database extends` the context type of the ORM package), `KnexContext` of `@ddd-ts-kit/knex`, `TypeOrmContext` of `@ddd-ts-kit/typeorm` |
|
|
185
|
-
| migration tooling | `drizzle.config.ts`, `knexfile.js` and `migrations/
|
|
186
|
-
| `scripts/openapi.ts`, `scripts/events.ts` | write `openapi/openapi.
|
|
195
|
+
| migration tooling | `drizzle.config.ts`, `knexfile.js` and `migrations/00000000000000_initial.js`, `prisma/schema.prisma` and `prisma.config.ts`, or `data-source.ts` |
|
|
196
|
+
| `scripts/openapi.ts`, `scripts/events.ts` | write `openapi/openapi.yaml` (one file per document of `openapi.documents`), `docs/integration/asyncapi.yaml` and `docs/integration/event-catalog.md`, in JSON under `openapi.format: json`; `--check` fails on a difference |
|
|
187
197
|
| `docker-compose.yml`, `.env.example`, `Dockerfile`, `.dockerignore` | the database with a healthcheck and a named volume, `jaegertracing/jaeger:2.22.0` behind the `observability` profile (its UI and its OTLP port bound to 127.0.0.1), ports from `.env`; a multi-stage, non-root image with production dependencies only |
|
|
188
198
|
| `vitest.e2e.config.ts`, `test/e2e/support/` | `start-application.ts` (the whole application on a free port, on an in-process database unless `DATABASE_URL` is set, no job run by time), `create-credentials.ts`, `auth-environment.ts`, `test-environment.ts`, `story-of.ts` (`storyOf(trace)`: a trace without the calls an adapter makes on itself, the form `expectSpanTree` asserts) |
|
|
189
199
|
| `docs/context-map.md`, `docs/integration/README.md` | see `docs` |
|
|
@@ -194,7 +204,7 @@ config, `docsUi`, `ci` and `logger` included.
|
|
|
194
204
|
| `knip.json` | dead code: entry points are `main.ts` and `apps/*/main.ts`, the scripts, the specs and the fakes, the module files in the explicit style, the role files under discovery (jobs and publishers included) |
|
|
195
205
|
| `vitest.config.ts` | unit and integration projects, the coverage thresholds read from `ddd-ts-kit.config.json` (`governedCoverage`), per context and layer, in the standard decorator mode `decorators()` of `@ddd-ts-kit/testing/vitest`, which compiles the files holding a decorator with the compiler of the project (Vitest does not lower standard decorators; it lowers legacy ones itself, so a project with `experimentalDecorators` gets no plugin), and under `--assembly discovery` `server.deps.inline: ['@ddd-ts-kit/di']` |
|
|
196
206
|
| `lefthook.yml`, `commitlint.config.mjs` | pre-commit (ESLint, the format check and `check` on the staged files, `check --commit-size --staged`, which never blocks), pre-push (types, unit tests) and commit-msg hooks (`npm run hooks:install`), conventional commits |
|
|
197
|
-
| `--ci github` | `.github/workflows/ci.yml`, `
|
|
207
|
+
| `--ci github` | `.github/workflows/ci.yml`, `pr-title.yml`, `.github/dependabot.yml`, `.github/branch-protection.md`, `renovate.json`; `codeql.yml` with `--ci-extras codeql` |
|
|
198
208
|
| `--ci gitlab` | `.gitlab-ci.yml` (architecture findings as a Code Quality report through `check --format gitlab`), `.gitlab/merge-request-settings.md`, `renovate.json` |
|
|
199
209
|
| `README.md`, `CLAUDE.md`, `.claude/rules/*.md` | how to run it; a slim guide (commands, how to read less, the map of the rules, generated files, compiler note, the skills of the plugin: `/ddd-ts-kit:start`, `glossary`, `use-case`, `document`, `quality-gate`) and the invariants in seven rule files, `domain.md`, `application.md`, `published-language.md`, `infrastructure.md`, `presentation.md`, `platform.md` and `tests.md`, each scoped by a `paths` frontmatter |
|
|
200
210
|
| `.claude/settings.json` | permissions only: the checks and generators run without asking, `.env` files are unreadable (`.env.example` stays readable), the three generated documents are not edited by hand, `git push`, `npm publish` and any edit of the files that hold the rules and the pipeline (`ddd-ts-kit.config.json`, `eslint.config.mjs`, `biome.json`, `.dependency-cruiser.cjs`, `knip.json`, `lefthook.yml`, `.gitlab-ci.yml`, `.github/workflows/**`, `.claude/settings.json`) ask first |
|
|
@@ -567,7 +577,7 @@ One context as facts read from the config and the source text, in both styles: u
|
|
|
567
577
|
their permission (or `public`), routes (method, path, operation id, use case, schema names, error
|
|
568
578
|
codes), consumed and published events, ports with their adapters, policies, gateways with their
|
|
569
579
|
upstream, scheduled jobs, upstreams and downstreams. Field lists are not guessed: they are in
|
|
570
|
-
`openapi/openapi.
|
|
580
|
+
`openapi/openapi.yaml` and `docs/integration/event-catalog.md`. `docs` writes the same facts in
|
|
571
581
|
each `CONTEXT.md`.
|
|
572
582
|
|
|
573
583
|
`--json` prints one object:
|
|
@@ -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;AAkE7C,gHAAgH;AAChH,eAAO,MAAM,kBAAkB,EAAE,SAAS,IAAI,EAiE7C,CAAC"}
|
|
@@ -43,6 +43,7 @@ import { layerPresentationNoInfrastructure } from '../rules/layer-presentation-n
|
|
|
43
43
|
import { namingOneConceptPerFile } from '../rules/naming-one-concept-per-file.js';
|
|
44
44
|
import { namingSearchNotList } from '../rules/naming-search-not-list.js';
|
|
45
45
|
import { namingSuffix } from '../rules/naming-suffix.js';
|
|
46
|
+
import { persistenceMigrationHistory } from '../rules/persistence-migration-history.js';
|
|
46
47
|
import { portsAbstractClass } from '../rules/ports-abstract-class.js';
|
|
47
48
|
import { portsImplementsNeverExtends } from '../rules/ports-implements-never-extends.js';
|
|
48
49
|
import { portsNoConcreteDependency } from '../rules/ports-no-concrete-dependency.js';
|
|
@@ -126,5 +127,6 @@ export const ARCHITECTURE_RULES = [
|
|
|
126
127
|
importsAliasDeclared,
|
|
127
128
|
errorsCodeUnique,
|
|
128
129
|
errorsKnownCode,
|
|
130
|
+
persistenceMigrationHistory,
|
|
129
131
|
];
|
|
130
132
|
//# sourceMappingURL=architecture-rules.js.map
|
|
@@ -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,O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kB;IAClB,eAAe;IACf,WAAW;IACX,qBAAqB;IACrB,aAAa;IACb,oBAAoB;IACpB,wBAAwB;IACxB,4BAA4B;IAC5B,qCAAqC;IACrC,kBAAkB;IAClB,aAAa;IACb,kBAAkB;IAClB,kBAAkB;IAClB,gBAAgB;IAChB,mBAAmB;IACnB,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;
|
|
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,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE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ection {
|
|
|
17
17
|
functionLinesLimit(): Violation[];
|
|
18
18
|
/** A commit limit that is not a positive integer is read as its default: the config says something nothing does. */
|
|
19
19
|
commitLimits(): Violation[];
|
|
20
|
+
/** An extra job the pipeline does not know is written by no `init`: the config says something no pipeline runs. */
|
|
21
|
+
ciExtras(): Violation[];
|
|
22
|
+
/** A format or a document the scripts cannot write as the config says. */
|
|
23
|
+
openApiSettings(): Violation[];
|
|
20
24
|
/** A threshold that is not a percentage is read as the reference: the config says something no run enforces. */
|
|
21
25
|
coverageThresholds(): Violation[];
|
|
22
26
|
/** An entry without a file or without a reason allows nothing: it is ignored, and has to be said. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-inspection.d.ts","sourceRoot":"","sources":["../../../src/check/configuration/config-inspection.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"config-inspection.d.ts","sourceRoot":"","sources":["../../../src/check/configuration/config-inspection.ts"],"names":[],"mappings":"AAAA,OAAO,EAaL,KAAK,aAAa,EAEnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAMvD,qGAAqG;AACrG,qBAAa,gBAAgB;IAEzB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFzB,YACmB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EAC7B;IAEJ,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,SAAS,EAAE,CAMjE;IAED,qBAAqB,IAAI,SAAS,EAAE,CAanC;IAED,YAAY,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,EAAE,CAoBlD;IAED,SAAS,IAAI,SAAS,EAAE,CAcvB;IAED,6EAA6E;IAC7E,eAAe,IAAI,SAAS,EAAE,CAc7B;IAED,2GAA2G;IAC3G,kBAAkB,IAAI,SAAS,EAAE,CAiBhC;IAED,oHAAoH;IACpH,YAAY,IAAI,SAAS,EAAE,CAI1B;IAED,mHAAmH;IACnH,QAAQ,IAAI,SAAS,EAAE,CAItB;IAED,0EAA0E;IAC1E,eAAe,IAAI,SAAS,EAAE,CAM7B;IAED,gHAAgH;IAChH,kBAAkB,IAAI,SAAS,EAAE,CAIhC;IAED,qGAAqG;IACrG,oBAAoB,IAAI,SAAS,EAAE,CA4BlC;IAED,OAAO,CAAC,cAAc;IActB,OAAO,CAAC,QAAQ;IAgChB,OAAO,CAAC,QAAQ;IAiBhB,qFAAqF;IACrF,OAAO,CAAC,QAAQ;CAGjB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CLASSIFICATIONS, commitLimitProblems, coverageProblems, CONFIG_FILE, FUNCTION_LINES_CEILING, GUARD_MODES, IMPORT_EXTENSIONS, isOneOf, RELATIONSHIPS, SEVERITIES, } from '../../config/index.js';
|
|
1
|
+
import { ciExtraProblems, openApiProblems, CLASSIFICATIONS, commitLimitProblems, coverageProblems, CONFIG_FILE, FUNCTION_LINES_CEILING, GUARD_MODES, IMPORT_EXTENSIONS, isOneOf, RELATIONSHIPS, SEVERITIES, } from '../../config/index.js';
|
|
2
2
|
import { isRecord } from '../support/is-record.js';
|
|
3
3
|
import { lineOf } from '../support/line-of.js';
|
|
4
4
|
import { lineOfSequence } from '../support/line-of-sequence.js';
|
|
@@ -75,6 +75,15 @@ export class ConfigInspection {
|
|
|
75
75
|
commitLimits() {
|
|
76
76
|
return commitLimitProblems(rawConfig(this.project)['commit']).map(({ key, message, fix }) => this.inConfig(key, message, fix));
|
|
77
77
|
}
|
|
78
|
+
/** An extra job the pipeline does not know is written by no `init`: the config says something no pipeline runs. */
|
|
79
|
+
ciExtras() {
|
|
80
|
+
return ciExtraProblems(rawConfig(this.project)['ci']).map(({ key, message, fix }) => this.inConfig(key, message, fix));
|
|
81
|
+
}
|
|
82
|
+
/** A format or a document the scripts cannot write as the config says. */
|
|
83
|
+
openApiSettings() {
|
|
84
|
+
const contexts = Object.keys(this.project.config.contexts);
|
|
85
|
+
return openApiProblems(rawConfig(this.project)['openapi'], contexts).map(({ key, message, fix }) => this.inConfig(key, message, fix));
|
|
86
|
+
}
|
|
78
87
|
/** A threshold that is not a percentage is read as the reference: the config says something no run enforces. */
|
|
79
88
|
coverageThresholds() {
|
|
80
89
|
return coverageProblems(rawConfig(this.project)['coverage']).map(({ where, message, fix }) => this.report({ file: CONFIG_FILE, line: lineOfSequence(this.project.configText, where) }, message, fix));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-inspection.js","sourceRoot":"","sources":["../../../src/check/configuration/config-inspection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,sBAAsB,EACtB,WAAW,EACX,iBAAiB,EACjB,OAAO,EACP,aAAa,EACb,UAAU,GAGX,MAAM,uBAAuB,CAAC;AAI/B,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,qGAAqG;AACrG,MAAM,OAAO,gBAAgB;IAER,OAAO;IACP,MAAM;IAFzB,YACmB,OAAgB,EAChB,MAAc;uBADd,OAAO;sBACP,MAAM;IACtB,CAAC;IAEJ,eAAe,CAAC,IAAY,EAAE,OAAsB;QAClD,OAAO;YACL,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC;YACrC,GAAG,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAA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IAChH,CAAC;CACF;AAED,SAAS,SAAS,CAAC,KAAc;IAC/B,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;IAE5C,MAAM,GAAG,GAAG,CAAC,GAAW,EAAW,EAAE;QACnC,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAE1B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;IAC1D,CAAC,CAAC;IAEF,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;QACjB,OAAO,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,oBAAoB,CAAC;IACvD,CAAC;IAED,OAAO,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persistence-docs.d.ts","sourceRoot":"","sources":["../../../src/check/explain/persistence-docs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAY9D,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const PERSISTENCE_DOCS = {
|
|
2
|
+
'persistence/migration-history': {
|
|
3
|
+
why: 'Migrations are applied in the order of their names, and several people add them at the same time. Numbered by an index, two branches each write `0002_...` and the order between them is a guess; named by a random word, nobody knows what a migration does. A timestamp and a description, `20261012093000_add-invoices`, keep every branch apart. drizzle-kit adds a journal and a chain of snapshots on top: its migrator applies only the entries newer than the last one a database applied, so an entry merged out of order is skipped without a word, and a snapshot generated from the same parent as another makes the next migration miss a change. After a merge, the migration of the branch is generated again on top of the main branch.',
|
|
4
|
+
bad: `migrations/
|
|
5
|
+
0002_brave_falcon.sql # an index, a random name
|
|
6
|
+
0002_quiet_owl.sql # the same index, from another branch
|
|
7
|
+
meta/_journal.json # entries 0002 and 0002, two snapshots with one parent`,
|
|
8
|
+
good: `migrations/
|
|
9
|
+
20261010120000_add-invoices.sql
|
|
10
|
+
20261012093000_add-payments.sql # generated again after main took add-invoices
|
|
11
|
+
meta/_journal.json # one entry each, in order, each snapshot from the one before`,
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=persistence-docs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persistence-docs.js","sourceRoot":"","sources":["../../../src/check/explain/persistence-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAAsC;IACjE,+BAA+B,EAAE;QAC/B,GAAG,EAAE,ytBAAytB;QAC9tB,GAAG,EAAE;;;wFAG+E;QACpF,IAAI,EAAE;;;kGAGwF;KAC/F;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;AAiBpD,oGAAoG;AACpG,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAgBvD,CAAC"}
|
|
@@ -7,6 +7,7 @@ import { IMPORTS_DOCS } from './imports-docs.js';
|
|
|
7
7
|
import { LANGUAGE_DOCS } from './language-docs.js';
|
|
8
8
|
import { LAYER_DOCS } from './layer-docs.js';
|
|
9
9
|
import { LAYOUT_DOCS } from './layout-docs.js';
|
|
10
|
+
import { PERSISTENCE_DOCS } from './persistence-docs.js';
|
|
10
11
|
import { PORTS_DOCS } from './ports-docs.js';
|
|
11
12
|
import { SCHEDULING_DOCS } from './scheduling-docs.js';
|
|
12
13
|
import { STANDARD_DOCS } from './standard-docs.js';
|
|
@@ -23,6 +24,7 @@ export const RULE_DOCS = {
|
|
|
23
24
|
...LANGUAGE_DOCS,
|
|
24
25
|
...LAYER_DOCS,
|
|
25
26
|
...LAYOUT_DOCS,
|
|
27
|
+
...PERSISTENCE_DOCS,
|
|
26
28
|
...PORTS_DOCS,
|
|
27
29
|
...SCHEDULING_DOCS,
|
|
28
30
|
...STANDARD_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,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAA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G;AACpG,MAAM,CAAC,MAAM,SAAS,GAAsC;IAC1D,GAAG,UAAU;IACb,GAAG,UAAU;IACb,GAAG,YAAY;IACf,GAAG,WAAW;IACd,GAAG,WAAW;IACd,GAAG,YAAY;IACf,GAAG,aAAa;IAChB,GAAG,UAAU;IACb,GAAG,WAAW;IACd,GAAG,gBAAgB;IACnB,GAAG,UAAU;IACb,GAAG,eAAe;IAClB,GAAG,aAAa;IAChB,GAAG,SAAS;IACZ,GAAG,WAAW;CACf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/fixtures.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/fixtures.ts"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,SAAS,OAAO,EAgCtC,CAAC"}
|
|
@@ -21,6 +21,7 @@ import { LAYER_FIXTURES } from './layer-fixtures.js';
|
|
|
21
21
|
import { LAYOUT_FIXTURES } from './layout-fixtures.js';
|
|
22
22
|
import { NAMING_FIXTURES } from './naming-fixtures.js';
|
|
23
23
|
import { OUTBOX_FIXTURES } from './outbox-fixtures.js';
|
|
24
|
+
import { PERSISTENCE_FIXTURES } from './persistence-fixtures.js';
|
|
24
25
|
import { PORTS_FIXTURES } from './ports-fixtures.js';
|
|
25
26
|
import { PURITY_FIXTURES } from './purity-fixtures.js';
|
|
26
27
|
import { SCHEDULING_FIXTURES } from './scheduling-fixtures.js';
|
|
@@ -57,6 +58,7 @@ export const FIXTURES = [
|
|
|
57
58
|
...LAYOUT_FIXTURES,
|
|
58
59
|
...NAMING_FIXTURES,
|
|
59
60
|
...OUTBOX_FIXTURES,
|
|
61
|
+
...PERSISTENCE_FIXTURES,
|
|
60
62
|
...PORTS_FIXTURES,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,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAuB;IAC1C,GAAG,uBAAuB;IAC1B,GAAG,uBAAuB;IAC1B,GAAG,cAAc;IACjB,GAAG,cAAc;IACjB,GAAG,oBAAoB;IACvB,GAAG,eAAe;IAClB,GAAG,8BAA8B;IACjC,GAAG,iBAAiB;IACpB,GAAG,gBAAgB;IACnB,GAAG,iBAAiB;IACpB,GAAG,qBAAqB;IACxB,GAAG,sBAAsB;IACzB,GAAG,eAAe;IAClB,GAAG,eAAe;IAClB,GAAG,kBAAkB;IACrB,GAAG,oBAAoB;IACvB,GAAG,mBAAmB;IACtB,GAAG,gBAAgB;IACnB,GAAG,iBAAiB;IACpB,GAAG,cAAc;IACjB,GAAG,eAAe;IAClB,GAAG,eAAe;IAClB,GAAG,eAAe;IAClB,GAAG,oBAAoB;IACvB,GAAG,cAAc;IACjB,GAAG,eAAe;IAClB,GAAG,mBAAmB;IACtB,GAAG,iBAAiB;IACpB,GAAG,aAAa;IAChB,GAAG,gBAAgB;IACnB,GAAG,aAAa;CACjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persistence-fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/persistence-fixtures.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAS5C,eAAO,MAAM,oBAAoB,EAAE,SAAS,OAAO,EAqClD,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { CONFIG_FILE } from '../../config/index.js';
|
|
2
|
+
import { config } from './config.js';
|
|
3
|
+
import { project } from './project.js';
|
|
4
|
+
const JOURNAL = 'migrations/meta/_journal.json';
|
|
5
|
+
const INITIAL = '20261010120000_initial';
|
|
6
|
+
const INVOICES = '20261011120000_add-invoices';
|
|
7
|
+
const PAYMENTS = '20261012120000_add-payments';
|
|
8
|
+
const ORIGIN = '00000000-0000-0000-0000-000000000000';
|
|
9
|
+
export const PERSISTENCE_FIXTURES = [
|
|
10
|
+
{
|
|
11
|
+
ruleId: 'persistence/migration-history',
|
|
12
|
+
name: 'drizzle migrations in the order generated, each snapshot from the one before',
|
|
13
|
+
expect: 'pass',
|
|
14
|
+
files: drizzle('b'),
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
ruleId: 'persistence/migration-history',
|
|
18
|
+
name: 'two drizzle migrations generated from the same snapshot on two branches',
|
|
19
|
+
expect: { file: JOURNAL },
|
|
20
|
+
files: drizzle('a'),
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
ruleId: 'persistence/migration-history',
|
|
24
|
+
name: 'a drizzle journal whose last entry was generated before the one it follows',
|
|
25
|
+
expect: { file: JOURNAL },
|
|
26
|
+
files: drizzle('b', [INITIAL, PAYMENTS, INVOICES]),
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
ruleId: 'persistence/migration-history',
|
|
30
|
+
name: 'knex migrations named by a timestamp, the index of the initial one kept',
|
|
31
|
+
expect: 'pass',
|
|
32
|
+
files: knex(['0001_initial', '20261012093000_add-invoices']),
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
ruleId: 'persistence/migration-history',
|
|
36
|
+
name: 'a knex migration written by hand without a number',
|
|
37
|
+
expect: { file: 'migrations/add-invoices.js' },
|
|
38
|
+
files: knex(['20261012093000_initial', 'add-invoices']),
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
ruleId: 'persistence/migration-history',
|
|
42
|
+
name: 'two knex migrations numbered by the same index on two branches',
|
|
43
|
+
expect: { file: 'migrations/0002_add-payments.js' },
|
|
44
|
+
files: knex(['0001_initial', '0002_add-invoices', '0002_add-payments']),
|
|
45
|
+
},
|
|
46
|
+
];
|
|
47
|
+
/** A drizzle-kit project with three migrations; `payments` names the snapshot the third one was generated from. */
|
|
48
|
+
function drizzle(payments, order = [INITIAL, INVOICES, PAYMENTS]) {
|
|
49
|
+
return project({
|
|
50
|
+
[`migrations/${INITIAL}.sql`]: 'CREATE TABLE "accounts" ("id" text PRIMARY KEY);\n',
|
|
51
|
+
[`migrations/${INVOICES}.sql`]: 'CREATE TABLE "invoices" ("id" text PRIMARY KEY);\n',
|
|
52
|
+
[`migrations/${PAYMENTS}.sql`]: 'CREATE TABLE "payments" ("id" text PRIMARY KEY);\n',
|
|
53
|
+
'migrations/meta/20261010120000_snapshot.json': snapshot('a', ORIGIN),
|
|
54
|
+
'migrations/meta/20261011120000_snapshot.json': snapshot('b', 'a'),
|
|
55
|
+
'migrations/meta/20261012120000_snapshot.json': snapshot('c', payments),
|
|
56
|
+
[JOURNAL]: journal(order.map((tag) => [tag, Number(tag.slice(0, 14))])),
|
|
57
|
+
}, { [CONFIG_FILE]: config({ stack: { orm: 'drizzle' } }) });
|
|
58
|
+
}
|
|
59
|
+
function snapshot(id, prevId) {
|
|
60
|
+
return JSON.stringify({ id, prevId, version: '7', dialect: 'postgresql', tables: {} }, null, 2);
|
|
61
|
+
}
|
|
62
|
+
function journal(tags) {
|
|
63
|
+
const entries = tags.map(([tag, when], idx) => ({ idx, version: '7', when, tag, breakpoints: true }));
|
|
64
|
+
return JSON.stringify({ version: '7', dialect: 'postgresql', entries }, null, 2);
|
|
65
|
+
}
|
|
66
|
+
function knex(names) {
|
|
67
|
+
const migration = 'export const up = async () => {};\n\nexport const down = async () => {};\n';
|
|
68
|
+
return project(Object.fromEntries(names.map((name) => [`migrations/${name}.js`, migration])), {
|
|
69
|
+
[CONFIG_FILE]: config({ stack: { orm: 'knex' } }),
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=persistence-fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persistence-fixtures.js","sourceRoot":"","sources":["../../../src/check/fixtures/persistence-fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,OAAO,GAAG,+BAA+B,CAAC;AAChD,MAAM,OAAO,GAAG,wBAAwB,CAAC;AACzC,MAAM,QAAQ,GAAG,6BAA6B,CAAC;AAC/C,MAAM,QAAQ,GAAG,6BAA6B,CAAC;AAC/C,MAAM,MAAM,GAAG,sCAAsC,CAAC;AAEtD,MAAM,CAAC,MAAM,oBAAoB,GAAuB;IACtD;QACE,MAAM,EAAE,+BAA+B;QACvC,IAAI,EAAE,8EAA8E;QACpF,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC;KACpB;IACD;QACE,MAAM,EAAE,+BAA+B;QACvC,IAAI,EAAE,yEAAyE;QAC/E,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;QACzB,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC;KACpB;IACD;QACE,MAAM,EAAE,+BAA+B;QACvC,IAAI,EAAE,4EAA4E;QAClF,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;QACzB,KAAK,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;KACnD;IACD;QACE,MAAM,EAAE,+BAA+B;QACvC,IAAI,EAAE,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E,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,EAAE,CACzD,CAAC;AACJ,CAAC;AAED,SAAS,QAAQ,CAAC,EAAU,EAAE,MAAc;IAC1C,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAClG,CAAC;AAED,SAAS,OAAO,CAAC,IAAuD;IACtE,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAEtG,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACnF,CAAC;AAED,SAAS,IAAI,CAAC,KAAwB;IACpC,MAAM,SAAS,GAAG,4EAA4E,CAAC;IAE/F,OAAO,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,cAAc,IAAI,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE;QAC5F,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC;KAClD,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Finding } from '../model/finding.js';
|
|
2
|
+
import type { DrizzleMigrations } from './drizzle-migrations.js';
|
|
3
|
+
/**
|
|
4
|
+
* What makes drizzle-kit and its migrator misbehave after a merge: an entry without its file or
|
|
5
|
+
* the reverse, entries out of the order they were generated in (the migrator skips a migration
|
|
6
|
+
* older than the last one a database applied), and two snapshots generated from the same one.
|
|
7
|
+
*/
|
|
8
|
+
export declare function drizzleHistoryFindings(migrations: DrizzleMigrations): Finding[];
|
|
9
|
+
//# sourceMappingURL=drizzle-history-findings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drizzle-history-findings.d.ts","sourceRoot":"","sources":["../../../src/check/migrations/drizzle-history-findings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,KAAK,EAAE,iBAAiB,EAAgB,MAAM,yBAAyB,CAAC;AAK/E;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,iBAAiB,GAAG,OAAO,EAAE,CAE/E"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { lineOf } from '../support/line-of.js';
|
|
2
|
+
const REGENERATE = 'Keep the migrations of the main branch, delete the one of your branch (its .sql file, its snapshot under meta/ and its entry of meta/_journal.json), then run `npm run db:generate <name>` again on top of them.';
|
|
3
|
+
/**
|
|
4
|
+
* What makes drizzle-kit and its migrator misbehave after a merge: an entry without its file or
|
|
5
|
+
* the reverse, entries out of the order they were generated in (the migrator skips a migration
|
|
6
|
+
* older than the last one a database applied), and two snapshots generated from the same one.
|
|
7
|
+
*/
|
|
8
|
+
export function drizzleHistoryFindings(migrations) {
|
|
9
|
+
return [...unmatched(migrations), ...outOfOrder(migrations), ...forked(migrations)];
|
|
10
|
+
}
|
|
11
|
+
function unmatched({ entries, files, folder, journalText }) {
|
|
12
|
+
const tags = entries.map((entry) => entry.tag);
|
|
13
|
+
const missingFiles = entries
|
|
14
|
+
.filter((entry) => !files.includes(entry.tag))
|
|
15
|
+
.map((entry) => ({
|
|
16
|
+
line: lineOf(journalText, `"${entry.tag}"`),
|
|
17
|
+
message: `The journal lists the migration "${entry.tag}" but ${folder}/${entry.tag}.sql does not exist.`,
|
|
18
|
+
fix: `Restore ${folder}/${entry.tag}.sql, or remove its entry from the journal if the migration was never applied anywhere.`,
|
|
19
|
+
}));
|
|
20
|
+
const missingEntries = files
|
|
21
|
+
.filter((file) => !tags.includes(file))
|
|
22
|
+
.map((file) => ({
|
|
23
|
+
line: 1,
|
|
24
|
+
message: `${folder}/${file}.sql is not in the journal: drizzle-kit migrate never applies it.`,
|
|
25
|
+
fix: `Generate a migration with \`npm run db:generate <name>\`, never by hand. After a merge: ${REGENERATE}`,
|
|
26
|
+
}));
|
|
27
|
+
return [...missingFiles, ...missingEntries];
|
|
28
|
+
}
|
|
29
|
+
function outOfOrder({ entries, journalText }) {
|
|
30
|
+
return entries.flatMap((entry, index) => {
|
|
31
|
+
const previous = entries[index - 1];
|
|
32
|
+
if (entry.idx === index && (previous === undefined || previous.when < entry.when)) {
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
return [
|
|
36
|
+
{
|
|
37
|
+
line: lineOf(journalText, `"${entry.tag}"`),
|
|
38
|
+
message: `The journal entry "${entry.tag}" is out of order (${disorder(entry, index, previous)}): a database that applied a later migration skips it without a word.`,
|
|
39
|
+
fix: `Two branches each added a migration. ${REGENERATE}`,
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function disorder(entry, index, previous) {
|
|
45
|
+
return entry.idx !== index || previous === undefined
|
|
46
|
+
? `idx ${entry.idx} at position ${index}`
|
|
47
|
+
: `generated before "${previous.tag}", which it follows`;
|
|
48
|
+
}
|
|
49
|
+
function forked({ entries, snapshots, journalText }) {
|
|
50
|
+
return entries.flatMap((entry, index) => {
|
|
51
|
+
const previous = entries[index - 1];
|
|
52
|
+
const link = snapshots.get(prefixOf(entry));
|
|
53
|
+
const parent = previous === undefined ? undefined : snapshots.get(prefixOf(previous));
|
|
54
|
+
if (previous === undefined || link === undefined || parent === undefined || link.prevId === parent.id) {
|
|
55
|
+
return [];
|
|
56
|
+
}
|
|
57
|
+
return [
|
|
58
|
+
{
|
|
59
|
+
line: lineOf(journalText, `"${entry.tag}"`),
|
|
60
|
+
message: `The snapshot of "${entry.tag}" was not generated from the one of "${previous.tag}": two branches generated a migration from the same schema, and the next \`db:generate\` would miss one of them.`,
|
|
61
|
+
fix: REGENERATE,
|
|
62
|
+
},
|
|
63
|
+
];
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
function prefixOf(entry) {
|
|
67
|
+
const at = entry.tag.indexOf('_');
|
|
68
|
+
return at === -1 ? entry.tag : entry.tag.slice(0, at);
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=drizzle-history-findings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drizzle-history-findings.js","sourceRoot":"","sources":["../../../src/check/migrations/drizzle-history-findings.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAG/C,MAAM,UAAU,GACd,kNAAkN,CAAC;AAErN;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,UAA6B;IAClE,OAAO,CAAC,GAAG,SAAS,CAAC,UAAU,CAAC,EAAE,GAAG,UAAU,CAAC,UAAU,CAAC,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;AACtF,CAAC;AAED,SAAS,SAAS,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAqB;IAC3E,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAE/C,MAAM,YAAY,GAAG,OAAO;SACzB,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;SAC7C,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,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SAAS,QAAQ,CAAC,KAAmB;IACnC,MAAM,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAElC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** One entry of `meta/_journal.json`, as drizzle-kit writes it. */
|
|
2
|
+
export interface JournalEntry {
|
|
3
|
+
readonly idx: number;
|
|
4
|
+
readonly when: number;
|
|
5
|
+
readonly tag: string;
|
|
6
|
+
}
|
|
7
|
+
/** The ids drizzle-kit gives a snapshot and the snapshot it was generated from. */
|
|
8
|
+
export interface SnapshotLink {
|
|
9
|
+
readonly id: string;
|
|
10
|
+
readonly prevId: string;
|
|
11
|
+
}
|
|
12
|
+
/** The migrations folder of a drizzle-kit project, as read from the disk. */
|
|
13
|
+
export interface DrizzleMigrations {
|
|
14
|
+
/** Relative to the project root, POSIX separators. */
|
|
15
|
+
readonly folder: string;
|
|
16
|
+
readonly journalText: string;
|
|
17
|
+
readonly entries: readonly JournalEntry[];
|
|
18
|
+
/** The tags of the `.sql` files of the folder. */
|
|
19
|
+
readonly files: readonly string[];
|
|
20
|
+
/** By the prefix of a tag (what precedes its first `_`). */
|
|
21
|
+
readonly snapshots: ReadonlyMap<string, SnapshotLink>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=drizzle-migrations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drizzle-migrations.d.ts","sourceRoot":"","sources":["../../../src/check/migrations/drizzle-migrations.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,mFAAmF;AACnF,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,6EAA6E;AAC7E,MAAM,WAAW,iBAAiB;IAChC,sDAAsD;IACtD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;IAC1C,kDAAkD;IAClD,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,4DAA4D;IAC5D,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;CACvD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drizzle-migrations.js","sourceRoot":"","sources":["../../../src/check/migrations/drizzle-migrations.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drizzle-out-folder.d.ts","sourceRoot":"","sources":["../../../src/check/migrations/drizzle-out-folder.ts"],"names":[],"mappings":"AAKA,6HAA6H;AAC7H,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKrD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
const CONFIG_FILES = ['drizzle.config.ts', 'drizzle.config.js', 'drizzle.config.mjs'];
|
|
4
|
+
/** The `out` folder a drizzle config writes, when it is a string literal; `migrations`, the one `init` writes, otherwise. */
|
|
5
|
+
export function drizzleOutFolder(root) {
|
|
6
|
+
const text = CONFIG_FILES.map((file) => readIfPresent(path.join(root, file))).find((read) => read !== undefined);
|
|
7
|
+
const written = text === undefined ? undefined : /\bout\s*:\s*['"`]([^'"`]+)['"`]/.exec(text)?.[1];
|
|
8
|
+
return path.posix.normalize(written ?? 'migrations').replace(/\/$/, '');
|
|
9
|
+
}
|
|
10
|
+
function readIfPresent(file) {
|
|
11
|
+
try {
|
|
12
|
+
return fs.readFileSync(file, 'utf8');
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=drizzle-out-folder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drizzle-out-folder.js","sourceRoot":"","sources":["../../../src/check/migrations/drizzle-out-folder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,YAAY,GAAG,CAAC,mBAAmB,EAAE,mBAAmB,EAAE,oBAAoB,CAAC,CAAC;AAEtF,6HAA6H;AAC7H,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,MAAM,IAAI,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC;IACjH,MAAM,OAAO,GAAG,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,iCAAiC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAEnG,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,IAAI,YAAY,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAC1E,CAAC;AAED,SAAS,aAAa,CAAC,IAAY;IACjC,IAAI,CAAC;QACH,OAAO,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACvC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** One migration: the name that orders it, without extension, and the file that holds it, from the project root. */
|
|
2
|
+
export interface Migration {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly file: string;
|
|
5
|
+
}
|
|
6
|
+
/** The migrations a project keeps in one folder. */
|
|
7
|
+
export interface MigrationFolder {
|
|
8
|
+
/** Relative to the project root, POSIX separators. */
|
|
9
|
+
readonly folder: string;
|
|
10
|
+
/** In the order the migration tool applies them: by name. */
|
|
11
|
+
readonly migrations: readonly Migration[];
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=migration-folder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migration-folder.d.ts","sourceRoot":"","sources":["../../../src/check/migrations/migration-folder.ts"],"names":[],"mappings":"AAAA,oHAAoH;AACpH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,oDAAoD;AACpD,MAAM,WAAW,eAAe;IAC9B,sDAAsD;IACtD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,6DAA6D;IAC7D,QAAQ,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,CAAC;CAC3C"}
|