@domain-first/project-structure 8.7.0 → 8.8.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 +2 -0
- package/dist/287.js +1275 -1127
- package/dist/561.js +19 -3
- package/dist/780.js +9 -2
- package/dist/agent-cli.d.ts +35 -4
- package/dist/agent-requests.d.ts +22 -0
- package/dist/backend-module-move.d.ts +16 -0
- package/dist/config-file.d.ts +38 -18
- package/dist/graph.cjs +9 -2
- package/dist/implementation-options-schema.d.ts +19 -9
- package/dist/in-memory-db.d.ts +5 -6
- package/dist/index.cjs +1635 -1464
- package/dist/init.cjs +53 -59
- package/dist/integration-tests.d.ts +39 -0
- package/dist/integration-tests.spec.d.ts +1 -0
- package/dist/integration.cjs +1635 -1464
- package/dist/lint.cjs +9 -2
- package/dist/react.cjs +1635 -1464
- package/dist/upgrade-steps.d.ts +19 -4
- package/dist/upgrade.cjs +9 -2
- package/dist/use-cases/prompt-implementation-type.d.ts +2 -0
- package/package.json +1 -1
- package/skills/df-ps-implement/SKILL.md +2 -1
- package/skills/df-ps-scaffold/SKILL.md +2 -1
- package/skills/df-ps-scaffold/references/agent-mode.md +1 -1
- package/skills/df-ps-scaffold/references/agent-operations.md +2 -2
- package/skills/df-ps-scaffold/references/generators.md +31 -7
- package/skills/df-ps-scaffold/references/units/aggregate.md +3 -2
- package/skills/df-ps-scaffold/references/units/command-query.md +3 -2
- package/skills/df-ps-scaffold/references/units/helper.md +1 -1
- package/skills/df-ps-scaffold/references/units/implementation.md +1 -1
- package/skills/df-ps-scaffold/references/units/port.md +2 -1
- package/skills/df-ps-scaffold/references/units/services.md +4 -3
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
|
|
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/agent-cli.d.ts
CHANGED
|
@@ -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;
|
|
@@ -292,6 +302,7 @@ export declare const describeAgentCommand: (command: AgentCommand) => {
|
|
|
292
302
|
nextAdapter: z.ZodOptional<z.ZodBoolean>;
|
|
293
303
|
configureReact: z.ZodOptional<z.ZodBoolean>;
|
|
294
304
|
replaceTestingLibrary: z.ZodOptional<z.ZodBoolean>;
|
|
305
|
+
integrationTestTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
295
306
|
withService: z.ZodOptional<z.ZodBoolean>;
|
|
296
307
|
routePrefix: z.ZodOptional<z.ZodString>;
|
|
297
308
|
openapiPath: z.ZodOptional<z.ZodString>;
|
|
@@ -329,10 +340,25 @@ export declare const describeAgentCommand: (command: AgentCommand) => {
|
|
|
329
340
|
} | undefined;
|
|
330
341
|
withInMemoryDb?: boolean | undefined;
|
|
331
342
|
testingLibrary?: string | undefined;
|
|
332
|
-
implementations?:
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
343
|
+
implementations?: {
|
|
344
|
+
queries?: {
|
|
345
|
+
primary: string[];
|
|
346
|
+
test: string[];
|
|
347
|
+
} | undefined;
|
|
348
|
+
commands?: {
|
|
349
|
+
primary: string[];
|
|
350
|
+
test: string[];
|
|
351
|
+
} | undefined;
|
|
352
|
+
repositories?: {
|
|
353
|
+
primary: string[];
|
|
354
|
+
test: string[];
|
|
355
|
+
} | undefined;
|
|
356
|
+
ports?: {
|
|
357
|
+
primary: string[];
|
|
358
|
+
test: string[];
|
|
359
|
+
} | undefined;
|
|
360
|
+
integrationTests?: string[] | undefined;
|
|
361
|
+
} | undefined;
|
|
336
362
|
rules?: {
|
|
337
363
|
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
364
|
add?: ("queries" | "commands" | "use-cases" | "application-ports" | "repositories" | "domain-services" | "application-services" | "infrastructure-services" | "presentation-services")[] | undefined;
|
|
@@ -360,6 +386,11 @@ export declare const describeAgentCommand: (command: AgentCommand) => {
|
|
|
360
386
|
implementations: string[];
|
|
361
387
|
}[];
|
|
362
388
|
contracts: {
|
|
389
|
+
integrationSpecs?: {
|
|
390
|
+
implementation: string;
|
|
391
|
+
file: string;
|
|
392
|
+
exists: boolean;
|
|
393
|
+
}[] | undefined;
|
|
363
394
|
id: string;
|
|
364
395
|
kind: import("./backend-module-move").BackendUnitKind;
|
|
365
396
|
implementations: string[];
|
package/dist/agent-requests.d.ts
CHANGED
|
@@ -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;
|
|
@@ -272,6 +282,7 @@ export declare const integrationRequestSchema: z.ZodObject<{
|
|
|
272
282
|
nextAdapter: z.ZodOptional<z.ZodBoolean>;
|
|
273
283
|
configureReact: z.ZodOptional<z.ZodBoolean>;
|
|
274
284
|
replaceTestingLibrary: z.ZodOptional<z.ZodBoolean>;
|
|
285
|
+
integrationTestTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
275
286
|
withService: z.ZodOptional<z.ZodBoolean>;
|
|
276
287
|
routePrefix: z.ZodOptional<z.ZodString>;
|
|
277
288
|
openapiPath: z.ZodOptional<z.ZodString>;
|
|
@@ -303,10 +314,12 @@ export declare const requestSchemaFor: (command: AgentCommand) => z.ZodDiscrimin
|
|
|
303
314
|
implementation: z.ZodOptional<z.ZodObject<{
|
|
304
315
|
type: z.ZodString;
|
|
305
316
|
save: z.ZodOptional<z.ZodBoolean>;
|
|
317
|
+
integrationTests: z.ZodOptional<z.ZodBoolean>;
|
|
306
318
|
}, z.core.$strict>>;
|
|
307
319
|
testImplementation: z.ZodOptional<z.ZodObject<{
|
|
308
320
|
type: z.ZodString;
|
|
309
321
|
save: z.ZodOptional<z.ZodBoolean>;
|
|
322
|
+
integrationTests: z.ZodOptional<z.ZodBoolean>;
|
|
310
323
|
}, z.core.$strict>>;
|
|
311
324
|
name: z.ZodString;
|
|
312
325
|
context: z.ZodString;
|
|
@@ -356,6 +369,7 @@ export declare const requestSchemaFor: (command: AgentCommand) => z.ZodDiscrimin
|
|
|
356
369
|
}, z.core.$strict>, z.ZodObject<{
|
|
357
370
|
operation: z.ZodLiteral<"infrastructure-service">;
|
|
358
371
|
dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
372
|
+
integrationSpec: z.ZodOptional<z.ZodBoolean>;
|
|
359
373
|
name: z.ZodString;
|
|
360
374
|
context: z.ZodString;
|
|
361
375
|
overwrite: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -387,10 +401,12 @@ export declare const requestSchemaFor: (command: AgentCommand) => z.ZodDiscrimin
|
|
|
387
401
|
implementation: z.ZodObject<{
|
|
388
402
|
type: z.ZodString;
|
|
389
403
|
save: z.ZodOptional<z.ZodBoolean>;
|
|
404
|
+
integrationTests: z.ZodOptional<z.ZodBoolean>;
|
|
390
405
|
}, z.core.$strict>;
|
|
391
406
|
testImplementation: z.ZodOptional<z.ZodObject<{
|
|
392
407
|
type: z.ZodString;
|
|
393
408
|
save: z.ZodOptional<z.ZodBoolean>;
|
|
409
|
+
integrationTests: z.ZodOptional<z.ZodBoolean>;
|
|
394
410
|
}, z.core.$strict>>;
|
|
395
411
|
name: z.ZodString;
|
|
396
412
|
context: z.ZodString;
|
|
@@ -402,10 +418,12 @@ export declare const requestSchemaFor: (command: AgentCommand) => z.ZodDiscrimin
|
|
|
402
418
|
implementation: z.ZodObject<{
|
|
403
419
|
type: z.ZodString;
|
|
404
420
|
save: z.ZodOptional<z.ZodBoolean>;
|
|
421
|
+
integrationTests: z.ZodOptional<z.ZodBoolean>;
|
|
405
422
|
}, z.core.$strict>;
|
|
406
423
|
testImplementation: z.ZodOptional<z.ZodObject<{
|
|
407
424
|
type: z.ZodString;
|
|
408
425
|
save: z.ZodOptional<z.ZodBoolean>;
|
|
426
|
+
integrationTests: z.ZodOptional<z.ZodBoolean>;
|
|
409
427
|
}, z.core.$strict>>;
|
|
410
428
|
name: z.ZodString;
|
|
411
429
|
context: z.ZodString;
|
|
@@ -417,10 +435,12 @@ export declare const requestSchemaFor: (command: AgentCommand) => z.ZodDiscrimin
|
|
|
417
435
|
implementation: z.ZodObject<{
|
|
418
436
|
type: z.ZodString;
|
|
419
437
|
save: z.ZodOptional<z.ZodBoolean>;
|
|
438
|
+
integrationTests: z.ZodOptional<z.ZodBoolean>;
|
|
420
439
|
}, z.core.$strict>;
|
|
421
440
|
testImplementation: z.ZodOptional<z.ZodObject<{
|
|
422
441
|
type: z.ZodString;
|
|
423
442
|
save: z.ZodOptional<z.ZodBoolean>;
|
|
443
|
+
integrationTests: z.ZodOptional<z.ZodBoolean>;
|
|
424
444
|
}, z.core.$strict>>;
|
|
425
445
|
name: z.ZodString;
|
|
426
446
|
context: z.ZodString;
|
|
@@ -433,6 +453,7 @@ export declare const requestSchemaFor: (command: AgentCommand) => z.ZodDiscrimin
|
|
|
433
453
|
implementation: z.ZodObject<{
|
|
434
454
|
type: z.ZodString;
|
|
435
455
|
save: z.ZodOptional<z.ZodBoolean>;
|
|
456
|
+
integrationTests: z.ZodOptional<z.ZodBoolean>;
|
|
436
457
|
}, z.core.$strict>;
|
|
437
458
|
environments: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
438
459
|
context: z.ZodString;
|
|
@@ -562,6 +583,7 @@ export declare const requestSchemaFor: (command: AgentCommand) => z.ZodDiscrimin
|
|
|
562
583
|
nextAdapter: z.ZodOptional<z.ZodBoolean>;
|
|
563
584
|
configureReact: z.ZodOptional<z.ZodBoolean>;
|
|
564
585
|
replaceTestingLibrary: z.ZodOptional<z.ZodBoolean>;
|
|
586
|
+
integrationTestTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
565
587
|
withService: z.ZodOptional<z.ZodBoolean>;
|
|
566
588
|
routePrefix: z.ZodOptional<z.ZodString>;
|
|
567
589
|
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
|
package/dist/config-file.d.ts
CHANGED
|
@@ -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.
|
|
92
|
-
queries:
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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.
|
|
191
|
-
queries:
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
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
|
|
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(){
|
|
@@ -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.
|
|
7
|
-
queries:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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>;
|
package/dist/in-memory-db.d.ts
CHANGED
|
@@ -2,7 +2,11 @@ import { File, Folder } from './file-system';
|
|
|
2
2
|
import { UnknownFormatNaming } from './unknown-format-naming';
|
|
3
3
|
import { type WiredModule } from './wiring';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Implementations of this type get the in-memory DB.
|
|
6
|
+
*/
|
|
7
|
+
export declare const inMemoryImplementationType = "in-memory";
|
|
8
|
+
/**
|
|
9
|
+
* The shared in-memory DB with its wire, as the config says.
|
|
6
10
|
*/
|
|
7
11
|
export declare const scaffoldInMemoryDb: (shared: Folder) => void;
|
|
8
12
|
/**
|
|
@@ -51,8 +55,3 @@ export declare const injectInMemoryDb: (classFile: File, implementationName: str
|
|
|
51
55
|
* Passes the in-memory DB wire to the implementation's `wireClass`.
|
|
52
56
|
*/
|
|
53
57
|
export declare const wireInMemoryDb: (consumerWireFile: File, implementationName: string) => void;
|
|
54
|
-
/**
|
|
55
|
-
* A spec without wiring builds the implementation itself, so it has to
|
|
56
|
-
* pass the in-memory DB.
|
|
57
|
-
*/
|
|
58
|
-
export declare const passInMemoryDb: (specFile: File, implementationName: string) => void;
|