You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each diff line is dispatched to a type-specific handler via an async queue capped at `getConcurrencyThreshold()`. The `TypeHandlerFactory` selects the handler class based on the metadata type's `xmlName`.
117
+
Each diff line is dispatched to a type-specific handler via an async queue capped at `getConcurrencyThreshold()`. The `TypeHandlerFactory` selects the handler class using a multi-tier resolution chain that combines explicit overrides with dynamic resolution from SDR registry attributes.
| 5. InFile parent | has children with `xmlTag`+`key`|`InFileHandler`|`Workflow`|
157
+
| 6. Fallback | none of the above |`StandardHandler`|`ApexClass`|
158
+
159
+
This design means most new SDR metadata types are handled automatically without code changes. Only types requiring specialized behavior need explicit overrides in `handlerMap`.
160
+
131
161
`MetadataBoundaryResolver` creates a `MetadataElement` — a value object capturing the parsed identity of the diff line: base path, extension, parent folder, component name, and path segments after the type directory. It may scan the git tree to find the component root when the directory name isn't present in the path.
132
162
133
163
### Handler Hierarchy
@@ -201,7 +231,7 @@ Detects the format by file extension and routes accordingly.
201
231
#### InFolderHandler
202
232
203
233
**Extends**: StandardHandler
204
-
**Used by**: Document, EmailTemplate
234
+
**Used by**: Document, EmailTemplate (and any type with `inFolder: true` not explicitly overridden)
205
235
206
236
Handles metadata stored in named folders. When a file changes, the handler also copies the folder's `-meta.xml` descriptor and any companion files sharing the same base name (e.g. thumbnails). Element names use the `Folder/MemberName` format.
207
237
@@ -229,7 +259,7 @@ Extends shared folder behavior: changing any sub-file also forces inclusion of t
**Used by**: ExperienceBundle, GenAiPlannerBundle, LightningTypeBundle, StaticResource, WaveTemplateBundle (and any type with `adapter: "bundle"` or `adapter: "mixedContent"` not explicitly overridden)
233
263
234
264
Handles bundle-like resources where changing any file within the bundle triggers the entire bundle to be redeployed. On deletion, checks if the bundle root still has content — if yes, treats as modification instead of deletion (the bundle still exists with remaining files).
235
265
@@ -257,7 +287,7 @@ Field translation files are not independently deployable. The handler produces a
**Used by**: SharingCriteriaRule, SharingGuestRule, SharingOwnerRule, Territory2, Territory2Rule, WorkflowAlert, WorkflowFieldUpdate, WorkflowFlowAction, WorkflowKnowledgePublish, WorkflowOutboundMessage, WorkflowRule, WorkflowSend, WorkflowTask (and any child type with `xmlTag` + `key` whose parent has no adapter)
261
291
262
292
Handles metadata stored as individual files in sub-folders of a parent type. Element names are qualified as `ParentName.ChildName`. On addition, also copies the parent type's `-meta.xml`.
263
293
@@ -285,7 +315,7 @@ On addition, scans the object's `fields/` subfolder for Master Detail fields and
| New metadata type handler |Add entry to `handlerMap` in `TypeHandlerFactory`mapping `xmlName → HandlerClass`|
449
+
| New metadata type handler |Most types are auto-resolved via SDR registry attributes (`adapter`, `decomposition`, `inFolder`, `xmlTag`+`key`). Only add an explicit entry to `handlerMap` in `TypeHandlerFactory`when a type needs behavior that differs from what SDR signals would select.|
420
450
| New post-processor | Add a `BaseProcessor` subclass to `registeredProcessors` in `postProcessorManager.ts`|
421
451
| Metadata type override | Add definition to `internalRegistry.ts` with special flags (`pruneOnly`, `excluded`, `xmlTag`, etc.) |
422
452
| Programmatic API |`import sgd from 'sfdx-git-delta'` — call `await sgd(config)` directly, receiving the `Work` object |
@@ -474,5 +504,7 @@ Metadata type definition (Zod-validated):
0 commit comments