sfdx-git-delta 7.1.0 → 7.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -2
- package/lib/adapter/GitAdapter.d.ts +10 -2
- package/lib/adapter/GitAdapter.js +62 -84
- package/lib/adapter/GitAdapter.js.map +1 -1
- package/lib/adapter/ioExecutor.d.ts +1 -1
- package/lib/adapter/ioExecutor.js.map +1 -1
- package/lib/adapter/pathMatching.d.ts +9 -0
- package/lib/adapter/pathMatching.js +83 -0
- package/lib/adapter/pathMatching.js.map +1 -0
- package/lib/commands/sgd/source/delta.js.map +1 -1
- package/lib/main.d.ts +2 -2
- package/lib/main.js +63 -34
- package/lib/main.js.map +1 -1
- package/lib/post-processor/baseProcessor.d.ts +9 -6
- package/lib/post-processor/baseProcessor.js +5 -6
- package/lib/post-processor/baseProcessor.js.map +1 -1
- package/lib/post-processor/changesManifestProcessor.d.ts +3 -2
- package/lib/post-processor/changesManifestProcessor.js +5 -4
- package/lib/post-processor/changesManifestProcessor.js.map +1 -1
- package/lib/post-processor/flowTranslationProcessor.d.ts +8 -7
- package/lib/post-processor/flowTranslationProcessor.js +19 -17
- package/lib/post-processor/flowTranslationProcessor.js.map +1 -1
- package/lib/post-processor/includeProcessor.d.ts +6 -5
- package/lib/post-processor/includeProcessor.js +7 -6
- package/lib/post-processor/includeProcessor.js.map +1 -1
- package/lib/post-processor/packageGenerator.d.ts +3 -2
- package/lib/post-processor/packageGenerator.js +5 -4
- package/lib/post-processor/packageGenerator.js.map +1 -1
- package/lib/post-processor/postProcessorManager.d.ts +5 -7
- package/lib/post-processor/postProcessorManager.js +23 -31
- package/lib/post-processor/postProcessorManager.js.map +1 -1
- package/lib/service/botHandler.d.ts +1 -2
- package/lib/service/botHandler.js +17 -10
- package/lib/service/botHandler.js.map +1 -1
- package/lib/service/containedDecomposedHandler.d.ts +4 -5
- package/lib/service/containedDecomposedHandler.js +13 -12
- package/lib/service/containedDecomposedHandler.js.map +1 -1
- package/lib/service/customFieldHandler.d.ts +1 -2
- package/lib/service/customFieldHandler.js +7 -6
- package/lib/service/customFieldHandler.js.map +1 -1
- package/lib/service/customLabelHandler.d.ts +1 -2
- package/lib/service/customLabelHandler.js +3 -3
- package/lib/service/customLabelHandler.js.map +1 -1
- package/lib/service/customObjectHandler.d.ts +3 -4
- package/lib/service/customObjectHandler.js +10 -9
- package/lib/service/customObjectHandler.js.map +1 -1
- package/lib/service/decomposedHandler.d.ts +3 -4
- package/lib/service/decomposedHandler.js +5 -4
- package/lib/service/decomposedHandler.js.map +1 -1
- package/lib/service/diffLineInterpreter.d.ts +3 -3
- package/lib/service/diffLineInterpreter.js +18 -14
- package/lib/service/diffLineInterpreter.js.map +1 -1
- package/lib/service/flowHandler.d.ts +1 -2
- package/lib/service/flowHandler.js +9 -4
- package/lib/service/flowHandler.js.map +1 -1
- package/lib/service/inFileHandler.d.ts +8 -9
- package/lib/service/inFileHandler.js +24 -24
- package/lib/service/inFileHandler.js.map +1 -1
- package/lib/service/inFolderHandler.d.ts +4 -5
- package/lib/service/inFolderHandler.js +6 -5
- package/lib/service/inFolderHandler.js.map +1 -1
- package/lib/service/inResourceHandler.d.ts +4 -5
- package/lib/service/inResourceHandler.js +8 -7
- package/lib/service/inResourceHandler.js.map +1 -1
- package/lib/service/objectTranslationHandler.d.ts +1 -2
- package/lib/service/objectTranslationHandler.js +6 -5
- package/lib/service/objectTranslationHandler.js.map +1 -1
- package/lib/service/reportingFolderHandler.d.ts +6 -7
- package/lib/service/reportingFolderHandler.js +6 -6
- package/lib/service/reportingFolderHandler.js.map +1 -1
- package/lib/service/sharedFolderHandler.d.ts +4 -5
- package/lib/service/sharedFolderHandler.js +6 -6
- package/lib/service/sharedFolderHandler.js.map +1 -1
- package/lib/service/standardHandler.d.ts +5 -9
- package/lib/service/standardHandler.js +28 -35
- package/lib/service/standardHandler.js.map +1 -1
- package/lib/service/typeHandlerFactory.d.ts +3 -3
- package/lib/service/typeHandlerFactory.js +6 -6
- package/lib/service/typeHandlerFactory.js.map +1 -1
- package/lib/types/config.d.ts +5 -1
- package/lib/types/handlerResult.d.ts +7 -7
- package/lib/types/handlerResult.js +10 -1
- package/lib/types/handlerResult.js.map +1 -1
- package/lib/types/work.d.ts +1 -1
- package/lib/utils/arrayUtils.d.ts +1 -1
- package/lib/utils/arrayUtils.js.map +1 -1
- package/lib/utils/bundleRollup.d.ts +6 -0
- package/lib/utils/bundleRollup.js +62 -0
- package/lib/utils/bundleRollup.js.map +1 -0
- package/lib/utils/changeSet.d.ts +12 -15
- package/lib/utils/changeSet.js +23 -120
- package/lib/utils/changeSet.js.map +1 -1
- package/lib/utils/changesAssembly.d.ts +8 -0
- package/lib/utils/changesAssembly.js +21 -0
- package/lib/utils/changesAssembly.js.map +1 -0
- package/lib/utils/configValidator.d.ts +7 -6
- package/lib/utils/configValidator.js +32 -11
- package/lib/utils/configValidator.js.map +1 -1
- package/lib/utils/fsHelper.d.ts +2 -1
- package/lib/utils/fsHelper.js +7 -3
- package/lib/utils/fsHelper.js.map +1 -1
- package/lib/utils/messageSanitizer.d.ts +1 -0
- package/lib/utils/messageSanitizer.js +48 -0
- package/lib/utils/messageSanitizer.js.map +1 -0
- package/lib/utils/pathspec.d.ts +15 -0
- package/lib/utils/pathspec.js +71 -0
- package/lib/utils/pathspec.js.map +1 -0
- package/lib/utils/renameResolver.d.ts +6 -6
- package/lib/utils/renameResolver.js +10 -9
- package/lib/utils/renameResolver.js.map +1 -1
- package/lib/utils/repoGitDiff.d.ts +2 -0
- package/lib/utils/repoGitDiff.js +14 -1
- package/lib/utils/repoGitDiff.js.map +1 -1
- package/messages/delta.md +26 -0
- package/oclif.manifest.json +2 -2
- package/package.json +16 -15
- package/lib/post-processor/bundleRollupProcessor.d.ts +0 -7
- package/lib/post-processor/bundleRollupProcessor.js +0 -81
- package/lib/post-processor/bundleRollupProcessor.js.map +0 -1
|
@@ -17,16 +17,24 @@ import { pathExists, sanitizePath } from './fsUtils.js';
|
|
|
17
17
|
import { log } from './LoggingDecorator.js';
|
|
18
18
|
import { Logger, lazy } from './LoggingService.js';
|
|
19
19
|
import { MessageService } from './MessageService.js';
|
|
20
|
+
import { sanitizeForMessage } from './messageSanitizer.js';
|
|
20
21
|
const SHA_KEYS = ['from', 'to'];
|
|
22
|
+
const SOURCE_DIR_REJECTION_MESSAGE_KEYS = {
|
|
23
|
+
empty: 'error.SourceDirIsEmpty',
|
|
24
|
+
magic: 'error.SourceDirUsesPathspecMagic',
|
|
25
|
+
wildcard: 'error.SourceDirContainsWildcard',
|
|
26
|
+
absolute: 'error.SourceDirIsAbsolute',
|
|
27
|
+
escapes: 'error.SourceDirEscapesRepository',
|
|
28
|
+
};
|
|
21
29
|
export default class ConfigValidator {
|
|
22
|
-
work;
|
|
23
30
|
config;
|
|
31
|
+
sourceRejections;
|
|
24
32
|
gitAdapter;
|
|
25
33
|
message;
|
|
26
|
-
constructor(
|
|
27
|
-
this.
|
|
28
|
-
this.
|
|
29
|
-
this.gitAdapter = GitAdapter.getInstance(
|
|
34
|
+
constructor(config, sourceRejections = []) {
|
|
35
|
+
this.config = config;
|
|
36
|
+
this.sourceRejections = sourceRejections;
|
|
37
|
+
this.gitAdapter = GitAdapter.getInstance(config);
|
|
30
38
|
this.message = new MessageService();
|
|
31
39
|
}
|
|
32
40
|
async _validateGitSha() {
|
|
@@ -48,9 +56,20 @@ export default class ConfigValidator {
|
|
|
48
56
|
}));
|
|
49
57
|
return errors;
|
|
50
58
|
}
|
|
59
|
+
_validateSource() {
|
|
60
|
+
return this.sourceRejections.map(rejection => this.message.getMessage(SOURCE_DIR_REJECTION_MESSAGE_KEYS[rejection.reason], [sanitizeForMessage(rejection.value)]));
|
|
61
|
+
}
|
|
51
62
|
async validateConfig() {
|
|
52
63
|
this._sanitizeConfig();
|
|
53
|
-
|
|
64
|
+
// Short-circuits before any git object is read: _validateGitSha below
|
|
65
|
+
// calls parseRev, which opens the repository. A bad --source-dir is
|
|
66
|
+
// the actionable error and the one that today produces a silent empty
|
|
67
|
+
// manifest, so it is reported alone even if the SHAs are also invalid.
|
|
68
|
+
const sourceErrors = this._validateSource();
|
|
69
|
+
if (sourceErrors.length > 0) {
|
|
70
|
+
throw new ConfigError(sourceErrors.join(', '));
|
|
71
|
+
}
|
|
72
|
+
const [defaultWarnings, repoExists, gitErrors, changesManifestErrors] = await Promise.all([
|
|
54
73
|
this._handleDefault(),
|
|
55
74
|
pathExists(join(this.config.repo, GIT_FOLDER)),
|
|
56
75
|
this._validateGitSha(),
|
|
@@ -66,6 +85,7 @@ export default class ConfigValidator {
|
|
|
66
85
|
throw new ConfigError(errors.join(', '));
|
|
67
86
|
}
|
|
68
87
|
await this.gitAdapter.configureRepository();
|
|
88
|
+
return defaultWarnings;
|
|
69
89
|
}
|
|
70
90
|
// oclif cannot natively validate --changes-manifest (it uses a string flag
|
|
71
91
|
// to allow the bare form). Replicate meaningful checks: if the path already
|
|
@@ -103,7 +123,7 @@ export default class ConfigValidator {
|
|
|
103
123
|
}
|
|
104
124
|
async _handleDefault() {
|
|
105
125
|
await this._getApiVersion();
|
|
106
|
-
await this._apiVersionDefault();
|
|
126
|
+
return await this._apiVersionDefault();
|
|
107
127
|
}
|
|
108
128
|
async _getApiVersion() {
|
|
109
129
|
if (this.config.apiVersion !== undefined)
|
|
@@ -127,13 +147,14 @@ export default class ConfigValidator {
|
|
|
127
147
|
const latestVersion = await this._resolveLatestSupportedVersion();
|
|
128
148
|
// Stryker disable next-line ConditionalExpression -- equivalent: undefined signals the lookup failed while a usable apiVersion is already set; flipping the guard would fall through to clamp against an undefined ceiling, which the offline test surface forbids
|
|
129
149
|
if (latestVersion === undefined)
|
|
130
|
-
return;
|
|
150
|
+
return [];
|
|
151
|
+
const warnings = [];
|
|
131
152
|
// Stryker disable ConditionalExpression,LogicalOperator -- equivalent: this triple-AND gate ensures we only override a numeric, defined, above-latest apiVersion; flipping individual conditions to true falls into the override branch when apiVersion is undefined or NaN, but the second `if (apiVersion === undefined || isNaN())` block immediately resets to latestVersion, producing the same observable apiVersion in both arms (only the warning content differs, which the test surface doesn't disambiguate)
|
|
132
153
|
if (this.config.apiVersion !== undefined &&
|
|
133
154
|
!isNaN(this.config.apiVersion) &&
|
|
134
155
|
this.config.apiVersion > latestVersion) {
|
|
135
156
|
// Stryker restore ConditionalExpression,LogicalOperator
|
|
136
|
-
|
|
157
|
+
warnings.push(new Error(this.message.getMessage('warning.ApiVersionOverridden', [
|
|
137
158
|
String(this.config.apiVersion),
|
|
138
159
|
String(latestVersion),
|
|
139
160
|
])));
|
|
@@ -142,10 +163,11 @@ export default class ConfigValidator {
|
|
|
142
163
|
// Stryker disable next-line ConditionalExpression -- equivalent: defaulting fallback when apiVersion is unset/NaN; flipping to false skips the default and the apiVersion stays as-is, but the only test fixtures with apiVersion already set hit the early-return at _getApiVersion start, so the default branch is unreachable for those test cases
|
|
143
164
|
if (this.config.apiVersion === undefined || isNaN(this.config.apiVersion)) {
|
|
144
165
|
this.config.apiVersion = latestVersion;
|
|
145
|
-
|
|
166
|
+
warnings.push(new Error(this.message.getMessage('warning.ApiVersionDefaulted', [
|
|
146
167
|
String(latestVersion),
|
|
147
168
|
])));
|
|
148
169
|
}
|
|
170
|
+
return warnings;
|
|
149
171
|
}
|
|
150
172
|
// Resolves the latest supported API version, falling back gracefully when the
|
|
151
173
|
// appexchange lookup is unreachable (offline/firewalled environments).
|
|
@@ -171,7 +193,6 @@ export default class ConfigValidator {
|
|
|
171
193
|
}
|
|
172
194
|
_sanitizeConfig() {
|
|
173
195
|
this.config.repo = sanitizePath(this.config.repo);
|
|
174
|
-
this.config.source = this.config.source.map(source => sanitizePath(source));
|
|
175
196
|
this.config.output = sanitizePath(this.config.output);
|
|
176
197
|
this.config.ignore = sanitizePath(this.config.ignore);
|
|
177
198
|
this.config.ignoreDestructive = sanitizePath(this.config.ignoreDestructive);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configValidator.js","sourceRoot":"","sources":["../../src/utils/configValidator.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;;;;;;;AACZ,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAEtC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAE5C,OAAO,UAAU,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAA;
|
|
1
|
+
{"version":3,"file":"configValidator.js","sourceRoot":"","sources":["../../src/utils/configValidator.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;;;;;;;AACZ,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAEtC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAE5C,OAAO,UAAU,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAA;AAE1E,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAC9D,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAA;AAC3C,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAO1D,MAAM,QAAQ,GAAsB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;AAElD,MAAM,iCAAiC,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AA;QACtD,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;QACrD,IAAI,CAAC,MAAM,CAAC,iBAAiB,GAAG,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAA;QAC3E,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;QACvD,IAAI,CAAC,MAAM,CAAC,kBAAkB,GAAG,YAAY,CAC3C,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAC/B,CAAA;QACD,IAAI,CAAC,MAAM,CAAC,8BAA8B,GAAG,YAAY,CACvD,IAAI,CAAC,MAAM,CAAC,8BAA8B,CAC3C,CAAA;QACD,IAAI,CAAC,MAAM,CAAC,eAAe,GAAG,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,CAAA;IACzE,CAAC;CACF;AAlLc;IADZ,GAAG;qDAoCH"}
|
package/lib/utils/fsHelper.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export declare const resetWrittenFiles: () => void;
|
|
|
4
4
|
export declare const readPathFromGit: (forRef: FileGitRef, config: Config) => Promise<string>;
|
|
5
5
|
export declare const pathExists: (path: string, config: Config) => Promise<boolean>;
|
|
6
6
|
export declare const readDirs: (paths: string | string[], config: Config) => Promise<string[]>;
|
|
7
|
-
export declare const
|
|
7
|
+
export declare const grepContentUnder: (pattern: string, path: string | string[], config: Config) => Promise<string[]>;
|
|
8
|
+
export declare const grepContentMatching: (pattern: string, pathspecs: string | string[], config: Config) => Promise<string[]>;
|
|
8
9
|
export declare const contentIncludes: (pattern: string, path: string, config: Config) => Promise<boolean>;
|
|
9
10
|
export declare const writeFile: (path: string, content: string, config: Config) => Promise<void>;
|
package/lib/utils/fsHelper.js
CHANGED
|
@@ -30,12 +30,16 @@ export const readDirs = async (paths, config) => {
|
|
|
30
30
|
const gitAdapter = GitAdapter.getInstance(config);
|
|
31
31
|
return await gitAdapter.getFilesPath(paths);
|
|
32
32
|
};
|
|
33
|
-
export const
|
|
33
|
+
export const grepContentUnder = async (pattern, path, config) => {
|
|
34
34
|
const gitAdapter = GitAdapter.getInstance(config);
|
|
35
|
-
return await gitAdapter.
|
|
35
|
+
return await gitAdapter.grepUnderPaths(pattern, path);
|
|
36
|
+
};
|
|
37
|
+
export const grepContentMatching = async (pattern, pathspecs, config) => {
|
|
38
|
+
const gitAdapter = GitAdapter.getInstance(config);
|
|
39
|
+
return await gitAdapter.grepMatchingPathspecs(pattern, pathspecs);
|
|
36
40
|
};
|
|
37
41
|
export const contentIncludes = async (pattern, path, config) => {
|
|
38
|
-
const results = await
|
|
42
|
+
const results = await grepContentUnder(pattern, path, config);
|
|
39
43
|
return results.length > 0;
|
|
40
44
|
};
|
|
41
45
|
export const writeFile = async (path, content, config) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fsHelper.js","sourceRoot":"","sources":["../../src/utils/fsHelper.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AACZ,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAEtC,OAAO,UAAU,MAAM,0BAA0B,CAAA;AAIjD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAElD,MAAM,YAAY,GAAG,IAAI,GAAG,EAAU,CAAA;AAEtC,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAS,EAAE;IAC1C,YAAY,CAAC,KAAK,EAAE,CAAA;AACtB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,EAAE,MAAkB,EAAE,MAAc,EAAE,EAAE;IAC1E,IA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sanitizeForMessage: (value: string) => string;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
// Untrusted values (a raw --source-dir value, an accepted source scope) get
|
|
3
|
+
// echoed back verbatim into error/warning messages. Neither is guaranteed
|
|
4
|
+
// printable: an ANSI escape sequence survives into a terminal, a newline is
|
|
5
|
+
// a legal git path character that would forge an extra log line, and a
|
|
6
|
+
// bidi override (Cf, e.g. U+202E) or line/paragraph separator (U+2028,
|
|
7
|
+
// U+2029) can reverse or restructure the rendered line in a bidi-aware
|
|
8
|
+
// viewer (terminals, the GitHub Actions log viewer, browsers) — a Trojan
|
|
9
|
+
// Source-style attack. Strip all of these before the value reaches a
|
|
10
|
+
// message string, and cap the length so a single value cannot blow out the
|
|
11
|
+
// message.
|
|
12
|
+
const CONTROL_CHARS_REGEX = /[\p{Cc}\p{Cf}\u2028\u2029]/gu;
|
|
13
|
+
const BACKSLASH_REGEX = /\\/g;
|
|
14
|
+
const MAX_MESSAGE_VALUE_LENGTH = 200;
|
|
15
|
+
const TRUNCATION_MARKER = '…';
|
|
16
|
+
// A fixed-width \xHH / \xHHHH escape is ambiguous: a 2-digit escape
|
|
17
|
+
// followed by two literal hex digits reads identically to a 4-digit one
|
|
18
|
+
// (e.g. escaping U+0006 next to a literal "00" and escaping U+0600 both
|
|
19
|
+
// produce "\x0600"), and astral format characters need a 5th digit anyway,
|
|
20
|
+
// so padding can never make every width uniform. The `\u{...}` delimited
|
|
21
|
+
// form is unambiguous at any width — the closing brace is the only valid
|
|
22
|
+
// terminator — and is itself valid ECMAScript escape syntax.
|
|
23
|
+
const escapeControlChar = (char) => {
|
|
24
|
+
// The regex only ever hands back a non-empty matched substring, so
|
|
25
|
+
// codePointAt(0) is guaranteed to resolve.
|
|
26
|
+
const codePoint = char.codePointAt(0);
|
|
27
|
+
return `\\u{${codePoint.toString(16)}}`;
|
|
28
|
+
};
|
|
29
|
+
export const sanitizeForMessage = (value) => {
|
|
30
|
+
// Truncate on code points (not UTF-16 code units) before escaping: a
|
|
31
|
+
// surrogate pair must never be split, and escaping only the already-
|
|
32
|
+
// capped substring guarantees every emitted \u{...} escape is complete —
|
|
33
|
+
// slicing an already-escaped string can otherwise cut mid-escape.
|
|
34
|
+
const codePoints = Array.from(value);
|
|
35
|
+
const isTruncated = codePoints.length > MAX_MESSAGE_VALUE_LENGTH;
|
|
36
|
+
const capped = isTruncated
|
|
37
|
+
? codePoints.slice(0, MAX_MESSAGE_VALUE_LENGTH).join('')
|
|
38
|
+
: value;
|
|
39
|
+
// Escape literal backslashes first so a real control-char escape (which
|
|
40
|
+
// is introduced afterwards) can never be confused with one that was
|
|
41
|
+
// already present in the input — otherwise 'a\u{a}' and an actual
|
|
42
|
+
// newline would sanitize to the same string.
|
|
43
|
+
const escaped = capped
|
|
44
|
+
.replace(BACKSLASH_REGEX, '\\\\')
|
|
45
|
+
.replace(CONTROL_CHARS_REGEX, escapeControlChar);
|
|
46
|
+
return isTruncated ? `${escaped}${TRUNCATION_MARKER}` : escaped;
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=messageSanitizer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messageSanitizer.js","sourceRoot":"","sources":["../../src/utils/messageSanitizer.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,4EAA4E;AAC5E,0EAA0E;AAC1E,4EAA4E;AAC5E,uEAAuE;AACvE,uEAAuE;AACvE,uEAAuE;AACvE,yEAAyE;AACzE,qEAAqE;AACrE,2EAA2E;AAC3E,WAAW;AACX,MAAM,mBAAmB,GAAG,8BAA8B,CAAA;AAC1D,MAAM,eAAe,GAAG,KAAK,CAAA;AAC7B,MAAM,wBAAwB,GAAG,GAAG,CAAA;AACpC,MAAM,iBAAiB,GAAG,GAAG,CAAA;AAE7B,oEAAoE;AACpE,wEAAwE;AACxE,wEAAwE;AACxE,2EAA2E;AAC3E,yEAAyE;AACzE,yEAAyE;AACzE,6DAA6D;AAC7D,MAAM,iBAAiB,GAAG,CAAC,IAAY,EAAU,EAAE;IACjD,mEAAmE;IACnE,2CAA2C;IAC3C,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAE,CAAA;IACtC,OAAO,OAAO,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAA;AACzC,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAa,EAAU,EAAE;IAC1D,qEAAqE;IACrE,qEAAqE;IACrE,yEAAyE;IACzE,kEAAkE;IAClE,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACpC,MAAM,WAAW,GAAG,UAAU,CAAC,MAAM,GAAG,wBAAwB,CAAA;IAChE,MAAM,MAAM,GAAG,WAAW;QACxB,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,wBAAwB,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;QACxD,CAAC,CAAC,KAAK,CAAA;IACT,wEAAwE;IACxE,oEAAoE;IACpE,kEAAkE;IAClE,6CAA6C;IAC7C,MAAM,OAAO,GAAG,MAAM;SACnB,OAAO,CAAC,eAAe,EAAE,MAAM,CAAC;SAChC,OAAO,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,CAAA;IAClD,OAAO,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,GAAG,iBAAiB,EAAE,CAAC,CAAC,CAAC,OAAO,CAAA;AACjE,CAAC,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare const PATHSPEC_BRAND: unique symbol;
|
|
2
|
+
export type Pathspec = string & {
|
|
3
|
+
readonly [PATHSPEC_BRAND]: true;
|
|
4
|
+
};
|
|
5
|
+
export type SourceDirRejectionReason = 'empty' | 'magic' | 'wildcard' | 'absolute' | 'escapes';
|
|
6
|
+
export type SourceDirRejection = Readonly<{
|
|
7
|
+
value: string;
|
|
8
|
+
reason: SourceDirRejectionReason;
|
|
9
|
+
}>;
|
|
10
|
+
export type ParsedSourceDirs = Readonly<{
|
|
11
|
+
pathspecs: Pathspec[];
|
|
12
|
+
rejections: SourceDirRejection[];
|
|
13
|
+
}>;
|
|
14
|
+
export declare const parseSourceDirs: (raw: string[]) => ParsedSourceDirs;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
import { isAbsolute } from 'node:path/posix';
|
|
3
|
+
import { sanitizePath, treatPathSep } from './fsUtils.js';
|
|
4
|
+
// Git pathspec magic prefix: ':(exclude)', ':!', ':(glob)', ':/', ':^' …
|
|
5
|
+
const MAGIC_PREFIX = ':';
|
|
6
|
+
const WILDCARD_CHARS_REGEX = /[*?[]/;
|
|
7
|
+
// Windows drive letter followed by a separator, e.g. 'C:/x' or 'C:\x'.
|
|
8
|
+
// `path.posix.isAbsolute` does not flag these once treatPathSep has run.
|
|
9
|
+
const WINDOWS_DRIVE_REGEX = /^[A-Za-z]:[\\/]/;
|
|
10
|
+
const TRAILING_SLASHES_REGEX = /\/+$/;
|
|
11
|
+
const PATH_SEGMENT_SEP = '/';
|
|
12
|
+
const PARENT_SEGMENT = '..';
|
|
13
|
+
// normalize('.') === '.', normalize('./') === './', normalize('././') === './'
|
|
14
|
+
const ROOT_PATHSPECS = new Set(['.', './']);
|
|
15
|
+
const WHOLE_REPOSITORY = '.';
|
|
16
|
+
const reject = (reason) => ({
|
|
17
|
+
ok: false,
|
|
18
|
+
reason,
|
|
19
|
+
});
|
|
20
|
+
const accept = (value) => ({
|
|
21
|
+
ok: true,
|
|
22
|
+
value: value,
|
|
23
|
+
});
|
|
24
|
+
// Steps 1-5 run on the raw value, before normalisation destroys the evidence
|
|
25
|
+
// they test for: a leading ':', a Windows drive letter, or a '..' segment
|
|
26
|
+
// all survive treatPathSep/normalize as an innocuous-looking literal —
|
|
27
|
+
// normalize('force-app/..') cancels straight down to '.', which is why the
|
|
28
|
+
// '..' check must see the segment before normalize resolves it away.
|
|
29
|
+
const hasParentSegment = (raw) => treatPathSep(raw).split(PATH_SEGMENT_SEP).includes(PARENT_SEGMENT);
|
|
30
|
+
const rejectRawValue = (raw) => {
|
|
31
|
+
if (raw === '')
|
|
32
|
+
return 'empty';
|
|
33
|
+
if (raw.startsWith(MAGIC_PREFIX))
|
|
34
|
+
return 'magic';
|
|
35
|
+
if (WILDCARD_CHARS_REGEX.test(raw))
|
|
36
|
+
return 'wildcard';
|
|
37
|
+
if (WINDOWS_DRIVE_REGEX.test(raw))
|
|
38
|
+
return 'absolute';
|
|
39
|
+
if (hasParentSegment(raw))
|
|
40
|
+
return 'escapes';
|
|
41
|
+
return undefined;
|
|
42
|
+
};
|
|
43
|
+
const canonicalise = (raw) => {
|
|
44
|
+
const rawRejection = rejectRawValue(raw);
|
|
45
|
+
if (rawRejection)
|
|
46
|
+
return reject(rawRejection);
|
|
47
|
+
const value = sanitizePath(raw);
|
|
48
|
+
if (isAbsolute(value))
|
|
49
|
+
return reject('absolute');
|
|
50
|
+
if (ROOT_PATHSPECS.has(value))
|
|
51
|
+
return accept(WHOLE_REPOSITORY);
|
|
52
|
+
return accept(value.replace(TRAILING_SLASHES_REGEX, ''));
|
|
53
|
+
};
|
|
54
|
+
export const parseSourceDirs = (raw) => {
|
|
55
|
+
const pathspecs = [];
|
|
56
|
+
const rejections = [];
|
|
57
|
+
const seen = new Set();
|
|
58
|
+
for (const value of raw) {
|
|
59
|
+
const result = canonicalise(value);
|
|
60
|
+
if (!result.ok) {
|
|
61
|
+
rejections.push({ value, reason: result.reason });
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
if (seen.has(result.value))
|
|
65
|
+
continue;
|
|
66
|
+
seen.add(result.value);
|
|
67
|
+
pathspecs.push(result.value);
|
|
68
|
+
}
|
|
69
|
+
return { pathspecs, rejections };
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=pathspec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":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,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC;YAAE,SAAQ;QACpC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QACtB,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IAC9B,CAAC;IAED,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,CAAA;AAClC,CAAC,CAAA"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { MetadataRepository } from '../metadata/MetadataRepository.js';
|
|
2
|
-
import type {
|
|
3
|
-
import type
|
|
2
|
+
import type { Config } from '../types/config.js';
|
|
3
|
+
import type { RenameTriple } from './changeSet.js';
|
|
4
4
|
import type { RenamePathPair } from './repoGitDiff.js';
|
|
5
5
|
/**
|
|
6
6
|
* Turns the `{ fromPath, toPath }` pairs git emitted for `-M` renames into
|
|
7
|
-
* `
|
|
8
|
-
*
|
|
7
|
+
* `RenameTriple` values by re-using the handler machinery to resolve each
|
|
8
|
+
* side to its Salesforce (type, member).
|
|
9
9
|
*
|
|
10
10
|
* Pairs where metadata resolution fails (ignored path, unknown type) or where
|
|
11
11
|
* the from/to side land on the same component are skipped — those reduce to
|
|
@@ -13,7 +13,7 @@ import type { RenamePathPair } from './repoGitDiff.js';
|
|
|
13
13
|
*/
|
|
14
14
|
export default class RenameResolver {
|
|
15
15
|
private readonly factory;
|
|
16
|
-
constructor(
|
|
17
|
-
|
|
16
|
+
constructor(config: Config, metadata: MetadataRepository);
|
|
17
|
+
resolve(pairs: readonly RenamePathPair[]): Promise<readonly RenameTriple[]>;
|
|
18
18
|
private _resolve;
|
|
19
19
|
}
|
|
@@ -13,8 +13,8 @@ import { log } from './LoggingDecorator.js';
|
|
|
13
13
|
import { Logger, lazy } from './LoggingService.js';
|
|
14
14
|
/**
|
|
15
15
|
* Turns the `{ fromPath, toPath }` pairs git emitted for `-M` renames into
|
|
16
|
-
* `
|
|
17
|
-
*
|
|
16
|
+
* `RenameTriple` values by re-using the handler machinery to resolve each
|
|
17
|
+
* side to its Salesforce (type, member).
|
|
18
18
|
*
|
|
19
19
|
* Pairs where metadata resolution fails (ignored path, unknown type) or where
|
|
20
20
|
* the from/to side land on the same component are skipped — those reduce to
|
|
@@ -22,16 +22,17 @@ import { Logger, lazy } from './LoggingService.js';
|
|
|
22
22
|
*/
|
|
23
23
|
export default class RenameResolver {
|
|
24
24
|
factory;
|
|
25
|
-
constructor(
|
|
26
|
-
this.factory = new TypeHandlerFactory(
|
|
25
|
+
constructor(config, metadata) {
|
|
26
|
+
this.factory = new TypeHandlerFactory(config, metadata);
|
|
27
27
|
}
|
|
28
|
-
async
|
|
28
|
+
async resolve(pairs) {
|
|
29
|
+
const triples = [];
|
|
29
30
|
for (const pair of pairs) {
|
|
30
31
|
const resolved = await this._resolve(pair);
|
|
31
|
-
if (resolved)
|
|
32
|
-
|
|
33
|
-
}
|
|
32
|
+
if (resolved)
|
|
33
|
+
triples.push(resolved);
|
|
34
34
|
}
|
|
35
|
+
return triples;
|
|
35
36
|
}
|
|
36
37
|
async _resolve(pair) {
|
|
37
38
|
try {
|
|
@@ -56,5 +57,5 @@ export default class RenameResolver {
|
|
|
56
57
|
}
|
|
57
58
|
__decorate([
|
|
58
59
|
log
|
|
59
|
-
], RenameResolver.prototype, "
|
|
60
|
+
], RenameResolver.prototype, "resolve", null);
|
|
60
61
|
//# sourceMappingURL=renameResolver.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renameResolver.js","sourceRoot":"","sources":["../../src/utils/renameResolver.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;;;;;;;AAEZ,OAAO,EAAE,GAAG,EAAE,MAAM,6BAA6B,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAEhE,OAAO,kBAAkB,MAAM,kCAAkC,CAAA;AAGjE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAC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W,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,cAAc,CACnD,GAAG,QAAQ,GAAG,GAAG,GAAG,IAAI,CAAC,QAAQ,EAAE,CACpC,CAAA;YACD,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,cAAc,CACjD,GAAG,QAAQ,GAAG,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,CAClC,CAAA;YACD,MAAM,IAAI,GAAG,WAAW,CAAC,oBAAoB,EAAE,CAAA;YAC/C,MAAM,EAAE,GAAG,SAAS,CAAC,oBAAoB,EAAE,CAAA;YAC3C,IAAI,IAAI,CAAC,IAAI,KAAK,EAAE,CAAC,IAAI;gBAAE,OAAO,IAAI,CAAA;YACtC,gOAAgO;YAChO,IAAI,IAAI,CAAC,MAAM,KAAK,EAAE,CAAC,MAAM;gBAAE,OAAO,IAAI,CAAA;YAC1C,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,MAAM,EAAE,CAAA;QAC9D,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,IAAI;YACT,0IAA0I;YAC1I,IAAI,CAAA,qCAAqC,IAAI,CAAC,QAAQ,OAAO,IAAI,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,CAC5G,CAAA;YACD,OAAO,IAAI,CAAA;QACb,CAAC;IACH,CAAC;CACF;AAnCc;IADZ,GAAG;6CAUH"}
|
|
@@ -10,6 +10,7 @@ export default class RepoGitDiff {
|
|
|
10
10
|
protected readonly metadata: MetadataRepository;
|
|
11
11
|
protected readonly gitAdapter: GitAdapter;
|
|
12
12
|
private renamePairs;
|
|
13
|
+
private readonly diffScopeVerdict;
|
|
13
14
|
constructor(config: Config, metadata: MetadataRepository);
|
|
14
15
|
/**
|
|
15
16
|
* Streams the filtered, rename-expanded diff lines. Yields A/M lines as
|
|
@@ -23,6 +24,7 @@ export default class RepoGitDiff {
|
|
|
23
24
|
*/
|
|
24
25
|
getLines(): AsyncGenerator<string>;
|
|
25
26
|
getRenamePairs(): readonly RenamePathPair[];
|
|
27
|
+
getUnmatchedSourceScopes(): readonly string[];
|
|
26
28
|
protected _expandRename(line: string): Iterable<string>;
|
|
27
29
|
protected _extractComparisonName(line: string): string;
|
|
28
30
|
}
|
package/lib/utils/repoGitDiff.js
CHANGED
|
@@ -8,6 +8,14 @@ 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
|
+
diffScopeVerdict = {
|
|
16
|
+
changesSeen: 0,
|
|
17
|
+
linesYielded: 0,
|
|
18
|
+
};
|
|
11
19
|
constructor(config, metadata) {
|
|
12
20
|
this.config = config;
|
|
13
21
|
this.metadata = metadata;
|
|
@@ -25,10 +33,12 @@ export default class RepoGitDiff {
|
|
|
25
33
|
*/
|
|
26
34
|
async *getLines() {
|
|
27
35
|
this.renamePairs = [];
|
|
36
|
+
this.diffScopeVerdict.changesSeen = 0;
|
|
37
|
+
this.diffScopeVerdict.linesYielded = 0;
|
|
28
38
|
const ignoreHelper = await buildIgnoreHelper(this.config);
|
|
29
39
|
const additionNames = new Set();
|
|
30
40
|
const deferredDeletions = [];
|
|
31
|
-
for await (const rawLine of this.gitAdapter.streamDiffLines()) {
|
|
41
|
+
for await (const rawLine of this.gitAdapter.streamDiffLines(this.diffScopeVerdict, this.config.source)) {
|
|
32
42
|
for (const expanded of this._expandRename(rawLine)) {
|
|
33
43
|
// 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
44
|
if (!expanded)
|
|
@@ -64,6 +74,9 @@ export default class RepoGitDiff {
|
|
|
64
74
|
getRenamePairs() {
|
|
65
75
|
return this.renamePairs;
|
|
66
76
|
}
|
|
77
|
+
getUnmatchedSourceScopes() {
|
|
78
|
+
return this.gitAdapter.getUnmatchedSourceScopes(this.diffScopeVerdict, this.config.source);
|
|
79
|
+
}
|
|
67
80
|
// git emits `R<score>\tfrom\tto` when -M detects a rename. Each rename is
|
|
68
81
|
// expanded into the equivalent D/A pair so every downstream handler keeps
|
|
69
82
|
// operating on a (status, path) tuple; the rename pair is captured for
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repoGitDiff.js","sourceRoot":"","sources":["../../src/utils/repoGitDiff.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AACZ,OAAO,
|
|
1
|
+
{"version":3,"file":"repoGitDiff.js","sourceRoot":"","sources":["../../src/utils/repoGitDiff.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AACZ,OAAO,UAAqC,MAAM,0BAA0B,CAAA;AAC5E,OAAO,EAAE,GAAG,EAAE,MAAM,6BAA6B,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAA;AAIzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAIrD,MAAM,CAAC,OAAO,OAAO,WAAW;IAaT,MAAM;IACN,QAAQ;IAbV,UAAU,CAAY;IACjC,WAAW,GAAqB,EAAE,CAAA;IAC1C,gEAAgE;IAChE,wEAAwE;IACxE,sEAAsE;IACtE,oEAAoE;IACnD,gBAAgB,GAAqB;QACpD,WAAW,EAAE,CAAC;QACd,YAAY,EAAE,CAAC;KAChB,CAAA;IAED,YACqB,MAAc,EACd,QAA4B;sBAD5B,MAAM;wBACN,QAAQ;QAE3B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,WAAW,CAAC,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ACpC,CAAC;IAES,sBAAsB,CAAC,IAAY;QAC3C,OAAO,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,iBAAiB,EAAE,CAAA;IACtE,CAAC;CACF"}
|
package/messages/delta.md
CHANGED
|
@@ -44,6 +44,8 @@ The folder can exist or not.
|
|
|
44
44
|
* If the folder exists, its contents will be processed.
|
|
45
45
|
* 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
46
|
|
|
47
|
+
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/...`.
|
|
48
|
+
|
|
47
49
|
# flags.ignore.summary
|
|
48
50
|
|
|
49
51
|
file listing paths to explicitly ignore for any diff actions
|
|
@@ -96,6 +98,26 @@ path to a JSON file grouping changed components by kind (add, modify, delete, re
|
|
|
96
98
|
|
|
97
99
|
--changes-manifest: cannot inspect '%s': %s
|
|
98
100
|
|
|
101
|
+
# error.SourceDirIsEmpty
|
|
102
|
+
|
|
103
|
+
--source-dir does not accept an empty value; use '.' to scope the whole repository (received: '%s')
|
|
104
|
+
|
|
105
|
+
# error.SourceDirIsAbsolute
|
|
106
|
+
|
|
107
|
+
--source-dir must be a path relative to --repo-dir, not an absolute path (received: '%s')
|
|
108
|
+
|
|
109
|
+
# error.SourceDirEscapesRepository
|
|
110
|
+
|
|
111
|
+
--source-dir does not accept '..' path segments; use a literal repository-relative path instead (received: '%s')
|
|
112
|
+
|
|
113
|
+
# error.SourceDirContainsWildcard
|
|
114
|
+
|
|
115
|
+
--source-dir does not accept wildcards (*, ?, [); repeat --source-dir once per folder, or use --include-file/--ignore-file to filter by pattern (received: '%s')
|
|
116
|
+
|
|
117
|
+
# error.SourceDirUsesPathspecMagic
|
|
118
|
+
|
|
119
|
+
--source-dir does not accept git pathspec magic (e.g. ':(exclude)', ':!'); use a literal repository-relative path instead (received: '%s')
|
|
120
|
+
|
|
99
121
|
# warning.ApiVersionOverridden
|
|
100
122
|
|
|
101
123
|
API version '%s' is not supported, using '%s' instead
|
|
@@ -120,6 +142,10 @@ Attempt to delete the flow '%s' via destructiveChanges.xml may not work as expec
|
|
|
120
142
|
|
|
121
143
|
Deleting the DigitalExperienceBundle '%s' via destructiveChanges.xml requires the related Experience site to be deactivated first for the deployment to succeed
|
|
122
144
|
|
|
145
|
+
# warning.SourceDirMatchedNothing
|
|
146
|
+
|
|
147
|
+
No changes found under '%s' between '%s' and '%s'
|
|
148
|
+
|
|
123
149
|
# info.CommandIsRunning
|
|
124
150
|
|
|
125
151
|
Generating incremental package
|
package/oclif.manifest.json
CHANGED
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
],
|
|
81
81
|
"char": "s",
|
|
82
82
|
"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.",
|
|
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.\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
84
|
"name": "source-dir",
|
|
85
85
|
"summary": "source folders focus location relative to --repo-dir",
|
|
86
86
|
"default": [
|
|
@@ -199,5 +199,5 @@
|
|
|
199
199
|
]
|
|
200
200
|
}
|
|
201
201
|
},
|
|
202
|
-
"version": "7.
|
|
202
|
+
"version": "7.2.0"
|
|
203
203
|
}
|