effect-errors 1.7.28 → 1.7.30
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/cjs/capture-errors.js +18 -21
- package/cjs/capture-errors.js.map +1 -1
- package/cjs/index.js +20 -69
- package/cjs/index.js.map +1 -1
- package/cjs/logic/effects/fs/fs-error.js +4 -6
- package/cjs/logic/effects/fs/fs-error.js.map +1 -1
- package/cjs/logic/effects/fs/fs-extra.effects.js +20 -45
- package/cjs/logic/effects/fs/fs-extra.effects.js.map +1 -1
- package/cjs/logic/errors/capture-errors-from-cause.js +10 -13
- package/cjs/logic/errors/capture-errors-from-cause.js.map +1 -1
- package/cjs/logic/errors/extract-error-details.js +53 -57
- package/cjs/logic/errors/extract-error-details.js.map +1 -1
- package/cjs/logic/errors/parse-error.js +17 -19
- package/cjs/logic/errors/parse-error.js.map +1 -1
- package/cjs/logic/pretty-printing/format-failures-title.js +11 -14
- package/cjs/logic/pretty-printing/format-failures-title.js.map +1 -1
- package/cjs/logic/pretty-printing/format-span-attributes.js +38 -51
- package/cjs/logic/pretty-printing/format-span-attributes.js.map +1 -1
- package/cjs/logic/pretty-printing/maybe-print-node-stacktrace.js +13 -19
- package/cjs/logic/pretty-printing/maybe-print-node-stacktrace.js.map +1 -1
- package/cjs/logic/pretty-printing/maybe-print-span-attributes.js +18 -26
- package/cjs/logic/pretty-printing/maybe-print-span-attributes.js.map +1 -1
- package/cjs/logic/pretty-printing/maybe-warn-about-plain-strings.js +9 -14
- package/cjs/logic/pretty-printing/maybe-warn-about-plain-strings.js.map +1 -1
- package/cjs/logic/pretty-printing/print-effect-stacktrace.js +12 -19
- package/cjs/logic/pretty-printing/print-effect-stacktrace.js.map +1 -1
- package/cjs/logic/spans/get-span-attributes.js +16 -25
- package/cjs/logic/spans/get-span-attributes.js.map +1 -1
- package/cjs/logic/spans/get-span-duration.js +10 -15
- package/cjs/logic/spans/get-span-duration.js.map +1 -1
- package/cjs/logic/spans/maybe-add-error-to-spans-stack.js +13 -16
- package/cjs/logic/spans/maybe-add-error-to-spans-stack.js.map +1 -1
- package/cjs/logic/spans/spans-stack-trailing-char.js +6 -11
- package/cjs/logic/spans/spans-stack-trailing-char.js.map +1 -1
- package/cjs/logic/spans/split-spans-attributes-by-type.js +12 -15
- package/cjs/logic/spans/split-spans-attributes-by-type.js.map +1 -1
- package/cjs/logic/stack/filter-stack.js +14 -17
- package/cjs/logic/stack/filter-stack.js.map +1 -1
- package/cjs/logic/stack/stack-regex.js +4 -7
- package/cjs/logic/stack/stack-regex.js.map +1 -1
- package/cjs/logic/strip-cwd-path.js +3 -6
- package/cjs/logic/strip-cwd-path.js.map +1 -1
- package/cjs/logic/util/big-int-replacer.js +8 -11
- package/cjs/logic/util/big-int-replacer.js.map +1 -1
- package/cjs/package.json +1 -0
- package/cjs/pretty-print.js +34 -40
- package/cjs/pretty-print.js.map +1 -1
- package/cjs/runners/run-promise.js +11 -14
- package/cjs/runners/run-promise.js.map +1 -1
- package/cjs/runners/run-sync.js +10 -13
- package/cjs/runners/run-sync.js.map +1 -1
- package/cjs/source-maps/get-error-location-from-file-path.js +11 -18
- package/cjs/source-maps/get-error-location-from-file-path.js.map +1 -1
- package/cjs/source-maps/get-error-related-sources.js +22 -29
- package/cjs/source-maps/get-error-related-sources.js.map +1 -1
- package/cjs/source-maps/get-source-code.js +18 -22
- package/cjs/source-maps/get-source-code.js.map +1 -1
- package/cjs/source-maps/get-sources-from-map-file.js +42 -45
- package/cjs/source-maps/get-sources-from-map-file.js.map +1 -1
- package/cjs/source-maps/get-sources-from-span.js +36 -48
- package/cjs/source-maps/get-sources-from-span.js.map +1 -1
- package/cjs/source-maps/get-sources-from-stack.js +16 -19
- package/cjs/source-maps/get-sources-from-stack.js.map +1 -1
- package/cjs/source-maps/maybe-map-sourcemaps.js +24 -25
- package/cjs/source-maps/maybe-map-sourcemaps.js.map +1 -1
- package/cjs/source-maps/transform-raw-error.js +30 -48
- package/cjs/source-maps/transform-raw-error.js.map +1 -1
- package/cjs/types/pretty-error.type.js +13 -16
- package/cjs/types/pretty-error.type.js.map +1 -1
- package/cjs/types/pretty-print-options.type.js +5 -8
- package/cjs/types/pretty-print-options.type.js.map +1 -1
- package/dts/capture-errors.d.ts +0 -1
- package/dts/index.d.ts +0 -1
- package/dts/logic/effects/fs/fs-error.d.ts +0 -1
- package/dts/logic/effects/fs/fs-extra.effects.d.ts +0 -1
- package/dts/logic/errors/capture-errors-from-cause.d.ts +0 -1
- package/dts/logic/errors/extract-error-details.d.ts +0 -1
- package/dts/logic/errors/parse-error.d.ts +0 -1
- package/dts/logic/pretty-printing/format-failures-title.d.ts +0 -1
- package/dts/logic/pretty-printing/format-span-attributes.d.ts +0 -1
- package/dts/logic/pretty-printing/maybe-print-node-stacktrace.d.ts +0 -1
- package/dts/logic/pretty-printing/maybe-print-span-attributes.d.ts +0 -1
- package/dts/logic/pretty-printing/maybe-warn-about-plain-strings.d.ts +0 -1
- package/dts/logic/pretty-printing/print-effect-stacktrace.d.ts +0 -1
- package/dts/logic/spans/get-span-attributes.d.ts +0 -1
- package/dts/logic/spans/get-span-duration.d.ts +0 -1
- package/dts/logic/spans/maybe-add-error-to-spans-stack.d.ts +0 -1
- package/dts/logic/spans/spans-stack-trailing-char.d.ts +0 -1
- package/dts/logic/spans/split-spans-attributes-by-type.d.ts +0 -1
- package/dts/logic/stack/filter-stack.d.ts +0 -1
- package/dts/logic/stack/stack-regex.d.ts +0 -1
- package/dts/logic/strip-cwd-path.d.ts +0 -1
- package/dts/logic/util/big-int-replacer.d.ts +0 -1
- package/dts/pretty-print.d.ts +0 -1
- package/dts/runners/run-promise.d.ts +0 -1
- package/dts/runners/run-sync.d.ts +0 -1
- package/dts/source-maps/get-error-location-from-file-path.d.ts +0 -1
- package/dts/source-maps/get-error-related-sources.d.ts +0 -1
- package/dts/source-maps/get-source-code.d.ts +0 -1
- package/dts/source-maps/get-sources-from-map-file.d.ts +0 -1
- package/dts/source-maps/get-sources-from-span.d.ts +0 -1
- package/dts/source-maps/get-sources-from-stack.d.ts +0 -1
- package/dts/source-maps/maybe-map-sourcemaps.d.ts +0 -1
- package/dts/source-maps/transform-raw-error.d.ts +0 -1
- package/dts/types/pretty-error.type.d.ts +0 -1
- package/dts/types/pretty-print-options.type.d.ts +0 -1
- package/esm/capture-errors.js +12 -12
- package/esm/capture-errors.js.map +1 -1
- package/esm/index.js.map +1 -1
- package/esm/logic/effects/fs/fs-error.js +2 -1
- package/esm/logic/effects/fs/fs-error.js.map +1 -1
- package/esm/logic/effects/fs/fs-extra.effects.js +12 -32
- package/esm/logic/effects/fs/fs-extra.effects.js.map +1 -1
- package/esm/logic/errors/capture-errors-from-cause.js +7 -7
- package/esm/logic/errors/capture-errors-from-cause.js.map +1 -1
- package/esm/logic/errors/extract-error-details.js +50 -51
- package/esm/logic/errors/extract-error-details.js.map +1 -1
- package/esm/logic/errors/parse-error.js +13 -12
- package/esm/logic/errors/parse-error.js.map +1 -1
- package/esm/logic/pretty-printing/format-failures-title.js +6 -4
- package/esm/logic/pretty-printing/format-failures-title.js.map +1 -1
- package/esm/logic/pretty-printing/format-span-attributes.js +28 -36
- package/esm/logic/pretty-printing/format-span-attributes.js.map +1 -1
- package/esm/logic/pretty-printing/maybe-print-node-stacktrace.js +7 -8
- package/esm/logic/pretty-printing/maybe-print-node-stacktrace.js.map +1 -1
- package/esm/logic/pretty-printing/maybe-print-span-attributes.js +12 -15
- package/esm/logic/pretty-printing/maybe-print-span-attributes.js.map +1 -1
- package/esm/logic/pretty-printing/maybe-warn-about-plain-strings.js +4 -4
- package/esm/logic/pretty-printing/maybe-warn-about-plain-strings.js.map +1 -1
- package/esm/logic/pretty-printing/print-effect-stacktrace.js +6 -8
- package/esm/logic/pretty-printing/print-effect-stacktrace.js.map +1 -1
- package/esm/logic/spans/get-span-attributes.js +10 -14
- package/esm/logic/spans/get-span-attributes.js.map +1 -1
- package/esm/logic/spans/get-span-duration.js +5 -5
- package/esm/logic/spans/get-span-duration.js.map +1 -1
- package/esm/logic/spans/maybe-add-error-to-spans-stack.js +11 -11
- package/esm/logic/spans/maybe-add-error-to-spans-stack.js.map +1 -1
- package/esm/logic/spans/spans-stack-trailing-char.js +1 -1
- package/esm/logic/spans/spans-stack-trailing-char.js.map +1 -1
- package/esm/logic/spans/split-spans-attributes-by-type.js +11 -11
- package/esm/logic/spans/split-spans-attributes-by-type.js.map +1 -1
- package/esm/logic/stack/filter-stack.js +10 -10
- package/esm/logic/stack/filter-stack.js.map +1 -1
- package/esm/logic/stack/stack-regex.js.map +1 -1
- package/esm/logic/strip-cwd-path.js +2 -2
- package/esm/logic/strip-cwd-path.js.map +1 -1
- package/esm/logic/util/big-int-replacer.js +7 -7
- package/esm/logic/util/big-int-replacer.js.map +1 -1
- package/esm/package.json +1 -0
- package/esm/pretty-print.js +20 -21
- package/esm/pretty-print.js.map +1 -1
- package/esm/runners/run-promise.js +8 -8
- package/esm/runners/run-promise.js.map +1 -1
- package/esm/runners/run-sync.js +7 -7
- package/esm/runners/run-sync.js.map +1 -1
- package/esm/source-maps/get-error-location-from-file-path.js +9 -13
- package/esm/source-maps/get-error-location-from-file-path.js.map +1 -1
- package/esm/source-maps/get-error-related-sources.js +18 -22
- package/esm/source-maps/get-error-related-sources.js.map +1 -1
- package/esm/source-maps/get-source-code.js +15 -16
- package/esm/source-maps/get-source-code.js.map +1 -1
- package/esm/source-maps/get-sources-from-map-file.js +34 -32
- package/esm/source-maps/get-sources-from-map-file.js.map +1 -1
- package/esm/source-maps/get-sources-from-span.js +31 -40
- package/esm/source-maps/get-sources-from-span.js.map +1 -1
- package/esm/source-maps/get-sources-from-stack.js +11 -11
- package/esm/source-maps/get-sources-from-stack.js.map +1 -1
- package/esm/source-maps/maybe-map-sourcemaps.js +20 -18
- package/esm/source-maps/maybe-map-sourcemaps.js.map +1 -1
- package/esm/source-maps/transform-raw-error.js +23 -38
- package/esm/source-maps/transform-raw-error.js.map +1 -1
- package/esm/types/pretty-error.type.js +12 -12
- package/esm/types/pretty-error.type.js.map +1 -1
- package/esm/types/pretty-print-options.type.js +3 -3
- package/esm/types/pretty-print-options.type.js.map +1 -1
- package/package.json +11 -10
- package/dts/capture-errors.d.ts.map +0 -1
- package/dts/index.d.ts.map +0 -1
- package/dts/logic/effects/fs/fs-error.d.ts.map +0 -1
- package/dts/logic/effects/fs/fs-extra.effects.d.ts.map +0 -1
- package/dts/logic/errors/capture-errors-from-cause.d.ts.map +0 -1
- package/dts/logic/errors/extract-error-details.d.ts.map +0 -1
- package/dts/logic/errors/parse-error.d.ts.map +0 -1
- package/dts/logic/pretty-printing/format-failures-title.d.ts.map +0 -1
- package/dts/logic/pretty-printing/format-span-attributes.d.ts.map +0 -1
- package/dts/logic/pretty-printing/maybe-print-node-stacktrace.d.ts.map +0 -1
- package/dts/logic/pretty-printing/maybe-print-span-attributes.d.ts.map +0 -1
- package/dts/logic/pretty-printing/maybe-warn-about-plain-strings.d.ts.map +0 -1
- package/dts/logic/pretty-printing/print-effect-stacktrace.d.ts.map +0 -1
- package/dts/logic/spans/get-span-attributes.d.ts.map +0 -1
- package/dts/logic/spans/get-span-duration.d.ts.map +0 -1
- package/dts/logic/spans/maybe-add-error-to-spans-stack.d.ts.map +0 -1
- package/dts/logic/spans/spans-stack-trailing-char.d.ts.map +0 -1
- package/dts/logic/spans/split-spans-attributes-by-type.d.ts.map +0 -1
- package/dts/logic/stack/filter-stack.d.ts.map +0 -1
- package/dts/logic/stack/stack-regex.d.ts.map +0 -1
- package/dts/logic/strip-cwd-path.d.ts.map +0 -1
- package/dts/logic/util/big-int-replacer.d.ts.map +0 -1
- package/dts/pretty-print.d.ts.map +0 -1
- package/dts/runners/run-promise.d.ts.map +0 -1
- package/dts/runners/run-sync.d.ts.map +0 -1
- package/dts/source-maps/get-error-location-from-file-path.d.ts.map +0 -1
- package/dts/source-maps/get-error-related-sources.d.ts.map +0 -1
- package/dts/source-maps/get-source-code.d.ts.map +0 -1
- package/dts/source-maps/get-sources-from-map-file.d.ts.map +0 -1
- package/dts/source-maps/get-sources-from-span.d.ts.map +0 -1
- package/dts/source-maps/get-sources-from-stack.d.ts.map +0 -1
- package/dts/source-maps/maybe-map-sourcemaps.d.ts.map +0 -1
- package/dts/source-maps/transform-raw-error.d.ts.map +0 -1
- package/dts/types/pretty-error.type.d.ts.map +0 -1
- package/dts/types/pretty-print-options.type.d.ts.map +0 -1
- package/esm/tsconfig-prod.tsbuildinfo +0 -1
|
@@ -1,56 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.formatSpanAttributes = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
const maybeCircle = isFirstEntry ? `\r\n${_picocolors.default.gray('◯')}` : '';
|
|
42
|
-
const message = _picocolors.default.white(`${maybeCircle}\r\n${(0, _spansStackTrailingChar.spanStackTrailingChar)(isLastEntry)}${_picocolors.default.gray('─')}${filePath}${(0, _getSpanDuration.getSpanDuration)(status, isLastEntry)}${formattedAttributes}`);
|
|
43
|
-
return {
|
|
44
|
-
message,
|
|
45
|
-
stack
|
|
46
|
-
};
|
|
47
|
-
}).reduce((prev, curr) => ({
|
|
48
|
-
message: prev.message + curr.message,
|
|
49
|
-
stack: [...prev.stack, ...curr.stack]
|
|
50
|
-
}), {
|
|
51
|
-
message: '',
|
|
52
|
-
stack: []
|
|
53
|
-
});
|
|
7
|
+
const effect_1 = require("effect");
|
|
8
|
+
const picocolors_1 = __importDefault(require("picocolors"));
|
|
9
|
+
const get_span_attributes_js_1 = require("../spans/get-span-attributes.js");
|
|
10
|
+
const get_span_duration_js_1 = require("../spans/get-span-duration.js");
|
|
11
|
+
const spans_stack_trailing_char_js_1 = require("../spans/spans-stack-trailing-char.js");
|
|
12
|
+
const strip_cwd_path_js_1 = require("../strip-cwd-path.js");
|
|
13
|
+
const formatSpanAttributes = (span, { stripCwd, reverseSpans }) => {
|
|
14
|
+
let current = span;
|
|
15
|
+
const spans = [];
|
|
16
|
+
while (current !== undefined && current._tag === 'Span') {
|
|
17
|
+
spans.push(current);
|
|
18
|
+
current = effect_1.Option.getOrUndefined(current.parent);
|
|
19
|
+
}
|
|
20
|
+
const orderedSpans = reverseSpans === true ? spans.toReversed() : spans;
|
|
21
|
+
return orderedSpans
|
|
22
|
+
.map(({ name, attributes, status }, index) => {
|
|
23
|
+
const isFirstEntry = index === 0;
|
|
24
|
+
const isLastEntry = index === spans.length - 1;
|
|
25
|
+
const filePath = ` at ${stripCwd !== undefined ? (0, strip_cwd_path_js_1.stripCwdPath)(name) : name}`;
|
|
26
|
+
const { formattedAttributes, stack } = (0, get_span_attributes_js_1.getSpanAttributes)(attributes, isLastEntry);
|
|
27
|
+
const maybeCircle = isFirstEntry ? `\r\n${picocolors_1.default.gray('◯')}` : '';
|
|
28
|
+
const message = picocolors_1.default.white(`${maybeCircle}\r\n${(0, spans_stack_trailing_char_js_1.spanStackTrailingChar)(isLastEntry)}${picocolors_1.default.gray('─')}${filePath}${(0, get_span_duration_js_1.getSpanDuration)(status, isLastEntry)}${formattedAttributes}`);
|
|
29
|
+
return {
|
|
30
|
+
message,
|
|
31
|
+
stack,
|
|
32
|
+
};
|
|
33
|
+
})
|
|
34
|
+
.reduce((prev, curr) => ({
|
|
35
|
+
message: prev.message + curr.message,
|
|
36
|
+
stack: [...prev.stack, ...curr.stack],
|
|
37
|
+
}), {
|
|
38
|
+
message: '',
|
|
39
|
+
stack: [],
|
|
40
|
+
});
|
|
54
41
|
};
|
|
55
42
|
exports.formatSpanAttributes = formatSpanAttributes;
|
|
56
43
|
//# sourceMappingURL=format-span-attributes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-span-attributes.js","
|
|
1
|
+
{"version":3,"file":"format-span-attributes.js","sourceRoot":"","sources":["../../../../src/logic/pretty-printing/format-span-attributes.ts"],"names":[],"mappings":";;;;;;AAAA,mCAAgC;AAEhC,4DAA+B;AAG/B,4EAAoE;AACpE,wEAAgE;AAChE,wFAA8E;AAC9E,4DAAoD;AAE7C,MAAM,oBAAoB,GAAG,CAClC,IAAsB,EACtB,EAAE,QAAQ,EAAE,YAAY,EAAsB,EAC9C,EAAE;IACF,IAAI,OAAO,GAA+B,IAAI,CAAC;IAE/C,MAAM,KAAK,GAAG,EAAE,CAAC;IACjB,OAAO,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QACxD,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpB,OAAO,GAAG,eAAM,CAAC,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAClD,CAAC;IAED,MAAM,YAAY,GAAG,YAAY,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;IAExE,OAAO,YAAY;SAChB,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE;QAC3C,MAAM,YAAY,GAAG,KAAK,KAAK,CAAC,CAAC;QACjC,MAAM,WAAW,GAAG,KAAK,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;QAE/C,MAAM,QAAQ,GAAG,OAAO,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,IAAA,gCAAY,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAE7E,MAAM,EAAE,mBAAmB,EAAE,KAAK,EAAE,GAAG,IAAA,0CAAiB,EACtD,UAAU,EACV,WAAW,CACZ,CAAC;QAEF,MAAM,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,OAAO,oBAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAEjE,MAAM,OAAO,GAAG,oBAAK,CAAC,KAAK,CACzB,GAAG,WAAW,OAAO,IAAA,oDAAqB,EAAC,WAAW,CAAC,GAAG,oBAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,GAAG,IAAA,sCAAe,EAAC,MAAM,EAAE,WAAW,CAAC,GAAG,mBAAmB,EAAE,CACpJ,CAAC;QAEF,OAAO;YACL,OAAO;YACP,KAAK;SACN,CAAC;IACJ,CAAC,CAAC;SACD,MAAM,CACL,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QACf,OAAO,EAAE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO;QACpC,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;KACtC,CAAC,EACF;QACE,OAAO,EAAE,EAAE;QACX,KAAK,EAAE,EAAE;KACV,CACF,CAAC;AACN,CAAC,CAAC;AA/CW,QAAA,oBAAoB,wBA+C/B"}
|
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.maybePrintNodeStacktrace = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}) => {
|
|
17
|
-
if (stack !== undefined) {
|
|
18
|
-
d.push(`\r\n${span !== undefined ? '\r\n' : ''}🚨 Node Stacktrace\r\n${_picocolors.default.red((0, _filterStack.filterStack)(stack, 'node', stripCwd === true))}`);
|
|
19
|
-
} else if (!isPlainString) {
|
|
20
|
-
d.push(`\r\n\r\n${_picocolors.default.gray('ℹ️ Consider using a yieldable error such as Data.TaggedError and Schema.TaggedError to get a stacktrace.')}`);
|
|
21
|
-
}
|
|
7
|
+
const picocolors_1 = __importDefault(require("picocolors"));
|
|
8
|
+
const filter_stack_js_1 = require("../stack/filter-stack.js");
|
|
9
|
+
const maybePrintNodeStacktrace = (d, span, stack, isPlainString, { stripCwd }) => {
|
|
10
|
+
if (stack !== undefined) {
|
|
11
|
+
d.push(`\r\n${span !== undefined ? '\r\n' : ''}🚨 Node Stacktrace\r\n${picocolors_1.default.red((0, filter_stack_js_1.filterStack)(stack, 'node', stripCwd === true))}`);
|
|
12
|
+
}
|
|
13
|
+
else if (!isPlainString) {
|
|
14
|
+
d.push(`\r\n\r\n${picocolors_1.default.gray('ℹ️ Consider using a yieldable error such as Data.TaggedError and Schema.TaggedError to get a stacktrace.')}`);
|
|
15
|
+
}
|
|
22
16
|
};
|
|
23
17
|
exports.maybePrintNodeStacktrace = maybePrintNodeStacktrace;
|
|
24
18
|
//# sourceMappingURL=maybe-print-node-stacktrace.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maybe-print-node-stacktrace.js","
|
|
1
|
+
{"version":3,"file":"maybe-print-node-stacktrace.js","sourceRoot":"","sources":["../../../../src/logic/pretty-printing/maybe-print-node-stacktrace.ts"],"names":[],"mappings":";;;;;;AACA,4DAA+B;AAG/B,8DAAuD;AAEhD,MAAM,wBAAwB,GAAG,CACtC,CAAW,EACX,IAAsB,EACtB,KAAyB,EACzB,aAAsB,EACtB,EAAE,QAAQ,EAAsB,EAChC,EAAE;IACF,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,CAAC,CAAC,IAAI,CACJ,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,yBAAyB,oBAAK,CAAC,GAAG,CAAC,IAAA,6BAAW,EAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,KAAK,IAAI,CAAC,CAAC,EAAE,CAC3H,CAAC;IACJ,CAAC;SAAM,IAAI,CAAC,aAAa,EAAE,CAAC;QAC1B,CAAC,CAAC,IAAI,CACJ,WAAW,oBAAK,CAAC,IAAI,CAAC,2GAA2G,CAAC,EAAE,CACrI,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAhBW,QAAA,wBAAwB,4BAgBnC"}
|
|
@@ -1,31 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.maybePrintSpanAttributes = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
reverseSpans
|
|
22
|
-
});
|
|
23
|
-
d.push(spanData.message);
|
|
24
|
-
return spanData.stack;
|
|
25
|
-
}
|
|
26
|
-
if (!isPlainString) {
|
|
27
|
-
d.push(`\r\n${_picocolors.default.gray('ℹ️ Consider using spans to improve errors reporting.\r\n')}`);
|
|
28
|
-
}
|
|
7
|
+
const picocolors_1 = __importDefault(require("picocolors"));
|
|
8
|
+
const format_span_attributes_js_1 = require("./format-span-attributes.js");
|
|
9
|
+
const maybePrintSpanAttributes = (d, span, isPlainString, { stripCwd, reverseSpans }) => {
|
|
10
|
+
if (span !== undefined) {
|
|
11
|
+
const spanData = (0, format_span_attributes_js_1.formatSpanAttributes)(span, {
|
|
12
|
+
stripCwd,
|
|
13
|
+
reverseSpans,
|
|
14
|
+
});
|
|
15
|
+
d.push(spanData.message);
|
|
16
|
+
return spanData.stack;
|
|
17
|
+
}
|
|
18
|
+
if (!isPlainString) {
|
|
19
|
+
d.push(`\r\n${picocolors_1.default.gray('ℹ️ Consider using spans to improve errors reporting.\r\n')}`);
|
|
20
|
+
}
|
|
29
21
|
};
|
|
30
22
|
exports.maybePrintSpanAttributes = maybePrintSpanAttributes;
|
|
31
23
|
//# sourceMappingURL=maybe-print-span-attributes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maybe-print-span-attributes.js","
|
|
1
|
+
{"version":3,"file":"maybe-print-span-attributes.js","sourceRoot":"","sources":["../../../../src/logic/pretty-printing/maybe-print-span-attributes.ts"],"names":[],"mappings":";;;;;;AACA,4DAA+B;AAI/B,2EAAmE;AAE5D,MAAM,wBAAwB,GAAG,CACtC,CAAW,EACX,IAAsB,EACtB,aAAsB,EACtB,EAAE,QAAQ,EAAE,YAAY,EAAsB,EAC9C,EAAE;IACF,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,MAAM,QAAQ,GAAG,IAAA,gDAAoB,EAAC,IAAI,EAAE;YAC1C,QAAQ;YACR,YAAY;SACb,CAAC,CAAC;QAEH,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACzB,OAAO,QAAQ,CAAC,KAAK,CAAC;IACxB,CAAC;IAED,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,CAAC,CAAC,IAAI,CACJ,OAAO,oBAAK,CAAC,IAAI,CAAC,2DAA2D,CAAC,EAAE,CACjF,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AArBW,QAAA,wBAAwB,4BAqBnC"}
|
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.maybeWarnAboutPlainStrings = void 0;
|
|
7
|
-
|
|
8
|
-
function _interopRequireDefault(e) {
|
|
9
|
-
return e && e.__esModule ? e : {
|
|
10
|
-
default: e
|
|
11
|
-
};
|
|
12
|
-
}
|
|
7
|
+
const picocolors_1 = __importDefault(require("picocolors"));
|
|
13
8
|
const maybeWarnAboutPlainStrings = (d, isPlainString) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
if (!isPlainString) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
d.push(`\r\n${picocolors_1.default.gray('ℹ️ You used a plain string to represent a failure in the error channel (E). You should consider using tagged objects (with a _tag field), or yieldable errors such as Data.TaggedError and Schema.TaggedError for better handling experience.')}`);
|
|
18
13
|
};
|
|
19
14
|
exports.maybeWarnAboutPlainStrings = maybeWarnAboutPlainStrings;
|
|
20
15
|
//# sourceMappingURL=maybe-warn-about-plain-strings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maybe-warn-about-plain-strings.js","
|
|
1
|
+
{"version":3,"file":"maybe-warn-about-plain-strings.js","sourceRoot":"","sources":["../../../../src/logic/pretty-printing/maybe-warn-about-plain-strings.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA+B;AAExB,MAAM,0BAA0B,GAAG,CACxC,CAAW,EACX,aAAsB,EACtB,EAAE;IACF,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,OAAO;IACT,CAAC;IAED,CAAC,CAAC,IAAI,CACJ,OAAO,oBAAK,CAAC,IAAI,CAAC,gPAAgP,CAAC,EAAE,CACtQ,CAAC;AACJ,CAAC,CAAC;AAXW,QAAA,0BAA0B,8BAWrC"}
|
|
@@ -1,24 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.printEffectStacktrace = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
stripCwd
|
|
16
|
-
}) => {
|
|
17
|
-
if (spanAttributesStack === undefined || spanAttributesStack.length === 0) {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
const cleanedStack = `│ ${(0, _filterStack.filterStack)(spanAttributesStack.join('\r\n│ '), 'effect', stripCwd === true)}`;
|
|
21
|
-
d.push(`\r\n${span !== undefined ? '\r\n' : ''}🚨 Spans Stacktrace\r\n${_picocolors.default.red(cleanedStack)}`);
|
|
7
|
+
const picocolors_1 = __importDefault(require("picocolors"));
|
|
8
|
+
const filter_stack_js_1 = require("../stack/filter-stack.js");
|
|
9
|
+
const printEffectStacktrace = (d, span, spanAttributesStack, { stripCwd }) => {
|
|
10
|
+
if (spanAttributesStack === undefined || spanAttributesStack.length === 0) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
const cleanedStack = `│ ${(0, filter_stack_js_1.filterStack)(spanAttributesStack.join('\r\n│ '), 'effect', stripCwd === true)}`;
|
|
14
|
+
d.push(`\r\n${span !== undefined ? '\r\n' : ''}🚨 Spans Stacktrace\r\n${picocolors_1.default.red(cleanedStack)}`);
|
|
22
15
|
};
|
|
23
16
|
exports.printEffectStacktrace = printEffectStacktrace;
|
|
24
17
|
//# sourceMappingURL=print-effect-stacktrace.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"print-effect-stacktrace.js","
|
|
1
|
+
{"version":3,"file":"print-effect-stacktrace.js","sourceRoot":"","sources":["../../../../src/logic/pretty-printing/print-effect-stacktrace.ts"],"names":[],"mappings":";;;;;;AACA,4DAA+B;AAG/B,8DAAuD;AAEhD,MAAM,qBAAqB,GAAG,CACnC,CAAW,EACX,IAAsB,EACtB,mBAAyC,EACzC,EAAE,QAAQ,EAAsB,EAChC,EAAE;IACF,IAAI,mBAAmB,KAAK,SAAS,IAAI,mBAAmB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1E,OAAO;IACT,CAAC;IAED,MAAM,YAAY,GAAG,KAAK,IAAA,6BAAW,EAAC,mBAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC,EAAE,CAAC;IAEzG,CAAC,CAAC,IAAI,CACJ,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,0BAA0B,oBAAK,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAC3F,CAAC;AACJ,CAAC,CAAC;AAfW,QAAA,qBAAqB,yBAehC"}
|
|
@@ -1,33 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getSpanAttributes = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return e && e.__esModule ? e : {
|
|
11
|
-
default: e
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
const maybePrintPipe = isLastEntry => isLastEntry ? ' ' : _picocolors.default.gray('│');
|
|
7
|
+
const picocolors_1 = __importDefault(require("picocolors"));
|
|
8
|
+
const split_spans_attributes_by_type_js_1 = require("./split-spans-attributes-by-type.js");
|
|
9
|
+
const maybePrintPipe = (isLastEntry) => isLastEntry ? ' ' : picocolors_1.default.gray('│');
|
|
15
10
|
const getSpanAttributes = (allAttributes, isLastEntry) => {
|
|
16
|
-
|
|
11
|
+
if (allAttributes.size === 0) {
|
|
12
|
+
return { formattedAttributes: '', stack: [] };
|
|
13
|
+
}
|
|
14
|
+
const { attributes, stacktrace } = (0, split_spans_attributes_by_type_js_1.splitSpansAttributesByTypes)(allAttributes);
|
|
15
|
+
const formattedAttributes = Array.from(attributes)
|
|
16
|
+
.map(([key, value]) => `${maybePrintPipe(isLastEntry)} ${picocolors_1.default.blue(key)}${picocolors_1.default.gray(':')} ${value}`)
|
|
17
|
+
.join('\r\n');
|
|
17
18
|
return {
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
formattedAttributes: `${formattedAttributes.length > 0 ? '\r\n' : ''}${formattedAttributes}`,
|
|
20
|
+
stack: stacktrace,
|
|
20
21
|
};
|
|
21
|
-
}
|
|
22
|
-
const {
|
|
23
|
-
attributes,
|
|
24
|
-
stacktrace
|
|
25
|
-
} = (0, _splitSpansAttributesByType.splitSpansAttributesByTypes)(allAttributes);
|
|
26
|
-
const formattedAttributes = Array.from(attributes).map(([key, value]) => `${maybePrintPipe(isLastEntry)} ${_picocolors.default.blue(key)}${_picocolors.default.gray(':')} ${value}`).join('\r\n');
|
|
27
|
-
return {
|
|
28
|
-
formattedAttributes: `${formattedAttributes.length > 0 ? '\r\n' : ''}${formattedAttributes}`,
|
|
29
|
-
stack: stacktrace
|
|
30
|
-
};
|
|
31
22
|
};
|
|
32
23
|
exports.getSpanAttributes = getSpanAttributes;
|
|
33
24
|
//# sourceMappingURL=get-span-attributes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-span-attributes.js","
|
|
1
|
+
{"version":3,"file":"get-span-attributes.js","sourceRoot":"","sources":["../../../../src/logic/spans/get-span-attributes.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA+B;AAE/B,2FAAkF;AAElF,MAAM,cAAc,GAAG,CAAC,WAAoB,EAAE,EAAE,CAC9C,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,oBAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/B,MAAM,iBAAiB,GAAG,CAC/B,aAA2C,EAC3C,WAAoB,EACpB,EAAE;IACF,IAAI,aAAa,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;QAC7B,OAAO,EAAE,mBAAmB,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;IAChD,CAAC;IAED,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,IAAA,+DAA2B,EAAC,aAAa,CAAC,CAAC;IAE9E,MAAM,mBAAmB,GAAG,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC;SAC/C,GAAG,CACF,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CACf,GAAG,cAAc,CAAC,WAAW,CAAC,QAAQ,oBAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,oBAAK,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,KAAe,EAAE,CAC/F;SACA,IAAI,CAAC,MAAM,CAAC,CAAC;IAEhB,OAAO;QACL,mBAAmB,EAAE,GAAG,mBAAmB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,mBAAmB,EAAE;QAC5F,KAAK,EAAE,UAAU;KAClB,CAAC;AACJ,CAAC,CAAC;AArBW,QAAA,iBAAiB,qBAqB5B"}
|
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getSpanDuration = void 0;
|
|
7
|
-
|
|
8
|
-
function _interopRequireDefault(e) {
|
|
9
|
-
return e && e.__esModule ? e : {
|
|
10
|
-
default: e
|
|
11
|
-
};
|
|
12
|
-
}
|
|
7
|
+
const picocolors_1 = __importDefault(require("picocolors"));
|
|
13
8
|
const getSpanDuration = (status, isLastEntry) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
if (status._tag !== 'Ended') {
|
|
10
|
+
return '';
|
|
11
|
+
}
|
|
12
|
+
const duration = (status.endTime - status.startTime) / BigInt(1000000);
|
|
13
|
+
return `\r\n${isLastEntry ? ' ' : picocolors_1.default.gray('│')} ~ ${duration}ms`;
|
|
19
14
|
};
|
|
20
15
|
exports.getSpanDuration = getSpanDuration;
|
|
21
16
|
//# sourceMappingURL=get-span-duration.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-span-duration.js","
|
|
1
|
+
{"version":3,"file":"get-span-duration.js","sourceRoot":"","sources":["../../../../src/logic/spans/get-span-duration.ts"],"names":[],"mappings":";;;;;;AACA,4DAA+B;AAExB,MAAM,eAAe,GAAG,CAAC,MAAkB,EAAE,WAAoB,EAAE,EAAE;IAC1E,IAAI,MAAM,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QAC5B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,QAAQ,GAAG,CAAC,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IAEvE,OAAO,OAAO,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,oBAAK,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,QAAQ,IAAI,CAAC;AAC1E,CAAC,CAAC;AARW,QAAA,eAAe,mBAQ1B"}
|
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const removeNodeModulesEntriesFromStack = stack => {
|
|
8
|
-
const lines = stack.split('\r\n');
|
|
9
|
-
return lines.filter(line => line.includes(process.cwd()) && !line.includes('/node_modules/'));
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.maybeAddErrorToSpansStack = exports.removeNodeModulesEntriesFromStack = void 0;
|
|
4
|
+
const removeNodeModulesEntriesFromStack = (stack) => {
|
|
5
|
+
const lines = stack.split('\r\n');
|
|
6
|
+
return lines.filter((line) => line.includes(process.cwd()) && !line.includes('/node_modules/'));
|
|
10
7
|
};
|
|
11
8
|
exports.removeNodeModulesEntriesFromStack = removeNodeModulesEntriesFromStack;
|
|
12
9
|
const maybeAddErrorToSpansStack = (stack, spanAttributesStack) => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
const effectStack = [];
|
|
11
|
+
if (stack && spanAttributesStack !== undefined) {
|
|
12
|
+
effectStack.push(...(0, exports.removeNodeModulesEntriesFromStack)(stack));
|
|
13
|
+
}
|
|
14
|
+
if (spanAttributesStack !== undefined) {
|
|
15
|
+
effectStack.push(...spanAttributesStack);
|
|
16
|
+
}
|
|
17
|
+
return effectStack;
|
|
21
18
|
};
|
|
22
19
|
exports.maybeAddErrorToSpansStack = maybeAddErrorToSpansStack;
|
|
23
20
|
//# sourceMappingURL=maybe-add-error-to-spans-stack.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maybe-add-error-to-spans-stack.js","
|
|
1
|
+
{"version":3,"file":"maybe-add-error-to-spans-stack.js","sourceRoot":"","sources":["../../../../src/logic/spans/maybe-add-error-to-spans-stack.ts"],"names":[],"mappings":";;;AAAO,MAAM,iCAAiC,GAAG,CAAC,KAAa,EAAE,EAAE;IACjE,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAElC,OAAO,KAAK,CAAC,MAAM,CACjB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAC3E,CAAC;AACJ,CAAC,CAAC;AANW,QAAA,iCAAiC,qCAM5C;AAEK,MAAM,yBAAyB,GAAG,CACvC,KAAyB,EACzB,mBAAyC,EACzC,EAAE;IACF,MAAM,WAAW,GAAa,EAAE,CAAC;IAEjC,IAAI,KAAK,IAAI,mBAAmB,KAAK,SAAS,EAAE,CAAC;QAC/C,WAAW,CAAC,IAAI,CAAC,GAAG,IAAA,yCAAiC,EAAC,KAAK,CAAC,CAAC,CAAC;IAChE,CAAC;IACD,IAAI,mBAAmB,KAAK,SAAS,EAAE,CAAC;QACtC,WAAW,CAAC,IAAI,CAAC,GAAG,mBAAmB,CAAC,CAAC;IAC3C,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAdW,QAAA,yBAAyB,6BAcpC"}
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.spanStackTrailingChar = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return e && e.__esModule ? e : {
|
|
10
|
-
default: e
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
const spanStackTrailingChar = isLastEntry => isLastEntry ? _picocolors.default.gray('╰') : _picocolors.default.gray('├');
|
|
7
|
+
const picocolors_1 = __importDefault(require("picocolors"));
|
|
8
|
+
const spanStackTrailingChar = (isLastEntry) => isLastEntry ? picocolors_1.default.gray('╰') : picocolors_1.default.gray('├');
|
|
14
9
|
exports.spanStackTrailingChar = spanStackTrailingChar;
|
|
15
10
|
//# sourceMappingURL=spans-stack-trailing-char.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spans-stack-trailing-char.js","
|
|
1
|
+
{"version":3,"file":"spans-stack-trailing-char.js","sourceRoot":"","sources":["../../../../src/logic/spans/spans-stack-trailing-char.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA+B;AAExB,MAAM,qBAAqB,GAAG,CAAC,WAAoB,EAAE,EAAE,CAC5D,WAAW,CAAC,CAAC,CAAC,oBAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,oBAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AADrC,QAAA,qBAAqB,yBACgB"}
|
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.splitSpansAttributesByTypes = void 0;
|
|
7
|
-
const splitSpansAttributesByTypes = attributes => Array.from(attributes.entries()).reduce((prev, [key, value]) => {
|
|
8
|
-
|
|
4
|
+
const splitSpansAttributesByTypes = (attributes) => Array.from(attributes.entries()).reduce((prev, [key, value]) => {
|
|
5
|
+
if (key === 'code.stacktrace') {
|
|
6
|
+
return {
|
|
7
|
+
attributes: prev.attributes,
|
|
8
|
+
stacktrace: [...prev.stacktrace, value],
|
|
9
|
+
};
|
|
10
|
+
}
|
|
9
11
|
return {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
attributes: new Map([...prev.attributes, [key, value]]),
|
|
13
|
+
stacktrace: prev.stacktrace,
|
|
12
14
|
};
|
|
13
|
-
}
|
|
14
|
-
return {
|
|
15
|
-
attributes: new Map([...prev.attributes, [key, value]]),
|
|
16
|
-
stacktrace: prev.stacktrace
|
|
17
|
-
};
|
|
18
15
|
}, {
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
stacktrace: [],
|
|
17
|
+
attributes: new Map(),
|
|
21
18
|
});
|
|
22
19
|
exports.splitSpansAttributesByTypes = splitSpansAttributesByTypes;
|
|
23
20
|
//# sourceMappingURL=split-spans-attributes-by-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split-spans-attributes-by-type.js","
|
|
1
|
+
{"version":3,"file":"split-spans-attributes-by-type.js","sourceRoot":"","sources":["../../../../src/logic/spans/split-spans-attributes-by-type.ts"],"names":[],"mappings":";;;AAKO,MAAM,2BAA2B,GAAG,CACzC,UAAwC,EACxC,EAAE,CACF,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM,CACrC,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;IACrB,IAAI,GAAG,KAAK,iBAAiB,EAAE,CAAC;QAC9B,OAAO;YACL,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,UAAU,EAAE,CAAC,GAAG,IAAI,CAAC,UAAU,EAAE,KAAK,CAAa;SACpD,CAAC;IACJ,CAAC;IAED,OAAO;QACL,UAAU,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;QACvD,UAAU,EAAE,IAAI,CAAC,UAAU;KAC5B,CAAC;AACJ,CAAC,EACD;IACE,UAAU,EAAE,EAAE;IACd,UAAU,EAAE,IAAI,GAAG,EAAE;CACtB,CACF,CAAC;AArBS,QAAA,2BAA2B,+BAqBpC"}
|
|
@@ -1,24 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.filterStack = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const match =
|
|
4
|
+
const effect_1 = require("effect");
|
|
5
|
+
const strip_cwd_path_js_1 = require("../strip-cwd-path.js");
|
|
6
|
+
const stack_regex_js_1 = require("./stack-regex.js");
|
|
7
|
+
const match = effect_1.Match.type().pipe(effect_1.Match.when('effect', (_) => 'at '), effect_1.Match.when('node', (_) => '│ at '), effect_1.Match.exhaustive);
|
|
11
8
|
const filterStack = (stack, type, stripCwd) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
const lines = stack.split('\r\n');
|
|
10
|
+
const out = [];
|
|
11
|
+
for (const line of lines) {
|
|
12
|
+
out.push(line.replace(/at .*effect_cutpoint.*\((.*)\)/, 'at $1'));
|
|
13
|
+
if (line.includes('effect_cutpoint')) {
|
|
14
|
+
return out.join('\r\n');
|
|
15
|
+
}
|
|
18
16
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return stripCwd ? (0, _stripCwdPath.stripCwdPath)(final) : final;
|
|
17
|
+
const final = out.join('\r\n').replace(stack_regex_js_1.stackAtRegex, match(type));
|
|
18
|
+
return stripCwd ? (0, strip_cwd_path_js_1.stripCwdPath)(final) : final;
|
|
22
19
|
};
|
|
23
20
|
exports.filterStack = filterStack;
|
|
24
21
|
//# sourceMappingURL=filter-stack.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-stack.js","
|
|
1
|
+
{"version":3,"file":"filter-stack.js","sourceRoot":"","sources":["../../../../src/logic/stack/filter-stack.ts"],"names":[],"mappings":";;;AAAA,mCAA+B;AAE/B,4DAAoD;AACpD,qDAAgD;AAEhD,MAAM,KAAK,GAAG,cAAK,CAAC,IAAI,EAAqB,CAAC,IAAI,CAChD,cAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,EAClC,cAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,EAClC,cAAK,CAAC,UAAU,CACjB,CAAC;AAEK,MAAM,WAAW,GAAG,CACzB,KAAa,EACb,IAAuB,EACvB,QAAiB,EACjB,EAAE;IACF,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAClC,MAAM,GAAG,GAAa,EAAE,CAAC;IAEzB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,gCAAgC,EAAE,OAAO,CAAC,CAAC,CAAC;QAElE,IAAI,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC;YACrC,OAAO,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;IAED,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,6BAAY,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAElE,OAAO,QAAQ,CAAC,CAAC,CAAC,IAAA,gCAAY,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAChD,CAAC,CAAC;AAnBW,QAAA,WAAW,eAmBtB"}
|