sf-decomposer 7.1.1 → 7.2.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/CHANGELOG.md +7 -0
- package/README.md +149 -87
- package/lib/helpers/types.d.ts +9 -2
- package/lib/metadata/getRegistryValuesBySuffix.d.ts +1 -1
- package/lib/metadata/getRegistryValuesBySuffix.js +10 -3
- package/lib/metadata/getRegistryValuesBySuffix.js.map +1 -1
- package/lib/metadata/parseManifest.js +28 -12
- package/lib/metadata/parseManifest.js.map +1 -1
- package/lib/metadata/registry/manifestXml.d.ts +13 -0
- package/lib/metadata/registry/manifestXml.js +74 -0
- package/lib/metadata/registry/manifestXml.js.map +1 -0
- package/lib/metadata/registry/metadataRegistry.json +5417 -0
- package/lib/metadata/registry/registryAccess.d.ts +14 -0
- package/lib/metadata/registry/registryAccess.js +52 -0
- package/lib/metadata/registry/registryAccess.js.map +1 -0
- package/lib/metadata/registry/resolveManifestComponents.d.ts +13 -0
- package/lib/metadata/registry/resolveManifestComponents.js +60 -0
- package/lib/metadata/registry/resolveManifestComponents.js.map +1 -0
- package/lib/metadata/registry/types.d.ts +23 -0
- package/lib/metadata/registry/types.js +3 -0
- package/lib/metadata/registry/types.js.map +1 -0
- package/lib/metadata/registry/xmlParser.d.ts +5 -0
- package/lib/metadata/registry/xmlParser.js +177 -0
- package/lib/metadata/registry/xmlParser.js.map +1 -0
- package/oclif.manifest.json +1 -1
- package/package.json +59 -6
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,13 @@
|
|
|
5
5
|
|
|
6
6
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
7
7
|
|
|
8
|
+
## [7.2.0](https://github.com/mcarvin8/sf-decomposer/compare/v7.1.1...v7.2.0) (2026-08-24)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **metadata:** vendor SDR registry to drop runtime dependency ([#568](https://github.com/mcarvin8/sf-decomposer/issues/568)) ([76285e8](https://github.com/mcarvin8/sf-decomposer/commit/76285e850b3b4fe0b0732bf7de14d7b7dd056999))
|
|
14
|
+
|
|
8
15
|
## [7.1.1](https://github.com/mcarvin8/sf-decomposer/compare/v7.1.0...v7.1.1) (2026-08-18)
|
|
9
16
|
|
|
10
17
|
|
package/README.md
CHANGED
|
@@ -20,8 +20,8 @@ A Salesforce CLI plugin that **decomposes** large metadata XML files into smalle
|
|
|
20
20
|
- [3. Configure .forceignore](#3-configure-forceignore)
|
|
21
21
|
- [4. Configure Hooks](#4-configure-hooks-recommended)
|
|
22
22
|
- [Daily Workflow](#daily-workflow)
|
|
23
|
+
- [Commands](#commands)
|
|
23
24
|
- [Reference](#reference)
|
|
24
|
-
- [Commands](#commands)
|
|
25
25
|
- [Decompose Strategies](#decompose-strategies)
|
|
26
26
|
- [Supported Metadata](#supported-metadata)
|
|
27
27
|
- [Manifest-scoped Runs](#manifest-scoped-runs)
|
|
@@ -134,142 +134,204 @@ Pass `-x manifest/package.xml` to both `decompose` and `recompose` (and `deploy`
|
|
|
134
134
|
|
|
135
135
|
---
|
|
136
136
|
|
|
137
|
-
##
|
|
138
|
-
|
|
139
|
-
### Commands
|
|
137
|
+
## Commands
|
|
140
138
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
| `sf decomposer verify` | Round-trip check: disassemble + reassemble each parent XML in isolation and diff. |
|
|
139
|
+
<!-- commands -->
|
|
140
|
+
* [`sf decomposer decompose`](#sf-decomposer-decompose)
|
|
141
|
+
* [`sf decomposer recompose`](#sf-decomposer-recompose)
|
|
142
|
+
* [`sf decomposer verify`](#sf-decomposer-verify)
|
|
146
143
|
|
|
147
|
-
|
|
144
|
+
## `sf decomposer decompose`
|
|
148
145
|
|
|
149
|
-
Decomposes metadata
|
|
146
|
+
Decomposes the metadata files created by retrievals.
|
|
150
147
|
|
|
151
148
|
```
|
|
152
149
|
USAGE
|
|
153
|
-
$ sf decomposer decompose [
|
|
150
|
+
$ sf decomposer decompose [--json] [--flags-dir <value>] [-m <value>...] [-x <value>] [--prepurge] [--postpurge] [-f
|
|
151
|
+
xml|json|yaml|json5] [-i <value>...] [-s unique-id|grouped-by-tag] [-p] [-c] [--update-forceignore]
|
|
152
|
+
[--update-gitattributes]
|
|
154
153
|
|
|
155
154
|
FLAGS
|
|
156
|
-
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
--
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
--
|
|
155
|
+
-c, --config
|
|
156
|
+
Load all settings from .sfdecomposer.config.json in the repo root. When set, all top-level fields (metadataSuffixes,
|
|
157
|
+
manifest, prePurge, postPurge, decomposedFormat, strategy, ignorePackageDirectories, decomposeNestedPermissions,
|
|
158
|
+
updateForceignore, updateGitattributes) and the "overrides" array are applied. Explicit CLI flags take precedence
|
|
159
|
+
over config values. Makes --metadata-type and --manifest optional when either is defined in the config.
|
|
160
|
+
|
|
161
|
+
-f, --format=<option>
|
|
162
|
+
[default: xml] File format for the decomposed files.
|
|
163
|
+
<options: xml|json|yaml|json5>
|
|
164
|
+
|
|
165
|
+
-i, --ignore-package-directory=<value>...
|
|
166
|
+
Ignore a package directory.
|
|
167
|
+
|
|
168
|
+
-m, --metadata-type=<value>...
|
|
169
|
+
The metadata suffix to process, such as 'flow', 'labels', etc. Required unless --manifest is provided.
|
|
170
|
+
|
|
171
|
+
-p, --decompose-nested-permissions
|
|
172
|
+
Additionally decompose object and field permissions on a permission set when strategy is set to "grouped-by-tag".
|
|
173
|
+
|
|
174
|
+
-s, --strategy=<option>
|
|
175
|
+
[default: unique-id] Strategy to follow when decomposing files.
|
|
176
|
+
<options: unique-id|grouped-by-tag>
|
|
177
|
+
|
|
178
|
+
-x, --manifest=<value>
|
|
179
|
+
Path to a package.xml manifest file. When provided, only the metadata listed in the manifest is decomposed. If
|
|
180
|
+
--metadata-type is also provided, the intersection of the two is used.
|
|
181
|
+
|
|
182
|
+
--postpurge
|
|
183
|
+
Purge the original files after decomposing them.
|
|
184
|
+
|
|
185
|
+
--prepurge
|
|
186
|
+
Purge directories of pre-existing decomposed files.
|
|
187
|
+
|
|
188
|
+
--update-forceignore
|
|
189
|
+
Automatically add decomposed file paths to .forceignore after successful decomposition.
|
|
190
|
+
|
|
191
|
+
--update-gitattributes
|
|
192
|
+
Automatically add root metadata file patterns to .gitattributes after successful decomposition, suppressing noisy
|
|
193
|
+
diffs on recomposed files while keeping them tracked for tools like sfdx-git-delta.
|
|
167
194
|
|
|
168
195
|
GLOBAL FLAGS
|
|
169
|
-
--
|
|
170
|
-
|
|
196
|
+
--flags-dir=<value> Import flag values from a directory.
|
|
197
|
+
--json Format output as json.
|
|
171
198
|
|
|
172
|
-
|
|
199
|
+
DESCRIPTION
|
|
200
|
+
Decomposes the metadata files created by retrievals.
|
|
173
201
|
|
|
174
|
-
|
|
202
|
+
Decompose large metadata files into smaller files.
|
|
175
203
|
|
|
176
|
-
|
|
177
|
-
# Decompose flows (XML), purge before/after
|
|
178
|
-
sf decomposer decompose -m "flow" -f "xml" --prepurge --postpurge
|
|
204
|
+
You should run this after you retrieve metadata from an org.
|
|
179
205
|
|
|
180
|
-
|
|
181
|
-
sf decomposer decompose -m "flow" -
|
|
206
|
+
EXAMPLES
|
|
207
|
+
`sf decomposer decompose -m "flow" -f "xml" --prepurge --postpurge`
|
|
182
208
|
|
|
183
|
-
|
|
184
|
-
sf decomposer decompose -m "flow" -i "force-app"
|
|
209
|
+
`sf decomposer decompose -m "flow" -m "labels" -f "xml" --prepurge --postpurge`
|
|
185
210
|
|
|
186
|
-
|
|
187
|
-
sf decomposer decompose -x "manifest/package.xml" --prepurge
|
|
211
|
+
`sf decomposer decompose -m "flow" -f "xml" -i "force-app"`
|
|
188
212
|
|
|
189
|
-
|
|
190
|
-
sf decomposer decompose -x "manifest/package.xml" -m "permissionset"
|
|
213
|
+
`sf decomposer decompose -x "manifest/package.xml" --postpurge`
|
|
191
214
|
|
|
192
|
-
|
|
193
|
-
sf decomposer decompose --config
|
|
215
|
+
`sf decomposer decompose -x "manifest/package.xml" -m "flow"`
|
|
194
216
|
```
|
|
195
217
|
|
|
196
|
-
|
|
218
|
+
_See code: [src/commands/decomposer/decompose.ts](https://github.com/mcarvin8/sf-decomposer/blob/v7.2.0/src/commands/decomposer/decompose.ts)_
|
|
197
219
|
|
|
198
|
-
|
|
220
|
+
## `sf decomposer recompose`
|
|
221
|
+
|
|
222
|
+
Recomposes the files created by the `decompose` command before deployments.
|
|
199
223
|
|
|
200
224
|
```
|
|
201
225
|
USAGE
|
|
202
|
-
$ sf decomposer recompose [-
|
|
226
|
+
$ sf decomposer recompose [--json] [--flags-dir <value>] [-m <value>...] [-x <value>] [--postpurge] [-i <value>...]
|
|
227
|
+
[-c]
|
|
203
228
|
|
|
204
229
|
FLAGS
|
|
205
|
-
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
230
|
+
-c, --config Load all settings from .sfdecomposer.config.json in the repo root. When
|
|
231
|
+
set, top-level fields (metadataSuffixes, manifest, postPurge,
|
|
232
|
+
ignorePackageDirectories) are applied. Explicit CLI flags take precedence
|
|
233
|
+
over config values. Makes --metadata-type and --manifest optional when
|
|
234
|
+
either is defined in the config.
|
|
235
|
+
-i, --ignore-package-directory=<value>... Ignore a package directory.
|
|
236
|
+
-m, --metadata-type=<value>... The metadata suffix to process, such as 'flow', 'labels', etc. Required
|
|
237
|
+
unless --manifest is provided.
|
|
238
|
+
-x, --manifest=<value> Path to a package.xml manifest file. When provided, only the metadata
|
|
239
|
+
listed in the manifest is recomposed. If --metadata-type is also provided,
|
|
240
|
+
the intersection of the two is used.
|
|
241
|
+
--postpurge Purge the decomposed files after recomposing them.
|
|
210
242
|
|
|
211
243
|
GLOBAL FLAGS
|
|
212
|
-
--
|
|
213
|
-
|
|
244
|
+
--flags-dir=<value> Import flag values from a directory.
|
|
245
|
+
--json Format output as json.
|
|
214
246
|
|
|
215
|
-
|
|
247
|
+
DESCRIPTION
|
|
248
|
+
Recomposes the files created by the `decompose` command before deployments.
|
|
216
249
|
|
|
217
|
-
|
|
250
|
+
Recompose the decomposed files into deployment-compatible metadata files.
|
|
218
251
|
|
|
219
|
-
|
|
220
|
-
sf decomposer recompose -m "flow" --postpurge
|
|
221
|
-
sf decomposer recompose -m "flow" -i "force-app"
|
|
252
|
+
You should run this before you deploy decomposed metadata to an org.
|
|
222
253
|
|
|
223
|
-
|
|
224
|
-
sf decomposer recompose -
|
|
225
|
-
|
|
254
|
+
EXAMPLES
|
|
255
|
+
`sf decomposer recompose -m "flow" --postpurge`
|
|
256
|
+
|
|
257
|
+
`sf decomposer recompose -m "flow" -i "force-app"`
|
|
226
258
|
|
|
227
|
-
|
|
228
|
-
|
|
259
|
+
`sf decomposer recompose -x "manifest/package.xml" --postpurge`
|
|
260
|
+
|
|
261
|
+
`sf decomposer recompose -x "manifest/package.xml" -m "flow"`
|
|
229
262
|
```
|
|
230
263
|
|
|
231
|
-
|
|
264
|
+
_See code: [src/commands/decomposer/recompose.ts](https://github.com/mcarvin8/sf-decomposer/blob/v7.2.0/src/commands/decomposer/recompose.ts)_
|
|
232
265
|
|
|
233
|
-
|
|
266
|
+
## `sf decomposer verify`
|
|
234
267
|
|
|
235
|
-
|
|
268
|
+
Round-trip verify that decompose followed by recompose preserves your metadata byte-for-byte.
|
|
236
269
|
|
|
237
270
|
```
|
|
238
271
|
USAGE
|
|
239
|
-
$ sf decomposer verify [
|
|
272
|
+
$ sf decomposer verify [--json] [--flags-dir <value>] [-m <value>...] [-x <value>] [-f xml|json|yaml|json5] [-i
|
|
273
|
+
<value>...] [-s unique-id|grouped-by-tag] [-p] [-c]
|
|
240
274
|
|
|
241
275
|
FLAGS
|
|
242
|
-
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
-
|
|
276
|
+
-c, --config
|
|
277
|
+
Load all settings from .sfdecomposer.config.json in the repo root. When set, all top-level fields (metadataSuffixes,
|
|
278
|
+
manifest, decomposedFormat, strategy, ignorePackageDirectories, decomposeNestedPermissions) and the "overrides"
|
|
279
|
+
array are applied. Explicit CLI flags take precedence over config values. Makes --metadata-type and --manifest
|
|
280
|
+
optional when either is defined in the config.
|
|
281
|
+
|
|
282
|
+
-f, --format=<option>
|
|
283
|
+
[default: xml] File format to decompose into for the round-trip check.
|
|
284
|
+
<options: xml|json|yaml|json5>
|
|
285
|
+
|
|
286
|
+
-i, --ignore-package-directory=<value>...
|
|
287
|
+
Ignore a package directory.
|
|
288
|
+
|
|
289
|
+
-m, --metadata-type=<value>...
|
|
290
|
+
The metadata suffix to verify, such as 'flow', 'labels', etc. Required unless --manifest is provided.
|
|
291
|
+
|
|
292
|
+
-p, --decompose-nested-permissions
|
|
293
|
+
Additionally decompose object and field permissions on a permission set when strategy is set to "grouped-by-tag".
|
|
294
|
+
|
|
295
|
+
-s, --strategy=<option>
|
|
296
|
+
[default: unique-id] Strategy to follow when decomposing files for the round-trip check.
|
|
297
|
+
<options: unique-id|grouped-by-tag>
|
|
298
|
+
|
|
299
|
+
-x, --manifest=<value>
|
|
300
|
+
Path to a package.xml manifest file. When provided, only the metadata listed in the manifest is verified. If
|
|
301
|
+
--metadata-type is also provided, the intersection of the two is used.
|
|
249
302
|
|
|
250
303
|
GLOBAL FLAGS
|
|
251
|
-
--
|
|
252
|
-
|
|
304
|
+
--flags-dir=<value> Import flag values from a directory.
|
|
305
|
+
--json Format output as json.
|
|
253
306
|
|
|
254
|
-
|
|
307
|
+
DESCRIPTION
|
|
308
|
+
Round-trip verify that decompose followed by recompose preserves your metadata byte-for-byte.
|
|
255
309
|
|
|
256
|
-
|
|
310
|
+
For every parent metadata XML file belonging to the requested metadata types, disassembles and
|
|
311
|
+
reassembles it in an isolated temp directory using the same flags and `.sfdecomposer.config.json`
|
|
312
|
+
overrides you would use in production, then compares the reconstructed XML against the original.
|
|
313
|
+
Comparison is **structural** (sibling and attribute order are ignored, matching how Salesforce
|
|
314
|
+
treats metadata). The command never modifies your working tree.
|
|
257
315
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
316
|
+
Files where the only delta is ordering are surfaced as informational notices ("reordered") and do
|
|
317
|
+
not fail the run. Genuine semantic differences are reported as drift and exit non-zero, which
|
|
318
|
+
makes the command suitable as a CI gate before committing strategy, format, or override changes.
|
|
319
|
+
|
|
320
|
+
EXAMPLES
|
|
321
|
+
`sf decomposer verify -m "permissionset" -f "xml"`
|
|
261
322
|
|
|
262
|
-
|
|
263
|
-
sf decomposer verify -m "permissionset" -s "grouped-by-tag" -p
|
|
323
|
+
`sf decomposer verify -m "permissionset" -m "profile" -s "grouped-by-tag" -p`
|
|
264
324
|
|
|
265
|
-
|
|
266
|
-
sf decomposer verify -x "manifest/package.xml" --config
|
|
325
|
+
`sf decomposer verify -x "manifest/package.xml" --config`
|
|
267
326
|
```
|
|
268
327
|
|
|
269
|
-
|
|
328
|
+
_See code: [src/commands/decomposer/verify.ts](https://github.com/mcarvin8/sf-decomposer/blob/v7.2.0/src/commands/decomposer/verify.ts)_
|
|
329
|
+
<!-- commandsstop -->
|
|
270
330
|
|
|
271
331
|
---
|
|
272
332
|
|
|
333
|
+
## Reference
|
|
334
|
+
|
|
273
335
|
### Decompose Strategies
|
|
274
336
|
|
|
275
337
|
Two primary strategies control how nested XML elements are split on disk. Both round-trip deterministically and can be mixed across types — or even across components of the same type — via the `overrides` array (see [CONFIGURATION.md](CONFIGURATION.md)). When switching strategies for an existing component, pass `--prepurge` (or `prePurge: true`) to remove leftover files from the prior strategy before writing new ones.
|
|
@@ -430,9 +492,9 @@ permissionsets/
|
|
|
430
492
|
|
|
431
493
|
### Supported Metadata
|
|
432
494
|
|
|
433
|
-
All parent and child metadata types from this plugin's
|
|
495
|
+
All parent and child metadata types from this plugin's vendored copy of the [@salesforce/source-deploy-retrieve](https://github.com/forcedotcom/source-deploy-retrieve) (SDR) metadata registry are supported, except where noted below. Child types (e.g. `field`, `listView`, `validationRule`) resolve via their parent in the registry and behave like any other type — most are leaf-only and will be skipped non-fatally if their files contain no nested repeatable elements (the Rust disassembler logs a skip at `RUST_LOG=error`, but the CLI does not fail).
|
|
434
496
|
|
|
435
|
-
Use the metadata **suffix** for `-m` / `--metadata-type`, as in [
|
|
497
|
+
Use the metadata **suffix** for `-m` / `--metadata-type`, as in the vendored [`metadataRegistry.json`](src/metadata/registry/metadataRegistry.json) (synced weekly from upstream SDR — see [`sync-metadata-registry.yml`](.github/workflows/sync-metadata-registry.yml)), or infer from the file name: `*.{suffix}-meta.xml`.
|
|
436
498
|
|
|
437
499
|
| Metadata Type | CLI value | Notes |
|
|
438
500
|
|-------------------------------|-------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
@@ -627,7 +689,7 @@ Error (1): sfdx-project.json not found in any parent directory.
|
|
|
627
689
|
|
|
628
690
|
#### Package Directories Not Found for Given Metadata Type
|
|
629
691
|
|
|
630
|
-
This plugin relies on the @salesforce/source-deploy-retrieve metadata registry to map each metadata type to its expected directory name.
|
|
692
|
+
This plugin relies on a vendored snapshot of the @salesforce/source-deploy-retrieve metadata registry to map each metadata type to its expected directory name.
|
|
631
693
|
|
|
632
694
|
If you provide a metadata type whose corresponding directory does not exist in any of your package directories, the plugin will fail with:
|
|
633
695
|
|
|
@@ -661,7 +723,7 @@ Example `WARN` (CustomApplication where four `actionOverrides` siblings shared t
|
|
|
661
723
|
### Built With
|
|
662
724
|
|
|
663
725
|
- [config-disassembler-node](https://github.com/mcarvin8/config-disassembler-node) – Disassemble XML (and other config formats) into smaller, manageable files and reassemble when needed. Node.js + Rust (NAPI-RS).
|
|
664
|
-
- [@salesforce/source-deploy-retrieve](https://github.com/forcedotcom/source-deploy-retrieve) –
|
|
726
|
+
- [@salesforce/source-deploy-retrieve](https://github.com/forcedotcom/source-deploy-retrieve) – Source of the vendored metadata registry (`src/metadata/registry/metadataRegistry.json`), synced weekly. Not a runtime dependency — this plugin ships its own minimal registry lookup and package.xml parser instead.
|
|
665
727
|
|
|
666
728
|
---
|
|
667
729
|
|
package/lib/helpers/types.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Command, Config } from '@oclif/core';
|
|
2
|
-
import { ScopedPostRetrieve } from '@salesforce/source-deploy-retrieve';
|
|
3
2
|
export type DecomposerResult = {
|
|
4
3
|
metadata: string[];
|
|
5
4
|
};
|
|
@@ -75,11 +74,18 @@ export type MetaAttributes = {
|
|
|
75
74
|
metadataPaths: string[];
|
|
76
75
|
uniqueIdElements: string;
|
|
77
76
|
};
|
|
77
|
+
type RetrieveHookResult = {
|
|
78
|
+
retrieveResult: {
|
|
79
|
+
response: {
|
|
80
|
+
status?: string;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
};
|
|
78
84
|
export type PostRetrieveHookOptions = {
|
|
79
85
|
Command: Command;
|
|
80
86
|
argv: string[];
|
|
81
87
|
commandId: string;
|
|
82
|
-
result?:
|
|
88
|
+
result?: RetrieveHookResult;
|
|
83
89
|
config: Config;
|
|
84
90
|
};
|
|
85
91
|
export type DecomposeOptions = {
|
|
@@ -132,3 +138,4 @@ export type VerifyResult = {
|
|
|
132
138
|
*/
|
|
133
139
|
reordered: string[];
|
|
134
140
|
};
|
|
141
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MetadataType } from '@salesforce/source-deploy-retrieve';
|
|
2
1
|
import { MetaAttributes } from '../helpers/types.js';
|
|
2
|
+
import { MetadataType } from './registry/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Resolves and validates the SDR registry entry for a metadata suffix (rejects `object`, unknown
|
|
5
5
|
* suffixes, and unsupported adapter strategies). Synchronous and side-effect free, so callers can
|
|
@@ -1,26 +1,33 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
import { RegistryAccess } from '@salesforce/source-deploy-retrieve';
|
|
3
2
|
import { DEFAULT_UNIQUE_ID_ELEMENTS, UNSUPPORTED_ADAPTERS } from '../helpers/constants.js';
|
|
4
3
|
import { getPackageDirectories } from './getPackageDirectories.js';
|
|
5
4
|
import { getUniqueIdElements } from './getUniqueIdElements.js';
|
|
5
|
+
import { RegistryAccess } from './registry/registryAccess.js';
|
|
6
6
|
// Singleton instance for RegistryAccess to avoid repeated instantiation
|
|
7
7
|
let registryAccessInstance = null;
|
|
8
8
|
// Lazy-built reverse map: suffix → child MetadataType (for child types whose suffix differs from xmlName)
|
|
9
9
|
let childSuffixMap = null;
|
|
10
10
|
function getRegistryAccessInstance() {
|
|
11
|
+
// Stryker disable next-line ConditionalExpression -- caching is a pure perf optimization here;
|
|
12
|
+
// RegistryAccess itself is a stateless wrapper around registryAccess.ts's own module-level
|
|
13
|
+
// (and therefore already-singleton) registry data, so a "recreated" instance behaves identically.
|
|
11
14
|
if (!registryAccessInstance) {
|
|
12
15
|
registryAccessInstance = new RegistryAccess();
|
|
13
16
|
}
|
|
14
17
|
return registryAccessInstance;
|
|
15
18
|
}
|
|
16
19
|
function getChildSuffixMap(registryAccess) {
|
|
20
|
+
// Stryker disable next-line ConditionalExpression -- same reasoning as getRegistryAccessInstance above.
|
|
17
21
|
if (!childSuffixMap) {
|
|
18
22
|
childSuffixMap = new Map();
|
|
19
|
-
const
|
|
20
|
-
for (const childXmlNameLower of Object.keys(reg.childTypes)) {
|
|
23
|
+
for (const childXmlNameLower of Object.keys(registryAccess.childTypes)) {
|
|
21
24
|
const parentType = registryAccess.getParentType(childXmlNameLower);
|
|
25
|
+
// Stryker disable next-line OptionalChaining -- defensive guard; every key in childTypes
|
|
26
|
+
// is guaranteed (by the vendored registry's own invariants) to resolve to a real parentType
|
|
27
|
+
// with a children.types entry for that key.
|
|
22
28
|
const childEntry = parentType?.children?.types[childXmlNameLower];
|
|
23
29
|
/* v8 ignore next -- defensive guard; SDR registry always provides a suffix for child types */
|
|
30
|
+
// Stryker disable next-line ConditionalExpression, OptionalChaining -- same registry invariant.
|
|
24
31
|
if (childEntry?.suffix) {
|
|
25
32
|
childSuffixMap.set(childEntry.suffix, childEntry);
|
|
26
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRegistryValuesBySuffix.js","sourceRoot":"","sources":["../../src/metadata/getRegistryValuesBySuffix.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,
|
|
1
|
+
{"version":3,"file":"getRegistryValuesBySuffix.js","sourceRoot":"","sources":["../../src/metadata/getRegistryValuesBySuffix.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAE3F,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAG9D,wEAAwE;AACxE,IAAI,sBAAsB,GAA0B,IAAI,CAAC;AACzD,0GAA0G;AAC1G,IAAI,cAAc,GAAqC,IAAI,CAAC;AAE5D,SAAS,yBAAyB;IAChC,+FAA+F;IAC/F,2FAA2F;IAC3F,kGAAkG;IAClG,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAC5B,sBAAsB,GAAG,IAAI,cAAc,EAAE,CAAC;IAChD,CAAC;IACD,OAAO,sBAAsB,CAAC;AAChC,CAAC;AAED,SAAS,iBAAiB,CAAC,cAA8B;IACvD,wGAAwG;IACxG,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,cAAc,GAAG,IAAI,GAAG,EAAE,CAAC;QAC3B,KAAK,MAAM,iBAAiB,IAAI,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,CAAC;YACvE,MAAM,UAAU,GAAG,cAAc,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAA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AChC,gBAAyB,EACzB,gBAAyB,EACzB,SAAgE;IAEhE,MAAM,iBAAiB,GAAG,wBAAwB,CAAC,UAAU,CAAC,CAAC;IAE/D,IAAI,gBAAoC,CAAC;IACzC,IAAI,OAAO,KAAK,WAAW;QAAE,gBAAgB,GAAG,gBAAgB,IAAI,mBAAmB,CAAC,UAAU,CAAC,CAAC;IAEpG,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,SAAS;QAC7C,CAAC,CAAC;YACE,aAAa,EAAE,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,iBAAiB,CAAC,aAAa,EAAE,CAAC,IAAI,EAAE;YAC9E,UAAU,EAAE,SAAS,CAAC,UAAU;SACjC;QACH,CAAC,CAAC,MAAM,qBAAqB,CAAC,GAAG,iBAAiB,CAAC,aAAa,EAAE,EAAE,UAAU,EAAE,gBAAgB,CAAC,CAAC;IACpG,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC;QAC5B,MAAM,KAAK,CAAC,wBAAwB,iBAAiB,CAAC,aAAa,uCAAuC,CAAC,CAAC;IAE9G,MAAM,cAAc,GAAG;QACrB,UAAU,EAAE,iBAAiB,CAAC,MAAgB;QAC9C,mBAAmB,EAAE,iBAAiB,CAAC,mBAA8B;QACrE,UAAU,EAAE,iBAAiB,CAAC,UAAoB;QAClD,aAAa;QACb,gBAAgB,EAAE,gBAAgB;YAChC,CAAC,CAAC,GAAG,0BAA0B,IAAI,gBAAgB,EAAE;YACrD,CAAC,CAAC,0BAA0B;KAC/B,CAAC;IACF,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,CAAC;AACxC,CAAC"}
|
|
@@ -1,23 +1,29 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
import { readdir, stat } from 'node:fs/promises';
|
|
2
|
+
import { readdir, readFile, stat } from 'node:fs/promises';
|
|
3
3
|
import { join, resolve } from 'node:path';
|
|
4
|
-
import { ManifestResolver, RegistryAccess } from '@salesforce/source-deploy-retrieve';
|
|
5
4
|
import { getRepoRoot } from '../service/core/getRepoRoot.js';
|
|
6
5
|
import { buildPackageDirectoryIndex } from './getPackageDirectories.js';
|
|
6
|
+
import { RegistryAccess } from './registry/registryAccess.js';
|
|
7
|
+
import { resolveManifestComponents } from './registry/resolveManifestComponents.js';
|
|
7
8
|
export async function parseManifest(manifestPath, ignoreDirs, repoRootOverride) {
|
|
8
9
|
const { repoRoot } = repoRootOverride
|
|
9
10
|
? { repoRoot: repoRootOverride }
|
|
10
11
|
: (await getRepoRoot());
|
|
11
12
|
const absManifestPath = resolve(repoRoot, manifestPath);
|
|
12
13
|
const registry = new RegistryAccess();
|
|
13
|
-
const
|
|
14
|
-
const
|
|
14
|
+
const manifestContents = await readFile(absManifestPath, 'utf-8');
|
|
15
|
+
const components = resolveManifestComponents(manifestContents, registry);
|
|
15
16
|
// Group declared manifest entries by their effective parent metadata type.
|
|
16
17
|
const byParentType = new Map();
|
|
17
18
|
for (const component of components) {
|
|
18
19
|
const parentType = registry.getParentType(component.type.name) ?? component.type;
|
|
19
20
|
const parentMember = component.fullName.split('.')[0];
|
|
20
|
-
|
|
21
|
+
// Stryker disable next-line ConditionalExpression, StringLiteral -- whenever fullName === '*'
|
|
22
|
+
// exactly, parentMember (= fullName.split('.')[0]) is provably also '*' ('*'.split('.')[0] is
|
|
23
|
+
// '*'), so this disjunct can never independently change isWildcard's result below -- the
|
|
24
|
+
// parentMember check already covers that case.
|
|
25
|
+
const isFullNameWildcard = component.fullName === '*';
|
|
26
|
+
const isWildcard = isFullNameWildcard || parentMember === '*';
|
|
21
27
|
let entry = byParentType.get(parentType.name);
|
|
22
28
|
if (!entry) {
|
|
23
29
|
entry = { parentType, parentMembers: new Set(), wildcard: false };
|
|
@@ -41,7 +47,8 @@ export async function parseManifest(manifestPath, ignoreDirs, repoRootOverride)
|
|
|
41
47
|
const { index: directoryPathsByName } = directoryIndex;
|
|
42
48
|
const resolvedPerGroup = await Promise.all(groupedEntries.map(async ({ parentType, parentMembers, wildcard }) => {
|
|
43
49
|
const suffix = parentType.suffix;
|
|
44
|
-
/* istanbul ignore next -- @preserve: parent metadata types always declare a suffix in SDR's registry.
|
|
50
|
+
/* istanbul ignore next -- @preserve: parent metadata types always declare a suffix in SDR's registry. */
|
|
51
|
+
// Stryker disable next-line all
|
|
45
52
|
if (!suffix)
|
|
46
53
|
return undefined;
|
|
47
54
|
const typeDirs = directoryPathsByName.get(`${parentType.directoryName}`) ?? [];
|
|
@@ -76,7 +83,8 @@ export async function parseManifest(manifestPath, ignoreDirs, repoRootOverride)
|
|
|
76
83
|
}));
|
|
77
84
|
const unresolvedComponents = [];
|
|
78
85
|
for (const entry of resolvedPerGroup) {
|
|
79
|
-
/* istanbul ignore next -- @preserve: undefined only reachable via the suffix-less branch already ignored above.
|
|
86
|
+
/* istanbul ignore next -- @preserve: undefined only reachable via the suffix-less branch already ignored above. */
|
|
87
|
+
// Stryker disable next-line ConditionalExpression
|
|
80
88
|
if (!entry)
|
|
81
89
|
continue;
|
|
82
90
|
const { suffix, xmlPaths, unresolvedMembers } = entry;
|
|
@@ -85,7 +93,8 @@ export async function parseManifest(manifestPath, ignoreDirs, repoRootOverride)
|
|
|
85
93
|
}
|
|
86
94
|
if (xmlPaths.size === 0)
|
|
87
95
|
continue;
|
|
88
|
-
/* istanbul ignore else -- @preserve: multiple parent types sharing a suffix is not produced by SDR's registry.
|
|
96
|
+
/* istanbul ignore else -- @preserve: multiple parent types sharing a suffix is not produced by SDR's registry. */
|
|
97
|
+
// Stryker disable next-line ConditionalExpression
|
|
89
98
|
if (!parentXmlsBySuffix.has(suffix)) {
|
|
90
99
|
parentXmlsBySuffix.set(suffix, xmlPaths);
|
|
91
100
|
orderedSuffixes.push(suffix);
|
|
@@ -135,7 +144,8 @@ export async function resolveEffectiveMetadataTypes(metadataTypes, manifest, ign
|
|
|
135
144
|
}
|
|
136
145
|
async function resolveMemberXml(typeDir, parentType, member) {
|
|
137
146
|
const { suffix, strictDirectoryName, folderType } = parentType;
|
|
138
|
-
/* istanbul ignore next -- @preserve: types reaching this point always have a suffix
|
|
147
|
+
/* istanbul ignore next -- @preserve: types reaching this point always have a suffix. */
|
|
148
|
+
// Stryker disable next-line all
|
|
139
149
|
if (!suffix)
|
|
140
150
|
return undefined;
|
|
141
151
|
// Labels type has a single file regardless of member name.
|
|
@@ -160,13 +170,19 @@ async function resolveMemberXml(typeDir, parentType, member) {
|
|
|
160
170
|
}
|
|
161
171
|
async function listParentXmlPaths(typeDir, parentType) {
|
|
162
172
|
const { suffix, strictDirectoryName } = parentType;
|
|
163
|
-
/* istanbul ignore next -- @preserve: types reaching this point always have a suffix
|
|
173
|
+
/* istanbul ignore next -- @preserve: types reaching this point always have a suffix. */
|
|
174
|
+
// Stryker disable next-line all
|
|
164
175
|
if (!suffix)
|
|
165
176
|
return [];
|
|
166
177
|
const metaEnding = `.${suffix}-meta.xml`;
|
|
167
178
|
if (strictDirectoryName) {
|
|
168
179
|
const entries = await readdir(typeDir, { withFileTypes: true });
|
|
169
|
-
const results = await Promise.all(
|
|
180
|
+
const results = await Promise.all(
|
|
181
|
+
// Stryker disable next-line MethodExpression -- defensive guard, not provably killable: a
|
|
182
|
+
// filesystem can't have a file and a directory sharing the same name under the same parent,
|
|
183
|
+
// so `join(typeDir, entry.name, ...)` can never resolve to a real file for a non-directory
|
|
184
|
+
// entry regardless of this filter -- exists() below would reject it either way.
|
|
185
|
+
entries
|
|
170
186
|
.filter((entry) => entry.isDirectory())
|
|
171
187
|
.map(async (entry) => {
|
|
172
188
|
const candidate = join(typeDir, entry.name, `${entry.name}${metaEnding}`);
|
|
@@ -187,9 +203,9 @@ async function exists(path) {
|
|
|
187
203
|
try {
|
|
188
204
|
await stat(path);
|
|
189
205
|
return true;
|
|
206
|
+
// Stryker disable next-line BlockStatement
|
|
190
207
|
}
|
|
191
208
|
catch {
|
|
192
|
-
// Stryker disable next-line BlockStatement
|
|
193
209
|
return false;
|
|
194
210
|
}
|
|
195
211
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseManifest.js","sourceRoot":"","sources":["../../src/metadata/parseManifest.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"parseManifest.js","sourceRoot":"","sources":["../../src/metadata/parseManifest.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AAwBpF,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,YAAoB,EACpB,UAAgC,EAChC,gBAAyB;IAEzB,MAAM,EAAE,QAAQ,EAAE,GAAG,gBAAgB;QACnC,CAAC,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE;QAChC,CAAC,CAAE,CAAC,MAAM,WAAW,EAAE,CAA0B,CAAC;IACpD,MAAM,eAAe,GAAG,OAAO,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IAExD,MAAM,QAAQ,GAAG,IAAI,cAAc,EAAE,CAAC;IACtC,MAAM,gBAAgB,GAAG,MAAM,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;IAClE,MAAM,UAAU,GAAG,yBAAyB,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;IAEzE,2EAA2E;IAC3E,MAAM,YAAY,GAAG,IAAI,GAAG,EAA0B,CAAC;IACvD,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC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0,0 +1,13 @@
|
|
|
1
|
+
export type ParsedManifestType = {
|
|
2
|
+
name: string;
|
|
3
|
+
members: string[];
|
|
4
|
+
};
|
|
5
|
+
export type ParsedManifest = {
|
|
6
|
+
types: ParsedManifestType[];
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Parses a package.xml manifest's raw text into its declared types/members. Validates only that
|
|
10
|
+
* the document follows the Metadata API manifest structure (a single <Package> root containing
|
|
11
|
+
* <types>/<version> elements) -- metadata type names are not checked against the registry here.
|
|
12
|
+
*/
|
|
13
|
+
export declare function parseManifestXml(xml: string): ParsedManifest;
|