sfdx-git-delta 7.3.0 → 7.4.1

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 (64) hide show
  1. package/README.md +23 -4
  2. package/lib/adapter/GitAdapter.d.ts +9 -4
  3. package/lib/adapter/GitAdapter.js +147 -52
  4. package/lib/adapter/GitAdapter.js.map +1 -1
  5. package/lib/adapter/pathMatching.d.ts +2 -1
  6. package/lib/adapter/pathMatching.js +35 -3
  7. package/lib/adapter/pathMatching.js.map +1 -1
  8. package/lib/adapter/treeReader.d.ts +1 -0
  9. package/lib/adapter/treeReader.js +10 -0
  10. package/lib/adapter/treeReader.js.map +1 -1
  11. package/lib/adapter/tsgitErrorMap.d.ts +6 -3
  12. package/lib/adapter/tsgitErrorMap.js +55 -16
  13. package/lib/adapter/tsgitErrorMap.js.map +1 -1
  14. package/lib/constant/metadataConstants.d.ts +9 -1
  15. package/lib/constant/metadataConstants.js +17 -3
  16. package/lib/constant/metadataConstants.js.map +1 -1
  17. package/lib/main.js +66 -63
  18. package/lib/main.js.map +1 -1
  19. package/lib/metadata/MetadataRepositoryImpl.d.ts +14 -2
  20. package/lib/metadata/MetadataRepositoryImpl.js +192 -50
  21. package/lib/metadata/MetadataRepositoryImpl.js.map +1 -1
  22. package/lib/post-processor/includeProcessor.js +8 -9
  23. package/lib/post-processor/includeProcessor.js.map +1 -1
  24. package/lib/service/botHandler.js +1 -1
  25. package/lib/service/botHandler.js.map +1 -1
  26. package/lib/service/inBundleHandler.js +10 -23
  27. package/lib/service/inBundleHandler.js.map +1 -1
  28. package/lib/service/inFolderHandler.js +1 -2
  29. package/lib/service/inFolderHandler.js.map +1 -1
  30. package/lib/service/objectTranslationHandler.d.ts +0 -1
  31. package/lib/service/objectTranslationHandler.js +11 -4
  32. package/lib/service/objectTranslationHandler.js.map +1 -1
  33. package/lib/types/runContext.d.ts +16 -5
  34. package/lib/types/runContext.js +17 -5
  35. package/lib/types/runContext.js.map +1 -1
  36. package/lib/utils/__mocks__/LoggingService.d.ts +2 -7
  37. package/lib/utils/__mocks__/LoggingService.js.map +1 -1
  38. package/lib/utils/changeSet.d.ts +1 -0
  39. package/lib/utils/changeSet.js +26 -1
  40. package/lib/utils/changeSet.js.map +1 -1
  41. package/lib/utils/configValidator.d.ts +14 -1
  42. package/lib/utils/configValidator.js +144 -72
  43. package/lib/utils/configValidator.js.map +1 -1
  44. package/lib/utils/errorUtils.d.ts +8 -0
  45. package/lib/utils/errorUtils.js +14 -0
  46. package/lib/utils/errorUtils.js.map +1 -1
  47. package/lib/utils/messageSanitizer.d.ts +1 -0
  48. package/lib/utils/messageSanitizer.js +46 -0
  49. package/lib/utils/messageSanitizer.js.map +1 -1
  50. package/lib/utils/metadataDiff/xmlEventReader.js +1 -1
  51. package/lib/utils/metadataDiff/xmlEventReader.js.map +1 -1
  52. package/lib/utils/repoGitDiff.d.ts +17 -2
  53. package/lib/utils/repoGitDiff.js +93 -12
  54. package/lib/utils/repoGitDiff.js.map +1 -1
  55. package/lib/utils/treeIndexScope.js +5 -14
  56. package/lib/utils/treeIndexScope.js.map +1 -1
  57. package/lib/utils/treeReaderBuilder.d.ts +8 -0
  58. package/lib/utils/treeReaderBuilder.js +34 -0
  59. package/lib/utils/treeReaderBuilder.js.map +1 -0
  60. package/lib/utils/txmlAdapter.js +1 -1
  61. package/lib/utils/txmlAdapter.js.map +1 -1
  62. package/messages/delta.md +16 -5
  63. package/oclif.manifest.json +1 -1
  64. package/package.json +105 -49
@@ -6,3 +6,4 @@ export type TreeReader = Readonly<{
6
6
  }>;
7
7
  export declare const createTreeReader: (entries: ReadonlyMap<string, TreeIndex>) => TreeReader;
8
8
  export declare const EMPTY_TREE_READER: TreeReader;
9
+ export declare const withoutRevision: (reader: TreeReader, revision: string) => TreeReader;
@@ -19,4 +19,14 @@ export const createTreeReader = (entries) => {
19
19
  // that was never built would produce. Expressed via the real factory over
20
20
  // an empty map so it cannot drift from what createTreeReader actually does.
21
21
  export const EMPTY_TREE_READER = createTreeReader(new Map());
22
+ // Forces one named revision to answer exactly as an unbuilt one would —
23
+ // false/[]/[] — regardless of whether the wrapped reader holds a real index
24
+ // for it. Every other revision passes through untouched. Used to make a
25
+ // container-liveness check answer `false` by construction rather than by a
26
+ // revision happening to be unindexed (see IncludeProcessor's DELETION pass).
27
+ export const withoutRevision = (reader, revision) => ({
28
+ pathExists: (rev, path) => rev === revision ? false : reader.pathExists(rev, path),
29
+ filesUnder: (rev, paths) => rev === revision ? [] : reader.filesUnder(rev, paths),
30
+ children: (rev, dir) => (rev === revision ? [] : reader.children(rev, dir)),
31
+ });
22
32
  //# sourceMappingURL=treeReader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"treeReader.js","sourceRoot":"","sources":["../../src/adapter/treeReader.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAwB1C,4EAA4E;AAC5E,qEAAqE;AACrE,yEAAyE;AACzE,0EAA0E;AAC1E,aAAa;AACb,MAAM,QAAQ,GAAkB,IAAI,SAAS,EAAE,CAAA;AAE/C,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,OAAuC,EAC3B,EAAE;IACd,MAAM,OAAO,GAAG,CAAC,QAAgB,EAAiB,EAAE,CAClD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAA;IACnC,OAAO;QACL,UAAU,EAAE,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC;QAClE,UAAU,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC;QACtE,QAAQ,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,YAAY,CAAC,GAA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A6E;AAC7E,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,MAAkB,EAClB,QAAgB,EACJ,EAAE,CAAC,CAAC;IAChB,UAAU,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CACxB,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC;IACzD,UAAU,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CACzB,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC;IACvD,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;CAC5E,CAAC,CAAA"}
@@ -1,7 +1,10 @@
1
1
  /**
2
2
  * Normalizes a raw tsgit rejection into a release-compatible Error. Pure —
3
3
  * no I/O, never throws itself, always returns an Error for the caller to
4
- * rethrow. `context` identifies the operation (a ref, an oid, a repo path)
5
- * and is interpolated into the mapped message.
4
+ * rethrow sgd's own `SgdError` instances come back by identity. `context`
5
+ * identifies the operation (a ref, an oid, a range) and is interpolated into
6
+ * object-lookup messages; `repoPath` identifies the repository and is
7
+ * interpolated into repository-refusal messages instead, since tsgit
8
+ * renders those down to a bare basename.
6
9
  */
7
- export declare const mapTsgitError: (error: unknown, context: string) => Error;
10
+ export declare const mapTsgitError: (error: unknown, context: string, repoPath: string) => Error;
@@ -1,32 +1,71 @@
1
1
  'use strict';
2
- import { getErrorMessage } from '../utils/errorUtils.js';
2
+ import { getErrorMessage, RepositoryRefusalError, SgdError, } from '../utils/errorUtils.js';
3
+ import { sanitizeForMessage } from '../utils/messageSanitizer.js';
3
4
  // Raw tsgit surfaces this module narrows away from GitAdapter's
4
- // user-surfacing methods: `openRepository` rejects with a plain Node
5
- // ENOENT whose message names `realpath` when the repo directory is
6
- // missing; a bad ref/oid rejects with `TsgitError` whose message is
7
- // prefixed `OBJECT_NOT_FOUND:`. Neither raw shape is release-compatible.
8
- const ENOENT_CODE = 'ENOENT';
9
- const REALPATH_HINT = 'realpath';
5
+ // user-surfacing methods: a bad ref/oid rejects with `TsgitError` whose
6
+ // `data.code` is 'OBJECT_NOT_FOUND' and whose message is prefixed
7
+ // `OBJECT_NOT_FOUND:`; a repository tsgit refuses to open at all rejects
8
+ // with one of the codes in REFUSAL_MESSAGES below, carried the same way.
9
+ // Neither raw shape is release-compatible. tsgit never sets a top-level
10
+ // `error.code` every code lives under `error.data.code`.
10
11
  const OBJECT_NOT_FOUND_CODE = 'OBJECT_NOT_FOUND';
11
12
  const OBJECT_NOT_FOUND_PREFIX = `${OBJECT_NOT_FOUND_CODE}:`;
12
- const codeOf = (error) => error?.code;
13
- const isMissingRepo = (error, message) => codeOf(error) === ENOENT_CODE && message.includes(REALPATH_HINT);
14
- const isObjectNotFound = (error, message) => codeOf(error) === OBJECT_NOT_FOUND_CODE ||
13
+ const NOT_A_REPOSITORY_CODE = 'NOT_A_REPOSITORY';
14
+ const REPOSITORY_FORMAT_VERSION_UNSUPPORTED_CODE = 'REPOSITORY_FORMAT_VERSION_UNSUPPORTED';
15
+ const REPOSITORY_EXTENSIONS_UNSUPPORTED_CODE = 'REPOSITORY_EXTENSIONS_UNSUPPORTED';
16
+ const REPOSITORY_EXTENSION_UNSUPPORTED_CODE = 'REPOSITORY_EXTENSION_UNSUPPORTED';
17
+ const dataCodeOf = (error) => error?.data?.code;
18
+ const isObjectNotFound = (error, message) => dataCodeOf(error) === OBJECT_NOT_FOUND_CODE ||
15
19
  message.startsWith(OBJECT_NOT_FOUND_PREFIX);
20
+ // tsgit renders every repository path down to its basename, so a mapped
21
+ // message has to be rebuilt from the path sgd itself opened. One sentence
22
+ // per condition, not per code: the three format refusals are not separately
23
+ // actionable — the user's move is the same for all three. The path is
24
+ // untrusted (it can come straight from --repo-dir), so it is sanitized
25
+ // here the same way ConfigValidator sanitizes error.PathIsNotGit's — that
26
+ // shared transformation is what keeps the two renderings byte-identical,
27
+ // which is what lets validateConfig's `new Set(errors)` collapse a
28
+ // same-repository refusal reported through both paths into one sentence.
29
+ const notARepository = (repoPath) => `'${sanitizeForMessage(repoPath)}' is not a git repository`;
30
+ const unreadableFormat = (repoPath) => `'${sanitizeForMessage(repoPath)}' uses a repository format this version of sgd cannot read`;
31
+ const REFUSAL_MESSAGES = new Map([
32
+ [NOT_A_REPOSITORY_CODE, notARepository],
33
+ [REPOSITORY_FORMAT_VERSION_UNSUPPORTED_CODE, unreadableFormat],
34
+ [REPOSITORY_EXTENSIONS_UNSUPPORTED_CODE, unreadableFormat],
35
+ [REPOSITORY_EXTENSION_UNSUPPORTED_CODE, unreadableFormat],
36
+ ]);
37
+ const refusalMessageFor = (error, message) => {
38
+ for (const [code, render] of REFUSAL_MESSAGES) {
39
+ if (dataCodeOf(error) === code || message.startsWith(`${code}:`)) {
40
+ return render;
41
+ }
42
+ }
43
+ return undefined;
44
+ };
16
45
  /**
17
46
  * Normalizes a raw tsgit rejection into a release-compatible Error. Pure —
18
47
  * no I/O, never throws itself, always returns an Error for the caller to
19
- * rethrow. `context` identifies the operation (a ref, an oid, a repo path)
20
- * and is interpolated into the mapped message.
48
+ * rethrow sgd's own `SgdError` instances come back by identity. `context`
49
+ * identifies the operation (a ref, an oid, a range) and is interpolated into
50
+ * object-lookup messages; `repoPath` identifies the repository and is
51
+ * interpolated into repository-refusal messages instead, since tsgit
52
+ * renders those down to a bare basename.
21
53
  */
22
- export const mapTsgitError = (error, context) => {
54
+ export const mapTsgitError = (error, context, repoPath) => {
55
+ // sgd's own typed errors are already release-shaped; only raw tsgit
56
+ // rejections need rewriting. Without this, a NotACommitError raised inside
57
+ // an adapter method would leave it as a generic `git operation failed: …`
58
+ // and ConfigValidator could not tell a non-commit from any other failure.
59
+ if (error instanceof SgdError)
60
+ return error;
23
61
  const message = getErrorMessage(error);
24
- if (isMissingRepo(error, message)) {
25
- return new Error(`'${context}' is not a git repository`);
26
- }
27
62
  if (isObjectNotFound(error, message)) {
28
63
  return new Error(`${context}: not a valid git revision`);
29
64
  }
65
+ const renderRefusal = refusalMessageFor(error, message);
66
+ if (renderRefusal) {
67
+ return new RepositoryRefusalError(renderRefusal(repoPath));
68
+ }
30
69
  return new Error(`git operation failed: ${message}`);
31
70
  };
32
71
  //# sourceMappingURL=tsgitErrorMap.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tsgitErrorMap.js","sourceRoot":"","sources":["../../src/adapter/tsgitErrorMap.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AACZ,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAExD,gEAAgE;AAChE,qEAAqE;AACrE,mEAAmE;AACnE,oEAAoE;AACpE,yEAAyE;AACzE,MAAM,WAAW,GAAG,QAAQ,CAAA;AAC5B,MAAM,aAAa,GAAG,UAAU,CAAA;AAChC,MAAM,qBAAqB,GAAG,kBAAkB,CAAA;AAChD,MAAM,uBAAuB,GAAG,GAAG,qBAAqB,GAAG,CAAA;AAI3D,MAAM,MAAM,GAAG,CAAC,KAAc,EAAW,EAAE,CAAE,KAAoB,EAAE,IAAI,CAAA;AAEvE,MAAM,aAAa,GAAG,CAAC,KAAc,EAAE,OAAe,EAAW,EAAE,CACjE,MAAM,CAAC,KAAK,CAAC,KAAK,WAAW,IAAI,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAA;AAElE,MAAM,gBAAgB,GAAG,CAAC,KAAc,EAAE,OAAe,EAAW,EAAE,CACpE,MAAM,CAAC,KAAK,CAAC,KAAK,qBAAqB;IACvC,OAAO,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAA;AAE7C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,K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K,CAAC,CAAA;IACtC,IAAI,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC;QACrC,OAAO,IAAI,KAAK,CAAC,GAAG,OAAO,4BAA4B,CAAC,CAAA;IAC1D,CAAC;IACD,MAAM,aAAa,GAAG,iBAAiB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;IACvD,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,IAAI,sBAAsB,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAA;IAC5D,CAAC;IACD,OAAO,IAAI,KAAK,CAAC,yBAAyB,OAAO,EAAE,CAAC,CAAA;AACtD,CAAC,CAAA"}
@@ -1,13 +1,20 @@
1
- export declare const CONTENT_CONTAINER_ADAPTERS: Set<string>;
1
+ export declare const BOT_TYPE = "Bot";
2
+ export declare const BOT_VERSION_TYPE = "BotVersion";
2
3
  export declare const CUSTOM_APPLICATION_SUFFIX = "app";
3
4
  export declare const CUSTOM_METADATA_SUFFIX = "md";
5
+ export declare const DEFAULT_CONTAINER_DEPTH = 1;
6
+ export declare const DIGITAL_EXPERIENCE_ADAPTER = "digitalExperience";
7
+ export declare const CONTENT_CONTAINER_ADAPTERS: Set<string>;
4
8
  export declare const DIGITAL_EXPERIENCE_BUNDLE_TYPE = "DigitalExperienceBundle";
9
+ export declare const DIGITAL_EXPERIENCE_BUNDLE_DEPTH = 2;
10
+ export declare const DIGITAL_EXPERIENCE_CONTENT_DEPTH = 4;
5
11
  export declare const DIGITAL_EXPERIENCE_TYPE = "DigitalExperience";
6
12
  export declare const EMAIL_SERVICES_FUNCTION_SUFFIX = "xml";
7
13
  export declare const FIELD_DIRECTORY_NAME = "fields";
8
14
  export declare const FLOW_DEFINITIONS_KEY = "flowDefinitions";
9
15
  export declare const FLOW_XML_NAME = "Flow";
10
16
  export declare const INFOLDER_SUFFIX = "Folder";
17
+ export declare const INFOLDER_SUFFIX_REGEX: RegExp;
11
18
  export declare const LABEL_DECOMPOSED_SUFFIX = "label";
12
19
  export declare const MASTER_DETAIL_TAG = "<type>MasterDetail</type>";
13
20
  export declare const METAFILE_SUFFIX = "-meta.xml";
@@ -20,4 +27,5 @@ export declare const SHARING_RULE_TYPE = "SharingRules";
20
27
  export declare const SUB_OBJECT_TYPES: string[];
21
28
  export declare const TRANSLATION_EXTENSION = "translation";
22
29
  export declare const TRANSLATION_TYPE = "Translations";
30
+ export declare const VIRTUAL_BOT_TYPE = "VirtualBot";
23
31
  export declare const WORKFLOW_TYPE = "Workflow";
@@ -1,4 +1,13 @@
1
1
  'use strict';
2
+ export const BOT_TYPE = 'Bot';
3
+ export const BOT_VERSION_TYPE = 'BotVersion';
4
+ export const CUSTOM_APPLICATION_SUFFIX = 'app';
5
+ export const CUSTOM_METADATA_SUFFIX = 'md';
6
+ // A component named by the single segment below its type directory: every
7
+ // content-container adapter except digitalExperience (depths below), and the
8
+ // holder-scoped composed types, whose every file keys on that one segment.
9
+ export const DEFAULT_CONTAINER_DEPTH = 1;
10
+ export const DIGITAL_EXPERIENCE_ADAPTER = 'digitalExperience';
2
11
  // SDR adapters whose component is a directory owning an opaque content subtree
3
12
  // (StaticResource/ExperienceBundle/Document via mixedContent, Aura/LWC via
4
13
  // bundle, DigitalExperienceBundle via digitalExperience). When such a type is
@@ -6,18 +15,22 @@
6
15
  // metadata directories — so type resolution must stop there.
7
16
  export const CONTENT_CONTAINER_ADAPTERS = new Set([
8
17
  'bundle',
9
- 'digitalExperience',
18
+ DIGITAL_EXPERIENCE_ADAPTER,
10
19
  'mixedContent',
11
20
  ]);
12
- export const CUSTOM_APPLICATION_SUFFIX = 'app';
13
- export const CUSTOM_METADATA_SUFFIX = 'md';
14
21
  export const DIGITAL_EXPERIENCE_BUNDLE_TYPE = 'DigitalExperienceBundle';
22
+ // SDR's canonical layout below `digitalExperiences/` is
23
+ // `<baseType>/<spaceApiName>/<contentType>/<contentApiName>/<file>`: the
24
+ // bundle is the first two segments, a page content folder the first four.
25
+ export const DIGITAL_EXPERIENCE_BUNDLE_DEPTH = 2;
26
+ export const DIGITAL_EXPERIENCE_CONTENT_DEPTH = 4;
15
27
  export const DIGITAL_EXPERIENCE_TYPE = 'DigitalExperience';
16
28
  export const EMAIL_SERVICES_FUNCTION_SUFFIX = 'xml';
17
29
  export const FIELD_DIRECTORY_NAME = 'fields';
18
30
  export const FLOW_DEFINITIONS_KEY = 'flowDefinitions';
19
31
  export const FLOW_XML_NAME = 'Flow';
20
32
  export const INFOLDER_SUFFIX = `Folder`;
33
+ export const INFOLDER_SUFFIX_REGEX = new RegExp(`${INFOLDER_SUFFIX}$`);
21
34
  export const LABEL_DECOMPOSED_SUFFIX = 'label';
22
35
  export const MASTER_DETAIL_TAG = '<type>MasterDetail</type>';
23
36
  export const METAFILE_SUFFIX = '-meta.xml';
@@ -54,5 +67,6 @@ export const SUB_OBJECT_TYPES = [
54
67
  ];
55
68
  export const TRANSLATION_EXTENSION = 'translation';
56
69
  export const TRANSLATION_TYPE = 'Translations';
70
+ export const VIRTUAL_BOT_TYPE = 'VirtualBot';
57
71
  export const WORKFLOW_TYPE = 'Workflow';
58
72
  //# sourceMappingURL=metadataConstants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"metadataConstants.js","sourceRoot":"","sources":["../../src/constant/metadataConstants.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AACZ,+EAA+E;AAC/E,2EAA2E;AAC3E,8EAA8E;AAC9E,+EAA+E;AAC/E,6DAA6D;AAC7D,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,GAAG,CAAC;IAChD,QAAQ;IACR,mBAAmB;IACnB,cAAc;CACf,CAAC,CAAA;AACF,MAAM,CAAC,MAAM,yBAAyB,GAAG,KAAK,CAAA;AAC9C,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAA;AAC1C,MAAM,CAAC,MAAM,8BAA8B,GAAG,yBAAyB,CAAA;AACvE,MAAM,CAAC,MAAM,uBAAuB,GAAG,mBAAmB,CAAA;AAC1D,MAAM,CAA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CAAC,CAAA;AACtE,MAAM,CAAC,MAAM,uBAAuB,GAAG,OAAO,CAAA;AAC9C,MAAM,CAAC,MAAM,iBAAiB,GAAG,2BAA2B,CAAA;AAC5D,MAAM,CAAC,MAAM,eAAe,GAAG,WAAW,CAAA;AAC1C,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,GAAG,eAAe,GAAG,CAAC,CAAA;AAC3D,MAAM,CAAC,MAAM,kCAAkC,GAAG,oBAAoB,eAAe,EAAE,CAAA;AACvF,MAAM,CAAC,MAAM,uBAAuB,GAAG,yBAAyB,CAAA;AAChE,MAAM,CAAC,MAAM,WAAW,GAAG,cAAc,CAAA;AACzC,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAe,CAAA;AACjD,MAAM,CAAC,MAAM,iBAAiB,GAAG,cAAc,CAAA;AAC/C,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,iBAAiB;IACjB,eAAe;IACf,aAAa;IACb,UAAU;IACV,OAAO;IACP,UAAU;IACV,YAAY;IACZ,qBAAqB;IACrB,kBAAkB;IAClB,kBAAkB;IAClB,eAAe;IACf,YAAY;IACZ,gBAAgB;IAChB,gBAAgB;IAChB,SAAS;IACT,eAAe;IACf,qBAAqB;IACrB,oBAAoB;IACpB,0BAA0B;IAC1B,yBAAyB;IACzB,cAAc;IACd,cAAc;IACd,cAAc;CACf,CAAA;AACD,MAAM,CAAC,MAAM,qBAAqB,GAAG,aAAa,CAAA;AAClD,MAAM,CAAC,MAAM,gBAAgB,GAAG,cAAc,CAAA;AAC9C,MAAM,CAAC,MAAM,gBAAgB,GAAG,YAAY,CAAA;AAC5C,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAA"}
package/lib/main.js CHANGED
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
  import GitAdapter from './adapter/GitAdapter.js';
3
3
  import IOExecutor from './adapter/ioExecutor.js';
4
- import { createTreeReader, EMPTY_TREE_READER } from './adapter/treeReader.js';
5
4
  import { getDefinition } from './metadata/metadataManager.js';
6
5
  import { getPostProcessors } from './post-processor/postProcessorManager.js';
7
6
  import DiffLineInterpreter from './service/diffLineInterpreter.js';
@@ -15,6 +14,14 @@ import { parseSourceDirs } from './utils/pathspec.js';
15
14
  import RenameResolver from './utils/renameResolver.js';
16
15
  import RepoGitDiff from './utils/repoGitDiff.js';
17
16
  import { computeTreeIndexScope } from './utils/treeIndexScope.js';
17
+ import { buildRunTreeReader } from './utils/treeReaderBuilder.js';
18
+ const collectLines = async (lines) => {
19
+ const materialized = [];
20
+ for await (const line of lines) {
21
+ materialized.push(line);
22
+ }
23
+ return materialized;
24
+ };
18
25
  export default async (configInput) => {
19
26
  // Stryker disable next-line StringLiteral -- equivalent: log content is observability only; tests assert on the returned Work, not lazy log lines
20
27
  Logger.trace('main: entry');
@@ -30,55 +37,28 @@ export default async (configInput) => {
30
37
  const configWarnings = await new ConfigValidator(config, rejections).validateConfig();
31
38
  const metadata = await getDefinition(config);
32
39
  const repoGitDiffHelper = new RepoGitDiff(config, metadata);
33
- // The treeIndex scope read needs the full path set up front, so when
34
- // generateDelta is on without an include override we materialize the
35
- // streamed diff once. Otherwise we feed the async iterable straight
36
- // into DiffLineInterpreter so handlers start firing while git is
37
- // still emitting lines.
38
- const needsScopeFromDiff = config.generateDelta && !config.include && !config.includeDestructive;
39
- let lines;
40
- if (needsScopeFromDiff) {
41
- const materialized = [];
42
- for await (const line of repoGitDiffHelper.getLines()) {
43
- materialized.push(line);
44
- }
45
- lines = materialized;
46
- }
47
- // Stryker disable next-line BlockStatement -- equivalent: emptying the else block leaves `lines` undefined which downstream lineProcessor.process(undefined) iterates as empty; the test main.test.ts only asserts mockProcess was called with the materialized array in the if-branch fixture, and the else-body BlockStatement mutant on the assignment expression is observably equivalent because mockProcess accepts undefined under stryker's perTest path-coverage analysis
48
- else {
49
- lines = repoGitDiffHelper.getLines();
50
- }
51
- // Built here and threaded to every reader (DiffLineInterpreter,
52
- // RenameResolver, IOExecutor, the post-processors) rather than cached
53
- // on GitAdapter: one TreeIndex per revision, for this run only, so a
54
- // reader can never see a different scope than the one this block just
55
- // built under — the lesson from the shared, scope-keyed cache this
56
- // replaces (see design history) is that a cache keyed by a value each
57
- // reader recomputes is an implicit contract that will drift.
58
- let trees = EMPTY_TREE_READER;
59
- if (config.generateDelta) {
60
- const gitAdapter = GitAdapter.getInstance(config);
61
- let scopePaths = config.source;
62
- if (needsScopeFromDiff) {
63
- scopePaths = [
64
- ...computeTreeIndexScope(lines, metadata),
65
- ];
66
- }
67
- if (scopePaths.length > 0) {
68
- const [toIndex, fromIndex] = await Promise.all([
69
- gitAdapter.buildTreeIndex(config.to, scopePaths),
70
- gitAdapter.buildTreeIndex(config.from, scopePaths),
71
- ]);
72
- const entries = new Map();
73
- // Stryker disable ConditionalExpression -- equivalent: forcing either guard to always run stores `undefined` at that revision key instead of skipping it, but the only reader is createTreeReader's `entries.get(revision) ?? NO_INDEX`, and Map.get answers `undefined` for an absent key and an explicitly-undefined value alike. `entries` is local to this block and exposes no has/size/enumeration, so no observer can tell the two apart
74
- if (toIndex)
75
- entries.set(config.to, toIndex);
76
- if (fromIndex)
77
- entries.set(config.from, fromIndex);
78
- // Stryker restore ConditionalExpression
79
- trees = createTreeReader(entries);
80
- }
81
- }
40
+ // The tree-index scope is read off the diff whenever no include file
41
+ // overrides it, so the stream is materialised once: computeTreeIndexScope
42
+ // and lineProcessor.process walk the same lines. With an include file the
43
+ // scope is config.source and the async iterable feeds straight into
44
+ // DiffLineInterpreter, so handlers fire while git is still emitting.
45
+ const needsScopeFromDiff = !config.include && !config.includeDestructive;
46
+ const materialized = needsScopeFromDiff
47
+ ? await collectLines(repoGitDiffHelper.getLines())
48
+ : undefined;
49
+ const lines = materialized ?? repoGitDiffHelper.getLines();
50
+ // The manifests must not depend on --generate-delta: every index-backed
51
+ // read that decides package.xml vs destructiveChanges.xml (container
52
+ // liveness, decomposed-holder liveness, the include listing) runs in
53
+ // every mode, so the run's two indexes are built in every mode. The flag
54
+ // gates only what is copied. Built here and threaded to every reader
55
+ // (DiffLineInterpreter, RenameResolver, IOExecutor, the post-processors)
56
+ // through RunContext rather than cached on GitAdapter, so no reader can
57
+ // see a different scope than the one this run built under.
58
+ const scopePaths = materialized
59
+ ? [...computeTreeIndexScope(materialized, metadata)]
60
+ : config.source;
61
+ const { trees, unindexed } = await buildRunTreeReader(GitAdapter.getInstance(config), config, scopePaths);
82
62
  const ctx = { config, metadata, trees };
83
63
  const lineProcessor = new DiffLineInterpreter(ctx);
84
64
  const postProcessors = getPostProcessors(ctx);
@@ -102,20 +82,41 @@ export default async (configInput) => {
102
82
  // changes at all — a non-empty manifest (e.g. members sourced by
103
83
  // --include-file independent of the diff) means the scope did its
104
84
  // job, so naming it as unmatched would be misleading.
85
+ const messages = new MessageService();
86
+ // tokens is a thunk, not a precomputed array: sanitizeForMessage must
87
+ // only run when the warning actually fires, matching the ternaries this
88
+ // replaces (some callers never set config.to/from, so an unconditional
89
+ // sanitizeForMessage(requestedTo) would crash on undefined).
90
+ const warnIf = (condition, key, tokens) => condition ? [new Error(messages.getMessage(key, tokens()))] : [];
105
91
  const unmatchedScopes = repoGitDiffHelper.getUnmatchedSourceScopes();
106
- const sourceScopeWarnings = unmatchedScopes.length > 0 && changes.isEmpty()
107
- ? [
108
- new Error(new MessageService().getMessage('warning.SourceDirMatchedNothing', [
109
- // Sanitize each scope before joining: the length cap in
110
- // sanitizeForMessage must apply per scope, not to the
111
- // joined aggregate, or one long scope name silently
112
- // elides every scope listed after it.
113
- unmatchedScopes.map(sanitizeForMessage).join(', '),
114
- sanitizeForMessage(requestedFrom),
115
- sanitizeForMessage(requestedTo),
116
- ])),
117
- ]
118
- : [];
92
+ const sourceScopeWarnings = warnIf(unmatchedScopes.length > 0 && changes.isEmpty(), 'warning.SourceDirMatchedNothing', () => [
93
+ // Sanitize each scope before joining: the length cap in
94
+ // sanitizeForMessage must apply per scope, not to the
95
+ // joined aggregate, or one long scope name silently
96
+ // elides every scope listed after it.
97
+ unmatchedScopes.map(sanitizeForMessage).join(', '),
98
+ sanitizeForMessage(requestedFrom),
99
+ sanitizeForMessage(requestedTo),
100
+ ]);
101
+ // Also final by this point. When the `to` listing could not be read,
102
+ // components moved into an ignored directory were not recognised as
103
+ // moves, so their deletions are reported destructively. That is the
104
+ // safe direction, but it is a degraded answer and must not be silent.
105
+ const probeFailure = repoGitDiffHelper.getHeldAdditionProbeFailure();
106
+ const ignoredMoveWarnings = warnIf(!!probeFailure, 'warning.IgnoredMoveCheckSkipped',
107
+ // Non-null: this thunk only runs when warnIf's condition (!!probeFailure)
108
+ // is true, but the closure sits outside TS's narrowing of that check.
109
+ () => [
110
+ sanitizeForMessage(requestedTo),
111
+ probeFailure.candidateCount.toString(),
112
+ ]);
113
+ // Known as soon as the tree reader is built, but raised here with the
114
+ // rest of the warnings for a single review point. Only `to` is
115
+ // warn-worthy: it is the revision every liveness read (pathExists,
116
+ // readDirs) resolves through, so its degrade is what lets a live
117
+ // container land in destructiveChanges.xml. `from` only feeds deep-path
118
+ // member-name resolution, a narrower and already-attributed effect.
119
+ const treeIndexWarnings = warnIf(unindexed.includes(config.to), 'warning.TreeIndexUnavailable', () => [sanitizeForMessage(requestedTo)]);
119
120
  const work = {
120
121
  config,
121
122
  changes,
@@ -124,6 +125,8 @@ export default async (configInput) => {
124
125
  ...assemblyWarnings,
125
126
  ...processorWarnings,
126
127
  ...sourceScopeWarnings,
128
+ ...ignoredMoveWarnings,
129
+ ...treeIndexWarnings,
127
130
  ],
128
131
  };
129
132
  // Stryker disable next-line StringLiteral -- equivalent: log content is observability only
package/lib/main.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AACZ,OAAO,UAAU,MAAM,yBAAyB,CAAA;AAChD,OAAO,UAAU,MAAM,yBAAyB,CAAA;AAEhD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,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AC,MAAM,CAAC,EAAE,CAAC,EAC7B,8BAA8B,EAC9B,GAAG,EAAE,CAAC,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC,CACxC,CAAA;QAED,MAAM,IAAI,GAAS;YACjB,MAAM;YACN,OAAO;YACP,QAAQ,EAAE;gBACR,GAAG,cAAc;gBACjB,GAAG,gBAAgB;gBACnB,GAAG,iBAAiB;gBACpB,GAAG,mBAAmB;gBACtB,GAAG,mBAAmB;gBACtB,GAAG,iBAAiB;aACrB;SACF,CAAA;QACD,2FAA2F;QAC3F,MAAM,CAAC,KAAK,CAAC,IAAI,CAAA,gBAAgB,IAAI,EAAE,CAAC,CAAA;QACxC,2FAA2F;QAC3F,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;QAC1B,OAAO,IAAI,CAAA;IACb,CAAC;YAAS,CAAC;QACT,MAAM,UAAU,CAAC,QAAQ,EAAE,CAAA;IAC7B,CAAC;AACH,CAAC,CAAA"}
@@ -6,21 +6,33 @@ export declare class MetadataRepositoryImpl implements MetadataRepository {
6
6
  protected readonly metadataPerDir: Map<string, Metadata>;
7
7
  protected readonly metadataPerXmlName: Map<string, Metadata>;
8
8
  private readonly pathCache;
9
+ private readonly unsafeExtensions;
9
10
  constructor(metadatas: Metadata[]);
10
11
  protected addSuffix(metadata: Metadata): void;
12
+ private registerSuffix;
11
13
  protected addSharedFolderSuffix(metadata: Metadata): void;
12
14
  protected addFolder(metadata: Metadata): void;
13
15
  protected addXmlName(metadata: Metadata): void;
14
16
  has(path: string): boolean;
15
17
  get(path: string): Metadata | undefined;
18
+ private resolve;
16
19
  protected searchByExtension(parts: string[]): Metadata | undefined;
17
20
  protected searchByDirectory(parts: string[]): Metadata | undefined;
18
21
  protected ownsNestedPaths(metadata: Metadata): boolean;
22
+ private isContentContainer;
19
23
  private declaresNestedContent;
20
- protected searchByXmlName(xmlName: string): Metadata | undefined;
21
24
  getByXmlName(xmlName: string): Metadata | undefined;
22
25
  getFullyQualifiedName(path: string): string;
26
+ private plainTypeName;
27
+ private composedTypeName;
28
+ private holderScopedName;
29
+ private componentScopedName;
30
+ private folderScopedName;
31
+ private nestedContentName;
32
+ private containerName;
33
+ private containerDepth;
23
34
  values(): Metadata[];
24
- private static UNSAFE_EXTENSION;
25
35
  private static COMPOSED_TYPES;
36
+ private static HOLDER_SCOPED_COMPOSED_TYPES;
37
+ private static FOLDER_SCOPED_TYPES;
26
38
  }