ddd-ts-kit 0.92.0 → 0.93.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.
Files changed (110) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.fr.md +12 -7
  3. package/README.md +9 -5
  4. package/dist/acceptance/check-locked-files.d.ts +25 -0
  5. package/dist/acceptance/check-locked-files.d.ts.map +1 -0
  6. package/dist/acceptance/check-locked-files.js +84 -0
  7. package/dist/acceptance/check-locked-files.js.map +1 -0
  8. package/dist/acceptance/scenarios-in.d.ts +4 -0
  9. package/dist/acceptance/scenarios-in.d.ts.map +1 -1
  10. package/dist/acceptance/scenarios-in.js +2 -2
  11. package/dist/acceptance/scenarios-in.js.map +1 -1
  12. package/dist/commands/acceptance.d.ts.map +1 -1
  13. package/dist/commands/acceptance.js +14 -0
  14. package/dist/commands/acceptance.js.map +1 -1
  15. package/dist/commands/generate.js +2 -0
  16. package/dist/commands/generate.js.map +1 -1
  17. package/dist/commit/run-git.d.ts +5 -1
  18. package/dist/commit/run-git.d.ts.map +1 -1
  19. package/dist/commit/run-git.js +19 -2
  20. package/dist/commit/run-git.js.map +1 -1
  21. package/dist/controllers/finish-migration.js +4 -2
  22. package/dist/controllers/finish-migration.js.map +1 -1
  23. package/dist/docs/behaviour-page.d.ts.map +1 -1
  24. package/dist/docs/behaviour-page.js +9 -1
  25. package/dist/docs/behaviour-page.js.map +1 -1
  26. package/dist/generate/kind.d.ts +2 -0
  27. package/dist/generate/kind.d.ts.map +1 -1
  28. package/dist/generate/kinds/job/job-vars.d.ts +4 -1
  29. package/dist/generate/kinds/job/job-vars.d.ts.map +1 -1
  30. package/dist/generate/kinds/job/job-vars.js +11 -1
  31. package/dist/generate/kinds/job/job-vars.js.map +1 -1
  32. package/dist/generate/kinds/job-kind.js +20 -3
  33. package/dist/generate/kinds/job-kind.js.map +1 -1
  34. package/dist/generate/kinds/service-kind.d.ts.map +1 -1
  35. package/dist/generate/kinds/service-kind.js +30 -3
  36. package/dist/generate/kinds/service-kind.js.map +1 -1
  37. package/dist/init/files/inert-persistence-file.d.ts +5 -0
  38. package/dist/init/files/inert-persistence-file.d.ts.map +1 -0
  39. package/dist/init/files/inert-persistence-file.js +16 -0
  40. package/dist/init/files/inert-persistence-file.js.map +1 -0
  41. package/dist/init/files/platform-files.js +6 -1
  42. package/dist/init/files/platform-files.js.map +1 -1
  43. package/dist/init/manifest/versions.js +24 -24
  44. package/dist/measures/branch-commits.d.ts +4 -2
  45. package/dist/measures/branch-commits.d.ts.map +1 -1
  46. package/dist/measures/branch-commits.js +32 -8
  47. package/dist/measures/branch-commits.js.map +1 -1
  48. package/dist/measures/timeline-of.d.ts +3 -2
  49. package/dist/measures/timeline-of.d.ts.map +1 -1
  50. package/dist/measures/timeline-of.js +37 -8
  51. package/dist/measures/timeline-of.js.map +1 -1
  52. package/dist/platform-layout/platform-layout.d.ts +2 -0
  53. package/dist/platform-layout/platform-layout.d.ts.map +1 -1
  54. package/dist/platform-layout/platform-layout.js +2 -0
  55. package/dist/platform-layout/platform-layout.js.map +1 -1
  56. package/dist/presets/no-flags.d.ts.map +1 -1
  57. package/dist/presets/no-flags.js +1 -0
  58. package/dist/presets/no-flags.js.map +1 -1
  59. package/dist/progress/build-next-of.d.ts +9 -0
  60. package/dist/progress/build-next-of.d.ts.map +1 -0
  61. package/dist/progress/build-next-of.js +22 -0
  62. package/dist/progress/build-next-of.js.map +1 -0
  63. package/dist/progress/format-progress.d.ts.map +1 -1
  64. package/dist/progress/format-progress.js +3 -0
  65. package/dist/progress/format-progress.js.map +1 -1
  66. package/dist/progress/progress.d.ts +3 -1
  67. package/dist/progress/progress.d.ts.map +1 -1
  68. package/dist/progress/read-progress.d.ts.map +1 -1
  69. package/dist/progress/read-progress.js +7 -2
  70. package/dist/progress/read-progress.js.map +1 -1
  71. package/dist/version.d.ts +1 -1
  72. package/dist/version.js +1 -1
  73. package/package.json +4 -4
  74. package/templates/architecture/extractable.declared.spec.ts.tpl +2 -2
  75. package/templates/architecture/extractable.manual.spec.ts.tpl +2 -2
  76. package/templates/architecture/extractable.tsyringe.spec.ts.tpl +2 -2
  77. package/templates/architecture/hosting.declared.spec.ts.tpl +69 -0
  78. package/templates/architecture/hosting.manual.spec.ts.tpl +57 -0
  79. package/templates/architecture/hosting.tsyringe.spec.ts.tpl +69 -0
  80. package/templates/init/docker/env.example.tpl +8 -0
  81. package/templates/init/gitignore.tpl +3 -0
  82. package/templates/init/main.ts.tpl +27 -20
  83. package/templates/init/platform/audit/audit.module.tsyringe.ts.tpl +11 -3
  84. package/templates/init/platform/composition/compose-application.manual.ts.tpl +25 -4
  85. package/templates/init/platform/composition/compose-application.tsyringe.ts.tpl +47 -65
  86. package/templates/init/platform/composition/context-selection.tsyringe.ts.tpl +17 -0
  87. package/templates/init/platform/composition/lay-foundations.manual.ts.tpl +15 -0
  88. package/templates/init/platform/composition/platform-options.manual.ts.tpl +9 -0
  89. package/templates/init/platform/composition/routes-of.tsyringe.ts.tpl +51 -0
  90. package/templates/init/platform/config/app-config.ts.tpl +7 -0
  91. package/templates/init/platform/config/load-config.ts.tpl +25 -0
  92. package/templates/init/platform/files/files.module.tsyringe.ts.tpl +6 -2
  93. package/templates/init/platform/jobs/job-settings.ts.tpl +13 -3
  94. package/templates/init/platform/privacy/privacy.module.tsyringe.ts.tpl +9 -6
  95. package/templates/init/platform/redis/open-redis.ts.tpl +13 -8
  96. package/templates/job/job.declared.ts.tpl +1 -1
  97. package/templates/job/job.spec.buses.ts.tpl +3 -0
  98. package/templates/job/job.spec.tsyringe.ts.tpl +29 -1
  99. package/templates/job/wiring.manual.tpl +3 -0
  100. package/templates/job/wiring.tsyringe.tpl +1 -1
  101. package/templates/pipeline/biome.json.tpl +7 -0
  102. package/templates/pipeline/knip.json.tpl +1 -0
  103. package/templates/pipeline/package-scripts.json +1 -1
  104. package/templates/service/compose.tpl +1 -1
  105. package/templates/service/extracted-name.tpl +2 -0
  106. package/templates/service/extracted.declared.tpl +6 -0
  107. package/templates/service/extracted.manual.tpl +2 -0
  108. package/templates/service/extracted.tsyringe.tpl +6 -0
  109. package/templates/service/main.ts.tpl +5 -1
  110. package/templates/worker/main.ts.tpl +20 -13
@@ -1,5 +1,10 @@
1
1
  {
2
2
  "$schema": "https://biomejs.dev/schemas/2.6.2/schema.json",
3
+ "vcs": {
4
+ "enabled": true,
5
+ "clientKind": "git",
6
+ "useIgnoreFile": true
7
+ },
3
8
  "files": {
4
9
  "includes": [
5
10
  "**/*.ts",
@@ -14,6 +19,8 @@
14
19
  "!**/coverage",
15
20
  "!**/reports",
16
21
  "!.worktrees",
22
+ "!**/.claude",
23
+ "!.mcp.json",
17
24
  "!**/.ddd-ts-kit",
18
25
  "!**/generated",
19
26
  "!**/package-lock.json",
@@ -11,6 +11,7 @@
11
11
  "ignoreDependencies": {{knip.ignored}},
12
12
  {{/if}}
13
13
  "ignoreExportsUsedInFile": true,
14
+ "mcp": false,
14
15
  {{#if refusals.named}}
15
16
  "ignoreIssues": {
16
17
  "{{config.contextsDir}}/*/*.codes.ts": ["types"]
@@ -23,7 +23,7 @@
23
23
  "@biomejs/biome": "2.6.2",
24
24
  "@commitlint/cli": "^21.2.3",
25
25
  "@commitlint/config-conventional": "^21.2.3",
26
- "@ddd-ts-kit/eslint-plugin": "^0.92.0",
26
+ "@ddd-ts-kit/eslint-plugin": "^0.93.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",
@@ -8,4 +8,4 @@
8
8
  profiles: [services]
9
9
  env_file: .env
10
10
  ports:
11
- - "${{service.portVariable}}:3000"
11
+ - "{{service.portVariable}}:3000"
@@ -0,0 +1,2 @@
1
+ @@extracted
2
+ '{{context.kebab}}',
@@ -0,0 +1,6 @@
1
+ @@extracted
2
+ '{{context.kebab}}',
3
+ {{#if routes.listed}}
4
+ @@extracted-routes
5
+ {{context.camel}}Routes,
6
+ {{/if}}
@@ -0,0 +1,2 @@
1
+ @@extracted
2
+ {{context.camel}}Module,
@@ -0,0 +1,6 @@
1
+ @@extracted
2
+ '{{context.kebab}}',
3
+ {{#if http.any}}
4
+ @@extracted-routes
5
+ {{context.camel}}Routes,
6
+ {{/if}}
@@ -54,8 +54,12 @@ const application = composeApplication(
54
54
  log: { ...config.log, service: config.serviceName, environment: config.environment },
55
55
  traceConsumers: config.tracing.consumers,
56
56
  resilience: config.resilience,
57
- // A context run alone takes its jobs with it, and only its own.
57
+ // A context run alone takes its jobs with it, and only its own: the jobs of the platform stay with the whole application.
58
58
  jobs: { start: config.runJobs, settings: jobSettings(process.env, '{{context.kebab}}') },
59
+ platformJobs: false,
60
+ {{#if tenancy.any}}
61
+ tenants: config.tenants,
62
+ {{/if}}
59
63
  {{#if cache.redis}}
60
64
  redis,
61
65
  {{/if}}
@@ -7,7 +7,7 @@ import { errors } from '{{alias.platform}}/observability/errors{{alias.ext}}';
7
7
  {{#if http.any}}
8
8
  import { createAuthenticator } from '{{alias.platform}}/auth/authentication/create-authenticator{{alias.ext}}';
9
9
  {{/if}}
10
- import { composeApplication } from '{{alias.platform}}/composition/compose-application{{alias.ext}}';
10
+ import { composeApplication, hostedContexts } from '{{alias.platform}}/composition/compose-application{{alias.ext}}';
11
11
  import { loadConfig } from '{{alias.platform}}/config/load-config{{alias.ext}}';
12
12
  import { openPersistence } from '{{alias.platform}}/database/open-persistence{{alias.ext}}';
13
13
  import { {{events.providerName}} } from '{{alias.platform}}/events/{{events.providerFile}}{{alias.ext}}';
@@ -31,26 +31,33 @@ const persistence = openPersistence();
31
31
  const redis = openRedis(config);
32
32
  {{/if}}
33
33
 
34
- const application = composeApplication(persistence, {
35
- events: {{events.provider}},
34
+ const application = composeApplication(
35
+ persistence,
36
+ {
37
+ events: {{events.provider}},
36
38
  {{#if errors.sentry}}
37
- errors,
39
+ errors,
38
40
  {{/if}}
39
41
  {{#if http.any}}
40
- authenticator: createAuthenticator(config),
42
+ authenticator: createAuthenticator(config),
43
+ {{/if}}
44
+ log: { ...config.log, service: config.serviceName, environment: config.environment },
45
+ traceConsumers: config.tracing.consumers,
46
+ resilience: config.resilience,
47
+ // This process is the one that runs the jobs, whatever `RUN_JOBS` says to the others.
48
+ jobs: { start: true, settings: jobSettings(process.env) },
49
+ {{#if tenancy.any}}
50
+ tenants: config.tenants,
41
51
  {{/if}}
42
- log: { ...config.log, service: config.serviceName, environment: config.environment },
43
- traceConsumers: config.tracing.consumers,
44
- resilience: config.resilience,
45
- // This process is the one that runs the jobs, whatever `RUN_JOBS` says to the others.
46
- jobs: { start: true, settings: jobSettings(process.env) },
47
52
  {{#if cache.redis}}
48
- redis,
53
+ redis,
49
54
  {{/if}}
50
55
  {{#if files.any}}
51
- files: openFiles(config.files),
56
+ files: openFiles(config.files),
52
57
  {{/if}}
53
- });
58
+ },
59
+ hostedContexts,
60
+ );
54
61
 
55
62
  await application.start();
56
63
  application.logger.info('started', { process: 'worker' });