sfdx-git-delta 7.1.0 → 7.3.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.
Files changed (134) hide show
  1. package/README.md +27 -5
  2. package/lib/adapter/GitAdapter.d.ts +26 -12
  3. package/lib/adapter/GitAdapter.js +162 -175
  4. package/lib/adapter/GitAdapter.js.map +1 -1
  5. package/lib/adapter/ioExecutor.d.ts +6 -7
  6. package/lib/adapter/ioExecutor.js +22 -22
  7. package/lib/adapter/ioExecutor.js.map +1 -1
  8. package/lib/adapter/pathMatching.d.ts +9 -0
  9. package/lib/adapter/pathMatching.js +83 -0
  10. package/lib/adapter/pathMatching.js.map +1 -0
  11. package/lib/adapter/treeIndex.d.ts +7 -4
  12. package/lib/adapter/treeIndex.js +34 -0
  13. package/lib/adapter/treeIndex.js.map +1 -1
  14. package/lib/adapter/treeReader.d.ts +8 -0
  15. package/lib/adapter/treeReader.js +22 -0
  16. package/lib/adapter/treeReader.js.map +1 -0
  17. package/lib/commands/sgd/source/delta.d.ts +1 -0
  18. package/lib/commands/sgd/source/delta.js +5 -0
  19. package/lib/commands/sgd/source/delta.js.map +1 -1
  20. package/lib/main.d.ts +2 -2
  21. package/lib/main.js +84 -37
  22. package/lib/main.js.map +1 -1
  23. package/lib/post-processor/baseProcessor.d.ts +11 -8
  24. package/lib/post-processor/baseProcessor.js +8 -8
  25. package/lib/post-processor/baseProcessor.js.map +1 -1
  26. package/lib/post-processor/changesManifestProcessor.d.ts +3 -2
  27. package/lib/post-processor/changesManifestProcessor.js +5 -4
  28. package/lib/post-processor/changesManifestProcessor.js.map +1 -1
  29. package/lib/post-processor/flowTranslationProcessor.d.ts +6 -8
  30. package/lib/post-processor/flowTranslationProcessor.js +18 -20
  31. package/lib/post-processor/flowTranslationProcessor.js.map +1 -1
  32. package/lib/post-processor/includeProcessor.d.ts +6 -6
  33. package/lib/post-processor/includeProcessor.js +8 -7
  34. package/lib/post-processor/includeProcessor.js.map +1 -1
  35. package/lib/post-processor/packageGenerator.d.ts +3 -2
  36. package/lib/post-processor/packageGenerator.js +5 -4
  37. package/lib/post-processor/packageGenerator.js.map +1 -1
  38. package/lib/post-processor/postProcessorManager.d.ts +5 -8
  39. package/lib/post-processor/postProcessorManager.js +24 -32
  40. package/lib/post-processor/postProcessorManager.js.map +1 -1
  41. package/lib/service/botHandler.d.ts +1 -2
  42. package/lib/service/botHandler.js +17 -10
  43. package/lib/service/botHandler.js.map +1 -1
  44. package/lib/service/containedDecomposedHandler.d.ts +4 -5
  45. package/lib/service/containedDecomposedHandler.js +14 -13
  46. package/lib/service/containedDecomposedHandler.js.map +1 -1
  47. package/lib/service/customFieldHandler.d.ts +1 -2
  48. package/lib/service/customFieldHandler.js +7 -6
  49. package/lib/service/customFieldHandler.js.map +1 -1
  50. package/lib/service/customLabelHandler.d.ts +1 -2
  51. package/lib/service/customLabelHandler.js +3 -3
  52. package/lib/service/customLabelHandler.js.map +1 -1
  53. package/lib/service/customObjectHandler.d.ts +3 -4
  54. package/lib/service/customObjectHandler.js +11 -10
  55. package/lib/service/customObjectHandler.js.map +1 -1
  56. package/lib/service/decomposedHandler.d.ts +3 -4
  57. package/lib/service/decomposedHandler.js +5 -4
  58. package/lib/service/decomposedHandler.js.map +1 -1
  59. package/lib/service/diffLineInterpreter.d.ts +3 -5
  60. package/lib/service/diffLineInterpreter.js +17 -16
  61. package/lib/service/diffLineInterpreter.js.map +1 -1
  62. package/lib/service/flowHandler.d.ts +1 -2
  63. package/lib/service/flowHandler.js +9 -4
  64. package/lib/service/flowHandler.js.map +1 -1
  65. package/lib/service/inFileHandler.d.ts +8 -9
  66. package/lib/service/inFileHandler.js +25 -25
  67. package/lib/service/inFileHandler.js.map +1 -1
  68. package/lib/service/inFolderHandler.d.ts +4 -5
  69. package/lib/service/inFolderHandler.js +7 -6
  70. package/lib/service/inFolderHandler.js.map +1 -1
  71. package/lib/service/inResourceHandler.d.ts +4 -5
  72. package/lib/service/inResourceHandler.js +11 -9
  73. package/lib/service/inResourceHandler.js.map +1 -1
  74. package/lib/service/objectTranslationHandler.d.ts +1 -2
  75. package/lib/service/objectTranslationHandler.js +6 -5
  76. package/lib/service/objectTranslationHandler.js.map +1 -1
  77. package/lib/service/reportingFolderHandler.d.ts +6 -7
  78. package/lib/service/reportingFolderHandler.js +6 -6
  79. package/lib/service/reportingFolderHandler.js.map +1 -1
  80. package/lib/service/sharedFolderHandler.d.ts +4 -5
  81. package/lib/service/sharedFolderHandler.js +6 -6
  82. package/lib/service/sharedFolderHandler.js.map +1 -1
  83. package/lib/service/standardHandler.d.ts +8 -10
  84. package/lib/service/standardHandler.js +34 -36
  85. package/lib/service/standardHandler.js.map +1 -1
  86. package/lib/service/typeHandlerFactory.d.ts +7 -5
  87. package/lib/service/typeHandlerFactory.js +13 -12
  88. package/lib/service/typeHandlerFactory.js.map +1 -1
  89. package/lib/types/config.d.ts +6 -1
  90. package/lib/types/handlerResult.d.ts +7 -7
  91. package/lib/types/handlerResult.js +10 -1
  92. package/lib/types/handlerResult.js.map +1 -1
  93. package/lib/types/runContext.d.ts +21 -0
  94. package/lib/types/runContext.js +12 -0
  95. package/lib/types/runContext.js.map +1 -0
  96. package/lib/types/work.d.ts +1 -1
  97. package/lib/utils/arrayUtils.d.ts +1 -1
  98. package/lib/utils/arrayUtils.js.map +1 -1
  99. package/lib/utils/bundleRollup.d.ts +6 -0
  100. package/lib/utils/bundleRollup.js +62 -0
  101. package/lib/utils/bundleRollup.js.map +1 -0
  102. package/lib/utils/changeSet.d.ts +12 -15
  103. package/lib/utils/changeSet.js +23 -120
  104. package/lib/utils/changeSet.js.map +1 -1
  105. package/lib/utils/changesAssembly.d.ts +8 -0
  106. package/lib/utils/changesAssembly.js +21 -0
  107. package/lib/utils/changesAssembly.js.map +1 -0
  108. package/lib/utils/configValidator.d.ts +8 -6
  109. package/lib/utils/configValidator.js +56 -13
  110. package/lib/utils/configValidator.js.map +1 -1
  111. package/lib/utils/fsHelper.d.ts +5 -3
  112. package/lib/utils/fsHelper.js +12 -9
  113. package/lib/utils/fsHelper.js.map +1 -1
  114. package/lib/utils/messageSanitizer.d.ts +1 -0
  115. package/lib/utils/messageSanitizer.js +48 -0
  116. package/lib/utils/messageSanitizer.js.map +1 -0
  117. package/lib/utils/metadataBoundaryResolver.d.ts +7 -5
  118. package/lib/utils/metadataBoundaryResolver.js +18 -21
  119. package/lib/utils/metadataBoundaryResolver.js.map +1 -1
  120. package/lib/utils/pathspec.d.ts +15 -0
  121. package/lib/utils/pathspec.js +71 -0
  122. package/lib/utils/pathspec.js.map +1 -0
  123. package/lib/utils/renameResolver.d.ts +6 -7
  124. package/lib/utils/renameResolver.js +10 -9
  125. package/lib/utils/renameResolver.js.map +1 -1
  126. package/lib/utils/repoGitDiff.d.ts +3 -0
  127. package/lib/utils/repoGitDiff.js +30 -1
  128. package/lib/utils/repoGitDiff.js.map +1 -1
  129. package/messages/delta.md +38 -0
  130. package/oclif.manifest.json +10 -3
  131. package/package.json +23 -22
  132. package/lib/post-processor/bundleRollupProcessor.d.ts +0 -7
  133. package/lib/post-processor/bundleRollupProcessor.js +0 -81
  134. package/lib/post-processor/bundleRollupProcessor.js.map +0 -1
@@ -8,6 +8,15 @@ export default class RepoGitDiff {
8
8
  metadata;
9
9
  gitAdapter;
10
10
  renamePairs = [];
11
+ // The field initialiser only zeroes this once, at construction.
12
+ // getLines() can be called more than once on the same instance (see the
13
+ // renamePairs reset below), so the verdict is reset explicitly at the
14
+ // start of every call rather than relying on the initialiser alone.
15
+ // Stryker disable next-line ObjectLiteral -- equivalent: emptying this initialiser is unobservable. getLines() reassigns both fields to 0 as its first synchronous statement before any await, and the only other consumer, GitAdapter.getUnmatchedSourceScopes, branches solely on `changesSeen > 0` — false for both 0 and undefined
16
+ diffScopeVerdict = {
17
+ changesSeen: 0,
18
+ linesYielded: 0,
19
+ };
11
20
  constructor(config, metadata) {
12
21
  this.config = config;
13
22
  this.metadata = metadata;
@@ -25,10 +34,16 @@ export default class RepoGitDiff {
25
34
  */
26
35
  async *getLines() {
27
36
  this.renamePairs = [];
37
+ this.diffScopeVerdict.changesSeen = 0;
38
+ this.diffScopeVerdict.linesYielded = 0;
28
39
  const ignoreHelper = await buildIgnoreHelper(this.config);
29
40
  const additionNames = new Set();
30
41
  const deferredDeletions = [];
31
- for await (const rawLine of this.gitAdapter.streamDiffLines()) {
42
+ for await (const rawLine of this.gitAdapter.streamDiffLines({
43
+ spec: this.diffSpec(),
44
+ verdict: this.diffScopeVerdict,
45
+ scopes: this.config.source,
46
+ })) {
32
47
  for (const expanded of this._expandRename(rawLine)) {
33
48
  // Stryker disable next-line ConditionalExpression -- equivalent: _expandRename never yields empty/falsy strings — it yields the original line or the synthetic D/A pair, both non-empty; the false-flip falls through to metadata.has which would return false on empty paths, observably the same continue
34
49
  if (!expanded)
@@ -64,6 +79,9 @@ export default class RepoGitDiff {
64
79
  getRenamePairs() {
65
80
  return this.renamePairs;
66
81
  }
82
+ getUnmatchedSourceScopes() {
83
+ return this.gitAdapter.getUnmatchedSourceScopes(this.diffScopeVerdict, this.config.source);
84
+ }
67
85
  // git emits `R<score>\tfrom\tto` when -M detects a rename. Each rename is
68
86
  // expanded into the equivalent D/A pair so every downstream handler keeps
69
87
  // operating on a (status, path) tuple; the rename pair is captured for
@@ -88,5 +106,16 @@ export default class RepoGitDiff {
88
106
  _extractComparisonName(line) {
89
107
  return this.metadata.getFullyQualifiedName(line).toLocaleLowerCase();
90
108
  }
109
+ // Built fresh on every getLines() call (not cached at construction) so a
110
+ // later rewrite of config.from (ConfigValidator resolves SHAs after
111
+ // RepoGitDiff may already exist) is still visible when the diff runs.
112
+ diffSpec() {
113
+ return {
114
+ from: this.config.from,
115
+ to: this.config.to,
116
+ detectRenames: Boolean(this.config.changesManifest),
117
+ ignoreWhitespace: this.config.ignoreWhitespace,
118
+ };
119
+ }
91
120
  }
92
121
  //# sourceMappingURL=repoGitDiff.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"repoGitDiff.js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iB,EAAE,CAAA;IACtE,CAAC;IAED,yEAAyE;IACzE,oEAAoE;IACpE,sEAAsE;IAC9D,QAAQ;QACd,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI;YACtB,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE;YAClB,aAAa,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC;YACnD,gBAAgB,EAAE,IAAI,CAAC,MAAM,CAAC,gBAAgB;SAC/C,CAAA;IACH,CAAC;CACF"}
package/messages/delta.md CHANGED
@@ -16,6 +16,10 @@ Use two git commit reference to generate the package corresponding to what has c
16
16
 
17
17
  <%= config.bin %> <%= command.id %> --from "origin/development" --generate-delta --output-dir incremental
18
18
 
19
+ - Build incremental manifest from where the current branch diverged from main
20
+
21
+ <%= config.bin %> <%= command.id %> --from "main" --merge-base --output-dir incremental
22
+
19
23
  # flags.to.summary
20
24
 
21
25
  commit sha to where the diff is done
@@ -24,6 +28,10 @@ commit sha to where the diff is done
24
28
 
25
29
  commit sha from where the diff is done
26
30
 
31
+ # flags.merge-base.summary
32
+
33
+ diff from the merge base of --from and --to instead of --from itself (git three-dot semantics)
34
+
27
35
  # flags.repo.summary
28
36
 
29
37
  git repository location
@@ -44,6 +52,8 @@ The folder can exist or not.
44
52
  * If the folder exists, its contents will be processed.
45
53
  * If the folder doesn't exist, it usually won't show any output—unless the folder was recently deleted and is part of a diff, in which case changes may still be picked up.
46
54
 
55
+ Each value must be a literal repository-relative path: wildcards (`*`, `?`, `[`), git pathspec magic (`:(...)`), absolute paths, `..` and the empty string are all rejected. Matching is rooted at the repository root, so `--source-dir force-app` does not match `nested/force-app/...`.
56
+
47
57
  # flags.ignore.summary
48
58
 
49
59
  file listing paths to explicitly ignore for any diff actions
@@ -84,6 +94,10 @@ path to a JSON file grouping changed components by kind (add, modify, delete, re
84
94
 
85
95
  --%s is not a valid sha pointer: '%s' (If in CI/CD context, check the fetch depth is properly set)
86
96
 
97
+ # error.MergeBaseNotFound
98
+
99
+ no merge base found between --from '%s' and --to '%s' (If in CI/CD context, check the fetch depth is properly set)
100
+
87
101
  # error.PathIsNotGit
88
102
 
89
103
  '%s' is not a git repository
@@ -96,6 +110,26 @@ path to a JSON file grouping changed components by kind (add, modify, delete, re
96
110
 
97
111
  --changes-manifest: cannot inspect '%s': %s
98
112
 
113
+ # error.SourceDirIsEmpty
114
+
115
+ --source-dir does not accept an empty value; use '.' to scope the whole repository (received: '%s')
116
+
117
+ # error.SourceDirIsAbsolute
118
+
119
+ --source-dir must be a path relative to --repo-dir, not an absolute path (received: '%s')
120
+
121
+ # error.SourceDirEscapesRepository
122
+
123
+ --source-dir does not accept '..' path segments; use a literal repository-relative path instead (received: '%s')
124
+
125
+ # error.SourceDirContainsWildcard
126
+
127
+ --source-dir does not accept wildcards (*, ?, [); repeat --source-dir once per folder, or use --include-file/--ignore-file to filter by pattern (received: '%s')
128
+
129
+ # error.SourceDirUsesPathspecMagic
130
+
131
+ --source-dir does not accept git pathspec magic (e.g. ':(exclude)', ':!'); use a literal repository-relative path instead (received: '%s')
132
+
99
133
  # warning.ApiVersionOverridden
100
134
 
101
135
  API version '%s' is not supported, using '%s' instead
@@ -120,6 +154,10 @@ Attempt to delete the flow '%s' via destructiveChanges.xml may not work as expec
120
154
 
121
155
  Deleting the DigitalExperienceBundle '%s' via destructiveChanges.xml requires the related Experience site to be deactivated first for the deployment to succeed
122
156
 
157
+ # warning.SourceDirMatchedNothing
158
+
159
+ No changes found under '%s' between '%s' and '%s'
160
+
123
161
  # info.CommandIsRunning
124
162
 
125
163
  Generating incremental package
@@ -5,7 +5,7 @@
5
5
  "args": {},
6
6
  "description": "Use two git commit reference to generate the package corresponding to what has changed in between",
7
7
  "examples": [
8
- "- Build incremental manifest from the previous commit\n\n<%= config.bin %> <%= command.id %> --from \"origin/development\" --output-dir incremental\n\n- Build incremental manifest and source from the development branch\n\n<%= config.bin %> <%= command.id %> --from \"origin/development\" --generate-delta --output-dir incremental"
8
+ "- Build incremental manifest from the previous commit\n\n<%= config.bin %> <%= command.id %> --from \"origin/development\" --output-dir incremental\n\n- Build incremental manifest and source from the development branch\n\n<%= config.bin %> <%= command.id %> --from \"origin/development\" --generate-delta --output-dir incremental\n\n- Build incremental manifest from where the current branch diverged from main\n\n<%= config.bin %> <%= command.id %> --from \"main\" --merge-base --output-dir incremental"
9
9
  ],
10
10
  "flags": {
11
11
  "json": {
@@ -41,6 +41,13 @@
41
41
  "multiple": false,
42
42
  "type": "option"
43
43
  },
44
+ "merge-base": {
45
+ "char": "b",
46
+ "name": "merge-base",
47
+ "summary": "diff from the merge base of --from and --to instead of --from itself (git three-dot semantics)",
48
+ "allowNo": false,
49
+ "type": "boolean"
50
+ },
44
51
  "generate-delta": {
45
52
  "char": "d",
46
53
  "name": "generate-delta",
@@ -80,7 +87,7 @@
80
87
  ],
81
88
  "char": "s",
82
89
  "deprecateAliases": true,
83
- "description": "You can use this flag multiple times to include different folders that contain source files. Each path should be relative to --repo-dir.\n\nThe folder can exist or not.\n* If the folder exists, its contents will be processed.\n* If the folder doesn't exist, it usually won't show any output—unless the folder was recently deleted and is part of a diff, in which case changes may still be picked up.",
90
+ "description": "You can use this flag multiple times to include different folders that contain source files. Each path should be relative to --repo-dir.\n\nThe folder can exist or not.\n* If the folder exists, its contents will be processed.\n* If the folder doesn't exist, it usually won't show any output—unless the folder was recently deleted and is part of a diff, in which case changes may still be picked up.\n\nEach value must be a literal repository-relative path: wildcards (`*`, `?`, `[`), git pathspec magic (`:(...)`), absolute paths, `..` and the empty string are all rejected. Matching is rooted at the repository root, so `--source-dir force-app` does not match `nested/force-app/...`.",
84
91
  "name": "source-dir",
85
92
  "summary": "source folders focus location relative to --repo-dir",
86
93
  "default": [
@@ -199,5 +206,5 @@
199
206
  ]
200
207
  }
201
208
  },
202
- "version": "7.1.0"
209
+ "version": "7.3.0"
203
210
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sfdx-git-delta",
3
- "version": "7.1.0",
3
+ "version": "7.3.0",
4
4
  "description": "Generate the sfdx content in source format and destructive change from two git commits",
5
5
  "keywords": [
6
6
  "salesforce",
@@ -14,12 +14,12 @@
14
14
  "sf-plugin"
15
15
  ],
16
16
  "engines": {
17
- "node": ">=22.22.1"
17
+ "node": ">=22.22.1",
18
+ "npm": ">=12"
18
19
  },
19
20
  "files": [
20
21
  "/lib",
21
22
  "/messages",
22
- "/npm-shrinkwrap.json",
23
23
  "/oclif.lock",
24
24
  "/oclif.manifest.json"
25
25
  ],
@@ -48,32 +48,33 @@
48
48
  "access": "public"
49
49
  },
50
50
  "dependencies": {
51
- "@oclif/core": "4.13.2",
52
- "@salesforce/core": "^9.1.0",
51
+ "@oclif/core": "4.13.5",
52
+ "@salesforce/core": "9.1.2",
53
53
  "@salesforce/sf-plugins-core": "13.0.0",
54
- "@salesforce/source-deploy-retrieve": "13.0.1",
55
- "@scolladon/tsgit": "^3.2.1",
54
+ "@salesforce/source-deploy-retrieve": "13.1.1",
55
+ "@scolladon/tsgit": "3.4.0",
56
56
  "ignore": "7.0.6",
57
- "txml": "6.0.0",
57
+ "txml": "6.0.1",
58
58
  "zod": "4.4.3"
59
59
  },
60
60
  "devDependencies": {
61
- "@biomejs/biome": "2.5.6",
62
- "@commitlint/cli": "21.2.1",
63
- "@commitlint/config-conventional": "21.2.0",
61
+ "@biomejs/biome": "2.5.8",
62
+ "@commitlint/cli": "21.2.2",
63
+ "@commitlint/config-conventional": "21.2.2",
64
64
  "@ls-lint/ls-lint": "2.3.1",
65
- "@oclif/plugin-help": "6.2.55",
66
- "@salesforce/cli-plugins-testkit": "5.3.64",
65
+ "@oclif/plugin-help": "6.2.58",
66
+ "@salesforce/cli-plugins-testkit": "5.3.66",
67
67
  "@salesforce/dev-config": "4.3.3",
68
- "@stryker-mutator/core": "9.6.1",
69
- "@stryker-mutator/vitest-runner": "9.6.1",
70
- "@types/node": "26.1.2",
68
+ "@stryker-mutator/core": "10.0.0",
69
+ "@stryker-mutator/vitest-runner": "10.0.0",
70
+ "@types/node": "26.2.0",
71
71
  "@vitest/coverage-v8": "4.1.10",
72
72
  "husky": "9.1.7",
73
- "knip": "6.31.0",
73
+ "knip": "6.32.2",
74
74
  "lint-staged": "17.3.0",
75
75
  "ls-engines": "0.10.1",
76
- "oclif": "4.23.29",
76
+ "oclif": "4.23.30",
77
+ "pkg-pr-new": "0.0.88",
77
78
  "shx": "0.4.0",
78
79
  "ts-node": "10.9.2",
79
80
  "typescript": "7.0.2",
@@ -87,6 +88,9 @@
87
88
  },
88
89
  "filelist": {
89
90
  "minimatch": "^10.1.2"
91
+ },
92
+ "typed-rest-client": {
93
+ "qs": "^6.15.3"
90
94
  }
91
95
  },
92
96
  "scripts": {
@@ -96,9 +100,6 @@
96
100
  "clean:package-manager": "wireit",
97
101
  "dependencies:reinstall": "npm install",
98
102
  "dependencies:upgrade": "npx npm-check-updates -u ; npm install ; npm audit fix",
99
- "devops:cleanup:dev-tag": "./tooling/devops-cleanup.sh",
100
- "devops:cleanup:dev-tag:all": "./tooling/devops-cleanup-all.sh",
101
- "devops:move-tag": "./tooling/devops-movetag.sh",
102
103
  "lint:dependencies": "wireit",
103
104
  "lint:engine": "wireit",
104
105
  "lint:fs": "wireit",
@@ -107,7 +108,7 @@
107
108
  "postpack": "shx rm -f oclif.manifest.json && shx sed -i 'blob/v[^/]*/' 'blob/main/' README.md",
108
109
  "prepack": "wireit",
109
110
  "prepare": "husky",
110
- "prepublishOnly": "shx cp package-lock.json npm-shrinkwrap.json",
111
+ "preview:publish": "pkg-pr-new publish --comment=off",
111
112
  "sync:registry": "TS_NODE_COMPILER_OPTIONS='{\"rootDir\":\".\"}' node --loader ts-node/esm tooling/syncInternalRegistryWithSdr.ts",
112
113
  "test:build": "wireit",
113
114
  "test:functional": "wireit",
@@ -1,7 +0,0 @@
1
- import BaseProcessor from './baseProcessor.js';
2
- export default class BundleRollupProcessor extends BaseProcessor {
3
- process(): Promise<void>;
4
- private _collectBundleMembers;
5
- private _isCoveredByBundle;
6
- private _warnBundleDeletions;
7
- }
@@ -1,81 +0,0 @@
1
- 'use strict';
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- import { DOT } from '../constant/fsConstants.js';
9
- import { DIGITAL_EXPERIENCE_BUNDLE_TYPE, DIGITAL_EXPERIENCE_TYPE, } from '../constant/metadataConstants.js';
10
- import { ManifestTarget } from '../types/handlerResult.js';
11
- import { log } from '../utils/LoggingDecorator.js';
12
- import { MessageService } from '../utils/MessageService.js';
13
- import BaseProcessor from './baseProcessor.js';
14
- // Generic shape (one concrete pair today): a parent metadata type whose
15
- // member subsumes every child of the same site/bundle in the deploy contract.
16
- // For DigitalExperienceBundle → DigitalExperience, a DEB member deploys (or
17
- // deletes) every DE child, so DE entries covered by a same-manifest DEB are
18
- // redundant. This processor collapses them per manifest and — because a
19
- // whole-bundle deletion is org-gated — warns when a DEB lands in
20
- // destructiveChanges. When a second parent/child pair appears, generalize to
21
- // a `BundleRollupProcessor` that takes a list of (parentType, childType,
22
- // parentMemberOf) configs; until then we keep the implementation focused on
23
- // the only pair we have empirical deploy semantics for.
24
- export default class BundleRollupProcessor extends BaseProcessor {
25
- async process() {
26
- const elements = this.work.changes.toElements();
27
- const bundleMembersByTarget = this._collectBundleMembers(elements);
28
- for (const element of elements) {
29
- if (
30
- // Stryker disable next-line ConditionalExpression -- equivalent: flipping the type guard to `true` would also attempt to remove non-DE elements covered by a same-prefix bundle member, but `ChangeSet.removeMember` is a no-op for non-shrinkable types — so the post-process manifest is byte-identical to the original.
31
- element.type === DIGITAL_EXPERIENCE_TYPE &&
32
- this._isCoveredByBundle(element, bundleMembersByTarget)) {
33
- this.work.changes.removeMember(element.target, element.type, element.member);
34
- }
35
- }
36
- this._warnBundleDeletions(bundleMembersByTarget.get(ManifestTarget.DestructiveChanges));
37
- }
38
- _collectBundleMembers(elements) {
39
- const bundleMembersByTarget = new Map();
40
- for (const { target, type, member } of elements) {
41
- if (type !== DIGITAL_EXPERIENCE_BUNDLE_TYPE)
42
- continue;
43
- let members = bundleMembersByTarget.get(target);
44
- if (!members) {
45
- members = new Set();
46
- bundleMembersByTarget.set(target, members);
47
- }
48
- members.add(member);
49
- }
50
- return bundleMembersByTarget;
51
- }
52
- _isCoveredByBundle(element, bundleMembersByTarget) {
53
- const bundleMembers = bundleMembersByTarget.get(element.target);
54
- if (!bundleMembers)
55
- return false;
56
- // A canonical `DigitalExperience` member is `<base>/<space>.<ct>/<cn>` and
57
- // `<space>` (a Salesforce API name) cannot contain `.`, so the first `.`
58
- // delimits the parent bundle's member exactly. One Set lookup vs. an
59
- // `O(B)` linear `startsWith` scan over `bundleMembers`.
60
- const dotIdx = element.member.indexOf(DOT);
61
- // Stryker disable next-line ConditionalExpression,EqualityOperator,BlockStatement,BooleanLiteral -- equivalent/defensive: `BundleHandler.getElementDescriptor` constructs every `DigitalExperience` member as `<base>/<space>.<ct>/<cn>`, so a dotless member cannot reach this branch from the production pipeline.
62
- /* v8 ignore next -- defensive: a DigitalExperience member without `.` is unreachable in production */
63
- if (dotIdx < 0)
64
- return false;
65
- return bundleMembers.has(element.member.slice(0, dotIdx));
66
- }
67
- _warnBundleDeletions(bundleMembers) {
68
- if (!bundleMembers)
69
- return;
70
- const message = new MessageService();
71
- for (const bundleMember of bundleMembers) {
72
- this.work.warnings.push(new Error(message.getMessage('warning.DigitalExperienceBundleDeletion', [
73
- bundleMember,
74
- ])));
75
- }
76
- }
77
- }
78
- __decorate([
79
- log
80
- ], BundleRollupProcessor.prototype, "process", null);
81
- //# sourceMappingURL=bundleRollupProcessor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bundleRollupProcessor.js","sourceRoot":"","sources":["../../src/post-processor/bundleRollupProcessor.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;;;;;;;AAEZ,OAAO,EAAE,GAAG,EAAE,MAAM,4BAA4B,CAAA;AAChD,OAAO,EACL,8BAA8B,EAC9B,uBAAuB,GACxB,MAAM,kCAAkC,CAAA;AAEzC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC1D,OAAO,EAAE,GAAG,EAAE,MAAM,8BAA8B,CAAA;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAE3D,OAAO,aAAa,MAAM,oBAAoB,CAAA;AAE9C,wEAAwE;AACxE,8EAA8E;AAC9E,4EAA4E;AAC5E,4EAA4E;AAC5E,wEAAwE;AACxE,iEAAiE;AACjE,6EAA6E;AAC7E,yEAAyE;AACzE,4EAA4E;AAC5E,wDAAwD;AACxD,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,aAAa;IAExC,AAAN,KAAK,CAAC,OAAO;QAC3B,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAA;QAC/C,MAAM,qBAAqB,GAAG,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAA;QAElE,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC/B;YACE,2TAA2T;YAC3T,OAAO,CAAC,IAAI,KAAK,uBAAuB;gBACxC,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,qBAAqB,CAAC,EACvD,CAAC;gBACD,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAC5B,OAAO,CAAC,MAAM,EACd,OAAO,CAAC,IAAI,EACZ,OAAO,CAAC,MAAM,CACf,CAAA;YACH,CAAC;QACH,CAAC;QAED,IAAI,CAAC,oBAAo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