@rushstack/package-extractor 0.10.38 → 0.10.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.json CHANGED
@@ -1,6 +1,60 @@
1
1
  {
2
2
  "name": "@rushstack/package-extractor",
3
3
  "entries": [
4
+ {
5
+ "version": "0.10.40",
6
+ "tag": "@rushstack/package-extractor_v0.10.40",
7
+ "date": "Tue, 30 Sep 2025 23:57:45 GMT",
8
+ "comments": {
9
+ "dependency": [
10
+ {
11
+ "comment": "Updating dependency \"@rushstack/node-core-library\" to `5.15.1`"
12
+ },
13
+ {
14
+ "comment": "Updating dependency \"@rushstack/terminal\" to `0.18.0`"
15
+ },
16
+ {
17
+ "comment": "Updating dependency \"@rushstack/ts-command-line\" to `5.0.5`"
18
+ },
19
+ {
20
+ "comment": "Updating dependency \"@rushstack/heft-webpack5-plugin\" to `1.0.0`"
21
+ },
22
+ {
23
+ "comment": "Updating dependency \"@rushstack/heft\" to `1.0.0`"
24
+ },
25
+ {
26
+ "comment": "Updating dependency \"@rushstack/webpack-preserve-dynamic-require-plugin\" to `0.11.110`"
27
+ }
28
+ ]
29
+ }
30
+ },
31
+ {
32
+ "version": "0.10.39",
33
+ "tag": "@rushstack/package-extractor_v0.10.39",
34
+ "date": "Tue, 30 Sep 2025 20:33:51 GMT",
35
+ "comments": {
36
+ "dependency": [
37
+ {
38
+ "comment": "Updating dependency \"@rushstack/node-core-library\" to `5.15.0`"
39
+ },
40
+ {
41
+ "comment": "Updating dependency \"@rushstack/terminal\" to `0.17.0`"
42
+ },
43
+ {
44
+ "comment": "Updating dependency \"@rushstack/ts-command-line\" to `5.0.4`"
45
+ },
46
+ {
47
+ "comment": "Updating dependency \"@rushstack/heft-webpack5-plugin\" to `0.11.43`"
48
+ },
49
+ {
50
+ "comment": "Updating dependency \"@rushstack/heft\" to `0.75.0`"
51
+ },
52
+ {
53
+ "comment": "Updating dependency \"@rushstack/webpack-preserve-dynamic-require-plugin\" to `0.11.109`"
54
+ }
55
+ ]
56
+ }
57
+ },
4
58
  {
5
59
  "version": "0.10.38",
6
60
  "tag": "@rushstack/package-extractor_v0.10.38",
package/CHANGELOG.md CHANGED
@@ -1,6 +1,16 @@
1
1
  # Change Log - @rushstack/package-extractor
2
2
 
3
- This log was last generated on Fri, 12 Sep 2025 15:13:07 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 30 Sep 2025 23:57:45 GMT and should not be manually modified.
4
+
5
+ ## 0.10.40
6
+ Tue, 30 Sep 2025 23:57:45 GMT
7
+
8
+ _Version update only_
9
+
10
+ ## 0.10.39
11
+ Tue, 30 Sep 2025 20:33:51 GMT
12
+
13
+ _Version update only_
4
14
 
5
15
  ## 0.10.38
6
16
  Fri, 12 Sep 2025 15:13:07 GMT
@@ -3245,17 +3245,46 @@ const TerminalWritable_1 = __webpack_require__(/*! ./TerminalWritable */ 33900);
3245
3245
  class SplitterTransform extends TerminalWritable_1.TerminalWritable {
3246
3246
  constructor(options) {
3247
3247
  super();
3248
- this.destinations = [...options.destinations];
3248
+ this._destinations = new Set(options.destinations);
3249
+ }
3250
+ get destinations() {
3251
+ return this._destinations;
3252
+ }
3253
+ /**
3254
+ * Adds a destination to the set of destinations. Duplicates are ignored.
3255
+ * Only new chunks received after the destination is added will be sent to it.
3256
+ * @param destination - The destination to add.
3257
+ */
3258
+ addDestination(destination) {
3259
+ this._destinations.add(destination);
3260
+ }
3261
+ /**
3262
+ * Removes a destination from the set of destinations. It will no longer receive chunks, and will be closed, unless
3263
+ * `destination.preventAutoclose` is set to `true`.
3264
+ * @param destination - The destination to remove.
3265
+ * @param close - If `true` (default), the destination will be closed when removed, unless `destination.preventAutoclose` is set to `true`.
3266
+ * @returns `true` if the destination was removed, `false` if it was not found.
3267
+ * @remarks
3268
+ * If the destination is not found, it will not be closed.
3269
+ */
3270
+ removeDestination(destination, close = true) {
3271
+ if (this._destinations.delete(destination)) {
3272
+ if (close && !destination.preventAutoclose) {
3273
+ destination.close();
3274
+ }
3275
+ return true;
3276
+ }
3277
+ return false;
3249
3278
  }
3250
3279
  onWriteChunk(chunk) {
3251
- for (const destination of this.destinations) {
3280
+ for (const destination of this._destinations) {
3252
3281
  destination.writeChunk(chunk);
3253
3282
  }
3254
3283
  }
3255
3284
  onClose() {
3256
3285
  const errors = [];
3257
3286
  // If an exception is thrown, try to ensure that the other destinations get closed properly
3258
- for (const destination of this.destinations) {
3287
+ for (const destination of this._destinations) {
3259
3288
  if (!destination.preventAutoclose) {
3260
3289
  try {
3261
3290
  destination.close();
@@ -3265,6 +3294,7 @@ class SplitterTransform extends TerminalWritable_1.TerminalWritable {
3265
3294
  }
3266
3295
  }
3267
3296
  }
3297
+ this._destinations.clear();
3268
3298
  if (errors.length > 0) {
3269
3299
  throw errors[0];
3270
3300
  }
@@ -3826,6 +3856,24 @@ var tap =
3826
3856
 
3827
3857
  /***/ }),
3828
3858
 
3859
+ /***/ 51542:
3860
+ /*!***************************************!*\
3861
+ !*** ../problem-matcher/lib/index.js ***!
3862
+ \***************************************/
3863
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3864
+
3865
+ "use strict";
3866
+
3867
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
3868
+ // See LICENSE in the project root for license information.
3869
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
3870
+ exports.parseProblemMatchersJson = void 0;
3871
+ var ProblemMatcher_1 = __webpack_require__(/*! ./ProblemMatcher */ 217315);
3872
+ Object.defineProperty(exports, "parseProblemMatchersJson", ({ enumerable: true, get: function () { return ProblemMatcher_1.parseProblemMatchersJson; } }));
3873
+ //# sourceMappingURL=index.js.map
3874
+
3875
+ /***/ }),
3876
+
3829
3877
  /***/ 51650:
3830
3878
  /*!************************************************************************************************!*\
3831
3879
  !*** ../../common/temp/default/node_modules/.pnpm/ramda@0.27.2/node_modules/ramda/es/minBy.js ***!
@@ -16825,6 +16873,250 @@ function _of(x) {
16825
16873
 
16826
16874
  /***/ }),
16827
16875
 
16876
+ /***/ 217315:
16877
+ /*!************************************************!*\
16878
+ !*** ../problem-matcher/lib/ProblemMatcher.js ***!
16879
+ \************************************************/
16880
+ /***/ ((__unused_webpack_module, exports) => {
16881
+
16882
+ "use strict";
16883
+
16884
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
16885
+ // See LICENSE in the project root for license information.
16886
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
16887
+ exports.parseProblemMatchersJson = parseProblemMatchersJson;
16888
+ /**
16889
+ * Parse VS Code problem matcher JSON definitions into {@link IProblemMatcher} objects.
16890
+ *
16891
+ * @public
16892
+ */
16893
+ function parseProblemMatchersJson(problemMatchers) {
16894
+ const result = [];
16895
+ for (const matcher of problemMatchers) {
16896
+ const problemPatterns = Array.isArray(matcher.pattern)
16897
+ ? matcher.pattern
16898
+ : [matcher.pattern];
16899
+ if (problemPatterns.length === 0) {
16900
+ continue;
16901
+ }
16902
+ const name = matcher.name;
16903
+ const defaultSeverity = matcher.severity;
16904
+ const compiled = compileProblemPatterns(problemPatterns);
16905
+ if (compiled.length === 1) {
16906
+ result.push(createSingleLineMatcher(name, compiled[0], defaultSeverity));
16907
+ }
16908
+ else {
16909
+ result.push(createMultiLineMatcher(name, compiled, defaultSeverity));
16910
+ }
16911
+ }
16912
+ return result;
16913
+ }
16914
+ function toNumber(text) {
16915
+ if (!text) {
16916
+ return undefined;
16917
+ }
16918
+ const n = parseInt(text, 10);
16919
+ return isNaN(n) ? undefined : n;
16920
+ }
16921
+ function normalizeSeverity(raw) {
16922
+ if (!raw) {
16923
+ return undefined;
16924
+ }
16925
+ const lowered = raw.toLowerCase();
16926
+ // Support full words as well as common abbreviations (e.g. single-letter tokens)
16927
+ if (lowered.indexOf('err') === 0)
16928
+ return 'error';
16929
+ if (lowered.indexOf('warn') === 0)
16930
+ return 'warning';
16931
+ if (lowered.indexOf('info') === 0)
16932
+ return 'info';
16933
+ return undefined;
16934
+ }
16935
+ function compileProblemPatterns(problemPatterns) {
16936
+ return problemPatterns.map((problemPattern) => {
16937
+ let reStr = problemPattern.regexp;
16938
+ if (/\\r?\\n\$/.test(reStr) || /\\n\$/.test(reStr)) {
16939
+ // already newline aware
16940
+ }
16941
+ else if (reStr.length > 0 && reStr.charAt(reStr.length - 1) === '$') {
16942
+ reStr = reStr.slice(0, -1) + '\\r?\\n$';
16943
+ }
16944
+ else {
16945
+ reStr = reStr + '(?:\\r?\\n)';
16946
+ }
16947
+ const re = new RegExp(reStr);
16948
+ return { re, spec: problemPattern };
16949
+ });
16950
+ }
16951
+ function createEmptyCaptures() {
16952
+ return { messageParts: [] };
16953
+ }
16954
+ /**
16955
+ * Apply one pattern's regex match to the (possibly accumulating) captures.
16956
+ */
16957
+ function applyPatternCaptures(spec, reMatch, captures, defaultSeverity) {
16958
+ if (spec.file && reMatch[spec.file]) {
16959
+ captures.file = reMatch[spec.file];
16960
+ }
16961
+ if (spec.location && reMatch[spec.location]) {
16962
+ const loc = reMatch[spec.location];
16963
+ const parts = loc.split(/[,.:]/).filter((s) => s.length > 0);
16964
+ if (parts.length === 1) {
16965
+ captures.line = toNumber(parts[0]);
16966
+ }
16967
+ else if (parts.length === 2) {
16968
+ captures.line = toNumber(parts[0]);
16969
+ captures.column = toNumber(parts[1]);
16970
+ }
16971
+ else if (parts.length === 4) {
16972
+ captures.line = toNumber(parts[0]);
16973
+ captures.column = toNumber(parts[1]);
16974
+ captures.endLine = toNumber(parts[2]);
16975
+ captures.endColumn = toNumber(parts[3]);
16976
+ }
16977
+ }
16978
+ else {
16979
+ if (spec.line && reMatch[spec.line]) {
16980
+ captures.line = toNumber(reMatch[spec.line]);
16981
+ }
16982
+ if (spec.column && reMatch[spec.column]) {
16983
+ captures.column = toNumber(reMatch[spec.column]);
16984
+ }
16985
+ }
16986
+ if (spec.endLine && reMatch[spec.endLine]) {
16987
+ captures.endLine = toNumber(reMatch[spec.endLine]);
16988
+ }
16989
+ if (spec.endColumn && reMatch[spec.endColumn]) {
16990
+ captures.endColumn = toNumber(reMatch[spec.endColumn]);
16991
+ }
16992
+ if (spec.severity && reMatch[spec.severity]) {
16993
+ captures.severity = normalizeSeverity(reMatch[spec.severity]) || defaultSeverity;
16994
+ }
16995
+ else if (!captures.severity && defaultSeverity) {
16996
+ captures.severity = defaultSeverity;
16997
+ }
16998
+ if (spec.code && reMatch[spec.code]) {
16999
+ captures.code = reMatch[spec.code];
17000
+ }
17001
+ if (spec.message && reMatch[spec.message]) {
17002
+ captures.messageParts.push(reMatch[spec.message]);
17003
+ }
17004
+ }
17005
+ function finalizeProblem(matcherName, captures, defaultSeverity) {
17006
+ // For multi-line patterns, use only the last non-empty message part
17007
+ const message = captures.messageParts.length > 0 ? captures.messageParts[captures.messageParts.length - 1] : '';
17008
+ return {
17009
+ matcherName,
17010
+ file: captures.file,
17011
+ line: captures.line,
17012
+ column: captures.column,
17013
+ endLine: captures.endLine,
17014
+ endColumn: captures.endColumn,
17015
+ severity: captures.severity || defaultSeverity,
17016
+ code: captures.code,
17017
+ message: message
17018
+ };
17019
+ }
17020
+ function createSingleLineMatcher(name, compiled, defaultSeverity) {
17021
+ const { re, spec } = compiled;
17022
+ return {
17023
+ name,
17024
+ exec(line) {
17025
+ const match = re.exec(line);
17026
+ if (!match) {
17027
+ return false;
17028
+ }
17029
+ const captures = createEmptyCaptures();
17030
+ applyPatternCaptures(spec, match, captures, defaultSeverity);
17031
+ return finalizeProblem(name, captures, defaultSeverity);
17032
+ }
17033
+ };
17034
+ }
17035
+ function createMultiLineMatcher(name, compiled, defaultSeverity) {
17036
+ // currentIndex points to the next pattern we expect to match. When it equals compiled.length
17037
+ // and the last pattern is a loop, we are in a special "loop state" where additional lines
17038
+ // should be attempted against only the last pattern to emit more problems.
17039
+ let currentIndex = 0;
17040
+ const lastSpec = compiled[compiled.length - 1].spec;
17041
+ const lastIsLoop = !!lastSpec.loop;
17042
+ let captures = createEmptyCaptures();
17043
+ return {
17044
+ name,
17045
+ exec(line) {
17046
+ let effectiveMatch = null;
17047
+ let effectiveSpec;
17048
+ // Determine matching behavior based on current state
17049
+ if (currentIndex === compiled.length && lastIsLoop) {
17050
+ // Loop state: only try to match the last pattern
17051
+ const lastPattern = compiled[compiled.length - 1];
17052
+ effectiveMatch = lastPattern.re.exec(line);
17053
+ if (!effectiveMatch) {
17054
+ // Exit loop state and reset for a potential new sequence
17055
+ currentIndex = 0;
17056
+ captures = createEmptyCaptures();
17057
+ // Attempt to treat this line as a fresh start (pattern 0)
17058
+ const first = compiled[0];
17059
+ const fresh = first.re.exec(line);
17060
+ if (!fresh) {
17061
+ return false;
17062
+ }
17063
+ effectiveMatch = fresh;
17064
+ effectiveSpec = first.spec;
17065
+ currentIndex = compiled.length > 1 ? 1 : compiled.length;
17066
+ }
17067
+ else {
17068
+ effectiveSpec = lastPattern.spec;
17069
+ // currentIndex remains compiled.length (loop state) until we decide to emit
17070
+ }
17071
+ }
17072
+ else {
17073
+ // Normal multi-line progression state
17074
+ const active = compiled[currentIndex];
17075
+ const reMatch = active.re.exec(line);
17076
+ if (!reMatch) {
17077
+ // Reset and maybe attempt new start
17078
+ currentIndex = 0;
17079
+ captures = createEmptyCaptures();
17080
+ const { re: re0, spec: spec0 } = compiled[0];
17081
+ const restartMatch = re0.exec(line);
17082
+ if (!restartMatch) {
17083
+ return false;
17084
+ }
17085
+ effectiveMatch = restartMatch;
17086
+ effectiveSpec = spec0;
17087
+ currentIndex = compiled.length > 1 ? 1 : compiled.length;
17088
+ }
17089
+ else {
17090
+ effectiveMatch = reMatch;
17091
+ effectiveSpec = active.spec;
17092
+ currentIndex++;
17093
+ }
17094
+ }
17095
+ applyPatternCaptures(effectiveSpec, effectiveMatch, captures, defaultSeverity);
17096
+ // If we haven't matched all patterns yet (and not in loop state), wait for more lines
17097
+ if (currentIndex < compiled.length) {
17098
+ return false;
17099
+ }
17100
+ // We have matched the full sequence (either first completion or a loop iteration)
17101
+ const problem = finalizeProblem(name, captures, defaultSeverity);
17102
+ if (lastIsLoop) {
17103
+ // Stay in loop state; reset fields that accumulate per problem but retain other context (e.g., file if first pattern captured it?)
17104
+ // For safety, if the last pattern provided the file each iteration we keep overwriting anyway.
17105
+ captures.messageParts = [];
17106
+ // Do not clear entire captures to allow preceding pattern data (e.g., summary) to persist if desirable.
17107
+ }
17108
+ else {
17109
+ currentIndex = 0;
17110
+ captures = createEmptyCaptures();
17111
+ }
17112
+ return problem;
17113
+ }
17114
+ };
17115
+ }
17116
+ //# sourceMappingURL=ProblemMatcher.js.map
17117
+
17118
+ /***/ }),
17119
+
16828
17120
  /***/ 217948:
16829
17121
  /*!*****************************************************************************************************************!*\
16830
17122
  !*** ../../common/temp/default/node_modules/.pnpm/graceful-fs@4.2.4/node_modules/graceful-fs/legacy-streams.js ***!
@@ -29445,6 +29737,24 @@ const Path_1 = __webpack_require__(/*! ./Path */ 302405);
29445
29737
  const TypeUuid_1 = __webpack_require__(/*! ./TypeUuid */ 694977);
29446
29738
  const uuidFileError = '37a4c772-2dc8-4c66-89ae-262f8cc1f0c1';
29447
29739
  const baseFolderEnvVar = 'RUSHSTACK_FILE_ERROR_BASE_FOLDER';
29740
+ const unixProblemMatcherPattern = {
29741
+ regexp: '^\\[[^\\]]+\\]\\s+(Error|Warning):\\s+([^:]+):(\\d+):(\\d+)\\s+-\\s+(?:\\(([^)]+)\\)\\s+)?(.*)$',
29742
+ severity: 1,
29743
+ file: 2,
29744
+ line: 3,
29745
+ column: 4,
29746
+ code: 5,
29747
+ message: 6
29748
+ };
29749
+ const vsProblemMatcherPattern = {
29750
+ regexp: '^\\[[^\\]]+\\]\\s+(Error|Warning):\\s+([^\\(]+)\\((\\d+),(\\d+)\\)\\s+-\\s+(?:\\(([^)]+)\\)\\s+)?(.*)$',
29751
+ severity: 1,
29752
+ file: 2,
29753
+ line: 3,
29754
+ column: 4,
29755
+ code: 5,
29756
+ message: 6
29757
+ };
29448
29758
  /**
29449
29759
  * An `Error` subclass that should be thrown to report an unexpected state that specifically references
29450
29760
  * a location in a file.
@@ -29497,6 +29807,23 @@ class FileError extends Error {
29497
29807
  column: this.column
29498
29808
  });
29499
29809
  }
29810
+ /**
29811
+ * Get the problem matcher pattern for parsing error messages.
29812
+ *
29813
+ * @param options - Options for the error message format.
29814
+ * @returns The problem matcher pattern.
29815
+ */
29816
+ static getProblemMatcher(options) {
29817
+ const format = (options === null || options === void 0 ? void 0 : options.format) || 'Unix';
29818
+ switch (format) {
29819
+ case 'Unix':
29820
+ return unixProblemMatcherPattern;
29821
+ case 'VisualStudio':
29822
+ return vsProblemMatcherPattern;
29823
+ default:
29824
+ throw new Error(`The FileError format "${format}" is not supported for problem matchers.`);
29825
+ }
29826
+ }
29500
29827
  _evaluateBaseFolder() {
29501
29828
  // Cache the sanitized environment variable. This means that we don't support changing
29502
29829
  // the environment variable mid-execution. This is a reasonable tradeoff for the benefit
@@ -71550,7 +71877,7 @@ exports.CommandLineAction = CommandLineAction;
71550
71877
  // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
71551
71878
  // See LICENSE in the project root for license information.
71552
71879
  Object.defineProperty(exports, "__esModule", ({ value: true }));
71553
- exports.TerminalStreamWritable = exports.NoOpTerminalProvider = exports.PrefixProxyTerminalProvider = exports.StringBufferTerminalProvider = exports.ConsoleTerminalProvider = exports.TerminalProviderSeverity = exports.Colorize = exports.Terminal = exports.AnsiEscape = exports.TextRewriterTransform = exports.TextRewriter = exports.TerminalWritable = exports.TerminalTransform = exports.StdioWritable = exports.StdioSummarizer = exports.StderrLineTransform = exports.SplitterTransform = exports.RemoveColorsTextRewriter = exports.PrintUtilities = exports.DEFAULT_CONSOLE_WIDTH = exports.NormalizeNewlinesTextRewriter = exports.MockWritable = exports.TerminalChunkKind = exports.DiscardStdoutTransform = exports.CallbackWritable = void 0;
71880
+ exports.ProblemCollector = exports.TerminalStreamWritable = exports.NoOpTerminalProvider = exports.PrefixProxyTerminalProvider = exports.StringBufferTerminalProvider = exports.ConsoleTerminalProvider = exports.TerminalProviderSeverity = exports.Colorize = exports.Terminal = exports.AnsiEscape = exports.TextRewriterTransform = exports.TextRewriter = exports.TerminalWritable = exports.TerminalTransform = exports.StdioWritable = exports.StdioSummarizer = exports.StderrLineTransform = exports.SplitterTransform = exports.RemoveColorsTextRewriter = exports.PrintUtilities = exports.DEFAULT_CONSOLE_WIDTH = exports.NormalizeNewlinesTextRewriter = exports.MockWritable = exports.TerminalChunkKind = exports.DiscardStdoutTransform = exports.CallbackWritable = void 0;
71554
71881
  /// <reference types="node" preserve="true" />
71555
71882
  /**
71556
71883
  * This library implements a system for processing human readable text that
@@ -71610,6 +71937,8 @@ var NoOpTerminalProvider_1 = __webpack_require__(/*! ./NoOpTerminalProvider */ 7
71610
71937
  Object.defineProperty(exports, "NoOpTerminalProvider", ({ enumerable: true, get: function () { return NoOpTerminalProvider_1.NoOpTerminalProvider; } }));
71611
71938
  var TerminalStreamWritable_1 = __webpack_require__(/*! ./TerminalStreamWritable */ 687716);
71612
71939
  Object.defineProperty(exports, "TerminalStreamWritable", ({ enumerable: true, get: function () { return TerminalStreamWritable_1.TerminalStreamWritable; } }));
71940
+ var ProblemCollector_1 = __webpack_require__(/*! ./ProblemCollector */ 996746);
71941
+ Object.defineProperty(exports, "ProblemCollector", ({ enumerable: true, get: function () { return ProblemCollector_1.ProblemCollector; } }));
71613
71942
  //# sourceMappingURL=index.js.map
71614
71943
 
71615
71944
  /***/ }),
@@ -72359,6 +72688,105 @@ var last =
72359
72688
 
72360
72689
  /***/ }),
72361
72690
 
72691
+ /***/ 996746:
72692
+ /*!*******************************************!*\
72693
+ !*** ../terminal/lib/ProblemCollector.js ***!
72694
+ \*******************************************/
72695
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
72696
+
72697
+ "use strict";
72698
+
72699
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
72700
+ // See LICENSE in the project root for license information.
72701
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
72702
+ exports.ProblemCollector = void 0;
72703
+ const problem_matcher_1 = __webpack_require__(/*! @rushstack/problem-matcher */ 51542);
72704
+ const TerminalWritable_1 = __webpack_require__(/*! ./TerminalWritable */ 33900);
72705
+ /**
72706
+ * A {@link TerminalWritable} that consumes line-oriented terminal output and extracts structured
72707
+ * problems using one or more {@link @rushstack/problem-matcher#IProblemMatcher | IProblemMatcher} instances.
72708
+ *
72709
+ * @remarks
72710
+ * This collector expects that each incoming {@link ITerminalChunk} represents a single line terminated
72711
+ * by a `"\n"` character (for example when preceded by {@link StderrLineTransform} / `StdioLineTransform`).
72712
+ * If a chunk does not end with a newline an error is thrown to surface incorrect pipeline wiring early.
72713
+ *
72714
+ * @beta
72715
+ */
72716
+ class ProblemCollector extends TerminalWritable_1.TerminalWritable {
72717
+ constructor(options) {
72718
+ super(options);
72719
+ this._problems = new Set();
72720
+ if (!options ||
72721
+ ((!options.matchers || options.matchers.length === 0) &&
72722
+ (!options.matcherJson || options.matcherJson.length === 0))) {
72723
+ throw new Error('ProblemCollector requires at least one problem matcher.');
72724
+ }
72725
+ const fromJson = options.matcherJson
72726
+ ? (0, problem_matcher_1.parseProblemMatchersJson)(options.matcherJson)
72727
+ : [];
72728
+ this._matchers = [...(options.matchers || []), ...fromJson];
72729
+ if (this._matchers.length === 0) {
72730
+ throw new Error('ProblemCollector requires at least one problem matcher.');
72731
+ }
72732
+ this._onProblem = options.onProblem;
72733
+ }
72734
+ /**
72735
+ * {@inheritdoc IProblemCollector}
72736
+ */
72737
+ get problems() {
72738
+ return this._problems;
72739
+ }
72740
+ /**
72741
+ * {@inheritdoc TerminalWritable}
72742
+ */
72743
+ onWriteChunk(chunk) {
72744
+ var _a;
72745
+ const text = chunk.text;
72746
+ if (text.length === 0 || text[text.length - 1] !== '\n') {
72747
+ throw new Error('ProblemCollector expects chunks that were split into newline terminated lines. ' +
72748
+ 'Invalid input: ' +
72749
+ JSON.stringify(text));
72750
+ }
72751
+ for (const matcher of this._matchers) {
72752
+ const problem = matcher.exec(text);
72753
+ if (problem) {
72754
+ const finalized = {
72755
+ ...problem,
72756
+ matcherName: matcher.name
72757
+ };
72758
+ this._problems.add(finalized);
72759
+ (_a = this._onProblem) === null || _a === void 0 ? void 0 : _a.call(this, finalized);
72760
+ }
72761
+ }
72762
+ }
72763
+ /**
72764
+ * {@inheritdoc TerminalWritable}
72765
+ */
72766
+ onClose() {
72767
+ var _a;
72768
+ for (const matcher of this._matchers) {
72769
+ if (matcher.flush) {
72770
+ const flushed = matcher.flush();
72771
+ if (flushed && flushed.length > 0) {
72772
+ for (const problem of flushed) {
72773
+ const finalized = {
72774
+ ...problem,
72775
+ matcherName: matcher.name
72776
+ };
72777
+ this._problems.add(finalized);
72778
+ (_a = this._onProblem) === null || _a === void 0 ? void 0 : _a.call(this, finalized);
72779
+ }
72780
+ }
72781
+ }
72782
+ }
72783
+ }
72784
+ }
72785
+ exports.ProblemCollector = ProblemCollector;
72786
+ //# sourceMappingURL=ProblemCollector.js.map
72787
+
72788
+ /***/ }),
72789
+
72362
72790
  /***/ 999130:
72363
72791
  /*!**************************************************************************************************!*\
72364
72792
  !*** ../../common/temp/default/node_modules/.pnpm/ramda@0.27.2/node_modules/ramda/es/indexBy.js ***!