@domain-first/project-structure 8.7.1 → 8.9.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 (39) hide show
  1. package/README.md +4 -2
  2. package/dist/287.js +2446 -2005
  3. package/dist/561.js +19 -3
  4. package/dist/780.js +9 -2
  5. package/dist/947.js +4 -0
  6. package/dist/agent-cli.d.ts +37 -5
  7. package/dist/agent-requests.d.ts +24 -0
  8. package/dist/backend-module-move.d.ts +16 -0
  9. package/dist/config-file.d.ts +38 -18
  10. package/dist/graph.cjs +13 -2
  11. package/dist/implementation-options-schema.d.ts +19 -9
  12. package/dist/in-memory-db.d.ts +4 -0
  13. package/dist/index.cjs +3465 -2997
  14. package/dist/init.cjs +94 -77
  15. package/dist/integration-tests.d.ts +39 -0
  16. package/dist/integration-tests.spec.d.ts +1 -0
  17. package/dist/integration.cjs +3489 -3021
  18. package/dist/integrations/drizzle.d.ts +8 -0
  19. package/dist/integrations/drizzle.spec.d.ts +1 -0
  20. package/dist/integrations/index.d.ts +1 -0
  21. package/dist/integrations/testcontainers.d.ts +1 -1
  22. package/dist/lint.cjs +13 -2
  23. package/dist/react.cjs +3465 -2997
  24. package/dist/upgrade-steps.d.ts +19 -4
  25. package/dist/upgrade.cjs +9 -2
  26. package/dist/use-cases/add-integration.d.ts +3 -3
  27. package/dist/use-cases/prompt-implementation-type.d.ts +2 -0
  28. package/package.json +1 -1
  29. package/skills/df-ps-implement/SKILL.md +2 -1
  30. package/skills/df-ps-project-scripts/SKILL.md +22 -5
  31. package/skills/df-ps-scaffold/SKILL.md +1 -0
  32. package/skills/df-ps-scaffold/references/agent-mode.md +1 -1
  33. package/skills/df-ps-scaffold/references/agent-operations.md +3 -2
  34. package/skills/df-ps-scaffold/references/generators.md +27 -2
  35. package/skills/df-ps-scaffold/references/units/aggregate.md +2 -1
  36. package/skills/df-ps-scaffold/references/units/command-query.md +2 -1
  37. package/skills/df-ps-scaffold/references/units/implementation.md +1 -1
  38. package/skills/df-ps-scaffold/references/units/port.md +1 -0
  39. package/skills/df-ps-scaffold/references/units/services.md +3 -2
package/dist/561.js CHANGED
@@ -3,7 +3,7 @@ import node_path from "node:path";
3
3
  import { parseArgs } from "node:util";
4
4
  import zod from "zod";
5
5
  import { implementationLabelSchema, discardPendingChanges, filesToOverwrite, ConfigFile, Folder, implementationKinds, ProjectRoot, pendingChanges } from "./780.js";
6
- import { scaffoldNewHandlersRestEndpoint, addIntegration, findContracts, helperImplementationTypes, scaffoldNewAggregateUseCase, scaffoldNewInfrastructureService, runWithAnswers, scaffoldNewCommand, scaffoldNewQuery, findReactModules, moveBackendUnitUseCase, scaffoldReactUIKitComponent, scaffoldReactSharedHook, moveReactModuleUseCase, reactKindTitles, deleteBackendUnitUseCase, integrationIds, scaffoldNewApplicationService, scaffoldNewImplementation, savedImplementations, RequestError, deleteReactModuleUseCase, rootControllerChoice, moduleId, assertAnswersConsumed, scaffoldNewDomainService, findRestEndpointGenerator, scaffoldNewErrorUseCase, scaffoldReactWidget, savePendingChanges, unitId, systemImplementationChoices, scaffoldReactPage, scaffoldNewPresentationService, scaffoldNewInfrastructureHelper, findBackendUnits, scaffoldNewUseCase, integrationDescriptions, wireDependency, scaffoldNewDomainObject, scaffoldNewBoundedContextUseCase, scaffoldNewApplicationPort } from "./287.js";
6
+ import { scaffoldNewHandlersRestEndpoint, addIntegration, findContracts, helperImplementationTypes, scaffoldNewAggregateUseCase, scaffoldNewInfrastructureService, runWithAnswers, scaffoldNewCommand, scaffoldNewQuery, findReactModules, moveBackendUnitUseCase, scaffoldReactUIKitComponent, scaffoldReactSharedHook, moveReactModuleUseCase, reactKindTitles, deleteBackendUnitUseCase, integrationIds, scaffoldNewApplicationService, scaffoldNewImplementation, savedImplementations, RequestError, deleteReactModuleUseCase, rootControllerChoice, moduleId, assertAnswersConsumed, scaffoldNewDomainService, findRestEndpointGenerator, scaffoldNewErrorUseCase, scaffoldReactWidget, savePendingChanges, unitId, systemImplementationChoices, scaffoldReactPage, scaffoldNewPresentationService, scaffoldNewInfrastructureHelper, integrationSpecsAvailable, integrationSpecFile, findBackendUnits, scaffoldNewUseCase, integrationDescriptions, wireDependency, scaffoldNewDomainObject, scaffoldNewBoundedContextUseCase, scaffoldNewApplicationPort } from "./287.js";
7
7
  import { findWiredModules, availableDependencies, hasNeighboringBoundedContext } from "./947.js";
8
8
  import { restControllers } from "./526.js";
9
9
  const agent_requests_name = implementationLabelSchema;
@@ -11,7 +11,8 @@ const nestedName = zod.string().regex(/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*(?:\/[a-z][
11
11
  const id = zod.string().min(1);
12
12
  const agent_requests_implementation = zod.strictObject({
13
13
  type: agent_requests_name,
14
- save: zod.boolean().optional().describe('Remember this ordinary type for future runs. Default: false.')
14
+ save: zod.boolean().optional().describe('Remember this ordinary type for future runs. Default: false.'),
15
+ integrationTests: zod.boolean().optional().describe('For a newly entered primary type, with the Testcontainers integration and wire: whether its implementations get integration specs. Default: true. With save: true, remembered for the type. Not allowed otherwise.')
15
16
  });
16
17
  const dependencies = zod.record(zod.string().regex(/^[A-Z][A-Za-z0-9]*$/), zod.array(id)).describe('Implementation/class name -> exact module IDs from --describe. Omitted entries keep suggested dependencies; [] selects none.');
17
18
  const common = {
@@ -73,6 +74,7 @@ const scaffoldRequestSchema = zod.discriminatedUnion('operation', [
73
74
  }),
74
75
  agent_requests_operation('infrastructure-service', {
75
76
  ...named,
77
+ integrationSpec: zod.boolean().optional().describe('With the Testcontainers integration and wire: whether the service gets an integration spec. Default: false. Not allowed otherwise.'),
76
78
  ...wired
77
79
  }),
78
80
  agent_requests_operation('helper', {
@@ -211,6 +213,7 @@ const integrationRequestSchema = agent_requests_operation('add', {
211
213
  nextAdapter: zod.boolean().optional(),
212
214
  configureReact: zod.boolean().optional(),
213
215
  replaceTestingLibrary: zod.boolean().optional(),
216
+ integrationTestTypes: zod.array(agent_requests_name).optional().describe('testcontainers with wire: saved primary implementation types whose implementations get integration specs. Omitted: the configured list stays.'),
214
217
  withService: zod.boolean().optional(),
215
218
  routePrefix: zod.string().regex(/^\/?[a-zA-Z0-9_/-]*$/).optional(),
216
219
  openapiPath: relativePath.optional(),
@@ -286,6 +289,7 @@ const describeAgentCommand = (command)=>{
286
289
  const owners = configured ? ownerFolders(root) : [];
287
290
  const modules = owners.flatMap((owner)=>findWiredModules(owner.folder.path));
288
291
  const relative = (file)=>node_path.relative(root, file).split(node_path.sep).join('/');
292
+ const withIntegrationSpecs = Boolean(config?.backend) && integrationSpecsAvailable();
289
293
  return {
290
294
  schemaVersion: 1,
291
295
  command,
@@ -307,7 +311,19 @@ const describeAgentCommand = (command)=>{
307
311
  contracts: findContracts(owner.folder.path).map((unit)=>({
308
312
  id: unitId(unit),
309
313
  kind: unit.kind,
310
- implementations: unit.labels
314
+ implementations: unit.labels,
315
+ ...withIntegrationSpecs ? {
316
+ integrationSpecs: unit.labels.flatMap((implementation)=>{
317
+ const file = integrationSpecFile(unit, implementation);
318
+ return file ? [
319
+ {
320
+ implementation,
321
+ file: relative(file),
322
+ exists: node_fs.existsSync(file)
323
+ }
324
+ ] : [];
325
+ })
326
+ } : {}
311
327
  })),
312
328
  modules: findWiredModules(owner.folder.path).map((module)=>({
313
329
  id: moduleId(module),
package/dist/780.js CHANGED
@@ -9,10 +9,17 @@ const implementationKinds = [
9
9
  'ports'
10
10
  ];
11
11
  const implementationLabelSchema = zod.string().regex(/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/);
12
- const implementationOptionsSchema = zod.partialRecord(zod["enum"](implementationKinds), zod.object({
12
+ const implementationGroupSchema = zod.object({
13
13
  primary: zod.array(implementationLabelSchema).default([]),
14
14
  test: zod.array(implementationLabelSchema).default([])
15
- }).strict());
15
+ }).strict();
16
+ const implementationOptionsSchema = zod.object({
17
+ ...Object.fromEntries(implementationKinds.map((kind)=>[
18
+ kind,
19
+ implementationGroupSchema.optional()
20
+ ])),
21
+ integrationTests: zod.array(implementationLabelSchema).optional()
22
+ }).strict();
16
23
  const moduleKinds = [
17
24
  'repositories',
18
25
  'domain-services',
package/dist/947.js CHANGED
@@ -217,6 +217,10 @@ const systemInfrastructureServices = new Map([
217
217
  'prisma',
218
218
  'prisma-infrastructure-service'
219
219
  ],
220
+ [
221
+ 'drizzle',
222
+ 'drizzle-infrastructure-service'
223
+ ],
220
224
  [
221
225
  'in-memory',
222
226
  'in-memory-db-infrastructure-service'
@@ -33,10 +33,12 @@ export declare const describeAgentCommand: (command: AgentCommand) => {
33
33
  implementation: z.ZodOptional<z.ZodObject<{
34
34
  type: z.ZodString;
35
35
  save: z.ZodOptional<z.ZodBoolean>;
36
+ integrationTests: z.ZodOptional<z.ZodBoolean>;
36
37
  }, z.core.$strict>>;
37
38
  testImplementation: z.ZodOptional<z.ZodObject<{
38
39
  type: z.ZodString;
39
40
  save: z.ZodOptional<z.ZodBoolean>;
41
+ integrationTests: z.ZodOptional<z.ZodBoolean>;
40
42
  }, z.core.$strict>>;
41
43
  name: z.ZodString;
42
44
  context: z.ZodString;
@@ -86,6 +88,7 @@ export declare const describeAgentCommand: (command: AgentCommand) => {
86
88
  }, z.core.$strict>, z.ZodObject<{
87
89
  operation: z.ZodLiteral<"infrastructure-service">;
88
90
  dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
91
+ integrationSpec: z.ZodOptional<z.ZodBoolean>;
89
92
  name: z.ZodString;
90
93
  context: z.ZodString;
91
94
  overwrite: z.ZodOptional<z.ZodBoolean>;
@@ -117,10 +120,12 @@ export declare const describeAgentCommand: (command: AgentCommand) => {
117
120
  implementation: z.ZodObject<{
118
121
  type: z.ZodString;
119
122
  save: z.ZodOptional<z.ZodBoolean>;
123
+ integrationTests: z.ZodOptional<z.ZodBoolean>;
120
124
  }, z.core.$strict>;
121
125
  testImplementation: z.ZodOptional<z.ZodObject<{
122
126
  type: z.ZodString;
123
127
  save: z.ZodOptional<z.ZodBoolean>;
128
+ integrationTests: z.ZodOptional<z.ZodBoolean>;
124
129
  }, z.core.$strict>>;
125
130
  name: z.ZodString;
126
131
  context: z.ZodString;
@@ -132,10 +137,12 @@ export declare const describeAgentCommand: (command: AgentCommand) => {
132
137
  implementation: z.ZodObject<{
133
138
  type: z.ZodString;
134
139
  save: z.ZodOptional<z.ZodBoolean>;
140
+ integrationTests: z.ZodOptional<z.ZodBoolean>;
135
141
  }, z.core.$strict>;
136
142
  testImplementation: z.ZodOptional<z.ZodObject<{
137
143
  type: z.ZodString;
138
144
  save: z.ZodOptional<z.ZodBoolean>;
145
+ integrationTests: z.ZodOptional<z.ZodBoolean>;
139
146
  }, z.core.$strict>>;
140
147
  name: z.ZodString;
141
148
  context: z.ZodString;
@@ -147,10 +154,12 @@ export declare const describeAgentCommand: (command: AgentCommand) => {
147
154
  implementation: z.ZodObject<{
148
155
  type: z.ZodString;
149
156
  save: z.ZodOptional<z.ZodBoolean>;
157
+ integrationTests: z.ZodOptional<z.ZodBoolean>;
150
158
  }, z.core.$strict>;
151
159
  testImplementation: z.ZodOptional<z.ZodObject<{
152
160
  type: z.ZodString;
153
161
  save: z.ZodOptional<z.ZodBoolean>;
162
+ integrationTests: z.ZodOptional<z.ZodBoolean>;
154
163
  }, z.core.$strict>>;
155
164
  name: z.ZodString;
156
165
  context: z.ZodString;
@@ -163,6 +172,7 @@ export declare const describeAgentCommand: (command: AgentCommand) => {
163
172
  implementation: z.ZodObject<{
164
173
  type: z.ZodString;
165
174
  save: z.ZodOptional<z.ZodBoolean>;
175
+ integrationTests: z.ZodOptional<z.ZodBoolean>;
166
176
  }, z.core.$strict>;
167
177
  environments: z.ZodOptional<z.ZodArray<z.ZodString>>;
168
178
  context: z.ZodString;
@@ -280,6 +290,7 @@ export declare const describeAgentCommand: (command: AgentCommand) => {
280
290
  operation: z.ZodLiteral<"add">;
281
291
  integrations: z.ZodArray<z.ZodEnum<{
282
292
  prisma: "prisma";
293
+ drizzle: "drizzle";
283
294
  openapi: "openapi";
284
295
  orval: "orval";
285
296
  "rest-endpoint-generator": "rest-endpoint-generator";
@@ -292,6 +303,7 @@ export declare const describeAgentCommand: (command: AgentCommand) => {
292
303
  nextAdapter: z.ZodOptional<z.ZodBoolean>;
293
304
  configureReact: z.ZodOptional<z.ZodBoolean>;
294
305
  replaceTestingLibrary: z.ZodOptional<z.ZodBoolean>;
306
+ integrationTestTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
295
307
  withService: z.ZodOptional<z.ZodBoolean>;
296
308
  routePrefix: z.ZodOptional<z.ZodString>;
297
309
  openapiPath: z.ZodOptional<z.ZodString>;
@@ -329,10 +341,25 @@ export declare const describeAgentCommand: (command: AgentCommand) => {
329
341
  } | undefined;
330
342
  withInMemoryDb?: boolean | undefined;
331
343
  testingLibrary?: string | undefined;
332
- implementations?: Partial<Record<"queries" | "commands" | "repositories" | "ports", {
333
- primary: string[];
334
- test: string[];
335
- }>> | undefined;
344
+ implementations?: {
345
+ queries?: {
346
+ primary: string[];
347
+ test: string[];
348
+ } | undefined;
349
+ commands?: {
350
+ primary: string[];
351
+ test: string[];
352
+ } | undefined;
353
+ repositories?: {
354
+ primary: string[];
355
+ test: string[];
356
+ } | undefined;
357
+ ports?: {
358
+ primary: string[];
359
+ test: string[];
360
+ } | undefined;
361
+ integrationTests?: string[] | undefined;
362
+ } | undefined;
336
363
  rules?: {
337
364
  dependencies?: Partial<Record<"queries" | "commands" | "use-cases" | "application-ports" | "repositories" | "domain-services" | "application-services" | "infrastructure-services" | "presentation-services", ("queries" | "commands" | "use-cases" | "application-ports" | "repositories" | "domain-services" | "application-services" | "infrastructure-services" | "presentation-services")[] | {
338
365
  add?: ("queries" | "commands" | "use-cases" | "application-ports" | "repositories" | "domain-services" | "application-services" | "infrastructure-services" | "presentation-services")[] | undefined;
@@ -360,6 +387,11 @@ export declare const describeAgentCommand: (command: AgentCommand) => {
360
387
  implementations: string[];
361
388
  }[];
362
389
  contracts: {
390
+ integrationSpecs?: {
391
+ implementation: string;
392
+ file: string;
393
+ exists: boolean;
394
+ }[] | undefined;
363
395
  id: string;
364
396
  kind: import("./backend-module-move").BackendUnitKind;
365
397
  implementations: string[];
@@ -386,7 +418,7 @@ export declare const describeAgentCommand: (command: AgentCommand) => {
386
418
  } | undefined;
387
419
  }[];
388
420
  integrations: {
389
- id: "prisma" | "openapi" | "orval" | "rest-endpoint-generator" | "storybook" | "vitest" | "testcontainers" | "in-memory-db" | "playwright";
421
+ id: "prisma" | "drizzle" | "openapi" | "orval" | "rest-endpoint-generator" | "storybook" | "vitest" | "testcontainers" | "in-memory-db" | "playwright";
390
422
  name: string;
391
423
  group: "backend" | "frontend";
392
424
  available: boolean;
@@ -11,10 +11,12 @@ export declare const scaffoldRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject
11
11
  implementation: z.ZodOptional<z.ZodObject<{
12
12
  type: z.ZodString;
13
13
  save: z.ZodOptional<z.ZodBoolean>;
14
+ integrationTests: z.ZodOptional<z.ZodBoolean>;
14
15
  }, z.core.$strict>>;
15
16
  testImplementation: z.ZodOptional<z.ZodObject<{
16
17
  type: z.ZodString;
17
18
  save: z.ZodOptional<z.ZodBoolean>;
19
+ integrationTests: z.ZodOptional<z.ZodBoolean>;
18
20
  }, z.core.$strict>>;
19
21
  name: z.ZodString;
20
22
  context: z.ZodString;
@@ -64,6 +66,7 @@ export declare const scaffoldRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject
64
66
  }, z.core.$strict>, z.ZodObject<{
65
67
  operation: z.ZodLiteral<"infrastructure-service">;
66
68
  dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
69
+ integrationSpec: z.ZodOptional<z.ZodBoolean>;
67
70
  name: z.ZodString;
68
71
  context: z.ZodString;
69
72
  overwrite: z.ZodOptional<z.ZodBoolean>;
@@ -95,10 +98,12 @@ export declare const scaffoldRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject
95
98
  implementation: z.ZodObject<{
96
99
  type: z.ZodString;
97
100
  save: z.ZodOptional<z.ZodBoolean>;
101
+ integrationTests: z.ZodOptional<z.ZodBoolean>;
98
102
  }, z.core.$strict>;
99
103
  testImplementation: z.ZodOptional<z.ZodObject<{
100
104
  type: z.ZodString;
101
105
  save: z.ZodOptional<z.ZodBoolean>;
106
+ integrationTests: z.ZodOptional<z.ZodBoolean>;
102
107
  }, z.core.$strict>>;
103
108
  name: z.ZodString;
104
109
  context: z.ZodString;
@@ -110,10 +115,12 @@ export declare const scaffoldRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject
110
115
  implementation: z.ZodObject<{
111
116
  type: z.ZodString;
112
117
  save: z.ZodOptional<z.ZodBoolean>;
118
+ integrationTests: z.ZodOptional<z.ZodBoolean>;
113
119
  }, z.core.$strict>;
114
120
  testImplementation: z.ZodOptional<z.ZodObject<{
115
121
  type: z.ZodString;
116
122
  save: z.ZodOptional<z.ZodBoolean>;
123
+ integrationTests: z.ZodOptional<z.ZodBoolean>;
117
124
  }, z.core.$strict>>;
118
125
  name: z.ZodString;
119
126
  context: z.ZodString;
@@ -125,10 +132,12 @@ export declare const scaffoldRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject
125
132
  implementation: z.ZodObject<{
126
133
  type: z.ZodString;
127
134
  save: z.ZodOptional<z.ZodBoolean>;
135
+ integrationTests: z.ZodOptional<z.ZodBoolean>;
128
136
  }, z.core.$strict>;
129
137
  testImplementation: z.ZodOptional<z.ZodObject<{
130
138
  type: z.ZodString;
131
139
  save: z.ZodOptional<z.ZodBoolean>;
140
+ integrationTests: z.ZodOptional<z.ZodBoolean>;
132
141
  }, z.core.$strict>>;
133
142
  name: z.ZodString;
134
143
  context: z.ZodString;
@@ -141,6 +150,7 @@ export declare const scaffoldRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject
141
150
  implementation: z.ZodObject<{
142
151
  type: z.ZodString;
143
152
  save: z.ZodOptional<z.ZodBoolean>;
153
+ integrationTests: z.ZodOptional<z.ZodBoolean>;
144
154
  }, z.core.$strict>;
145
155
  environments: z.ZodOptional<z.ZodArray<z.ZodString>>;
146
156
  context: z.ZodString;
@@ -260,6 +270,7 @@ export declare const integrationRequestSchema: z.ZodObject<{
260
270
  operation: z.ZodLiteral<"add">;
261
271
  integrations: z.ZodArray<z.ZodEnum<{
262
272
  prisma: "prisma";
273
+ drizzle: "drizzle";
263
274
  openapi: "openapi";
264
275
  orval: "orval";
265
276
  "rest-endpoint-generator": "rest-endpoint-generator";
@@ -272,6 +283,7 @@ export declare const integrationRequestSchema: z.ZodObject<{
272
283
  nextAdapter: z.ZodOptional<z.ZodBoolean>;
273
284
  configureReact: z.ZodOptional<z.ZodBoolean>;
274
285
  replaceTestingLibrary: z.ZodOptional<z.ZodBoolean>;
286
+ integrationTestTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
275
287
  withService: z.ZodOptional<z.ZodBoolean>;
276
288
  routePrefix: z.ZodOptional<z.ZodString>;
277
289
  openapiPath: z.ZodOptional<z.ZodString>;
@@ -303,10 +315,12 @@ export declare const requestSchemaFor: (command: AgentCommand) => z.ZodDiscrimin
303
315
  implementation: z.ZodOptional<z.ZodObject<{
304
316
  type: z.ZodString;
305
317
  save: z.ZodOptional<z.ZodBoolean>;
318
+ integrationTests: z.ZodOptional<z.ZodBoolean>;
306
319
  }, z.core.$strict>>;
307
320
  testImplementation: z.ZodOptional<z.ZodObject<{
308
321
  type: z.ZodString;
309
322
  save: z.ZodOptional<z.ZodBoolean>;
323
+ integrationTests: z.ZodOptional<z.ZodBoolean>;
310
324
  }, z.core.$strict>>;
311
325
  name: z.ZodString;
312
326
  context: z.ZodString;
@@ -356,6 +370,7 @@ export declare const requestSchemaFor: (command: AgentCommand) => z.ZodDiscrimin
356
370
  }, z.core.$strict>, z.ZodObject<{
357
371
  operation: z.ZodLiteral<"infrastructure-service">;
358
372
  dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
373
+ integrationSpec: z.ZodOptional<z.ZodBoolean>;
359
374
  name: z.ZodString;
360
375
  context: z.ZodString;
361
376
  overwrite: z.ZodOptional<z.ZodBoolean>;
@@ -387,10 +402,12 @@ export declare const requestSchemaFor: (command: AgentCommand) => z.ZodDiscrimin
387
402
  implementation: z.ZodObject<{
388
403
  type: z.ZodString;
389
404
  save: z.ZodOptional<z.ZodBoolean>;
405
+ integrationTests: z.ZodOptional<z.ZodBoolean>;
390
406
  }, z.core.$strict>;
391
407
  testImplementation: z.ZodOptional<z.ZodObject<{
392
408
  type: z.ZodString;
393
409
  save: z.ZodOptional<z.ZodBoolean>;
410
+ integrationTests: z.ZodOptional<z.ZodBoolean>;
394
411
  }, z.core.$strict>>;
395
412
  name: z.ZodString;
396
413
  context: z.ZodString;
@@ -402,10 +419,12 @@ export declare const requestSchemaFor: (command: AgentCommand) => z.ZodDiscrimin
402
419
  implementation: z.ZodObject<{
403
420
  type: z.ZodString;
404
421
  save: z.ZodOptional<z.ZodBoolean>;
422
+ integrationTests: z.ZodOptional<z.ZodBoolean>;
405
423
  }, z.core.$strict>;
406
424
  testImplementation: z.ZodOptional<z.ZodObject<{
407
425
  type: z.ZodString;
408
426
  save: z.ZodOptional<z.ZodBoolean>;
427
+ integrationTests: z.ZodOptional<z.ZodBoolean>;
409
428
  }, z.core.$strict>>;
410
429
  name: z.ZodString;
411
430
  context: z.ZodString;
@@ -417,10 +436,12 @@ export declare const requestSchemaFor: (command: AgentCommand) => z.ZodDiscrimin
417
436
  implementation: z.ZodObject<{
418
437
  type: z.ZodString;
419
438
  save: z.ZodOptional<z.ZodBoolean>;
439
+ integrationTests: z.ZodOptional<z.ZodBoolean>;
420
440
  }, z.core.$strict>;
421
441
  testImplementation: z.ZodOptional<z.ZodObject<{
422
442
  type: z.ZodString;
423
443
  save: z.ZodOptional<z.ZodBoolean>;
444
+ integrationTests: z.ZodOptional<z.ZodBoolean>;
424
445
  }, z.core.$strict>>;
425
446
  name: z.ZodString;
426
447
  context: z.ZodString;
@@ -433,6 +454,7 @@ export declare const requestSchemaFor: (command: AgentCommand) => z.ZodDiscrimin
433
454
  implementation: z.ZodObject<{
434
455
  type: z.ZodString;
435
456
  save: z.ZodOptional<z.ZodBoolean>;
457
+ integrationTests: z.ZodOptional<z.ZodBoolean>;
436
458
  }, z.core.$strict>;
437
459
  environments: z.ZodOptional<z.ZodArray<z.ZodString>>;
438
460
  context: z.ZodString;
@@ -550,6 +572,7 @@ export declare const requestSchemaFor: (command: AgentCommand) => z.ZodDiscrimin
550
572
  operation: z.ZodLiteral<"add">;
551
573
  integrations: z.ZodArray<z.ZodEnum<{
552
574
  prisma: "prisma";
575
+ drizzle: "drizzle";
553
576
  openapi: "openapi";
554
577
  orval: "orval";
555
578
  "rest-endpoint-generator": "rest-endpoint-generator";
@@ -562,6 +585,7 @@ export declare const requestSchemaFor: (command: AgentCommand) => z.ZodDiscrimin
562
585
  nextAdapter: z.ZodOptional<z.ZodBoolean>;
563
586
  configureReact: z.ZodOptional<z.ZodBoolean>;
564
587
  replaceTestingLibrary: z.ZodOptional<z.ZodBoolean>;
588
+ integrationTestTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
565
589
  withService: z.ZodOptional<z.ZodBoolean>;
566
590
  routePrefix: z.ZodOptional<z.ZodString>;
567
591
  openapiPath: z.ZodOptional<z.ZodString>;
@@ -27,6 +27,22 @@ type KindLayout = {
27
27
  sharedKernel: boolean;
28
28
  };
29
29
  export declare const kindLayouts: Record<BackendUnitKind, KindLayout>;
30
+ /** Where the Testcontainers integration keeps integration specs. */
31
+ export declare const integrationSpecsFolder = "specs/integration";
32
+ type ContractUnit = Pick<BackendUnit, 'kind' | 'name' | 'ownerPath'>;
33
+ /**
34
+ * The integration spec of an implementation, or of an infrastructure
35
+ * service without `label`, mirroring its path in the owner without
36
+ * `infrastructure/`:
37
+ * `specs/integration/sales/queries/prisma/prisma-orders-query.spec.ts`,
38
+ * `specs/integration/sales/services/mailer-infrastructure-service.spec.ts`.
39
+ * Undefined for other units or outside a project.
40
+ */
41
+ export declare const integrationSpecFile: (unit: ContractUnit, label?: string) => string | undefined;
42
+ /** What a unit's integration specs are of: its implementations or itself. */
43
+ export declare const integrationSpecSubjects: (unit: Pick<BackendUnit, "kind" | "labels">) => (string | undefined)[];
44
+ /** Where emptied folders of integration specs stop being removed. */
45
+ export declare const integrationSpecsStop: (file: string) => string | undefined;
30
46
  export declare const aggregatesOf: (ownerPath: string) => string[];
31
47
  /**
32
48
  * Units generated in a bounded context or the Shared Kernel, found by
@@ -88,15 +88,25 @@ export declare const backendConfigSchema: z.ZodObject<{
88
88
  }, z.core.$strip>>;
89
89
  withInMemoryDb: z.ZodOptional<z.ZodBoolean>;
90
90
  testingLibrary: z.ZodOptional<z.ZodString>;
91
- implementations: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
92
- queries: "queries";
93
- commands: "commands";
94
- repositories: "repositories";
95
- ports: "ports";
96
- }> & z.core.$partial, z.ZodObject<{
97
- primary: z.ZodDefault<z.ZodArray<z.ZodString>>;
98
- test: z.ZodDefault<z.ZodArray<z.ZodString>>;
99
- }, z.core.$strict>>>;
91
+ implementations: z.ZodOptional<z.ZodObject<{
92
+ queries: z.ZodOptional<z.ZodObject<{
93
+ primary: z.ZodDefault<z.ZodArray<z.ZodString>>;
94
+ test: z.ZodDefault<z.ZodArray<z.ZodString>>;
95
+ }, z.core.$strict>>;
96
+ commands: z.ZodOptional<z.ZodObject<{
97
+ primary: z.ZodDefault<z.ZodArray<z.ZodString>>;
98
+ test: z.ZodDefault<z.ZodArray<z.ZodString>>;
99
+ }, z.core.$strict>>;
100
+ repositories: z.ZodOptional<z.ZodObject<{
101
+ primary: z.ZodDefault<z.ZodArray<z.ZodString>>;
102
+ test: z.ZodDefault<z.ZodArray<z.ZodString>>;
103
+ }, z.core.$strict>>;
104
+ ports: z.ZodOptional<z.ZodObject<{
105
+ primary: z.ZodDefault<z.ZodArray<z.ZodString>>;
106
+ test: z.ZodDefault<z.ZodArray<z.ZodString>>;
107
+ }, z.core.$strict>>;
108
+ integrationTests: z.ZodOptional<z.ZodArray<typeof import("./implementation-options-schema").implementationLabelSchema>>;
109
+ }, z.core.$strict>>;
100
110
  rules: z.ZodOptional<z.ZodObject<{
101
111
  dependencies: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
102
112
  queries: "queries";
@@ -187,15 +197,25 @@ export declare const configSchema: z.ZodObject<{
187
197
  }, z.core.$strip>>;
188
198
  withInMemoryDb: z.ZodOptional<z.ZodBoolean>;
189
199
  testingLibrary: z.ZodOptional<z.ZodString>;
190
- implementations: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
191
- queries: "queries";
192
- commands: "commands";
193
- repositories: "repositories";
194
- ports: "ports";
195
- }> & z.core.$partial, z.ZodObject<{
196
- primary: z.ZodDefault<z.ZodArray<z.ZodString>>;
197
- test: z.ZodDefault<z.ZodArray<z.ZodString>>;
198
- }, z.core.$strict>>>;
200
+ implementations: z.ZodOptional<z.ZodObject<{
201
+ queries: z.ZodOptional<z.ZodObject<{
202
+ primary: z.ZodDefault<z.ZodArray<z.ZodString>>;
203
+ test: z.ZodDefault<z.ZodArray<z.ZodString>>;
204
+ }, z.core.$strict>>;
205
+ commands: z.ZodOptional<z.ZodObject<{
206
+ primary: z.ZodDefault<z.ZodArray<z.ZodString>>;
207
+ test: z.ZodDefault<z.ZodArray<z.ZodString>>;
208
+ }, z.core.$strict>>;
209
+ repositories: z.ZodOptional<z.ZodObject<{
210
+ primary: z.ZodDefault<z.ZodArray<z.ZodString>>;
211
+ test: z.ZodDefault<z.ZodArray<z.ZodString>>;
212
+ }, z.core.$strict>>;
213
+ ports: z.ZodOptional<z.ZodObject<{
214
+ primary: z.ZodDefault<z.ZodArray<z.ZodString>>;
215
+ test: z.ZodDefault<z.ZodArray<z.ZodString>>;
216
+ }, z.core.$strict>>;
217
+ integrationTests: z.ZodOptional<z.ZodArray<typeof import("./implementation-options-schema").implementationLabelSchema>>;
218
+ }, z.core.$strict>>;
199
219
  rules: z.ZodOptional<z.ZodObject<{
200
220
  dependencies: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
201
221
  queries: "queries";
package/dist/graph.cjs CHANGED
@@ -192,10 +192,17 @@ const implementationKinds = [
192
192
  'ports'
193
193
  ];
194
194
  const implementationLabelSchema = external_zod_default().string().regex(/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/);
195
- const implementationOptionsSchema = external_zod_default().partialRecord(external_zod_default()["enum"](implementationKinds), external_zod_default().object({
195
+ const implementationGroupSchema = external_zod_default().object({
196
196
  primary: external_zod_default().array(implementationLabelSchema).default([]),
197
197
  test: external_zod_default().array(implementationLabelSchema).default([])
198
- }).strict());
198
+ }).strict();
199
+ const implementationOptionsSchema = external_zod_default().object({
200
+ ...Object.fromEntries(implementationKinds.map((kind)=>[
201
+ kind,
202
+ implementationGroupSchema.optional()
203
+ ])),
204
+ integrationTests: external_zod_default().array(implementationLabelSchema).optional()
205
+ }).strict();
199
206
  class ProjectRoot {
200
207
  path;
201
208
  constructor(){
@@ -503,6 +510,10 @@ new Map([
503
510
  'prisma',
504
511
  'prisma-infrastructure-service'
505
512
  ],
513
+ [
514
+ 'drizzle',
515
+ 'drizzle-infrastructure-service'
516
+ ],
506
517
  [
507
518
  'in-memory',
508
519
  'in-memory-db-infrastructure-service'
@@ -3,12 +3,22 @@ export declare const implementationKinds: readonly ["repositories", "commands",
3
3
  export type ImplementationKind = (typeof implementationKinds)[number];
4
4
  export type ImplementationPurpose = 'primary' | 'test';
5
5
  export declare const implementationLabelSchema: z.ZodString;
6
- export declare const implementationOptionsSchema: z.ZodRecord<z.ZodEnum<{
7
- queries: "queries";
8
- commands: "commands";
9
- repositories: "repositories";
10
- ports: "ports";
11
- }> & z.core.$partial, z.ZodObject<{
12
- primary: z.ZodDefault<z.ZodArray<z.ZodString>>;
13
- test: z.ZodDefault<z.ZodArray<z.ZodString>>;
14
- }, z.core.$strict>>;
6
+ export declare const implementationOptionsSchema: z.ZodObject<{
7
+ queries: z.ZodOptional<z.ZodObject<{
8
+ primary: z.ZodDefault<z.ZodArray<z.ZodString>>;
9
+ test: z.ZodDefault<z.ZodArray<z.ZodString>>;
10
+ }, z.core.$strict>>;
11
+ commands: z.ZodOptional<z.ZodObject<{
12
+ primary: z.ZodDefault<z.ZodArray<z.ZodString>>;
13
+ test: z.ZodDefault<z.ZodArray<z.ZodString>>;
14
+ }, z.core.$strict>>;
15
+ repositories: z.ZodOptional<z.ZodObject<{
16
+ primary: z.ZodDefault<z.ZodArray<z.ZodString>>;
17
+ test: z.ZodDefault<z.ZodArray<z.ZodString>>;
18
+ }, z.core.$strict>>;
19
+ ports: z.ZodOptional<z.ZodObject<{
20
+ primary: z.ZodDefault<z.ZodArray<z.ZodString>>;
21
+ test: z.ZodDefault<z.ZodArray<z.ZodString>>;
22
+ }, z.core.$strict>>;
23
+ integrationTests: z.ZodOptional<z.ZodArray<typeof implementationLabelSchema>>;
24
+ }, z.core.$strict>;
@@ -1,6 +1,10 @@
1
1
  import { File, Folder } from './file-system';
2
2
  import { UnknownFormatNaming } from './unknown-format-naming';
3
3
  import { type WiredModule } from './wiring';
4
+ /**
5
+ * Implementations of this type get the in-memory DB.
6
+ */
7
+ export declare const inMemoryImplementationType = "in-memory";
4
8
  /**
5
9
  * The shared in-memory DB with its wire, as the config says.
6
10
  */