sf-decomposer 7.4.1 → 7.4.2
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 +3 -3
- package/lib/helpers/constants.d.ts +1 -0
- package/lib/helpers/constants.js +5 -0
- package/lib/helpers/constants.js.map +1 -1
- package/lib/service/decompose/customLabels.js +7 -1
- package/lib/service/decompose/customLabels.js.map +1 -1
- package/lib/service/recompose/reassembleLabels.js +13 -6
- package/lib/service/recompose/reassembleLabels.js.map +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
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.4.2](https://github.com/mcarvin8/sf-decomposer/compare/v7.4.1...v7.4.2) (2026-09-08)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **recompose:** preserve CustomLabels trailing newline, tighten perf byte-retention to 100% ([#599](https://github.com/mcarvin8/sf-decomposer/issues/599)) ([3c19e4b](https://github.com/mcarvin8/sf-decomposer/commit/3c19e4b90ed27e1f532771038ca5dca1e63fd9c6))
|
|
14
|
+
|
|
8
15
|
## [7.4.1](https://github.com/mcarvin8/sf-decomposer/compare/v7.4.0...v7.4.1) (2026-09-08)
|
|
9
16
|
|
|
10
17
|
|
package/README.md
CHANGED
|
@@ -221,7 +221,7 @@ EXAMPLES
|
|
|
221
221
|
`sf decomposer decompose -x "manifest/package.xml" -m "flow"`
|
|
222
222
|
```
|
|
223
223
|
|
|
224
|
-
_See code: [src/commands/decomposer/decompose.ts](https://github.com/mcarvin8/sf-decomposer/blob/v7.4.
|
|
224
|
+
_See code: [src/commands/decomposer/decompose.ts](https://github.com/mcarvin8/sf-decomposer/blob/v7.4.2/src/commands/decomposer/decompose.ts)_
|
|
225
225
|
|
|
226
226
|
## `sf decomposer recompose`
|
|
227
227
|
|
|
@@ -267,7 +267,7 @@ EXAMPLES
|
|
|
267
267
|
`sf decomposer recompose -x "manifest/package.xml" -m "flow"`
|
|
268
268
|
```
|
|
269
269
|
|
|
270
|
-
_See code: [src/commands/decomposer/recompose.ts](https://github.com/mcarvin8/sf-decomposer/blob/v7.4.
|
|
270
|
+
_See code: [src/commands/decomposer/recompose.ts](https://github.com/mcarvin8/sf-decomposer/blob/v7.4.2/src/commands/decomposer/recompose.ts)_
|
|
271
271
|
|
|
272
272
|
## `sf decomposer verify`
|
|
273
273
|
|
|
@@ -331,7 +331,7 @@ EXAMPLES
|
|
|
331
331
|
`sf decomposer verify -x "manifest/package.xml" --config`
|
|
332
332
|
```
|
|
333
333
|
|
|
334
|
-
_See code: [src/commands/decomposer/verify.ts](https://github.com/mcarvin8/sf-decomposer/blob/v7.4.
|
|
334
|
+
_See code: [src/commands/decomposer/verify.ts](https://github.com/mcarvin8/sf-decomposer/blob/v7.4.2/src/commands/decomposer/verify.ts)_
|
|
335
335
|
<!-- commandsstop -->
|
|
336
336
|
|
|
337
337
|
---
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const SFDX_PROJECT_FILE_NAME = "sfdx-project.json";
|
|
2
2
|
export declare const CUSTOM_LABELS_FILE = "CustomLabels.labels-meta.xml";
|
|
3
|
+
export declare const TRAILING_NEWLINE_SIDECAR = ".trailing_newline.json";
|
|
3
4
|
export declare const DEFAULT_UNIQUE_ID_ELEMENTS: string;
|
|
4
5
|
export declare const DECOMPOSED_FILE_TYPES: string[];
|
|
5
6
|
export declare const DECOMPOSED_STRATEGIES: string[];
|
package/lib/helpers/constants.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
export const SFDX_PROJECT_FILE_NAME = 'sfdx-project.json';
|
|
3
3
|
export const CUSTOM_LABELS_FILE = 'CustomLabels.labels-meta.xml';
|
|
4
|
+
// config-disassembler writes this alongside the shard directory it disassembles a parent XML
|
|
5
|
+
// into, recording whether the source file ended in a newline, and reads it back on reassemble.
|
|
6
|
+
// CustomLabels' decompose/recompose shuffle (customLabels.ts / reassembleLabels.ts) must
|
|
7
|
+
// carry it across manually since it lives one level up from the actual label shard files.
|
|
8
|
+
export const TRAILING_NEWLINE_SIDECAR = '.trailing_newline.json';
|
|
4
9
|
export const DEFAULT_UNIQUE_ID_ELEMENTS = 'fullName,name';
|
|
5
10
|
export const DECOMPOSED_FILE_TYPES = ['xml', 'json', 'yaml', 'json5'];
|
|
6
11
|
export const DECOMPOSED_STRATEGIES = ['unique-id', 'grouped-by-tag'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/helpers/constants.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AAC1D,MAAM,CAAC,MAAM,kBAAkB,GAAG,8BAA8B,CAAC;AACjE,MAAM,CAAC,MAAM,0BAA0B,GAAW,eAAe,CAAC;AAClE,MAAM,CAAC,MAAM,qBAAqB,GAAa,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAChF,MAAM,CAAC,MAAM,qBAAqB,GAAa,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC;AAC/E,MAAM,CAAC,MAAM,WAAW,GAAG,qBAAqB,CAAC;AACjD,MAAM,CAAC,MAAM,uBAAuB,GAA8B;IAChE,aAAa,EAAE,oBAAoB;IACnC,mBAAmB,EAAE,0BAA0B;IAC/C,kBAAkB,EAAE,yBAAyB;IAC7C,yBAAyB,EAAE,+BAA+B;IAC1D,uBAAuB,EAAE,8BAA8B;IACvD,YAAY,EAAE,mBAAmB;IACjC,YAAY,EAAE,mBAAmB;IACjC,WAAW,EAAE,mBAAmB;CACjC,CAAC;AACF,MAAM,CAAC,MAAM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mB;IACjC,WAAW,EAAE,mBAAmB;CACjC,CAAC;AACF,MAAM,CAAC,MAAM,gBAAgB,GAAG,2BAA2B,CAAC;AAE5D,0FAA0F;AAC1F,wFAAwF;AACxF,MAAM,CAAC,MAAM,oBAAoB,GAAa,CAAC,qBAAqB,EAAE,mBAAmB,EAAE,cAAc,EAAE,QAAQ,CAAC,CAAC;AAErH,qDAAqD;AACrD,4DAA4D;AAC5D,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,cAAc,EAAE,CAAC,EAAE,8CAA8C;IACjE,YAAY,EAAE,CAAC,EAAE,mDAAmD;IACpE,cAAc,EAAE,CAAC,EAAE,8CAA8C;IACjE,eAAe,EAAE,EAAE,EAAE,wEAAwE;CAC9F,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
import { readdir, rename, rm, stat } from 'node:fs/promises';
|
|
4
4
|
import { join } from 'node:path';
|
|
5
|
-
import { CONCURRENCY_LIMITS, CUSTOM_LABELS_FILE } from '../../helpers/constants.js';
|
|
5
|
+
import { CONCURRENCY_LIMITS, CUSTOM_LABELS_FILE, TRAILING_NEWLINE_SIDECAR } from '../../helpers/constants.js';
|
|
6
6
|
import { pLimit } from '../../helpers/pLimit.js';
|
|
7
7
|
import { moveFiles } from '../core/moveFiles.js';
|
|
8
8
|
export async function prePurgeLabels(metadataPath) {
|
|
@@ -31,6 +31,12 @@ export async function moveAndRenameLabels(metadataPath) {
|
|
|
31
31
|
await Promise.all(tasks);
|
|
32
32
|
// istanbul ignore next -- callback only invoked if non-label files exist after rename
|
|
33
33
|
await moveFiles(sourceDirectory, destinationDirectory, () => true);
|
|
34
|
+
// config-disassembler wrote the trailing-newline sidecar in the "CustomLabels" stem
|
|
35
|
+
// directory itself (sibling to the "labels" shard subdirectory we just emptied above),
|
|
36
|
+
// not inside it -- rescue it before the rm() below destroys it, so reassembleLabels can
|
|
37
|
+
// hand it back to reassemble() and the recomposed file's trailing newline round-trips
|
|
38
|
+
// like every other metadata type's.
|
|
39
|
+
await moveFiles(join(metadataPath, 'CustomLabels'), destinationDirectory, (fileName) => fileName === TRAILING_NEWLINE_SIDECAR);
|
|
34
40
|
await rm(join(metadataPath, 'CustomLabels'), { recursive: true });
|
|
35
41
|
}
|
|
36
42
|
//# sourceMappingURL=customLabels.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customLabels.js","sourceRoot":"","sources":["../../../src/service/decompose/customLabels.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,YAAY,CAAC;AAEb,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"customLabels.js","sourceRoot":"","sources":["../../../src/service/decompose/customLabels.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,YAAY,CAAC;AAEb,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAC9G,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,YAAoB;IACvD,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC;IAC7C,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,WAAW,GAAG,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QAChD,I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ACxF,sFAAsF;IACtF,oCAAoC;IACpC,MAAM,SAAS,CACb,IAAI,CAAC,YAAY,EAAE,cAAc,CAAC,EAClC,oBAAoB,EACpB,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,KAAK,wBAAwB,CACpD,CAAC;IAEF,MAAM,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,cAAc,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -1,20 +1,27 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
import { rm } from 'node:fs/promises';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
|
-
import { CUSTOM_LABELS_FILE } from '../../helpers/constants.js';
|
|
4
|
+
import { CUSTOM_LABELS_FILE, TRAILING_NEWLINE_SIDECAR } from '../../helpers/constants.js';
|
|
5
5
|
import { moveFiles } from '../core/moveFiles.js';
|
|
6
6
|
import { deleteFilesInDirectory } from './deleteFilesinDirectory.js';
|
|
7
7
|
import { reassembleHandler } from './recomposeFileHandler.js';
|
|
8
8
|
export async function reassembleLabels(metadataPath, metaSuffix, postpurge) {
|
|
9
|
+
const customLabelsDir = join(metadataPath, 'CustomLabels');
|
|
9
10
|
let sourceDirectory = metadataPath;
|
|
10
|
-
let destinationDirectory = join(
|
|
11
|
-
await moveFiles(sourceDirectory, destinationDirectory, (fileName) => fileName !== CUSTOM_LABELS_FILE);
|
|
11
|
+
let destinationDirectory = join(customLabelsDir, 'labels');
|
|
12
|
+
await moveFiles(sourceDirectory, destinationDirectory, (fileName) => fileName !== CUSTOM_LABELS_FILE && fileName !== TRAILING_NEWLINE_SIDECAR);
|
|
13
|
+
// The trailing-newline sidecar (rescued to metadataPath during decompose -- see
|
|
14
|
+
// moveAndRenameLabels in customLabels.ts) belongs in the "CustomLabels" stem directory
|
|
15
|
+
// itself, sibling to the "labels" shard subdirectory, not inside it -- that's where
|
|
16
|
+
// config-disassembler's reassemble() looks for it, matching how it wrote the sidecar
|
|
17
|
+
// for every other metadata type's single-level disassembly.
|
|
18
|
+
await moveFiles(metadataPath, customLabelsDir, (fileName) => fileName === TRAILING_NEWLINE_SIDECAR);
|
|
12
19
|
// do not use postpurge flag due to file moving
|
|
13
|
-
await reassembleHandler(
|
|
14
|
-
sourceDirectory = join(
|
|
20
|
+
await reassembleHandler(customLabelsDir, `${metaSuffix}-meta.xml`, false);
|
|
21
|
+
sourceDirectory = join(customLabelsDir, 'labels');
|
|
15
22
|
destinationDirectory = metadataPath;
|
|
16
23
|
await moveFiles(sourceDirectory, destinationDirectory, () => true);
|
|
17
|
-
await rm(
|
|
24
|
+
await rm(customLabelsDir, { recursive: true });
|
|
18
25
|
if (postpurge)
|
|
19
26
|
await deleteFilesInDirectory(destinationDirectory);
|
|
20
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reassembleLabels.js","sourceRoot":"","sources":["../../../src/service/recompose/reassembleLabels.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"reassembleLabels.js","sourceRoot":"","sources":["../../../src/service/recompose/reassembleLabels.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAC1F,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,MAAM,CAAC,KA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