@domain-first/project-structure 8.2.0 → 8.4.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/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 "./870.js";
6
- import { scaffoldNewHandlersRestEndpoint, addIntegration, findContracts, scaffoldNewAggregateUseCase, scaffoldNewInfrastructureService, scaffoldNewQuery, runWithAnswers, scaffoldNewCommand, moveBackendUnitUseCase, findReactModules, scaffoldReactUIKitComponent, scaffoldReactSharedHook, moveReactModuleUseCase, integrationIds, scaffoldNewImplementation, scaffoldNewApplicationService, savedImplementations, RequestError, moduleId, assertAnswersConsumed, scaffoldNewDomainService, findRestEndpointGenerator, scaffoldNewErrorUseCase, scaffoldReactWidget, savePendingChanges, systemImplementationChoices, unitId, scaffoldReactPage, scaffoldNewPresentationService, findBackendUnits, scaffoldNewUseCase, integrationDescriptions, wireDependency, scaffoldNewDomainObject, scaffoldNewBoundedContextUseCase, scaffoldNewApplicationPort } from "./287.js";
6
+ import { scaffoldNewHandlersRestEndpoint, addIntegration, findContracts, scaffoldNewAggregateUseCase, scaffoldNewInfrastructureService, scaffoldNewQuery, runWithAnswers, scaffoldNewCommand, moveBackendUnitUseCase, findReactModules, scaffoldReactUIKitComponent, scaffoldReactSharedHook, moveReactModuleUseCase, reactKindTitles, deleteBackendUnitUseCase, integrationIds, scaffoldNewImplementation, scaffoldNewApplicationService, savedImplementations, RequestError, deleteReactModuleUseCase, moduleId, assertAnswersConsumed, scaffoldNewDomainService, findRestEndpointGenerator, scaffoldNewErrorUseCase, scaffoldReactWidget, savePendingChanges, unitId, systemImplementationChoices, scaffoldReactPage, scaffoldNewPresentationService, findBackendUnits, scaffoldNewUseCase, integrationDescriptions, wireDependency, scaffoldNewDomainObject, scaffoldNewBoundedContextUseCase, scaffoldNewApplicationPort } from "./287.js";
7
7
  import { findWiredModules, availableDependencies, hasNeighboringBoundedContext } from "./201.js";
8
8
  const agent_requests_name = implementationLabelSchema;
9
9
  const nestedName = zod.string().regex(/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*(?:\/[a-z][a-z0-9]*(?:-[a-z0-9]+)*)*$/);
@@ -33,68 +33,68 @@ const named = {
33
33
  ...agent_requests_owner,
34
34
  name: agent_requests_name
35
35
  };
36
- const operation = (value, shape)=>zod.strictObject({
36
+ const agent_requests_operation = (value, shape)=>zod.strictObject({
37
37
  operation: zod.literal(value),
38
38
  ...shape
39
39
  });
40
40
  const scaffoldRequestSchema = zod.discriminatedUnion('operation', [
41
- operation('bounded-context', {
41
+ agent_requests_operation('bounded-context', {
42
42
  ...common,
43
43
  name: agent_requests_name.refine((value)=>'shared-kernel' !== value, 'shared-kernel is reserved for the Shared Kernel.')
44
44
  }),
45
- operation('aggregate', {
45
+ agent_requests_operation('aggregate', {
46
46
  ...named,
47
47
  withRepository: zod.boolean().optional(),
48
48
  implementation: agent_requests_implementation.optional(),
49
49
  testImplementation: agent_requests_implementation.optional(),
50
50
  ...wired
51
51
  }),
52
- operation('entity', {
52
+ agent_requests_operation('entity', {
53
53
  ...named,
54
54
  aggregate: agent_requests_name.optional()
55
55
  }),
56
- operation('value-object', {
56
+ agent_requests_operation('value-object', {
57
57
  ...named,
58
58
  aggregate: agent_requests_name.optional()
59
59
  }),
60
- operation('error', {
60
+ agent_requests_operation('error', {
61
61
  ...named,
62
62
  namespace: agent_requests_name.optional()
63
63
  }),
64
- operation('error-namespace', named),
65
- operation('domain-service', {
64
+ agent_requests_operation('error-namespace', named),
65
+ agent_requests_operation('domain-service', {
66
66
  ...named,
67
67
  ...wired
68
68
  }),
69
- operation('application-service', {
69
+ agent_requests_operation('application-service', {
70
70
  ...named,
71
71
  ...wired
72
72
  }),
73
- operation('infrastructure-service', {
73
+ agent_requests_operation('infrastructure-service', {
74
74
  ...named,
75
75
  ...wired
76
76
  }),
77
- operation('presentation-service', {
77
+ agent_requests_operation('presentation-service', {
78
78
  ...named,
79
79
  ...wired
80
80
  }),
81
- operation('use-case', {
81
+ agent_requests_operation('use-case', {
82
82
  ...named,
83
83
  ...wired
84
84
  }),
85
- operation('command', {
85
+ agent_requests_operation('command', {
86
86
  ...named,
87
87
  ...implementations
88
88
  }),
89
- operation('query', {
89
+ agent_requests_operation('query', {
90
90
  ...named,
91
91
  ...implementations
92
92
  }),
93
- operation('port', {
93
+ agent_requests_operation('port', {
94
94
  ...named,
95
95
  ...implementations
96
96
  }),
97
- operation('implementation', {
97
+ agent_requests_operation('implementation', {
98
98
  ...common,
99
99
  ...agent_requests_owner,
100
100
  contract: id.describe('Exact contract ID from --describe.'),
@@ -102,7 +102,7 @@ const scaffoldRequestSchema = zod.discriminatedUnion('operation', [
102
102
  environments: zod.array(agent_requests_name).min(1).optional().describe('Required when the contract wire is envBranchedWire; omit it otherwise.'),
103
103
  ...wired
104
104
  }),
105
- operation('endpoint', {
105
+ agent_requests_operation('endpoint', {
106
106
  ...common,
107
107
  ...agent_requests_owner,
108
108
  controller: agent_requests_name,
@@ -116,13 +116,18 @@ const scaffoldRequestSchema = zod.discriminatedUnion('operation', [
116
116
  path: zod.string().regex(/^(?:\/?(?:[a-zA-Z0-9_-]+|:[a-zA-Z][a-zA-Z0-9_]*))*\/?$/),
117
117
  handler: id.optional().describe('Exact handler module ID from --describe. Required when the context has wired queries, commands or use cases; omit it otherwise.')
118
118
  }),
119
- operation('wire-dependency', {
119
+ agent_requests_operation('wire-dependency', {
120
120
  ...common,
121
121
  ...agent_requests_owner,
122
122
  module: id.describe('Exact wiring target ID, including implementation class, from --describe.'),
123
123
  dependencies: dependencies
124
124
  }),
125
- operation('move', {
125
+ agent_requests_operation('delete', {
126
+ ...common,
127
+ ...agent_requests_owner,
128
+ module: id.describe('Exact unit ID from --describe. Refused while other files use it.')
129
+ }),
130
+ agent_requests_operation('move', {
126
131
  ...common,
127
132
  ...agent_requests_owner,
128
133
  module: id.describe('Exact unit ID from --describe.'),
@@ -132,11 +137,11 @@ const scaffoldRequestSchema = zod.discriminatedUnion('operation', [
132
137
  })
133
138
  ]);
134
139
  const reactRequestSchema = zod.discriminatedUnion('operation', [
135
- operation('page', {
140
+ agent_requests_operation('page', {
136
141
  ...common,
137
142
  name: nestedName
138
143
  }),
139
- operation('widget', {
144
+ agent_requests_operation('widget', {
140
145
  ...common,
141
146
  name: nestedName,
142
147
  widgetType: zod["enum"]([
@@ -145,28 +150,55 @@ const reactRequestSchema = zod.discriminatedUnion('operation', [
145
150
  'headless'
146
151
  ]).optional()
147
152
  }),
148
- operation('ui-kit-component', {
153
+ agent_requests_operation('ui-kit-component', {
149
154
  ...common,
150
155
  name: agent_requests_name
151
156
  }),
152
- operation('shared-hook', {
157
+ agent_requests_operation('shared-hook', {
153
158
  ...common,
154
159
  name: agent_requests_name
155
160
  }),
156
- operation('move-page', {
161
+ agent_requests_operation('move-page', {
157
162
  ...common,
158
163
  module: nestedName,
159
164
  name: nestedName,
160
165
  moveRoute: zod.boolean().optional().describe('With Next.js and a route at the page path: move it too (default true). Omit it without such a route.')
161
166
  }),
162
- operation('move-widget', {
167
+ agent_requests_operation('delete-page', {
168
+ ...common,
169
+ module: nestedName,
170
+ deleteRoute: zod.boolean().optional().describe("With Next.js and the page's own route: delete it too (default true). Omit it without such a route.")
171
+ }),
172
+ agent_requests_operation('delete-widget', {
173
+ ...common,
174
+ module: nestedName
175
+ }),
176
+ agent_requests_operation('move-ui-kit-component', {
177
+ ...common,
178
+ module: agent_requests_name,
179
+ name: agent_requests_name
180
+ }),
181
+ agent_requests_operation('move-shared-hook', {
182
+ ...common,
183
+ module: agent_requests_name,
184
+ name: agent_requests_name
185
+ }),
186
+ agent_requests_operation('delete-ui-kit-component', {
187
+ ...common,
188
+ module: agent_requests_name
189
+ }),
190
+ agent_requests_operation('delete-shared-hook', {
191
+ ...common,
192
+ module: agent_requests_name
193
+ }),
194
+ agent_requests_operation('move-widget', {
163
195
  ...common,
164
196
  module: nestedName,
165
197
  name: nestedName
166
198
  })
167
199
  ]);
168
200
  const relativePath = zod.string().regex(/^[a-zA-Z0-9_.-]+(?:\/[a-zA-Z0-9_.-]+)*$/).refine((value)=>!value.split('/').some((part)=>'.' === part || '..' === part), 'Use a project-relative path without . or .. segments.');
169
- const integrationRequestSchema = operation('add', {
201
+ const integrationRequestSchema = agent_requests_operation('add', {
170
202
  ...common,
171
203
  integrations: zod.array(zod["enum"](integrationIds)).min(1),
172
204
  nextAdapter: zod.boolean().optional(),
@@ -292,7 +324,9 @@ const describeAgentCommand = (command)=>{
292
324
  integrations: integrationDescriptionsSafe(configured),
293
325
  reactModules: config?.frontend?.react ? [
294
326
  'page',
295
- 'widget'
327
+ 'widget',
328
+ 'ui-kit',
329
+ 'hook'
296
330
  ].flatMap((kind)=>findReactModules(node_path.join(root, config.project.rootFolder, 'presentation/react'), kind).map((module)=>({
297
331
  kind,
298
332
  name: module.name,
@@ -363,7 +397,7 @@ const executeScaffold = async (request, owner)=>{
363
397
  'errors'
364
398
  ]).content.fileNames.includes(request.namespace)) throw new RequestError('TARGET_NOT_FOUND', `Unknown namespace: ${request.namespace}.`);
365
399
  if ('implementation' === request.operation && !findContracts(owner.path).length) throw new RequestError('TARGET_NOT_FOUND', 'No contracts in this context.');
366
- if ('move' === request.operation && !findBackendUnits(owner.path).length) throw new RequestError('TARGET_NOT_FOUND', 'No modules in this context.');
400
+ if (('move' === request.operation || 'delete' === request.operation) && !findBackendUnits(owner.path).length) throw new RequestError('TARGET_NOT_FOUND', 'No modules in this context.');
367
401
  if ('wire-dependency' === request.operation && (!ConfigFile.backend.domainFirstPackages.includes('@domain-first/wire') || !findWiredModules(owner.path).length)) throw new RequestError('TARGET_NOT_FOUND', 'No wired modules in this context.');
368
402
  if ('endpoint' === request.operation) {
369
403
  if (!ConfigFile.backend.domainFirstPackages.includes('@domain-first/handlers-rest') || !findRestEndpointGenerator(new Folder(requireProject()).subitem([
@@ -392,7 +426,8 @@ const executeScaffold = async (request, owner)=>{
392
426
  implementation: ()=>scaffoldNewImplementation(owner),
393
427
  endpoint: ()=>scaffoldNewHandlersRestEndpoint(owner),
394
428
  'wire-dependency': ()=>wireDependency(owner),
395
- move: ()=>moveBackendUnitUseCase(owner)
429
+ move: ()=>moveBackendUnitUseCase(owner),
430
+ delete: ()=>deleteBackendUnitUseCase(owner)
396
431
  };
397
432
  return actions[request.operation]();
398
433
  };
@@ -401,14 +436,22 @@ const executeReact = async (request)=>{
401
436
  ConfigFile.Instance.data.project.rootFolder,
402
437
  'presentation/react'
403
438
  ]);
404
- if (request.operation.startsWith('move-') && !findReactModules(folder.path, 'move-page' === request.operation ? 'page' : 'widget').length) throw new RequestError('TARGET_NOT_FOUND', 'No React modules to move.');
439
+ const kindOf = (operation)=>operation.endsWith('-page') ? 'page' : operation.endsWith('-widget') ? 'widget' : operation.endsWith('-ui-kit-component') ? 'ui-kit' : operation.endsWith('-shared-hook') ? 'hook' : void 0;
440
+ const kind = /^(move|delete)-/.test(request.operation) ? kindOf(request.operation) : void 0;
441
+ if (kind && !findReactModules(folder.path, kind).length) throw new RequestError('TARGET_NOT_FOUND', `No React ${reactKindTitles[kind][1]} here.`);
405
442
  const actions = {
406
443
  page: ()=>scaffoldReactPage(folder),
407
444
  widget: ()=>scaffoldReactWidget(folder),
408
445
  'ui-kit-component': ()=>scaffoldReactUIKitComponent(folder),
409
446
  'shared-hook': ()=>scaffoldReactSharedHook(folder),
410
447
  'move-page': ()=>moveReactModuleUseCase(folder, 'page'),
411
- 'move-widget': ()=>moveReactModuleUseCase(folder, 'widget')
448
+ 'move-widget': ()=>moveReactModuleUseCase(folder, 'widget'),
449
+ 'delete-page': ()=>deleteReactModuleUseCase(folder, 'page'),
450
+ 'delete-widget': ()=>deleteReactModuleUseCase(folder, 'widget'),
451
+ 'move-ui-kit-component': ()=>moveReactModuleUseCase(folder, 'ui-kit'),
452
+ 'move-shared-hook': ()=>moveReactModuleUseCase(folder, 'hook'),
453
+ 'delete-ui-kit-component': ()=>deleteReactModuleUseCase(folder, 'ui-kit'),
454
+ 'delete-shared-hook': ()=>deleteReactModuleUseCase(folder, 'hook')
412
455
  };
413
456
  return actions[request.operation]();
414
457
  };
@@ -183,6 +183,12 @@ export declare const describeAgentCommand: (command: AgentCommand) => {
183
183
  context: z.ZodString;
184
184
  overwrite: z.ZodOptional<z.ZodBoolean>;
185
185
  dryRun: z.ZodOptional<z.ZodBoolean>;
186
+ }, z.core.$strict>, z.ZodObject<{
187
+ operation: z.ZodLiteral<"delete">;
188
+ module: z.ZodString;
189
+ context: z.ZodString;
190
+ overwrite: z.ZodOptional<z.ZodBoolean>;
191
+ dryRun: z.ZodOptional<z.ZodBoolean>;
186
192
  }, z.core.$strict>, z.ZodObject<{
187
193
  operation: z.ZodLiteral<"move">;
188
194
  module: z.ZodString;
@@ -224,6 +230,39 @@ export declare const describeAgentCommand: (command: AgentCommand) => {
224
230
  moveRoute: z.ZodOptional<z.ZodBoolean>;
225
231
  overwrite: z.ZodOptional<z.ZodBoolean>;
226
232
  dryRun: z.ZodOptional<z.ZodBoolean>;
233
+ }, z.core.$strict>, z.ZodObject<{
234
+ operation: z.ZodLiteral<"delete-page">;
235
+ module: z.ZodString;
236
+ deleteRoute: z.ZodOptional<z.ZodBoolean>;
237
+ overwrite: z.ZodOptional<z.ZodBoolean>;
238
+ dryRun: z.ZodOptional<z.ZodBoolean>;
239
+ }, z.core.$strict>, z.ZodObject<{
240
+ operation: z.ZodLiteral<"delete-widget">;
241
+ module: z.ZodString;
242
+ overwrite: z.ZodOptional<z.ZodBoolean>;
243
+ dryRun: z.ZodOptional<z.ZodBoolean>;
244
+ }, z.core.$strict>, z.ZodObject<{
245
+ operation: z.ZodLiteral<"move-ui-kit-component">;
246
+ module: z.ZodString;
247
+ name: z.ZodString;
248
+ overwrite: z.ZodOptional<z.ZodBoolean>;
249
+ dryRun: z.ZodOptional<z.ZodBoolean>;
250
+ }, z.core.$strict>, z.ZodObject<{
251
+ operation: z.ZodLiteral<"move-shared-hook">;
252
+ module: z.ZodString;
253
+ name: z.ZodString;
254
+ overwrite: z.ZodOptional<z.ZodBoolean>;
255
+ dryRun: z.ZodOptional<z.ZodBoolean>;
256
+ }, z.core.$strict>, z.ZodObject<{
257
+ operation: z.ZodLiteral<"delete-ui-kit-component">;
258
+ module: z.ZodString;
259
+ overwrite: z.ZodOptional<z.ZodBoolean>;
260
+ dryRun: z.ZodOptional<z.ZodBoolean>;
261
+ }, z.core.$strict>, z.ZodObject<{
262
+ operation: z.ZodLiteral<"delete-shared-hook">;
263
+ module: z.ZodString;
264
+ overwrite: z.ZodOptional<z.ZodBoolean>;
265
+ dryRun: z.ZodOptional<z.ZodBoolean>;
227
266
  }, z.core.$strict>, z.ZodObject<{
228
267
  operation: z.ZodLiteral<"move-widget">;
229
268
  module: z.ZodString;
@@ -346,7 +385,7 @@ export declare const describeAgentCommand: (command: AgentCommand) => {
346
385
  available: boolean;
347
386
  }[];
348
387
  reactModules: {
349
- kind: string;
388
+ kind: "page" | "widget" | "ui-kit" | "hook";
350
389
  name: string;
351
390
  file: string;
352
391
  }[];
@@ -161,6 +161,12 @@ export declare const scaffoldRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject
161
161
  context: z.ZodString;
162
162
  overwrite: z.ZodOptional<z.ZodBoolean>;
163
163
  dryRun: z.ZodOptional<z.ZodBoolean>;
164
+ }, z.core.$strict>, z.ZodObject<{
165
+ operation: z.ZodLiteral<"delete">;
166
+ module: z.ZodString;
167
+ context: z.ZodString;
168
+ overwrite: z.ZodOptional<z.ZodBoolean>;
169
+ dryRun: z.ZodOptional<z.ZodBoolean>;
164
170
  }, z.core.$strict>, z.ZodObject<{
165
171
  operation: z.ZodLiteral<"move">;
166
172
  module: z.ZodString;
@@ -203,6 +209,39 @@ export declare const reactRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
203
209
  moveRoute: z.ZodOptional<z.ZodBoolean>;
204
210
  overwrite: z.ZodOptional<z.ZodBoolean>;
205
211
  dryRun: z.ZodOptional<z.ZodBoolean>;
212
+ }, z.core.$strict>, z.ZodObject<{
213
+ operation: z.ZodLiteral<"delete-page">;
214
+ module: z.ZodString;
215
+ deleteRoute: z.ZodOptional<z.ZodBoolean>;
216
+ overwrite: z.ZodOptional<z.ZodBoolean>;
217
+ dryRun: z.ZodOptional<z.ZodBoolean>;
218
+ }, z.core.$strict>, z.ZodObject<{
219
+ operation: z.ZodLiteral<"delete-widget">;
220
+ module: z.ZodString;
221
+ overwrite: z.ZodOptional<z.ZodBoolean>;
222
+ dryRun: z.ZodOptional<z.ZodBoolean>;
223
+ }, z.core.$strict>, z.ZodObject<{
224
+ operation: z.ZodLiteral<"move-ui-kit-component">;
225
+ module: z.ZodString;
226
+ name: z.ZodString;
227
+ overwrite: z.ZodOptional<z.ZodBoolean>;
228
+ dryRun: z.ZodOptional<z.ZodBoolean>;
229
+ }, z.core.$strict>, z.ZodObject<{
230
+ operation: z.ZodLiteral<"move-shared-hook">;
231
+ module: z.ZodString;
232
+ name: z.ZodString;
233
+ overwrite: z.ZodOptional<z.ZodBoolean>;
234
+ dryRun: z.ZodOptional<z.ZodBoolean>;
235
+ }, z.core.$strict>, z.ZodObject<{
236
+ operation: z.ZodLiteral<"delete-ui-kit-component">;
237
+ module: z.ZodString;
238
+ overwrite: z.ZodOptional<z.ZodBoolean>;
239
+ dryRun: z.ZodOptional<z.ZodBoolean>;
240
+ }, z.core.$strict>, z.ZodObject<{
241
+ operation: z.ZodLiteral<"delete-shared-hook">;
242
+ module: z.ZodString;
243
+ overwrite: z.ZodOptional<z.ZodBoolean>;
244
+ dryRun: z.ZodOptional<z.ZodBoolean>;
206
245
  }, z.core.$strict>, z.ZodObject<{
207
246
  operation: z.ZodLiteral<"move-widget">;
208
247
  module: z.ZodString;
@@ -407,6 +446,12 @@ export declare const requestSchemaFor: (command: AgentCommand) => z.ZodDiscrimin
407
446
  context: z.ZodString;
408
447
  overwrite: z.ZodOptional<z.ZodBoolean>;
409
448
  dryRun: z.ZodOptional<z.ZodBoolean>;
449
+ }, z.core.$strict>, z.ZodObject<{
450
+ operation: z.ZodLiteral<"delete">;
451
+ module: z.ZodString;
452
+ context: z.ZodString;
453
+ overwrite: z.ZodOptional<z.ZodBoolean>;
454
+ dryRun: z.ZodOptional<z.ZodBoolean>;
410
455
  }, z.core.$strict>, z.ZodObject<{
411
456
  operation: z.ZodLiteral<"move">;
412
457
  module: z.ZodString;
@@ -448,6 +493,39 @@ export declare const requestSchemaFor: (command: AgentCommand) => z.ZodDiscrimin
448
493
  moveRoute: z.ZodOptional<z.ZodBoolean>;
449
494
  overwrite: z.ZodOptional<z.ZodBoolean>;
450
495
  dryRun: z.ZodOptional<z.ZodBoolean>;
496
+ }, z.core.$strict>, z.ZodObject<{
497
+ operation: z.ZodLiteral<"delete-page">;
498
+ module: z.ZodString;
499
+ deleteRoute: z.ZodOptional<z.ZodBoolean>;
500
+ overwrite: z.ZodOptional<z.ZodBoolean>;
501
+ dryRun: z.ZodOptional<z.ZodBoolean>;
502
+ }, z.core.$strict>, z.ZodObject<{
503
+ operation: z.ZodLiteral<"delete-widget">;
504
+ module: z.ZodString;
505
+ overwrite: z.ZodOptional<z.ZodBoolean>;
506
+ dryRun: z.ZodOptional<z.ZodBoolean>;
507
+ }, z.core.$strict>, z.ZodObject<{
508
+ operation: z.ZodLiteral<"move-ui-kit-component">;
509
+ module: z.ZodString;
510
+ name: z.ZodString;
511
+ overwrite: z.ZodOptional<z.ZodBoolean>;
512
+ dryRun: z.ZodOptional<z.ZodBoolean>;
513
+ }, z.core.$strict>, z.ZodObject<{
514
+ operation: z.ZodLiteral<"move-shared-hook">;
515
+ module: z.ZodString;
516
+ name: z.ZodString;
517
+ overwrite: z.ZodOptional<z.ZodBoolean>;
518
+ dryRun: z.ZodOptional<z.ZodBoolean>;
519
+ }, z.core.$strict>, z.ZodObject<{
520
+ operation: z.ZodLiteral<"delete-ui-kit-component">;
521
+ module: z.ZodString;
522
+ overwrite: z.ZodOptional<z.ZodBoolean>;
523
+ dryRun: z.ZodOptional<z.ZodBoolean>;
524
+ }, z.core.$strict>, z.ZodObject<{
525
+ operation: z.ZodLiteral<"delete-shared-hook">;
526
+ module: z.ZodString;
527
+ overwrite: z.ZodOptional<z.ZodBoolean>;
528
+ dryRun: z.ZodOptional<z.ZodBoolean>;
451
529
  }, z.core.$strict>, z.ZodObject<{
452
530
  operation: z.ZodLiteral<"move-widget">;
453
531
  module: z.ZodString;
@@ -51,4 +51,20 @@ export type BackendMoveResult = {
51
51
  * are returned instead, with paths after the move.
52
52
  */
53
53
  export declare const moveBackendUnit: (projectRoot: string, rootFolderPath: string, unit: BackendUnit, target: UnitPlace) => BackendMoveResult;
54
+ export type BackendDeleteResult = {
55
+ /** Files outside the unit that still import it: [file, import]. */
56
+ usedBy: [string, string][];
57
+ } | {
58
+ deleted: string[];
59
+ updated: string[];
60
+ usedBy?: undefined;
61
+ };
62
+ /**
63
+ * Stages the deletion of a unit: every file of it (an aggregate with its
64
+ * whole folder). What the generators added for it elsewhere goes too: an
65
+ * entity's re-export in its aggregate's barrel, an aggregate's in-memory
66
+ * DB section. Nothing is staged while other files still import the unit;
67
+ * those imports are returned instead.
68
+ */
69
+ export declare const deleteBackendUnit: (projectRoot: string, rootFolderPath: string, unit: BackendUnit) => BackendDeleteResult;
54
70
  export {};