sf-decomposer 6.12.0 → 6.13.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 +9 -0
- package/README.md +53 -35
- package/lib/core/decomposeMetadataTypes.js +6 -9
- package/lib/core/decomposeMetadataTypes.js.map +1 -1
- package/lib/helpers/configOverrides.d.ts +29 -0
- package/lib/helpers/configOverrides.js +123 -36
- package/lib/helpers/configOverrides.js.map +1 -1
- package/lib/helpers/types.d.ts +4 -1
- package/lib/service/decompose/decomposeFileHandler.d.ts +3 -1
- package/lib/service/decompose/decomposeFileHandler.js +82 -27
- package/lib/service/decompose/decomposeFileHandler.js.map +1 -1
- package/lib/service/recompose/recomposeFileHandler.js +1 -1
- package/lib/service/recompose/recomposeFileHandler.js.map +1 -1
- package/messages/decomposer.decompose.md +1 -1
- package/oclif.manifest.json +2 -2
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,15 @@
|
|
|
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
|
+
## [6.13.0](https://github.com/mcarvin8/sf-decomposer/compare/v6.12.0...v6.13.0) (2026-04-30)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **decompose:** add per-component overrides ([#415](https://github.com/mcarvin8/sf-decomposer/issues/415)) ([47d7c79](https://github.com/mcarvin8/sf-decomposer/commit/47d7c794db17ccc59e832309a0a4980d736ab89c))
|
|
14
|
+
* **deps:** bump dependabot/fetch-metadata from 2 to 3 ([#412](https://github.com/mcarvin8/sf-decomposer/issues/412)) ([6b0a24b](https://github.com/mcarvin8/sf-decomposer/commit/6b0a24b9c83dfb6fb9ef1d8dc8e2dfbec23200bf))
|
|
15
|
+
* **metadata:** bump @salesforce/source-deploy-retrieve ([#413](https://github.com/mcarvin8/sf-decomposer/issues/413)) ([e261049](https://github.com/mcarvin8/sf-decomposer/commit/e261049cc07a94642c1e80cf29dbd1e96a7183bd))
|
|
16
|
+
|
|
8
17
|
## [6.12.0](https://github.com/mcarvin8/sf-decomposer/compare/v6.11.0...v6.12.0) (2026-04-27)
|
|
9
18
|
|
|
10
19
|
|
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ A Salesforce CLI plugin that **decomposes** large metadata XML files into smalle
|
|
|
26
26
|
- [Exceptions](#exceptions)
|
|
27
27
|
- [Troubleshooting](#troubleshooting)
|
|
28
28
|
- [Hooks](#hooks)
|
|
29
|
-
- [Per-Type Overrides](#per-type-overrides)
|
|
29
|
+
- [Per-Type & Per-Component Overrides](#per-type--per-component-overrides)
|
|
30
30
|
- [Ignore Files](#ignore-files)
|
|
31
31
|
- [.forceignore](#forceignore)
|
|
32
32
|
- [.sfdecomposerignore](#sfdecomposerignore)
|
|
@@ -79,7 +79,7 @@ A Salesforce CLI plugin that **decomposes** large metadata XML files into smalle
|
|
|
79
79
|
|
|
80
80
|
## Requirements
|
|
81
81
|
|
|
82
|
-
The [
|
|
82
|
+
The [config-disassembler-node](https://github.com/mcarvin8/config-disassembler-node) package, which depends on a Rust crate, ships with native binaries for these platforms:
|
|
83
83
|
|
|
84
84
|
| Platform | Architectures |
|
|
85
85
|
| ----------- | ---------------------------------- |
|
|
@@ -87,7 +87,7 @@ The [xml-disassembler-node](https://github.com/mcarvin8/xml-disassembler-node) p
|
|
|
87
87
|
| **Linux** | x64, arm64, ia32 |
|
|
88
88
|
| **Windows** | x64 |
|
|
89
89
|
|
|
90
|
-
If other platforms or architectures require support, please open an issue in [
|
|
90
|
+
If other platforms or architectures require support, please open an issue in [config-disassembler-node](https://github.com/mcarvin8/config-disassembler-node/issues).
|
|
91
91
|
|
|
92
92
|
---
|
|
93
93
|
|
|
@@ -135,7 +135,7 @@ FLAGS
|
|
|
135
135
|
--prepurge Remove existing decomposed files before decomposing [default: false]
|
|
136
136
|
--postpurge Remove original metadata files after decomposing [default: false]
|
|
137
137
|
-p, --decompose-nested-permissions With grouped-by-tag, further decompose permission set and muting permission set object/field permissions
|
|
138
|
-
-c, --config Load per-
|
|
138
|
+
-c, --config Load per-type and per-component overrides from .sfdecomposer.config.json in the repo root. Only the "overrides" array is consumed. See Per-Type & Per-Component Overrides. [default: false]
|
|
139
139
|
|
|
140
140
|
GLOBAL FLAGS
|
|
141
141
|
--json Output as JSON.
|
|
@@ -232,7 +232,7 @@ sf project deploy start -x "manifest/package.xml"
|
|
|
232
232
|
|
|
233
233
|
## Decompose Strategies
|
|
234
234
|
|
|
235
|
-
> **
|
|
235
|
+
> **Tip:** A single decompose run can mix strategies and formats across metadata types — and even across components within the same type — through the `overrides` array (see [Per-Type & Per-Component Overrides](#per-type--per-component-overrides)). Recompose is deterministic from the on-disk sidecar, so any combination round-trips. When switching strategies for an existing component, pass `--prepurge` (or set `prePurge: true`) so leftover files from the previous strategy are removed before the new ones are written.
|
|
236
236
|
|
|
237
237
|
- **unique-id** (default): Each nested element goes to its own file, named by unique-id fields or content hash. Leaf elements stay in a file named like the original XML.
|
|
238
238
|
- **grouped-by-tag**: All elements with the same tag (e.g. `<fieldPermissions>`) go into one file named after the tag (e.g. `fieldPermissions.xml`). Leaf elements are still grouped in the original-named file.
|
|
@@ -334,14 +334,14 @@ For example, if you attempt to decompose Custom Labels but none of your package
|
|
|
334
334
|
|
|
335
335
|
### XML disassemble output (Rust crate)
|
|
336
336
|
|
|
337
|
-
The
|
|
337
|
+
The config-disassembler Node plugin uses a **Rust crate** for XML decomposing and recomposing. Disassemble errors and messages are shown in the terminal.
|
|
338
338
|
|
|
339
339
|
Control verbosity with the `RUST_LOG` environment variable (e.g. `RUST_LOG=debug` for detailed output).
|
|
340
340
|
|
|
341
341
|
Example output in the terminal (Rust log format):
|
|
342
342
|
|
|
343
343
|
```
|
|
344
|
-
[2026-
|
|
344
|
+
[2026-04-30T12:34:38Z ERROR config_disassembler::xml::builders::build_disassembled_files] The XML file C:\Users\matthew.carvin\Documents\sf-decomposer\fixtures\package-dir-1\permissionsets\only_leafs.permissionset-meta.xml only has leaf elements. This file will not be disassembled.
|
|
345
345
|
```
|
|
346
346
|
|
|
347
347
|
### Files with only leaf elements
|
|
@@ -359,27 +359,27 @@ Put **.sfdecomposer.config.json** in the project root to run:
|
|
|
359
359
|
- **After** `sf project retrieve start`: decompose.
|
|
360
360
|
- **Before** `sf project deploy start` / `sf project deploy validate`: recompose.
|
|
361
361
|
|
|
362
|
-
Copy and customize the [sample config](https://raw.githubusercontent.com/mcarvin8/sf-decomposer/main/examples/.sfdecomposer.config.json), or the [sample config with
|
|
362
|
+
Copy and customize the [sample config](https://raw.githubusercontent.com/mcarvin8/sf-decomposer/main/examples/.sfdecomposer.config.json), or the [sample config with overrides](https://raw.githubusercontent.com/mcarvin8/sf-decomposer/main/examples/.sfdecomposer.config.overrides.json) to vary format/strategy/etc. by metadata type or by individual component.
|
|
363
363
|
|
|
364
|
-
| Option | Required | Description
|
|
365
|
-
| ---------------------------- | ----------- |
|
|
366
|
-
| `metadataSuffixes` | Conditional | Comma-separated metadata suffixes to decompose/recompose. Required unless `manifest` is set; when both are set, the run is scoped to the intersection.
|
|
367
|
-
| `manifest` | Conditional | Path (relative to the project root) to a `package.xml` manifest. When set, only the components listed in the manifest are decomposed/recomposed. See `-x` above.
|
|
368
|
-
| `ignorePackageDirectories` | No | Comma-separated package directories to skip.
|
|
369
|
-
| `prePurge` | No | Remove existing decomposed files before decomposing (default: false).
|
|
370
|
-
| `postPurge` | No | After decompose: remove originals; after recompose: remove decomposed files (default: false).
|
|
371
|
-
| `decomposedFormat` | No | xml, json, json5, or yaml (default: xml).
|
|
372
|
-
| `strategy` | No | `unique-id` \| `grouped-by-tag` (default: unique-id).
|
|
373
|
-
| `decomposeNestedPermissions` | No | With grouped-by-tag, set true to further decompose permission set and muting permission set object/field permissions.
|
|
374
|
-
| `overrides` | No | Array of per-
|
|
364
|
+
| Option | Required | Description |
|
|
365
|
+
| ---------------------------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
366
|
+
| `metadataSuffixes` | Conditional | Comma-separated metadata suffixes to decompose/recompose. Required unless `manifest` is set; when both are set, the run is scoped to the intersection. |
|
|
367
|
+
| `manifest` | Conditional | Path (relative to the project root) to a `package.xml` manifest. When set, only the components listed in the manifest are decomposed/recomposed. See `-x` above. |
|
|
368
|
+
| `ignorePackageDirectories` | No | Comma-separated package directories to skip. |
|
|
369
|
+
| `prePurge` | No | Remove existing decomposed files before decomposing (default: false). |
|
|
370
|
+
| `postPurge` | No | After decompose: remove originals; after recompose: remove decomposed files (default: false). |
|
|
371
|
+
| `decomposedFormat` | No | xml, json, json5, or yaml (default: xml). |
|
|
372
|
+
| `strategy` | No | `unique-id` \| `grouped-by-tag` (default: unique-id). |
|
|
373
|
+
| `decomposeNestedPermissions` | No | With grouped-by-tag, set true to further decompose permission set and muting permission set object/field permissions. |
|
|
374
|
+
| `overrides` | No | Array of per-type and/or per-component overrides for `decomposedFormat`, `strategy`, `decomposeNestedPermissions`, `prePurge`, and `postPurge`. See [Per-Type & Per-Component Overrides](#per-type--per-component-overrides). |
|
|
375
375
|
|
|
376
376
|
---
|
|
377
377
|
|
|
378
|
-
## Per-Type Overrides
|
|
378
|
+
## Per-Type & Per-Component Overrides
|
|
379
379
|
|
|
380
|
-
|
|
380
|
+
Overrides apply to **decompose only**. Recompose is a deterministic round-trip — it auto-detects format from the on-disk files and does not depend on strategy — so it ignores the `overrides` array.
|
|
381
381
|
|
|
382
|
-
By default, a single decompose run uses one format and one strategy across every metadata type. The optional `overrides` array in `.sfdecomposer.config.json` lets you vary a small set of options per metadata suffix without splitting the run into multiple invocations.
|
|
382
|
+
By default, a single decompose run uses one format and one strategy across every metadata type. The optional `overrides` array in `.sfdecomposer.config.json` lets you vary a small set of options per metadata suffix (**type-scope**) or per individual SDR component (**component-scope**) without splitting the run into multiple invocations.
|
|
383
383
|
|
|
384
384
|
```json
|
|
385
385
|
{
|
|
@@ -395,6 +395,11 @@ By default, a single decompose run uses one format and one strategy across every
|
|
|
395
395
|
"metadataTypes": ["permissionset", "mutingpermissionset"],
|
|
396
396
|
"strategy": "grouped-by-tag",
|
|
397
397
|
"decomposeNestedPermissions": true
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
"components": ["permissionset:HR_Admin", "permissionset:Big_PermSet"],
|
|
401
|
+
"strategy": "grouped-by-tag",
|
|
402
|
+
"decomposeNestedPermissions": true
|
|
398
403
|
}
|
|
399
404
|
]
|
|
400
405
|
}
|
|
@@ -402,24 +407,37 @@ By default, a single decompose run uses one format and one strategy across every
|
|
|
402
407
|
|
|
403
408
|
### What can be overridden
|
|
404
409
|
|
|
405
|
-
| Field | Notes
|
|
406
|
-
| ---------------------------- |
|
|
407
|
-
| `metadataTypes` |
|
|
408
|
-
| `
|
|
409
|
-
| `
|
|
410
|
-
| `
|
|
411
|
-
| `
|
|
412
|
-
| `
|
|
410
|
+
| Field | Notes |
|
|
411
|
+
| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
412
|
+
| `metadataTypes` | Optional (required if `components` is omitted). Array of metadata suffixes (same vocabulary as `--metadata-type` / `metadataSuffixes`). Each suffix may appear in at most one override. |
|
|
413
|
+
| `components` | Optional (required if `metadataTypes` is omitted). Array of `<metadataSuffix>:<fullName>` keys (e.g. `permissionset:HR_Admin`, `report:MyFolder/MyReport`). Each component may appear in at most one override. |
|
|
414
|
+
| `decomposedFormat` | `xml` \| `json` \| `json5` \| `yaml`. |
|
|
415
|
+
| `strategy` | `unique-id` \| `grouped-by-tag`. Hard rules still win — `labels` and `loyaltyProgramSetup` are always treated as `unique-id`. |
|
|
416
|
+
| `decomposeNestedPermissions` | Only applies to `permissionset` / `mutingpermissionset` with `grouped-by-tag`. |
|
|
417
|
+
| `prePurge` | Per-scope prePurge (decompose). Component-scope `prePurge` only purges the named component's decomposed directory. |
|
|
418
|
+
| `postPurge` | Per-scope postPurge (decompose: remove originals after decomposing). |
|
|
413
419
|
|
|
414
420
|
Run-scope options (`metadataSuffixes`, `manifest`, `ignorePackageDirectories`) are **not** valid inside an override; the plugin will throw if they are present.
|
|
415
421
|
|
|
422
|
+
#### Component key conventions
|
|
423
|
+
|
|
424
|
+
The `<fullName>` part of a component key is the SDR fullName for the component, matching the basename of the decomposed directory:
|
|
425
|
+
|
|
426
|
+
- **Plain types** (e.g. `permissionset`, `flow`, `profile`, `workflow`): use the file stem, e.g. `permissionset:HR_Admin` for `permissionsets/HR_Admin.permissionset-meta.xml`.
|
|
427
|
+
- **Strict-directory types** (e.g. `bot`): use the bot directory name, e.g. `bot:My_Bot` for `bots/My_Bot/My_Bot.bot-meta.xml`.
|
|
428
|
+
- **Folder-typed metadata** (e.g. `report`, `dashboard`, `email`, `document`): the unit of decomposition is the folder; use the folder name, e.g. `report:MyFolder` to scope every report inside `reports/MyFolder/`.
|
|
429
|
+
- **`labels`**: there is exactly one labels file per labels directory, so component-scope keys are not meaningful — use the type-scope `metadataTypes: ["labels"]` instead.
|
|
430
|
+
|
|
431
|
+
Component overrides are not a filter. If `--metadata` / `metadataSuffixes` includes `permissionset`, every permission set is still decomposed; the override only changes how the named ones are decomposed. Use `--manifest` / the hook's `manifest` field if you want to scope the run itself to a subset of components.
|
|
432
|
+
|
|
416
433
|
### Precedence
|
|
417
434
|
|
|
418
|
-
For each
|
|
435
|
+
For each component, each option is resolved independently in this order (highest first):
|
|
419
436
|
|
|
420
|
-
1. The
|
|
421
|
-
2.
|
|
422
|
-
3.
|
|
437
|
+
1. The component-scope override value (matching `<suffix>:<fullName>` in `components`), if set.
|
|
438
|
+
2. The type-scope override value (matching `<suffix>` in `metadataTypes`), if set.
|
|
439
|
+
3. The run-wide value (CLI flag, hook config top-level field, or built-in default).
|
|
440
|
+
4. Hard plugin rules (e.g. `labels` and `loyaltyProgramSetup` forced to `unique-id`) override all of the above.
|
|
423
441
|
|
|
424
442
|
### Opting in from the CLI
|
|
425
443
|
|
|
@@ -463,7 +481,7 @@ Bugs and feature requests: [open an issue](https://github.com/mcarvin8/sf-decomp
|
|
|
463
481
|
|
|
464
482
|
## Built With
|
|
465
483
|
|
|
466
|
-
- [
|
|
484
|
+
- [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 (Neon). See [Requirements](#requirements).
|
|
467
485
|
- [@salesforce/source-deploy-retrieve](https://github.com/forcedotcom/source-deploy-retrieve) – JavaScript toolkit for working with Salesforce metadata.
|
|
468
486
|
|
|
469
487
|
---
|
|
@@ -48,15 +48,12 @@ export async function decomposeMetadataTypes(options) {
|
|
|
48
48
|
log(`Skipping ${metadataType}: ${message}`);
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
effectiveStrategy = 'unique-id';
|
|
58
|
-
}
|
|
59
|
-
await decomposeFileHandler(metaAttributes, resolved.prepurge, resolved.postpurge, resolved.format, ignorePath, effectiveStrategy, resolved.decomposeNestedPerms, manifestXmlPaths);
|
|
51
|
+
// Type-scope resolved options serve as the base for component-scope resolution further
|
|
52
|
+
// down the call stack. Hard strategy rules (labels / loyaltyProgramSetup) are applied per
|
|
53
|
+
// file inside the disassembler so they remain in force even when a component-scope override
|
|
54
|
+
// tries to flip the strategy.
|
|
55
|
+
const typeResolved = resolveDecomposeOptionsForType(metadataType, { format, strategy, decomposeNestedPerms, prepurge, postpurge }, overrides);
|
|
56
|
+
await decomposeFileHandler(metaAttributes, typeResolved, ignorePath, overrides, manifestXmlPaths);
|
|
60
57
|
processed.push(metadataType);
|
|
61
58
|
log(`All metadata files have been decomposed for the metadata type: ${metadataType}`);
|
|
62
59
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decomposeMetadataTypes.js","sourceRoot":"","sources":["../../src/core/decomposeMetadataT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AC,CAAC,CACH,CAAC;IAEF,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAEzB,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;AACjC,CAAC"}
|
|
@@ -22,12 +22,41 @@ export declare function loadOverridesFromConfig(configPath: string): Promise<Dec
|
|
|
22
22
|
* Unknown override keys are tolerated (ignored), but forbidden run-scope keys throw.
|
|
23
23
|
*/
|
|
24
24
|
export declare function validateOverrides(overrides: DecomposerOverride[]): void;
|
|
25
|
+
/**
|
|
26
|
+
* Parse a component override key of the form `<metadataSuffix>:<fullName>`. Returns `undefined`
|
|
27
|
+
* when the key is malformed. Only the first colon is treated as the delimiter so fullNames that
|
|
28
|
+
* contain `/` (folder-typed metadata such as `report:MyFolder/MyReport`) are preserved verbatim.
|
|
29
|
+
*/
|
|
30
|
+
export declare function parseComponentKey(key: string): {
|
|
31
|
+
metadataType: string;
|
|
32
|
+
fullName: string;
|
|
33
|
+
} | undefined;
|
|
25
34
|
/**
|
|
26
35
|
* Find the override (if any) that targets a specific metadata suffix.
|
|
27
36
|
*/
|
|
28
37
|
export declare function getOverrideForType(metadataType: string, overrides?: DecomposerOverride[]): DecomposerOverride | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Find the override (if any) that targets a specific component, identified by its metadata
|
|
40
|
+
* suffix and SDR fullName.
|
|
41
|
+
*/
|
|
42
|
+
export declare function getOverrideForComponent(metadataType: string, fullName: string, overrides?: DecomposerOverride[]): DecomposerOverride | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Returns true when at least one override targets a component of the given metadata type.
|
|
45
|
+
* Used by the decompose handler to decide whether per-component enumeration is required.
|
|
46
|
+
*/
|
|
47
|
+
export declare function hasComponentOverridesForType(metadataType: string, overrides?: DecomposerOverride[]): boolean;
|
|
29
48
|
/**
|
|
30
49
|
* Resolve the effective decompose options for a single metadata type. The base values are
|
|
31
50
|
* the run-wide options (CLI flags or defaults); per-type override values, when present, win.
|
|
32
51
|
*/
|
|
33
52
|
export declare function resolveDecomposeOptionsForType(metadataType: string, base: ResolvedDecomposeTypeOptions, overrides?: DecomposerOverride[]): ResolvedDecomposeTypeOptions;
|
|
53
|
+
/**
|
|
54
|
+
* Resolve the effective decompose options for a single component. Precedence (highest first):
|
|
55
|
+
* component-scoped override fields (via `components`), then type-scoped resolved values
|
|
56
|
+
* (already applied by `resolveDecomposeOptionsForType`), then run-wide base values (passed
|
|
57
|
+
* through as the typeResolved fallback).
|
|
58
|
+
*
|
|
59
|
+
* Hard plugin rules (e.g. labels and loyaltyProgramSetup forced to `unique-id`) are applied
|
|
60
|
+
* separately by callers, not here, so this function stays pure.
|
|
61
|
+
*/
|
|
62
|
+
export declare function resolveDecomposeOptionsForComponent(metadataType: string, fullName: string, typeResolved: ResolvedDecomposeTypeOptions, overrides?: DecomposerOverride[]): ResolvedDecomposeTypeOptions;
|
|
@@ -24,14 +24,9 @@ export async function resolveDefaultConfigPath() {
|
|
|
24
24
|
}
|
|
25
25
|
return configPath;
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
'strategy',
|
|
31
|
-
'decomposeNestedPermissions',
|
|
32
|
-
'prePurge',
|
|
33
|
-
'postPurge',
|
|
34
|
-
]);
|
|
27
|
+
// Run-scope keys that must never appear inside an override entry. Any other key is treated
|
|
28
|
+
// as either a recognized override field (validated below) or as a forward-compatible unknown
|
|
29
|
+
// key (silently ignored).
|
|
35
30
|
const FORBIDDEN_OVERRIDE_KEYS = new Set(['manifest', 'metadataSuffixes', 'ignorePackageDirectories']);
|
|
36
31
|
/**
|
|
37
32
|
* Load and validate the `overrides` array from a `.sfdecomposer.config.json` file.
|
|
@@ -69,49 +64,120 @@ export async function loadOverridesFromConfig(configPath) {
|
|
|
69
64
|
*/
|
|
70
65
|
export function validateOverrides(overrides) {
|
|
71
66
|
const seenTypes = new Set();
|
|
67
|
+
const seenComponents = new Set();
|
|
72
68
|
for (let i = 0; i < overrides.length; i++) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
69
|
+
validateOverride(overrides[i], i, seenTypes, seenComponents);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
function validateOverride(override, i, seenTypes, seenComponents) {
|
|
73
|
+
if (!override || typeof override !== 'object') {
|
|
74
|
+
throw new Error(`Override at index ${i} must be an object.`);
|
|
75
|
+
}
|
|
76
|
+
if (override.metadataTypes !== undefined && !Array.isArray(override.metadataTypes)) {
|
|
77
|
+
throw new Error(`Override at index ${i} has a non-array "metadataTypes".`);
|
|
78
|
+
}
|
|
79
|
+
if (override.components !== undefined && !Array.isArray(override.components)) {
|
|
80
|
+
throw new Error(`Override at index ${i} has a non-array "components".`);
|
|
81
|
+
}
|
|
82
|
+
const hasMetadataTypes = Array.isArray(override.metadataTypes) && override.metadataTypes.length > 0;
|
|
83
|
+
const hasComponents = Array.isArray(override.components) && override.components.length > 0;
|
|
84
|
+
if (!hasMetadataTypes && !hasComponents) {
|
|
85
|
+
throw new Error(`Override at index ${i} must include a non-empty "metadataTypes" or "components" array.`);
|
|
86
|
+
}
|
|
87
|
+
validateForbiddenKeys(override, i);
|
|
88
|
+
validateOverrideValues(override, i);
|
|
89
|
+
if (hasMetadataTypes) {
|
|
90
|
+
validateMetadataTypeEntries(override.metadataTypes, i, seenTypes);
|
|
91
|
+
}
|
|
92
|
+
if (hasComponents) {
|
|
93
|
+
validateComponentEntries(override.components, i, seenComponents);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
function validateForbiddenKeys(override, i) {
|
|
97
|
+
for (const key of Object.keys(override)) {
|
|
98
|
+
if (FORBIDDEN_OVERRIDE_KEYS.has(key)) {
|
|
99
|
+
throw new Error(`Override at index ${i} contains "${key}", which is a run-scope option and cannot be set per metadata type.`);
|
|
76
100
|
}
|
|
77
|
-
|
|
78
|
-
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
function validateOverrideValues(override, i) {
|
|
104
|
+
if (override.decomposedFormat !== undefined && !DECOMPOSED_FILE_TYPES.includes(override.decomposedFormat)) {
|
|
105
|
+
throw new Error(`Override at index ${i} has invalid "decomposedFormat": "${override.decomposedFormat}". ` +
|
|
106
|
+
`Allowed values: ${DECOMPOSED_FILE_TYPES.join(', ')}.`);
|
|
107
|
+
}
|
|
108
|
+
if (override.strategy !== undefined && !DECOMPOSED_STRATEGIES.includes(override.strategy)) {
|
|
109
|
+
throw new Error(`Override at index ${i} has invalid "strategy": "${override.strategy}". ` +
|
|
110
|
+
`Allowed values: ${DECOMPOSED_STRATEGIES.join(', ')}.`);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function validateMetadataTypeEntries(metadataTypes, i, seenTypes) {
|
|
114
|
+
for (const metadataType of metadataTypes) {
|
|
115
|
+
if (typeof metadataType !== 'string' || metadataType.trim() === '') {
|
|
116
|
+
throw new Error(`Override at index ${i} contains an empty or non-string metadata type.`);
|
|
79
117
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
throw new Error(`Override at index ${i} contains "${key}", which is a run-scope option and cannot be set per metadata type.`);
|
|
83
|
-
}
|
|
84
|
-
if (!ALLOWED_OVERRIDE_KEYS.has(key)) {
|
|
85
|
-
// Unknown keys are ignored to keep the config forward-compatible.
|
|
86
|
-
continue;
|
|
87
|
-
}
|
|
118
|
+
if (seenTypes.has(metadataType)) {
|
|
119
|
+
throw new Error(`Metadata type "${metadataType}" appears in more than one override. Each type may appear at most once.`);
|
|
88
120
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
121
|
+
seenTypes.add(metadataType);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
function validateComponentEntries(components, i, seenComponents) {
|
|
125
|
+
for (const component of components) {
|
|
126
|
+
if (typeof component !== 'string' || component.trim() === '') {
|
|
127
|
+
throw new Error(`Override at index ${i} contains an empty or non-string component.`);
|
|
92
128
|
}
|
|
93
|
-
if (
|
|
94
|
-
throw new Error(`Override at index ${i} has invalid
|
|
95
|
-
|
|
129
|
+
if (!parseComponentKey(component)) {
|
|
130
|
+
throw new Error(`Override at index ${i} has invalid component key "${component}". ` +
|
|
131
|
+
'Expected format: "<metadataSuffix>:<fullName>" (e.g. "permissionset:HR_Admin").');
|
|
96
132
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
throw new Error(`Override at index ${i} contains an empty or non-string metadata type.`);
|
|
100
|
-
}
|
|
101
|
-
if (seenTypes.has(metadataType)) {
|
|
102
|
-
throw new Error(`Metadata type "${metadataType}" appears in more than one override. Each type may appear at most once.`);
|
|
103
|
-
}
|
|
104
|
-
seenTypes.add(metadataType);
|
|
133
|
+
if (seenComponents.has(component)) {
|
|
134
|
+
throw new Error(`Component "${component}" appears in more than one override. Each component may appear at most once.`);
|
|
105
135
|
}
|
|
136
|
+
seenComponents.add(component);
|
|
106
137
|
}
|
|
107
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* Parse a component override key of the form `<metadataSuffix>:<fullName>`. Returns `undefined`
|
|
141
|
+
* when the key is malformed. Only the first colon is treated as the delimiter so fullNames that
|
|
142
|
+
* contain `/` (folder-typed metadata such as `report:MyFolder/MyReport`) are preserved verbatim.
|
|
143
|
+
*/
|
|
144
|
+
export function parseComponentKey(key) {
|
|
145
|
+
const colonIdx = key.indexOf(':');
|
|
146
|
+
if (colonIdx <= 0 || colonIdx === key.length - 1)
|
|
147
|
+
return undefined;
|
|
148
|
+
const metadataType = key.slice(0, colonIdx).trim();
|
|
149
|
+
const fullName = key.slice(colonIdx + 1).trim();
|
|
150
|
+
if (!metadataType || !fullName)
|
|
151
|
+
return undefined;
|
|
152
|
+
return { metadataType, fullName };
|
|
153
|
+
}
|
|
108
154
|
/**
|
|
109
155
|
* Find the override (if any) that targets a specific metadata suffix.
|
|
110
156
|
*/
|
|
111
157
|
export function getOverrideForType(metadataType, overrides) {
|
|
112
158
|
if (!overrides || overrides.length === 0)
|
|
113
159
|
return undefined;
|
|
114
|
-
return overrides.find((override) => override.metadataTypes
|
|
160
|
+
return overrides.find((override) => override.metadataTypes?.includes(metadataType));
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Find the override (if any) that targets a specific component, identified by its metadata
|
|
164
|
+
* suffix and SDR fullName.
|
|
165
|
+
*/
|
|
166
|
+
export function getOverrideForComponent(metadataType, fullName, overrides) {
|
|
167
|
+
if (!overrides || overrides.length === 0)
|
|
168
|
+
return undefined;
|
|
169
|
+
const key = `${metadataType}:${fullName}`;
|
|
170
|
+
return overrides.find((override) => override.components?.includes(key));
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Returns true when at least one override targets a component of the given metadata type.
|
|
174
|
+
* Used by the decompose handler to decide whether per-component enumeration is required.
|
|
175
|
+
*/
|
|
176
|
+
export function hasComponentOverridesForType(metadataType, overrides) {
|
|
177
|
+
if (!overrides || overrides.length === 0)
|
|
178
|
+
return false;
|
|
179
|
+
const prefix = `${metadataType}:`;
|
|
180
|
+
return overrides.some((override) => override.components?.some((component) => component.startsWith(prefix)));
|
|
115
181
|
}
|
|
116
182
|
/**
|
|
117
183
|
* Resolve the effective decompose options for a single metadata type. The base values are
|
|
@@ -129,4 +195,25 @@ export function resolveDecomposeOptionsForType(metadataType, base, overrides) {
|
|
|
129
195
|
postpurge: override.postPurge ?? base.postpurge,
|
|
130
196
|
};
|
|
131
197
|
}
|
|
198
|
+
/**
|
|
199
|
+
* Resolve the effective decompose options for a single component. Precedence (highest first):
|
|
200
|
+
* component-scoped override fields (via `components`), then type-scoped resolved values
|
|
201
|
+
* (already applied by `resolveDecomposeOptionsForType`), then run-wide base values (passed
|
|
202
|
+
* through as the typeResolved fallback).
|
|
203
|
+
*
|
|
204
|
+
* Hard plugin rules (e.g. labels and loyaltyProgramSetup forced to `unique-id`) are applied
|
|
205
|
+
* separately by callers, not here, so this function stays pure.
|
|
206
|
+
*/
|
|
207
|
+
export function resolveDecomposeOptionsForComponent(metadataType, fullName, typeResolved, overrides) {
|
|
208
|
+
const componentOverride = getOverrideForComponent(metadataType, fullName, overrides);
|
|
209
|
+
if (!componentOverride)
|
|
210
|
+
return typeResolved;
|
|
211
|
+
return {
|
|
212
|
+
format: componentOverride.decomposedFormat ?? typeResolved.format,
|
|
213
|
+
strategy: componentOverride.strategy ?? typeResolved.strategy,
|
|
214
|
+
decomposeNestedPerms: componentOverride.decomposeNestedPermissions ?? typeResolved.decomposeNestedPerms,
|
|
215
|
+
prepurge: componentOverride.prePurge ?? typeResolved.prepurge,
|
|
216
|
+
postpurge: componentOverride.postPurge ?? typeResolved.postpurge,
|
|
217
|
+
};
|
|
218
|
+
}
|
|
132
219
|
//# sourceMappingURL=configOverrides.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configOverrides.js","sourceRoot":"","sources":["../../src/helpers/configOverrides.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGhG;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB;IAC5C,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,WAAW,EAAE,CAAC;IACzC,wIAAwI;IACxI,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,iBAAiB,gBAAgB,wBAAwB,CAAC,CAAC;IAC7E,CAAC;IACD,MAAM,UAAU,GAAG,OAAO,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;IACvD,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC;IAC3B,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CACb,6BAA6B,gBAAg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AAC"}
|
package/lib/helpers/types.d.ts
CHANGED
|
@@ -4,7 +4,10 @@ export type DecomposerResult = {
|
|
|
4
4
|
metadata: string[];
|
|
5
5
|
};
|
|
6
6
|
export type DecomposerOverride = {
|
|
7
|
-
|
|
7
|
+
/** Suffix-scoped targets (e.g. `permissionset`). Applies to every component of the type. */
|
|
8
|
+
metadataTypes?: string[];
|
|
9
|
+
/** Component-scoped targets in the form `<suffix>:<fullName>` (e.g. `permissionset:HR_Admin`). */
|
|
10
|
+
components?: string[];
|
|
8
11
|
decomposedFormat?: string;
|
|
9
12
|
strategy?: string;
|
|
10
13
|
decomposeNestedPermissions?: boolean;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { DecomposerOverride } from '../../helpers/types.js';
|
|
2
|
+
import { ResolvedDecomposeTypeOptions } from '../../helpers/configOverrides.js';
|
|
1
3
|
export declare function decomposeFileHandler(metaAttributes: {
|
|
2
4
|
metadataPaths: string[];
|
|
3
5
|
metaSuffix: string;
|
|
4
6
|
strictDirectoryName: boolean;
|
|
5
7
|
folderType: string;
|
|
6
8
|
uniqueIdElements: string;
|
|
7
|
-
},
|
|
9
|
+
}, typeResolved: ResolvedDecomposeTypeOptions, ignorePath: string, overrides?: DecomposerOverride[], manifestXmlPaths?: Set<string>): Promise<void>;
|
|
@@ -1,35 +1,39 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
import { resolve, relative, join, dirname } from 'node:path';
|
|
2
|
+
import { resolve, relative, join, dirname, basename } from 'node:path';
|
|
3
3
|
import { readdir, stat } from 'node:fs/promises';
|
|
4
|
-
import { DisassembleXMLFileHandler } from '
|
|
4
|
+
import { DisassembleXMLFileHandler } from 'config-disassembler';
|
|
5
5
|
import pLimit from 'p-limit';
|
|
6
6
|
import { CUSTOM_LABELS_FILE, CONCURRENCY_LIMITS } from '../../helpers/constants.js';
|
|
7
|
+
import { hasComponentOverridesForType, resolveDecomposeOptionsForComponent, } from '../../helpers/configOverrides.js';
|
|
7
8
|
import { prePurgeLabels, moveAndRenameLabels } from './customLabels.js';
|
|
8
9
|
import { renameWorkflows } from './renameWorkflows.js';
|
|
9
|
-
export async function decomposeFileHandler(metaAttributes,
|
|
10
|
+
export async function decomposeFileHandler(metaAttributes, typeResolved, ignorePath, overrides, manifestXmlPaths) {
|
|
10
11
|
const { metadataPaths, metaSuffix, strictDirectoryName, folderType, uniqueIdElements } = metaAttributes;
|
|
11
12
|
if (manifestXmlPaths && manifestXmlPaths.size > 0) {
|
|
12
|
-
await decomposeFromManifest(manifestXmlPaths, uniqueIdElements,
|
|
13
|
+
await decomposeFromManifest(manifestXmlPaths, uniqueIdElements, typeResolved, ignorePath, metaSuffix, strictDirectoryName, folderType, overrides);
|
|
13
14
|
return;
|
|
14
15
|
}
|
|
15
16
|
// Limit concurrent package directory processing to prevent file system overload
|
|
16
17
|
const limit = pLimit(CONCURRENCY_LIMITS.PACKAGE_DIRS);
|
|
17
18
|
const tasks = metadataPaths.map((metadataPath) => limit(async () => {
|
|
18
19
|
if (strictDirectoryName || folderType) {
|
|
19
|
-
await subDirectoryHandler(metadataPath, uniqueIdElements,
|
|
20
|
+
await subDirectoryHandler(metadataPath, uniqueIdElements, typeResolved, ignorePath, metaSuffix, overrides);
|
|
20
21
|
}
|
|
21
22
|
else if (metaSuffix === 'labels') {
|
|
22
|
-
//
|
|
23
|
-
|
|
23
|
+
// Labels live in a single shared file; component-scope overrides are not applicable.
|
|
24
|
+
// Skip the prePurge flag in the disassembler for labels due to file moving.
|
|
25
|
+
if (typeResolved.prepurge)
|
|
24
26
|
await prePurgeLabels(metadataPath);
|
|
25
27
|
const absoluteLabelFilePath = resolve(metadataPath, CUSTOM_LABELS_FILE);
|
|
26
28
|
const relativeLabelFilePath = relative(process.cwd(), absoluteLabelFilePath);
|
|
27
|
-
disassembleHandler(relativeLabelFilePath, uniqueIdElements,
|
|
28
|
-
// move labels from the directory they are created in
|
|
29
|
+
disassembleHandler(relativeLabelFilePath, uniqueIdElements, { ...typeResolved, prepurge: false }, ignorePath, metaSuffix);
|
|
29
30
|
await moveAndRenameLabels(metadataPath);
|
|
30
31
|
}
|
|
32
|
+
else if (hasComponentOverridesForType(metaSuffix, overrides)) {
|
|
33
|
+
await perFileHandler(metadataPath, uniqueIdElements, typeResolved, ignorePath, metaSuffix, overrides);
|
|
34
|
+
}
|
|
31
35
|
else {
|
|
32
|
-
disassembleHandler(metadataPath, uniqueIdElements,
|
|
36
|
+
disassembleHandler(metadataPath, uniqueIdElements, typeResolved, ignorePath, metaSuffix);
|
|
33
37
|
}
|
|
34
38
|
if (metaSuffix === 'workflow') {
|
|
35
39
|
await renameWorkflows(metadataPath);
|
|
@@ -37,32 +41,42 @@ export async function decomposeFileHandler(metaAttributes, prepurge, postpurge,
|
|
|
37
41
|
}));
|
|
38
42
|
await Promise.all(tasks);
|
|
39
43
|
}
|
|
40
|
-
async function decomposeFromManifest(manifestXmlPaths, uniqueIdElements,
|
|
44
|
+
async function decomposeFromManifest(manifestXmlPaths, uniqueIdElements, typeResolved, ignorePath, metaSuffix, strictDirectoryName, folderType, overrides) {
|
|
41
45
|
const limit = pLimit(CONCURRENCY_LIMITS.PACKAGE_DIRS);
|
|
42
46
|
const xmlPaths = Array.from(manifestXmlPaths);
|
|
43
47
|
if (metaSuffix === 'labels') {
|
|
44
48
|
// Labels have a single source file per labels directory; dedupe by containing dir.
|
|
45
49
|
const labelDirs = new Set(xmlPaths.map((xml) => dirname(xml)));
|
|
46
50
|
const tasks = Array.from(labelDirs).map((labelDir) => limit(async () => {
|
|
47
|
-
if (prepurge)
|
|
51
|
+
if (typeResolved.prepurge)
|
|
48
52
|
await prePurgeLabels(labelDir);
|
|
49
53
|
const absoluteLabelFilePath = resolve(labelDir, CUSTOM_LABELS_FILE);
|
|
50
54
|
const relativeLabelFilePath = relative(process.cwd(), absoluteLabelFilePath);
|
|
51
|
-
disassembleHandler(relativeLabelFilePath, uniqueIdElements,
|
|
55
|
+
disassembleHandler(relativeLabelFilePath, uniqueIdElements, { ...typeResolved, prepurge: false }, ignorePath, metaSuffix);
|
|
52
56
|
await moveAndRenameLabels(labelDir);
|
|
53
57
|
}));
|
|
54
58
|
await Promise.all(tasks);
|
|
55
59
|
return;
|
|
56
60
|
}
|
|
57
61
|
if (strictDirectoryName || folderType) {
|
|
58
|
-
// Each parent xml lives inside its own strict subdirectory (e.g. bots/MyBot/MyBot.bot-meta.xml)
|
|
59
|
-
//
|
|
62
|
+
// Each parent xml lives inside its own strict subdirectory (e.g. bots/MyBot/MyBot.bot-meta.xml),
|
|
63
|
+
// or, for folder-typed metadata, inside its containing folder (e.g. reports/MyFolder/MyReport.report-meta.xml).
|
|
64
|
+
// Dedupe by parent directory and disassemble the whole subdirectory; the parent directory's basename
|
|
65
|
+
// is the canonical fullName for component-scope override matching.
|
|
60
66
|
const parentDirs = new Set(xmlPaths.map((xml) => dirname(xml)));
|
|
61
|
-
const tasks = Array.from(parentDirs).map((parentDir) => limit(() =>
|
|
67
|
+
const tasks = Array.from(parentDirs).map((parentDir) => limit(() => {
|
|
68
|
+
const fullName = basename(parentDir);
|
|
69
|
+
const resolved = resolveDecomposeOptionsForComponent(metaSuffix, fullName, typeResolved, overrides);
|
|
70
|
+
return disassembleHandler(parentDir, uniqueIdElements, resolved, ignorePath, metaSuffix);
|
|
71
|
+
}));
|
|
62
72
|
await Promise.all(tasks);
|
|
63
73
|
return;
|
|
64
74
|
}
|
|
65
|
-
const tasks = xmlPaths.map((xmlPath) => limit(() =>
|
|
75
|
+
const tasks = xmlPaths.map((xmlPath) => limit(() => {
|
|
76
|
+
const fullName = stripMetaSuffix(basename(xmlPath), metaSuffix);
|
|
77
|
+
const resolved = resolveDecomposeOptionsForComponent(metaSuffix, fullName, typeResolved, overrides);
|
|
78
|
+
return disassembleHandler(xmlPath, uniqueIdElements, resolved, ignorePath, metaSuffix);
|
|
79
|
+
}));
|
|
66
80
|
await Promise.all(tasks);
|
|
67
81
|
if (metaSuffix === 'workflow') {
|
|
68
82
|
const workflowDirs = new Set(xmlPaths.map((xml) => dirname(xml)));
|
|
@@ -72,14 +86,15 @@ async function decomposeFromManifest(manifestXmlPaths, uniqueIdElements, prepurg
|
|
|
72
86
|
}
|
|
73
87
|
}
|
|
74
88
|
}
|
|
75
|
-
function disassembleHandler(filePath, uniqueIdElements,
|
|
89
|
+
function disassembleHandler(filePath, uniqueIdElements, options, ignorePath, metaSuffix) {
|
|
76
90
|
const handler = new DisassembleXMLFileHandler();
|
|
77
91
|
let multiLevel;
|
|
78
92
|
let splitTags;
|
|
79
|
-
const
|
|
93
|
+
const effectiveStrategy = applyHardStrategyRules(metaSuffix, options.strategy);
|
|
94
|
+
const decomposePermSets = options.decomposeNestedPerms &&
|
|
80
95
|
(metaSuffix === 'permissionset' || metaSuffix === 'mutingpermissionset') &&
|
|
81
|
-
|
|
82
|
-
const decomposeLoyalyProgram = metaSuffix === 'loyaltyProgramSetup' &&
|
|
96
|
+
effectiveStrategy === 'grouped-by-tag';
|
|
97
|
+
const decomposeLoyalyProgram = metaSuffix === 'loyaltyProgramSetup' && effectiveStrategy === 'unique-id';
|
|
83
98
|
if (decomposeLoyalyProgram) {
|
|
84
99
|
multiLevel = 'programProcesses:programProcesses:parameterName,ruleName';
|
|
85
100
|
}
|
|
@@ -89,16 +104,34 @@ function disassembleHandler(filePath, uniqueIdElements, prePurge, postPurge, for
|
|
|
89
104
|
handler.disassemble({
|
|
90
105
|
filePath,
|
|
91
106
|
uniqueIdElements,
|
|
92
|
-
prePurge,
|
|
93
|
-
postPurge,
|
|
107
|
+
prePurge: options.prepurge,
|
|
108
|
+
postPurge: options.postpurge,
|
|
94
109
|
ignorePath,
|
|
95
|
-
format,
|
|
96
|
-
strategy,
|
|
110
|
+
format: options.format,
|
|
111
|
+
strategy: effectiveStrategy,
|
|
97
112
|
multiLevel,
|
|
98
113
|
splitTags,
|
|
99
114
|
});
|
|
100
115
|
}
|
|
101
|
-
|
|
116
|
+
/**
|
|
117
|
+
* Hard plugin rules that always win over user-provided strategies. `labels` and
|
|
118
|
+
* `loyaltyProgramSetup` are forced to `unique-id` regardless of run-, type-, or component-scope
|
|
119
|
+
* configuration because their on-disk layout depends on it.
|
|
120
|
+
*/
|
|
121
|
+
function applyHardStrategyRules(metaSuffix, strategy) {
|
|
122
|
+
if (strategy !== 'grouped-by-tag')
|
|
123
|
+
return strategy;
|
|
124
|
+
if (metaSuffix === 'labels' || metaSuffix === 'loyaltyProgramSetup')
|
|
125
|
+
return 'unique-id';
|
|
126
|
+
return strategy;
|
|
127
|
+
}
|
|
128
|
+
function stripMetaSuffix(fileName, metaSuffix) {
|
|
129
|
+
const metaEnding = `.${metaSuffix}-meta.xml`;
|
|
130
|
+
/* istanbul ignore next -- @preserve: parseManifest always builds xml paths from `${member}.${suffix}-meta.xml`,
|
|
131
|
+
so non-matching basenames cannot reach this helper through the public API. */
|
|
132
|
+
return fileName.endsWith(metaEnding) ? fileName.slice(0, -metaEnding.length) : fileName;
|
|
133
|
+
}
|
|
134
|
+
async function subDirectoryHandler(metadataPath, uniqueIdElements, typeResolved, ignorePath, metaSuffix, overrides) {
|
|
102
135
|
const subFiles = await readdir(metadataPath);
|
|
103
136
|
// Limit concurrent subdirectory stat operations
|
|
104
137
|
const statLimit = pLimit(CONCURRENCY_LIMITS.FILE_OPERATIONS);
|
|
@@ -112,7 +145,29 @@ async function subDirectoryHandler(metadataPath, uniqueIdElements, prepurge, pos
|
|
|
112
145
|
const processLimit = pLimit(CONCURRENCY_LIMITS.SUBDIRECTORIES);
|
|
113
146
|
const processTasks = statResults
|
|
114
147
|
.filter(({ isDir }) => isDir)
|
|
115
|
-
.map(({ subFilePath }) => processLimit(() =>
|
|
148
|
+
.map(({ subFilePath }) => processLimit(() => {
|
|
149
|
+
const fullName = basename(subFilePath);
|
|
150
|
+
const resolved = resolveDecomposeOptionsForComponent(metaSuffix, fullName, typeResolved, overrides);
|
|
151
|
+
return disassembleHandler(subFilePath, uniqueIdElements, resolved, ignorePath, metaSuffix);
|
|
152
|
+
}));
|
|
116
153
|
await Promise.all(processTasks);
|
|
117
154
|
}
|
|
155
|
+
/**
|
|
156
|
+
* Per-file disassembly used when component-scope overrides are present for a non-strict, non-labels
|
|
157
|
+
* metadata type. Walks the type's package directory, resolves options per file, and disassembles
|
|
158
|
+
* each parent metadata XML individually so different components can use different strategies/formats.
|
|
159
|
+
*/
|
|
160
|
+
async function perFileHandler(metadataPath, uniqueIdElements, typeResolved, ignorePath, metaSuffix, overrides) {
|
|
161
|
+
const metaEnding = `.${metaSuffix}-meta.xml`;
|
|
162
|
+
const entries = await readdir(metadataPath, { withFileTypes: true });
|
|
163
|
+
const xmlEntries = entries.filter((entry) => entry.isFile() && entry.name.endsWith(metaEnding));
|
|
164
|
+
const limit = pLimit(CONCURRENCY_LIMITS.SUBDIRECTORIES);
|
|
165
|
+
const tasks = xmlEntries.map((entry) => limit(() => {
|
|
166
|
+
const filePath = join(metadataPath, entry.name);
|
|
167
|
+
const fullName = entry.name.slice(0, -metaEnding.length);
|
|
168
|
+
const resolved = resolveDecomposeOptionsForComponent(metaSuffix, fullName, typeResolved, overrides);
|
|
169
|
+
return disassembleHandler(filePath, uniqueIdElements, resolved, ignorePath, metaSuffix);
|
|
170
|
+
}));
|
|
171
|
+
await Promise.all(tasks);
|
|
172
|
+
}
|
|
118
173
|
//# sourceMappingURL=decomposeFileHandler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decomposeFileHandler.js","sourceRoot":"","sources":["../../../src/service/decompose/decomposeFileHandler.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"decomposeFileHandler.js","sourceRoot":"","sources":["../../../src/service/decompose/decomposeFileHandler.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,E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OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
import { readdir, stat } from 'node:fs/promises';
|
|
3
3
|
import { join, dirname, basename } from 'node:path';
|
|
4
|
-
import { ReassembleXMLFileHandler } from '
|
|
4
|
+
import { ReassembleXMLFileHandler } from 'config-disassembler';
|
|
5
5
|
import pLimit from 'p-limit';
|
|
6
6
|
import { CONCURRENCY_LIMITS } from '../../helpers/constants.js';
|
|
7
7
|
import { reassembleLabels } from './reassembleLabels.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recomposeFileHandler.js","sourceRoot":"","sources":["../../../src/service/recompose/recomposeFileHandler.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"recomposeFileHandler.js","sourceRoot":"","sources":["../../../src/service/recompose/recomposeFileHandler.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,MAAM,MAAM,SAAS,CAAC;AAE7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,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,CAAC;QACvE,CAAC;IACH,CAAC,CAAC,CACH,CAAC;IAEJ,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -50,7 +50,7 @@ Additionally decompose object and field permissions on a permission set when str
|
|
|
50
50
|
|
|
51
51
|
# flags.config.summary
|
|
52
52
|
|
|
53
|
-
Load per-
|
|
53
|
+
Load per-type and per-component overrides from .sfdecomposer.config.json in the repo root. When set, the file's "overrides" array is applied (format, strategy, decomposeNestedPermissions, prePurge, postPurge per type or per individual component). Other top-level config fields are ignored when invoking the CLI directly.
|
|
54
54
|
|
|
55
55
|
# error.missingMetadataOrManifest
|
|
56
56
|
|
package/oclif.manifest.json
CHANGED
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"char": "c",
|
|
111
111
|
"name": "config",
|
|
112
112
|
"required": false,
|
|
113
|
-
"summary": "Load per-
|
|
113
|
+
"summary": "Load per-type and per-component overrides from .sfdecomposer.config.json in the repo root. When set, the file's \"overrides\" array is applied (format, strategy, decomposeNestedPermissions, prePurge, postPurge per type or per individual component). Other top-level config fields are ignored when invoking the CLI directly.",
|
|
114
114
|
"allowNo": false,
|
|
115
115
|
"type": "boolean"
|
|
116
116
|
}
|
|
@@ -221,5 +221,5 @@
|
|
|
221
221
|
]
|
|
222
222
|
}
|
|
223
223
|
},
|
|
224
|
-
"version": "6.
|
|
224
|
+
"version": "6.13.0"
|
|
225
225
|
}
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sf-decomposer",
|
|
3
3
|
"description": "Split large Salesforce metadata files into version-control-friendly pieces and rebuild deployment-ready files.",
|
|
4
|
-
"version": "6.
|
|
4
|
+
"version": "6.13.0",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@oclif/core": "^4",
|
|
7
7
|
"@salesforce/core": "^8.26.3",
|
|
8
8
|
"@salesforce/sf-plugins-core": "^12.2.6",
|
|
9
|
-
"@salesforce/source-deploy-retrieve": "^12.
|
|
10
|
-
"
|
|
11
|
-
"
|
|
9
|
+
"@salesforce/source-deploy-retrieve": "^12.35.0",
|
|
10
|
+
"config-disassembler": "^1.0.0",
|
|
11
|
+
"p-limit": "^7.3.0"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"@commitlint/config-conventional": "^20.4.2",
|