ddd-ts-kit 0.107.0 → 0.108.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/CHANGELOG.md +16 -0
- package/dist/init/manifest/versions.js +24 -24
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -5
- package/templates/init/docker/env.example.tpl +4 -0
- package/templates/init/platform/auth/authorization/permissions.ts.tpl +4 -2
- package/templates/init/platform/config/load-config.ts.tpl +28 -4
- package/templates/pipeline/package-scripts.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,22 @@ What each version changes for someone who uses the kit. The packages of `package
|
|
|
4
4
|
together, under one version; the notes of each [GitHub release](https://github.com/gbourgeat/ddd-ts-kit/releases)
|
|
5
5
|
list the pull requests behind it.
|
|
6
6
|
|
|
7
|
+
## 0.108.0
|
|
8
|
+
|
|
9
|
+
**The registry of permissions of a fresh project is laid out as the formatter keeps it, with no context and no audit set.** `src/platform/auth/authorization/permissions.ts` wrote `PermissionRegistry.of(` holding only the comments of its region, which Biome lays out otherwise, so `format:check` and `verify` failed on the first run of `init --authz rebac --authn none --orm none`. The sets now sit in a `permissionSets` array declared above the call, which `generate context` and `generate command --permission` fill as before, and `PermissionRegistry.of(...permissionSets)` takes them. The end-to-end check of a fresh project formats the stack with no ORM and no context.
|
|
10
|
+
|
|
11
|
+
To move: run `ddd-ts-kit init --force` to receive the new form; a registry already formatted by hand keeps working as it is.
|
|
12
|
+
|
|
13
|
+
**Under VS Code the guard reads a tool that only reads as no write.** The hooks of VS Code have no matcher, so the write hooks also run on its readers: `read_file`, `view_image`, `list_dir`, `file_search`, `grep_search`, `semantic_search`, `search_workspace_symbols`, `get_errors`, `get_changed_files`, `read_project_structure`, `copilot_getNotebookSummary`, `read_notebook_cell_output`, `test_search`, `fetch_webpage`, `github_repo`, `github_text_search`, `get_vscode_api`, `search_subagent`, `explore_subagent`, `resolve_memory_file_uri` and `memory` when it views now write nothing, whatever field names a file, so a worker that lists a folder outside its context is no longer refused. A tool the guard does not name is judged as before, a `path` as a write. Why a list of readers and not of writers: [ADR-0007](docs/adr/0007-the-guard-names-the-readers-of-vs-code.md).
|
|
14
|
+
|
|
15
|
+
**Under the regulated profile the guard of the plugin runs git only in the repository of the session root.** The session root is the folder Claude Code started the session in (`CLAUDE_PROJECT_DIR`), or else the working directory the host sends, and its repository is the one `git rev-parse --show-toplevel` finds from there, its worktrees under `.worktrees/` included. A nested repository, a submodule and a worktree of another repository are not read, at any hook: the session start and the stop say so of a project there, and the guard counts no uncommitted change nor reads a branch in it. In the repository of the root, `git status` and `git diff` leave the submodules out. Every git the guard runs, those of the runs of a context-builder included, keeps `core.fsmonitor` and `core.hooksPath` off. Under the default profile nothing changes. Why, and what git cannot switch off: [ADR-0006](docs/adr/0006-the-regulated-guard-runs-git-in-its-root-only.md).
|
|
16
|
+
|
|
17
|
+
**`@ddd-ts-kit/opensearch` keeps the read model of a projection in OpenSearch, with each tenant apart.** `OpenSearchReadModelStore` implements the `ReadModelStore` port of the kernel: the criteria of a read become the query DSL (every operator, group, sort, offset and cursor page), a write is applied only if its event is newer and only on the document it read (`if_seq_no`), and a deleted row keeps its stamp. Under `tenancy: { strategy: 'index' }` each tenant has an index of its own; under `{ strategy: 'attribute' }` one index is shared and each tenant is read and written through an alias filtered on its tenant field and routed by it, so that OpenSearch itself keeps a tenant to its documents. A search under `acrossTenants` reads every tenant or the tenants it names; a get and a write reach the tenant of the work only. The platform creates the indices with `provision(tenant)` or `ensureMapping()`: a write never creates one. The package speaks the REST API through `fetchTransport`, or any `OpenSearchTransport`, with no client library. It is not on npm yet, and `init` does not wire it: its README shows the composition by hand, and [the decision record](docs/adr/0008-a-read-model-store-on-opensearch.md) says what each choice is and what reverses it. `@ddd-ts-kit/testing` gains `readModelRowsContract`, the rows half of `readModelStoreContract`, for a store that has no rebuild yet.
|
|
18
|
+
|
|
19
|
+
**A project on ReBAC refuses to start without `NODE_ENV` while its relation tuples live in memory.** `createTupleStore` refuses production, but an unset `NODE_ENV` read as development, so `node dist/main.js` started with no `NODE_ENV` ran on the in-memory store, where a revocation reaches one instance and a restart forgets every grant. Under `--authz rebac`, `loadConfig` now reports `NODE_ENV must be set`, as it does for the development header under `--authn none`. `.env` holds `NODE_ENV=development`, the Dockerfile sets `production` and the test runners set `test`, so only a start with no `NODE_ENV` changes. Once `createTupleStore` binds a store that persists, the comment of the check says to drop it. The choice is in `docs/adr/0003-the-in-memory-tuple-store-refuses-production.md`.
|
|
20
|
+
|
|
21
|
+
To move: run `ddd-ts-kit init --force` to receive the check, and set `NODE_ENV` wherever the application starts.
|
|
22
|
+
|
|
7
23
|
## 0.107.0
|
|
8
24
|
|
|
9
25
|
**The table of `generate` kinds in the README of the CLI lists every kind and its flags.** The rows of `module`, `property` and `acceptance` were missing, and so were the flags `--module` (on the 33 kinds that write into a module of the model), `--name` of `integration-handler` and `event-handler`, `--version` of `integration-handler`, `--global` of `job`, `--number` of `adr` and `--reason` of `context`. A spec holds the table, in English and in French, against `generate --help --json`.
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
/** Ranges written to the generated package.json; bumped together with the kit. */
|
|
2
2
|
export const VERSIONS = {
|
|
3
|
-
'@ddd-ts-kit/kernel': '^0.
|
|
4
|
-
'@ddd-ts-kit/validation': '^0.
|
|
5
|
-
'@ddd-ts-kit/http': '^0.
|
|
6
|
-
'@ddd-ts-kit/tracing': '^0.
|
|
7
|
-
'@ddd-ts-kit/di': '^0.
|
|
8
|
-
'@ddd-ts-kit/events': '^0.
|
|
9
|
-
'@ddd-ts-kit/testing': '^0.
|
|
10
|
-
'@ddd-ts-kit/drizzle': '^0.
|
|
11
|
-
'@ddd-ts-kit/knex': '^0.
|
|
12
|
-
'@ddd-ts-kit/prisma': '^0.
|
|
13
|
-
'@ddd-ts-kit/typeorm': '^0.
|
|
14
|
-
'@ddd-ts-kit/auth': '^0.
|
|
15
|
-
'@ddd-ts-kit/rabbitmq': '^0.
|
|
16
|
-
'@ddd-ts-kit/aspects': '^0.
|
|
17
|
-
'@ddd-ts-kit/audit': '^0.
|
|
18
|
-
'@ddd-ts-kit/redis': '^0.
|
|
19
|
-
'@ddd-ts-kit/kafka': '^0.
|
|
20
|
-
'@ddd-ts-kit/nats': '^0.
|
|
21
|
-
'@ddd-ts-kit/scheduling': '^0.
|
|
22
|
-
'@ddd-ts-kit/sentry': '^0.
|
|
23
|
-
'@ddd-ts-kit/s3': '^0.
|
|
3
|
+
'@ddd-ts-kit/kernel': '^0.108.0',
|
|
4
|
+
'@ddd-ts-kit/validation': '^0.108.0',
|
|
5
|
+
'@ddd-ts-kit/http': '^0.108.0',
|
|
6
|
+
'@ddd-ts-kit/tracing': '^0.108.0',
|
|
7
|
+
'@ddd-ts-kit/di': '^0.108.0',
|
|
8
|
+
'@ddd-ts-kit/events': '^0.108.0',
|
|
9
|
+
'@ddd-ts-kit/testing': '^0.108.0',
|
|
10
|
+
'@ddd-ts-kit/drizzle': '^0.108.0',
|
|
11
|
+
'@ddd-ts-kit/knex': '^0.108.0',
|
|
12
|
+
'@ddd-ts-kit/prisma': '^0.108.0',
|
|
13
|
+
'@ddd-ts-kit/typeorm': '^0.108.0',
|
|
14
|
+
'@ddd-ts-kit/auth': '^0.108.0',
|
|
15
|
+
'@ddd-ts-kit/rabbitmq': '^0.108.0',
|
|
16
|
+
'@ddd-ts-kit/aspects': '^0.108.0',
|
|
17
|
+
'@ddd-ts-kit/audit': '^0.108.0',
|
|
18
|
+
'@ddd-ts-kit/redis': '^0.108.0',
|
|
19
|
+
'@ddd-ts-kit/kafka': '^0.108.0',
|
|
20
|
+
'@ddd-ts-kit/nats': '^0.108.0',
|
|
21
|
+
'@ddd-ts-kit/scheduling': '^0.108.0',
|
|
22
|
+
'@ddd-ts-kit/sentry': '^0.108.0',
|
|
23
|
+
'@ddd-ts-kit/s3': '^0.108.0',
|
|
24
24
|
'@aws-sdk/client-s3': '^3.1150.0',
|
|
25
25
|
'@aws-sdk/lib-storage': '^3.1150.0',
|
|
26
26
|
'@aws-sdk/s3-request-presigner': '^3.1150.0',
|
|
27
27
|
busboy: '^1.6.0',
|
|
28
28
|
'@sentry/node': '^11.6.0',
|
|
29
|
-
'@ddd-ts-kit/pino': '^0.
|
|
29
|
+
'@ddd-ts-kit/pino': '^0.108.0',
|
|
30
30
|
pino: '^10.4.0',
|
|
31
31
|
'pino-pretty': '^13.2.0',
|
|
32
|
-
'@ddd-ts-kit/winston': '^0.
|
|
32
|
+
'@ddd-ts-kit/winston': '^0.108.0',
|
|
33
33
|
winston: '^3.19.0',
|
|
34
34
|
'@confluentinc/kafka-javascript': '^1.11.0',
|
|
35
35
|
'@nats-io/jetstream': '^3.4.0',
|
|
@@ -40,7 +40,7 @@ export const VERSIONS = {
|
|
|
40
40
|
'passport-jwt': '^4.0.1',
|
|
41
41
|
'@types/passport-jwt': '^4.0.1',
|
|
42
42
|
amqplib: '^2.2.0',
|
|
43
|
-
'ddd-ts-kit': '^0.
|
|
43
|
+
'ddd-ts-kit': '^0.108.0',
|
|
44
44
|
tsx: '^4.23.15',
|
|
45
45
|
vitest: '^5.0.3',
|
|
46
46
|
'fast-check': '^4.10.2',
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.108.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.108.0';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ddd-ts-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.108.0",
|
|
4
4
|
"description": "Bootstrap, scaffold and verify Domain-Driven Design (DDD), Clean Architecture and hexagonal TypeScript backends on Node.js: project and code generators, architecture checks, OpenAPI and AsyncAPI documents, for developers and AI coding agents (Claude Code, Codex, GitHub Copilot).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ddd",
|
|
@@ -55,10 +55,10 @@
|
|
|
55
55
|
"clean:packages": "node dist/bin.js check --clean-only ../kernel/src ../validation/src ../http/src ../tracing/src ../di/src ../events/src ../testing/src ../s3/src ../drizzle/src ../knex/src ../prisma/src ../typeorm/src ../aspects/src ../rabbitmq/src ../auth/src ../audit/src ../redis/src ../scheduling/src ../pino/src ../winston/src ../sentry/src ../kafka/src ../nats/src ../eslint-plugin/src"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@ddd-ts-kit/audit": "^0.
|
|
59
|
-
"@ddd-ts-kit/auth": "^0.
|
|
60
|
-
"@ddd-ts-kit/events": "^0.
|
|
61
|
-
"@ddd-ts-kit/kernel": "^0.
|
|
58
|
+
"@ddd-ts-kit/audit": "^0.108.0",
|
|
59
|
+
"@ddd-ts-kit/auth": "^0.108.0",
|
|
60
|
+
"@ddd-ts-kit/events": "^0.108.0",
|
|
61
|
+
"@ddd-ts-kit/kernel": "^0.108.0",
|
|
62
62
|
"@types/pg": "^8.23.1",
|
|
63
63
|
"pg": "^8.23.1"
|
|
64
64
|
}
|
|
@@ -153,6 +153,10 @@ KEYCLOAK_AUDIENCE={{project.name}}-api
|
|
|
153
153
|
|
|
154
154
|
# Authentication is the development header (x-development-actor: <id>;roles=<a>,<b>): the application starts with NODE_ENV=development or test only, never without it.
|
|
155
155
|
{{/if}}
|
|
156
|
+
{{#if authz.rebac}}
|
|
157
|
+
|
|
158
|
+
# The relation tuples live in memory until createTupleStore binds a store that persists: the application refuses to start without NODE_ENV, and with the in-memory store in production.
|
|
159
|
+
{{/if}}
|
|
156
160
|
{{#if errors.sentry}}
|
|
157
161
|
|
|
158
162
|
# Unexpected failures go to a Sentry or a GlitchTip project (same protocol, only the DSN differs). Without SENTRY_DSN the
|
|
@@ -6,10 +6,12 @@ import { auditPermissions } from '{{alias.platform}}/audit/audit.permissions{{al
|
|
|
6
6
|
// /ddd-ts-kit:imports
|
|
7
7
|
|
|
8
8
|
/** Every permission of every context{{#if audit.route}}, and the one of the audit trail{{/if}}: the authorization model is laid out over it. */
|
|
9
|
-
|
|
9
|
+
const permissionSets = [
|
|
10
10
|
{{#if audit.route}}
|
|
11
11
|
auditPermissions,
|
|
12
12
|
{{/if}}
|
|
13
13
|
// ddd-ts-kit:permission-sets
|
|
14
14
|
// /ddd-ts-kit:permission-sets
|
|
15
|
-
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
export const permissions = PermissionRegistry.of(...permissionSets);
|
|
@@ -47,10 +47,11 @@ export function loadConfig(variables: Variables): AppConfig {
|
|
|
47
47
|
const environment = env.oneOf('NODE_ENV', environments, 'development');
|
|
48
48
|
{{#if authn.none}}
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
requireEnvironmentForTheDevelopmentHeader(env);
|
|
51
|
+
{{/if}}
|
|
52
|
+
{{#if authz.rebac}}
|
|
53
|
+
|
|
54
|
+
requireEnvironmentForTheTupleStore(env);
|
|
54
55
|
{{/if}}
|
|
55
56
|
|
|
56
57
|
const config: AppConfig = {
|
|
@@ -126,6 +127,29 @@ export function loadConfig(variables: Variables): AppConfig {
|
|
|
126
127
|
return config;
|
|
127
128
|
}
|
|
128
129
|
|
|
130
|
+
{{#if authn.none}}
|
|
131
|
+
/** The development header is believed where NODE_ENV says so, never by default. */
|
|
132
|
+
function requireEnvironmentForTheDevelopmentHeader(env: Environment): void {
|
|
133
|
+
if (env.optional('NODE_ENV') === undefined) {
|
|
134
|
+
env.problem('NODE_ENV must be development or test: the development header is believed there only');
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
{{/if}}
|
|
139
|
+
{{#if authz.rebac}}
|
|
140
|
+
/**
|
|
141
|
+
* The in-memory tuple store of createTupleStore runs where NODE_ENV says so, never by default:
|
|
142
|
+
* drop this check once createTupleStore binds a store that persists.
|
|
143
|
+
*/
|
|
144
|
+
function requireEnvironmentForTheTupleStore(env: Environment): void {
|
|
145
|
+
if (env.optional('NODE_ENV') === undefined) {
|
|
146
|
+
env.problem(
|
|
147
|
+
'NODE_ENV must be set: the in-memory relation tuple store of createTupleStore runs in development and test only, and an unset NODE_ENV says neither',
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
{{/if}}
|
|
129
153
|
{{#if housekeeping.any}}
|
|
130
154
|
/** How long the platform keeps what it is done with, in days; past that, the nightly purges drop it. */
|
|
131
155
|
function readHousekeeping(env: Environment): Housekeeping {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@biomejs/biome": "2.6.3",
|
|
24
24
|
"@commitlint/cli": "^21.2.3",
|
|
25
25
|
"@commitlint/config-conventional": "^21.2.3",
|
|
26
|
-
"@ddd-ts-kit/eslint-plugin": "^0.
|
|
26
|
+
"@ddd-ts-kit/eslint-plugin": "^0.108.0",
|
|
27
27
|
"@eslint/js": "^10.0.1",
|
|
28
28
|
"@typescript/native": "npm:typescript@~7.0.2",
|
|
29
29
|
"@vitest/coverage-v8": "^5.0.3",
|