effect-errors 1.7.45 → 1.8.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 +67 -5
- package/cjs/index.js +1 -0
- package/cjs/index.js.map +1 -1
- package/cjs/logic/logger/index.js +12 -0
- package/cjs/logic/logger/index.js.map +1 -0
- package/cjs/logic/pretty-printing/captured-errors/index.js +20 -0
- package/cjs/logic/pretty-printing/captured-errors/index.js.map +1 -0
- package/cjs/logic/pretty-printing/captured-errors/maybe-advise-spans-usage.js +18 -0
- package/cjs/logic/pretty-printing/captured-errors/maybe-advise-spans-usage.js.map +1 -0
- package/cjs/logic/pretty-printing/captured-errors/maybe-print-node-stacktrace.js +34 -0
- package/cjs/logic/pretty-printing/captured-errors/maybe-print-node-stacktrace.js.map +1 -0
- package/cjs/logic/pretty-printing/captured-errors/maybe-print-spans-timeline.js +30 -0
- package/cjs/logic/pretty-printing/captured-errors/maybe-print-spans-timeline.js.map +1 -0
- package/cjs/logic/pretty-printing/captured-errors/print-effect-stacktrace.js +27 -0
- package/cjs/logic/pretty-printing/captured-errors/print-effect-stacktrace.js.map +1 -0
- package/cjs/logic/pretty-printing/common/constants/interrupted-message.js +5 -0
- package/cjs/logic/pretty-printing/common/constants/interrupted-message.js.map +1 -0
- package/cjs/logic/pretty-printing/common/constants/missing-spans-warning.js +9 -0
- package/cjs/logic/pretty-printing/common/constants/missing-spans-warning.js.map +1 -0
- package/cjs/logic/pretty-printing/{format-failures-title.js → common/format-error-title.js} +5 -5
- package/cjs/logic/pretty-printing/common/format-error-title.js.map +1 -0
- package/cjs/logic/pretty-printing/common/format-span-attributes.js +18 -0
- package/cjs/logic/pretty-printing/common/format-span-attributes.js.map +1 -0
- package/cjs/logic/pretty-printing/common/format-span-duration.js +10 -0
- package/cjs/logic/pretty-printing/common/format-span-duration.js.map +1 -0
- package/cjs/logic/pretty-printing/common/format-title.js +17 -0
- package/cjs/logic/pretty-printing/common/format-title.js.map +1 -0
- package/cjs/logic/pretty-printing/common/index.js +23 -0
- package/cjs/logic/pretty-printing/common/index.js.map +1 -0
- package/cjs/logic/pretty-printing/common/maybe-warn-about-plain-strings.js +18 -0
- package/cjs/logic/pretty-printing/common/maybe-warn-about-plain-strings.js.map +1 -0
- package/cjs/logic/pretty-printing/common/spans-stack-trailing-char.js.map +1 -0
- package/cjs/logic/pretty-printing/failures/index.js +20 -0
- package/cjs/logic/pretty-printing/failures/index.js.map +1 -0
- package/cjs/logic/pretty-printing/failures/maybe-print-node-stacktrace.js +32 -0
- package/cjs/logic/pretty-printing/failures/maybe-print-node-stacktrace.js.map +1 -0
- package/cjs/logic/pretty-printing/{print-effect-stacktrace.js → failures/print-effect-stacktrace.js} +10 -4
- package/cjs/logic/pretty-printing/failures/print-effect-stacktrace.js.map +1 -0
- package/cjs/logic/pretty-printing/failures/spans-timeline/extract-spans.js +15 -0
- package/cjs/logic/pretty-printing/failures/spans-timeline/extract-spans.js.map +1 -0
- package/cjs/logic/pretty-printing/failures/spans-timeline/format/get-span-attributes.js +18 -0
- package/cjs/logic/pretty-printing/failures/spans-timeline/format/get-span-attributes.js.map +1 -0
- package/cjs/logic/{spans → pretty-printing/failures/spans-timeline/format}/get-span-duration.js +2 -5
- package/cjs/logic/pretty-printing/failures/spans-timeline/format/get-span-duration.js.map +1 -0
- package/cjs/logic/pretty-printing/failures/spans-timeline/format/index.js +19 -0
- package/cjs/logic/pretty-printing/failures/spans-timeline/format/index.js.map +1 -0
- package/cjs/logic/pretty-printing/failures/spans-timeline/format-spans-at-timeline.js +34 -0
- package/cjs/logic/pretty-printing/failures/spans-timeline/format-spans-at-timeline.js.map +1 -0
- package/cjs/logic/pretty-printing/failures/spans-timeline/maybe-print-spans-timeline.js +23 -0
- package/cjs/logic/pretty-printing/failures/spans-timeline/maybe-print-spans-timeline.js.map +1 -0
- package/cjs/logic/pretty-printing/format-captured-error.js +26 -0
- package/cjs/logic/pretty-printing/format-captured-error.js.map +1 -0
- package/cjs/logic/pretty-printing/format-failure.js +24 -0
- package/cjs/logic/pretty-printing/format-failure.js.map +1 -0
- package/cjs/logic/pretty-printing/index.js +21 -0
- package/cjs/logic/pretty-printing/index.js.map +1 -0
- package/cjs/pretty-print-from-captured-errors.js +15 -0
- package/cjs/pretty-print-from-captured-errors.js.map +1 -0
- package/cjs/pretty-print.js +5 -26
- package/cjs/pretty-print.js.map +1 -1
- package/cjs/source-maps/get-error-related-sources.js +3 -2
- package/cjs/source-maps/get-error-related-sources.js.map +1 -1
- package/cjs/source-maps/get-sources-from-map-file.js +3 -1
- package/cjs/source-maps/get-sources-from-map-file.js.map +1 -1
- package/cjs/source-maps/get-sources-from-span.js +1 -1
- package/cjs/source-maps/get-sources-from-span.js.map +1 -1
- package/cjs/source-maps/get-sources-from-stack.js +1 -1
- package/cjs/source-maps/get-sources-from-stack.js.map +1 -1
- package/cjs/source-maps/maybe-map-sourcemaps.js +2 -2
- package/cjs/source-maps/maybe-map-sourcemaps.js.map +1 -1
- package/cjs/types/pretty-print-options.type.js +1 -0
- package/cjs/types/pretty-print-options.type.js.map +1 -1
- package/dts/index.d.ts +1 -0
- package/dts/logic/logger/index.d.ts +10 -0
- package/dts/logic/pretty-printing/captured-errors/index.d.ts +3 -0
- package/dts/logic/pretty-printing/captured-errors/maybe-advise-spans-usage.d.ts +2 -0
- package/dts/logic/pretty-printing/captured-errors/maybe-print-node-stacktrace.d.ts +2 -0
- package/dts/logic/pretty-printing/captured-errors/maybe-print-spans-timeline.d.ts +2 -0
- package/dts/logic/pretty-printing/captured-errors/print-effect-stacktrace.d.ts +2 -0
- package/dts/logic/pretty-printing/common/constants/interrupted-message.d.ts +1 -0
- package/dts/logic/pretty-printing/common/constants/missing-spans-warning.d.ts +1 -0
- package/dts/logic/pretty-printing/common/format-error-title.d.ts +1 -0
- package/dts/logic/pretty-printing/common/format-span-attributes.d.ts +1 -0
- package/dts/logic/pretty-printing/common/format-span-duration.d.ts +1 -0
- package/dts/logic/pretty-printing/common/format-title.d.ts +1 -0
- package/dts/logic/pretty-printing/common/index.d.ts +6 -0
- package/dts/logic/pretty-printing/common/maybe-warn-about-plain-strings.d.ts +1 -0
- package/dts/logic/pretty-printing/failures/index.d.ts +3 -0
- package/dts/logic/pretty-printing/failures/maybe-print-node-stacktrace.d.ts +2 -0
- package/dts/logic/pretty-printing/failures/print-effect-stacktrace.d.ts +2 -0
- package/dts/logic/pretty-printing/failures/spans-timeline/extract-spans.d.ts +2 -0
- package/dts/logic/{spans → pretty-printing/failures/spans-timeline/format}/get-span-attributes.d.ts +1 -1
- package/dts/logic/pretty-printing/failures/spans-timeline/format/index.d.ts +2 -0
- package/dts/logic/pretty-printing/failures/spans-timeline/format-spans-at-timeline.d.ts +8 -0
- package/dts/logic/pretty-printing/failures/spans-timeline/maybe-print-spans-timeline.d.ts +8 -0
- package/dts/logic/pretty-printing/format-captured-error.d.ts +3 -0
- package/dts/logic/pretty-printing/format-failure.d.ts +3 -0
- package/dts/logic/pretty-printing/index.d.ts +4 -0
- package/dts/pretty-print-from-captured-errors.d.ts +3 -0
- package/dts/source-maps/get-error-related-sources.d.ts +1 -1
- package/dts/source-maps/get-sources-from-map-file.d.ts +3 -1
- package/dts/source-maps/maybe-map-sourcemaps.d.ts +1 -1
- package/dts/source-maps/transform-raw-error.d.ts +2 -0
- package/dts/types/pretty-print-options.type.d.ts +1 -0
- package/esm/index.js +1 -0
- package/esm/index.js.map +1 -1
- package/esm/logic/logger/index.js +8 -0
- package/esm/logic/logger/index.js.map +1 -0
- package/esm/logic/pretty-printing/captured-errors/index.js +4 -0
- package/esm/logic/pretty-printing/captured-errors/index.js.map +1 -0
- package/esm/logic/pretty-printing/captured-errors/maybe-advise-spans-usage.js +11 -0
- package/esm/logic/pretty-printing/captured-errors/maybe-advise-spans-usage.js.map +1 -0
- package/esm/logic/pretty-printing/captured-errors/maybe-print-node-stacktrace.js +27 -0
- package/esm/logic/pretty-printing/captured-errors/maybe-print-node-stacktrace.js.map +1 -0
- package/esm/logic/pretty-printing/captured-errors/maybe-print-spans-timeline.js +23 -0
- package/esm/logic/pretty-printing/captured-errors/maybe-print-spans-timeline.js.map +1 -0
- package/esm/logic/pretty-printing/captured-errors/print-effect-stacktrace.js +20 -0
- package/esm/logic/pretty-printing/captured-errors/print-effect-stacktrace.js.map +1 -0
- package/esm/logic/pretty-printing/common/constants/interrupted-message.js +2 -0
- package/esm/logic/pretty-printing/common/constants/interrupted-message.js.map +1 -0
- package/esm/logic/pretty-printing/common/constants/missing-spans-warning.js +3 -0
- package/esm/logic/pretty-printing/common/constants/missing-spans-warning.js.map +1 -0
- package/esm/logic/pretty-printing/{format-failures-title.js → common/format-error-title.js} +3 -3
- package/esm/logic/pretty-printing/common/format-error-title.js.map +1 -0
- package/esm/logic/pretty-printing/common/format-span-attributes.js +11 -0
- package/esm/logic/pretty-printing/common/format-span-attributes.js.map +1 -0
- package/esm/logic/pretty-printing/common/format-span-duration.js +3 -0
- package/esm/logic/pretty-printing/common/format-span-duration.js.map +1 -0
- package/esm/logic/pretty-printing/common/format-title.js +10 -0
- package/esm/logic/pretty-printing/common/format-title.js.map +1 -0
- package/esm/logic/pretty-printing/common/index.js +7 -0
- package/esm/logic/pretty-printing/common/index.js.map +1 -0
- package/esm/logic/pretty-printing/common/maybe-warn-about-plain-strings.js +11 -0
- package/esm/logic/pretty-printing/common/maybe-warn-about-plain-strings.js.map +1 -0
- package/esm/logic/pretty-printing/common/spans-stack-trailing-char.js.map +1 -0
- package/esm/logic/pretty-printing/failures/index.js +4 -0
- package/esm/logic/pretty-printing/failures/index.js.map +1 -0
- package/esm/logic/pretty-printing/failures/maybe-print-node-stacktrace.js +25 -0
- package/esm/logic/pretty-printing/failures/maybe-print-node-stacktrace.js.map +1 -0
- package/esm/logic/pretty-printing/failures/print-effect-stacktrace.js +16 -0
- package/esm/logic/pretty-printing/failures/print-effect-stacktrace.js.map +1 -0
- package/esm/logic/pretty-printing/failures/spans-timeline/extract-spans.js +11 -0
- package/esm/logic/pretty-printing/failures/spans-timeline/extract-spans.js.map +1 -0
- package/esm/logic/pretty-printing/failures/spans-timeline/format/get-span-attributes.js +14 -0
- package/esm/logic/pretty-printing/failures/spans-timeline/format/get-span-attributes.js.map +1 -0
- package/esm/logic/{spans → pretty-printing/failures/spans-timeline/format}/get-span-duration.js +2 -2
- package/esm/logic/pretty-printing/failures/spans-timeline/format/get-span-duration.js.map +1 -0
- package/esm/logic/pretty-printing/failures/spans-timeline/format/index.js +3 -0
- package/esm/logic/pretty-printing/failures/spans-timeline/format/index.js.map +1 -0
- package/esm/logic/pretty-printing/failures/spans-timeline/format-spans-at-timeline.js +27 -0
- package/esm/logic/pretty-printing/failures/spans-timeline/format-spans-at-timeline.js.map +1 -0
- package/esm/logic/pretty-printing/failures/spans-timeline/maybe-print-spans-timeline.js +19 -0
- package/esm/logic/pretty-printing/failures/spans-timeline/maybe-print-spans-timeline.js.map +1 -0
- package/esm/logic/pretty-printing/format-captured-error.js +22 -0
- package/esm/logic/pretty-printing/format-captured-error.js.map +1 -0
- package/esm/logic/pretty-printing/format-failure.js +20 -0
- package/esm/logic/pretty-printing/format-failure.js.map +1 -0
- package/esm/logic/pretty-printing/index.js +5 -0
- package/esm/logic/pretty-printing/index.js.map +1 -0
- package/esm/pretty-print-from-captured-errors.js +11 -0
- package/esm/pretty-print-from-captured-errors.js.map +1 -0
- package/esm/pretty-print.js +5 -23
- package/esm/pretty-print.js.map +1 -1
- package/esm/source-maps/get-error-related-sources.js +3 -2
- package/esm/source-maps/get-error-related-sources.js.map +1 -1
- package/esm/source-maps/get-sources-from-map-file.js +3 -1
- package/esm/source-maps/get-sources-from-map-file.js.map +1 -1
- package/esm/source-maps/get-sources-from-span.js +1 -1
- package/esm/source-maps/get-sources-from-span.js.map +1 -1
- package/esm/source-maps/get-sources-from-stack.js +1 -1
- package/esm/source-maps/get-sources-from-stack.js.map +1 -1
- package/esm/source-maps/maybe-map-sourcemaps.js +2 -2
- package/esm/source-maps/maybe-map-sourcemaps.js.map +1 -1
- package/esm/types/pretty-print-options.type.js +1 -0
- package/esm/types/pretty-print-options.type.js.map +1 -1
- package/package.json +8 -7
- package/cjs/logic/pretty-printing/format-failures-title.js.map +0 -1
- package/cjs/logic/pretty-printing/format-span-attributes.js +0 -43
- package/cjs/logic/pretty-printing/format-span-attributes.js.map +0 -1
- package/cjs/logic/pretty-printing/maybe-print-node-stacktrace.js +0 -18
- package/cjs/logic/pretty-printing/maybe-print-node-stacktrace.js.map +0 -1
- package/cjs/logic/pretty-printing/maybe-print-span-attributes.js +0 -23
- package/cjs/logic/pretty-printing/maybe-print-span-attributes.js.map +0 -1
- package/cjs/logic/pretty-printing/maybe-warn-about-plain-strings.js +0 -15
- package/cjs/logic/pretty-printing/maybe-warn-about-plain-strings.js.map +0 -1
- package/cjs/logic/pretty-printing/print-effect-stacktrace.js.map +0 -1
- package/cjs/logic/spans/get-span-attributes.js +0 -24
- package/cjs/logic/spans/get-span-attributes.js.map +0 -1
- package/cjs/logic/spans/get-span-duration.js.map +0 -1
- package/cjs/logic/spans/spans-stack-trailing-char.js.map +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 -6
- package/dts/logic/pretty-printing/maybe-print-node-stacktrace.d.ts +0 -3
- package/dts/logic/pretty-printing/maybe-print-span-attributes.d.ts +0 -3
- 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 -3
- package/esm/logic/pretty-printing/format-failures-title.js.map +0 -1
- package/esm/logic/pretty-printing/format-span-attributes.js +0 -36
- package/esm/logic/pretty-printing/format-span-attributes.js.map +0 -1
- package/esm/logic/pretty-printing/maybe-print-node-stacktrace.js +0 -11
- package/esm/logic/pretty-printing/maybe-print-node-stacktrace.js.map +0 -1
- package/esm/logic/pretty-printing/maybe-print-span-attributes.js +0 -16
- package/esm/logic/pretty-printing/maybe-print-span-attributes.js.map +0 -1
- package/esm/logic/pretty-printing/maybe-warn-about-plain-strings.js +0 -8
- package/esm/logic/pretty-printing/maybe-warn-about-plain-strings.js.map +0 -1
- package/esm/logic/pretty-printing/print-effect-stacktrace.js +0 -10
- package/esm/logic/pretty-printing/print-effect-stacktrace.js.map +0 -1
- package/esm/logic/spans/get-span-attributes.js +0 -17
- package/esm/logic/spans/get-span-attributes.js.map +0 -1
- package/esm/logic/spans/get-span-duration.js.map +0 -1
- package/esm/logic/spans/spans-stack-trailing-char.js.map +0 -1
- /package/cjs/logic/{spans → pretty-printing/common}/spans-stack-trailing-char.js +0 -0
- /package/dts/logic/{spans → pretty-printing/common}/spans-stack-trailing-char.d.ts +0 -0
- /package/dts/logic/{spans → pretty-printing/failures/spans-timeline/format}/get-span-duration.d.ts +0 -0
- /package/esm/logic/{spans → pretty-printing/common}/spans-stack-trailing-char.js +0 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSpanAttributes = void 0;
|
|
4
|
+
const split_spans_attributes_by_type_js_1 = require("../../../../spans/split-spans-attributes-by-type.js");
|
|
5
|
+
const index_js_1 = require("../../../common/index.js");
|
|
6
|
+
const getSpanAttributes = (allAttributes, isLastEntry) => {
|
|
7
|
+
if (allAttributes.size === 0) {
|
|
8
|
+
return { formattedAttributes: '', stack: [] };
|
|
9
|
+
}
|
|
10
|
+
const { attributes, stacktrace } = (0, split_spans_attributes_by_type_js_1.splitSpansAttributesByTypes)(allAttributes);
|
|
11
|
+
const formattedAttributes = (0, index_js_1.formatSpanAttributes)(Object.fromEntries(attributes), isLastEntry);
|
|
12
|
+
return {
|
|
13
|
+
formattedAttributes,
|
|
14
|
+
stack: stacktrace,
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
exports.getSpanAttributes = getSpanAttributes;
|
|
18
|
+
//# sourceMappingURL=get-span-attributes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-span-attributes.js","sourceRoot":"","sources":["../../../../../../../src/logic/pretty-printing/failures/spans-timeline/format/get-span-attributes.ts"],"names":[],"mappings":";;;AAAA,2GAAkG;AAClG,uDAAgE;AAEzD,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,IAAA,+BAAoB,EAC9C,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,EAC9B,WAAW,CACZ,CAAC;IAEF,OAAO;QACL,mBAAmB;QACnB,KAAK,EAAE,UAAU;KAClB,CAAC;AACJ,CAAC,CAAC;AAnBW,QAAA,iBAAiB,qBAmB5B"}
|
package/cjs/logic/{spans → pretty-printing/failures/spans-timeline/format}/get-span-duration.js
RENAMED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.getSpanDuration = void 0;
|
|
7
|
-
const
|
|
4
|
+
const index_js_1 = require("../../../common/index.js");
|
|
8
5
|
const getSpanDuration = (status, isLastEntry) => {
|
|
9
6
|
if (status._tag !== 'Ended') {
|
|
10
7
|
return '';
|
|
11
8
|
}
|
|
12
9
|
const duration = (status.endTime - status.startTime) / BigInt(1000000);
|
|
13
|
-
return
|
|
10
|
+
return (0, index_js_1.formatSpanDuration)(duration, isLastEntry);
|
|
14
11
|
};
|
|
15
12
|
exports.getSpanDuration = getSpanDuration;
|
|
16
13
|
//# sourceMappingURL=get-span-duration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-span-duration.js","sourceRoot":"","sources":["../../../../../../../src/logic/pretty-printing/failures/spans-timeline/format/get-span-duration.ts"],"names":[],"mappings":";;;AAEA,uDAA8D;AAEvD,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,IAAA,6BAAkB,EAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;AACnD,CAAC,CAAC;AARW,QAAA,eAAe,mBAQ1B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./get-span-attributes.js"), exports);
|
|
18
|
+
__exportStar(require("./get-span-duration.js"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/logic/pretty-printing/failures/spans-timeline/format/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AACzC,yDAAuC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
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
|
+
exports.formatSpansAsTimeline = void 0;
|
|
7
|
+
const picocolors_1 = __importDefault(require("picocolors"));
|
|
8
|
+
const strip_cwd_path_js_1 = require("../../../strip-cwd-path.js");
|
|
9
|
+
const index_js_1 = require("../../common/index.js");
|
|
10
|
+
const extract_spans_js_1 = require("./extract-spans.js");
|
|
11
|
+
const index_js_2 = require("./format/index.js");
|
|
12
|
+
const formatSpansAsTimeline = (span, { stripCwd, reverseSpans }) => {
|
|
13
|
+
const spans = (0, extract_spans_js_1.extractSpans)(span);
|
|
14
|
+
const orderedSpans = reverseSpans === true ? spans.toReversed() : spans;
|
|
15
|
+
return orderedSpans.reduce((output, { name, status, attributes }, index) => {
|
|
16
|
+
const isFirstEntry = index === 0;
|
|
17
|
+
const isLastEntry = index === spans.length - 1;
|
|
18
|
+
const { formattedAttributes, stack } = (0, index_js_2.getSpanAttributes)(attributes, isLastEntry);
|
|
19
|
+
const maybeCircle = isFirstEntry ? `\r\n${picocolors_1.default.gray('◯')}` : '';
|
|
20
|
+
const trailing = (0, index_js_1.spanStackTrailingChar)(isLastEntry);
|
|
21
|
+
const filePath = ` ${stripCwd !== undefined ? picocolors_1.default.underline(picocolors_1.default.bold((0, strip_cwd_path_js_1.stripCwdPath)(name))) : picocolors_1.default.underline(name)}`;
|
|
22
|
+
const duration = picocolors_1.default.gray((0, index_js_2.getSpanDuration)(status, isLastEntry));
|
|
23
|
+
const message = `${maybeCircle}\r\n${trailing}${picocolors_1.default.gray('─')}${filePath}${duration}${formattedAttributes}`;
|
|
24
|
+
return {
|
|
25
|
+
message: `${output.message}${message}`,
|
|
26
|
+
stack: [...output.stack, ...stack],
|
|
27
|
+
};
|
|
28
|
+
}, {
|
|
29
|
+
message: '',
|
|
30
|
+
stack: [],
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
exports.formatSpansAsTimeline = formatSpansAsTimeline;
|
|
34
|
+
//# sourceMappingURL=format-spans-at-timeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-spans-at-timeline.js","sourceRoot":"","sources":["../../../../../../src/logic/pretty-printing/failures/spans-timeline/format-spans-at-timeline.ts"],"names":[],"mappings":";;;;;;AACA,4DAA+B;AAG/B,kEAA0D;AAC1D,oDAA8D;AAC9D,yDAAkD;AAClD,gDAAuE;AAOhE,MAAM,qBAAqB,GAAG,CACnC,IAAsB,EACtB,EAAE,QAAQ,EAAE,YAAY,EAAsB,EAC7B,EAAE;IACnB,MAAM,KAAK,GAAG,IAAA,+BAAY,EAAC,IAAI,CAAC,CAAC;IAEjC,MAAM,YAAY,GAAG,YAAY,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;IACxE,OAAO,YAAY,CAAC,MAAM,CACxB,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,EAAE;QAC9C,MAAM,YAAY,GAAG,KAAK,KAAK,CAAC,CAAC;QACjC,MAAM,WAAW,GAAG,KAAK,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;QAE/C,MAAM,EAAE,mBAAmB,EAAE,KAAK,EAAE,GAAG,IAAA,4BAAiB,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;QACjE,MAAM,QAAQ,GAAG,IAAA,gCAAqB,EAAC,WAAW,CAAC,CAAC;QACpD,MAAM,QAAQ,GAAG,IAAI,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,oBAAK,CAAC,SAAS,CAAC,oBAAK,CAAC,IAAI,CAAC,IAAA,gCAAY,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,oBAAK,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;QACxH,MAAM,QAAQ,GAAG,oBAAK,CAAC,IAAI,CAAC,IAAA,0BAAe,EAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;QAElE,MAAM,OAAO,GAAG,GAAG,WAAW,OAAO,QAAQ,GAAG,oBAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,GAAG,QAAQ,GAAG,mBAAmB,EAAE,CAAC;QAE9G,OAAO;YACL,OAAO,EAAE,GAAG,MAAM,CAAC,OAAO,GAAG,OAAO,EAAE;YACtC,KAAK,EAAE,CAAC,GAAG,MAAM,CAAC,KAAK,EAAE,GAAG,KAAK,CAAC;SACnC,CAAC;IACJ,CAAC,EACD;QACE,OAAO,EAAE,EAAE;QACX,KAAK,EAAE,EAAE;KACV,CACF,CAAC;AACJ,CAAC,CAAC;AAlCW,QAAA,qBAAqB,yBAkChC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.maybePrintSpansTimeline = void 0;
|
|
4
|
+
const index_js_1 = require("../../common/index.js");
|
|
5
|
+
const format_spans_at_timeline_js_1 = require("./format-spans-at-timeline.js");
|
|
6
|
+
const maybePrintSpansTimeline = (span, isPlainString, { stripCwd, reverseSpans }) => {
|
|
7
|
+
if (span === undefined) {
|
|
8
|
+
return {
|
|
9
|
+
spanAttributesStack: undefined,
|
|
10
|
+
spansTimeline: isPlainString === false ? [index_js_1.missingSpansWarning] : [],
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
const { stack, message } = (0, format_spans_at_timeline_js_1.formatSpansAsTimeline)(span, {
|
|
14
|
+
stripCwd,
|
|
15
|
+
reverseSpans,
|
|
16
|
+
});
|
|
17
|
+
return {
|
|
18
|
+
spanAttributesStack: stack,
|
|
19
|
+
spansTimeline: [message],
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
exports.maybePrintSpansTimeline = maybePrintSpansTimeline;
|
|
23
|
+
//# sourceMappingURL=maybe-print-spans-timeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maybe-print-spans-timeline.js","sourceRoot":"","sources":["../../../../../../src/logic/pretty-printing/failures/spans-timeline/maybe-print-spans-timeline.ts"],"names":[],"mappings":";;;AAGA,oDAA4D;AAC5D,+EAAsE;AAO/D,MAAM,uBAAuB,GAAG,CACrC,IAAsB,EACtB,aAAsB,EACtB,EAAE,QAAQ,EAAE,YAAY,EAAsB,EACf,EAAE;IACjC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO;YACL,mBAAmB,EAAE,SAAS;YAC9B,aAAa,EAAE,aAAa,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,8BAAmB,CAAC,CAAC,CAAC,CAAC,EAAE;SACpE,CAAC;IACJ,CAAC;IAED,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,IAAA,mDAAqB,EAAC,IAAI,EAAE;QACrD,QAAQ;QACR,YAAY;KACb,CAAC,CAAC;IAEH,OAAO;QACL,mBAAmB,EAAE,KAAK;QAC1B,aAAa,EAAE,CAAC,OAAO,CAAC;KACzB,CAAC;AACJ,CAAC,CAAC;AArBW,QAAA,uBAAuB,2BAqBlC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatCapturedError = void 0;
|
|
4
|
+
const index_js_1 = require("./captured-errors/index.js");
|
|
5
|
+
const maybe_advise_spans_usage_js_1 = require("./captured-errors/maybe-advise-spans-usage.js");
|
|
6
|
+
const index_js_2 = require("./common/index.js");
|
|
7
|
+
const formatCapturedError = (failuresCount, options) => ({ errorType, message, stack, spans, sources, isPlainString }, index) => {
|
|
8
|
+
const title = (0, index_js_2.formatErrorTitle)(errorType, message, failuresCount, index);
|
|
9
|
+
const plainStringWarning = (0, index_js_2.maybeWarnAboutPlainStrings)(isPlainString);
|
|
10
|
+
const spansTimeline = (0, index_js_1.maybePrintSpansTimeline)(spans, isPlainString, options);
|
|
11
|
+
const spansUsageAdvice = (0, maybe_advise_spans_usage_js_1.maybeAdviseSpansUsage)(spans);
|
|
12
|
+
const effectStacktrace = (0, index_js_1.printEffectStacktrace)(sources, spans, options);
|
|
13
|
+
const nodeStacktrace = (0, index_js_1.maybePrintNodeStacktrace)(stack, isPlainString, options);
|
|
14
|
+
return [
|
|
15
|
+
...title,
|
|
16
|
+
...plainStringWarning,
|
|
17
|
+
...spansTimeline,
|
|
18
|
+
...spansUsageAdvice,
|
|
19
|
+
'',
|
|
20
|
+
...effectStacktrace,
|
|
21
|
+
...nodeStacktrace,
|
|
22
|
+
'',
|
|
23
|
+
].join('\r\n');
|
|
24
|
+
};
|
|
25
|
+
exports.formatCapturedError = formatCapturedError;
|
|
26
|
+
//# sourceMappingURL=format-captured-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-captured-error.js","sourceRoot":"","sources":["../../../../src/logic/pretty-printing/format-captured-error.ts"],"names":[],"mappings":";;;AAEA,yDAIoC;AACpC,+FAAsF;AACtF,gDAG2B;AAEpB,MAAM,mBAAmB,GAC9B,CAAC,aAAqB,EAAE,OAA2B,EAAE,EAAE,CACvD,CACE,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAa,EACvE,KAAa,EACb,EAAE;IACF,MAAM,KAAK,GAAG,IAAA,2BAAgB,EAAC,SAAS,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC;IACzE,MAAM,kBAAkB,GAAG,IAAA,qCAA0B,EAAC,aAAa,CAAC,CAAC;IACrE,MAAM,aAAa,GAAG,IAAA,kCAAuB,EAC3C,KAAK,EACL,aAAa,EACb,OAAO,CACR,CAAC;IACF,MAAM,gBAAgB,GAAG,IAAA,mDAAqB,EAAC,KAAK,CAAC,CAAC;IAEtD,MAAM,gBAAgB,GAAG,IAAA,gCAAqB,EAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACxE,MAAM,cAAc,GAAG,IAAA,mCAAwB,EAC7C,KAAK,EACL,aAAa,EACb,OAAO,CACR,CAAC;IAEF,OAAO;QACL,GAAG,KAAK;QACR,GAAG,kBAAkB;QACrB,GAAG,aAAa;QAChB,GAAG,gBAAgB;QACnB,EAAE;QACF,GAAG,gBAAgB;QACnB,GAAG,cAAc;QACjB,EAAE;KACH,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACjB,CAAC,CAAC;AAhCS,QAAA,mBAAmB,uBAgC5B"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatFailure = void 0;
|
|
4
|
+
const maybe_add_error_to_spans_stack_js_1 = require("../spans/maybe-add-error-to-spans-stack.js");
|
|
5
|
+
const index_js_1 = require("./common/index.js");
|
|
6
|
+
const index_js_2 = require("./failures/index.js");
|
|
7
|
+
const formatFailure = (failuresCount, options) => ({ errorType, message, stack, span, isPlainString }, index) => {
|
|
8
|
+
const title = (0, index_js_1.formatErrorTitle)(errorType, message, failuresCount, index);
|
|
9
|
+
const plainStringWarning = (0, index_js_1.maybeWarnAboutPlainStrings)(isPlainString);
|
|
10
|
+
const { spanAttributesStack, spansTimeline } = (0, index_js_2.maybePrintSpansTimeline)(span, isPlainString, options);
|
|
11
|
+
const effectStack = (0, maybe_add_error_to_spans_stack_js_1.maybeAddErrorToSpansStack)(stack, spanAttributesStack);
|
|
12
|
+
const effectStacktrace = (0, index_js_2.printEffectStacktrace)(effectStack, options);
|
|
13
|
+
const nodeStacktrace = (0, index_js_2.maybePrintNodeStacktrace)(stack, isPlainString, options);
|
|
14
|
+
return [
|
|
15
|
+
...title,
|
|
16
|
+
...plainStringWarning,
|
|
17
|
+
...spansTimeline,
|
|
18
|
+
...effectStacktrace,
|
|
19
|
+
...nodeStacktrace,
|
|
20
|
+
'',
|
|
21
|
+
].join('\r\n');
|
|
22
|
+
};
|
|
23
|
+
exports.formatFailure = formatFailure;
|
|
24
|
+
//# sourceMappingURL=format-failure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-failure.js","sourceRoot":"","sources":["../../../../src/logic/pretty-printing/format-failure.ts"],"names":[],"mappings":";;;AAEA,kGAAuF;AACvF,gDAG2B;AAC3B,kDAI6B;AAEtB,MAAM,aAAa,GACxB,CAAC,aAAqB,EAAE,OAA2B,EAAE,EAAE,CACvD,CACE,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,EAAe,EAC/D,KAAa,EACb,EAAE;IACF,MAAM,KAAK,GAAG,IAAA,2BAAgB,EAAC,SAAS,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC;IACzE,MAAM,kBAAkB,GAAG,IAAA,qCAA0B,EAAC,aAAa,CAAC,CAAC;IACrE,MAAM,EAAE,mBAAmB,EAAE,aAAa,EAAE,GAAG,IAAA,kCAAuB,EACpE,IAAI,EACJ,aAAa,EACb,OAAO,CACR,CAAC;IACF,MAAM,WAAW,GAAG,IAAA,6DAAyB,EAAC,KAAK,EAAE,mBAAmB,CAAC,CAAC;IAE1E,MAAM,gBAAgB,GAAG,IAAA,gCAAqB,EAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACrE,MAAM,cAAc,GAAG,IAAA,mCAAwB,EAC7C,KAAK,EACL,aAAa,EACb,OAAO,CACR,CAAC;IAEF,OAAO;QACL,GAAG,KAAK;QACR,GAAG,kBAAkB;QACrB,GAAG,aAAa;QAChB,GAAG,gBAAgB;QACnB,GAAG,cAAc;QACjB,EAAE;KACH,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACjB,CAAC,CAAC;AA9BS,QAAA,aAAa,iBA8BtB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./format-failure.js"), exports);
|
|
18
|
+
__exportStar(require("./format-captured-error.js"), exports);
|
|
19
|
+
__exportStar(require("./common/format-title.js"), exports);
|
|
20
|
+
__exportStar(require("./common/constants/interrupted-message.js"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/logic/pretty-printing/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,6DAA2C;AAC3C,2DAAyC;AACzC,4EAA0D"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.prettyPrintFromCapturedErrors = void 0;
|
|
4
|
+
const index_js_1 = require("./logic/pretty-printing/index.js");
|
|
5
|
+
const pretty_print_options_type_js_1 = require("./types/pretty-print-options.type.js");
|
|
6
|
+
const prettyPrintFromCapturedErrors = ({ errors, interrupted }, options = pretty_print_options_type_js_1.prettyPrintOptionsDefault) => {
|
|
7
|
+
if (interrupted) {
|
|
8
|
+
return index_js_1.interruptedMessage;
|
|
9
|
+
}
|
|
10
|
+
const title = (0, index_js_1.formatTitle)(errors.length);
|
|
11
|
+
const formattedFailures = errors.map((0, index_js_1.formatCapturedError)(errors.length, options));
|
|
12
|
+
return [...title, ...formattedFailures].join('\r\n');
|
|
13
|
+
};
|
|
14
|
+
exports.prettyPrintFromCapturedErrors = prettyPrintFromCapturedErrors;
|
|
15
|
+
//# sourceMappingURL=pretty-print-from-captured-errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pretty-print-from-captured-errors.js","sourceRoot":"","sources":["../../src/pretty-print-from-captured-errors.ts"],"names":[],"mappings":";;;AACA,+DAI0C;AAC1C,uFAG8C;AAEvC,MAAM,6BAA6B,GAAG,CAC3C,EAAE,MAAM,EAAE,WAAW,EAAkB,EACvC,UAA8B,wDAAyB,EACvD,EAAE;IACF,IAAI,WAAW,EAAE,CAAC;QAChB,OAAO,6BAAkB,CAAC;IAC5B,CAAC;IAED,MAAM,KAAK,GAAG,IAAA,sBAAW,EAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACzC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAClC,IAAA,8BAAmB,EAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAC5C,CAAC;IAEF,OAAO,CAAC,GAAG,KAAK,EAAE,GAAG,iBAAiB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACvD,CAAC,CAAC;AAdW,QAAA,6BAA6B,iCAcxC"}
|
package/cjs/pretty-print.js
CHANGED
|
@@ -1,39 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.prettyPrint = void 0;
|
|
7
4
|
const Cause_1 = require("effect/Cause");
|
|
8
|
-
const picocolors_1 = __importDefault(require("picocolors"));
|
|
9
5
|
const capture_errors_from_cause_js_1 = require("./logic/errors/capture-errors-from-cause.js");
|
|
10
|
-
const
|
|
11
|
-
const maybe_print_node_stacktrace_js_1 = require("./logic/pretty-printing/maybe-print-node-stacktrace.js");
|
|
12
|
-
const maybe_print_span_attributes_js_1 = require("./logic/pretty-printing/maybe-print-span-attributes.js");
|
|
13
|
-
const maybe_warn_about_plain_strings_js_1 = require("./logic/pretty-printing/maybe-warn-about-plain-strings.js");
|
|
14
|
-
const print_effect_stacktrace_js_1 = require("./logic/pretty-printing/print-effect-stacktrace.js");
|
|
15
|
-
const maybe_add_error_to_spans_stack_js_1 = require("./logic/spans/maybe-add-error-to-spans-stack.js");
|
|
6
|
+
const index_js_1 = require("./logic/pretty-printing/index.js");
|
|
16
7
|
const pretty_print_options_type_js_1 = require("./types/pretty-print-options.type.js");
|
|
17
8
|
const prettyPrint = (cause, options = pretty_print_options_type_js_1.prettyPrintOptionsDefault) => {
|
|
18
9
|
if ((0, Cause_1.isInterruptedOnly)(cause)) {
|
|
19
|
-
return
|
|
10
|
+
return index_js_1.interruptedMessage;
|
|
20
11
|
}
|
|
21
12
|
const failures = (0, capture_errors_from_cause_js_1.captureErrorsFrom)(cause);
|
|
22
|
-
const title =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
.map(({ errorType, message: errorMessage, stack, span, isPlainString }, failureIndex) => {
|
|
26
|
-
const d = [
|
|
27
|
-
(0, format_failures_title_js_1.formatFailuresTitle)(errorType, errorMessage, failures.length, failureIndex),
|
|
28
|
-
];
|
|
29
|
-
(0, maybe_warn_about_plain_strings_js_1.maybeWarnAboutPlainStrings)(d, isPlainString);
|
|
30
|
-
const spanAttributesStack = (0, maybe_print_span_attributes_js_1.maybePrintSpanAttributes)(d, span, isPlainString, options);
|
|
31
|
-
const effectStack = (0, maybe_add_error_to_spans_stack_js_1.maybeAddErrorToSpansStack)(stack, spanAttributesStack);
|
|
32
|
-
(0, print_effect_stacktrace_js_1.printEffectStacktrace)(d, span, effectStack, options);
|
|
33
|
-
(0, maybe_print_node_stacktrace_js_1.maybePrintNodeStacktrace)(d, span, stack, isPlainString, options);
|
|
34
|
-
return [...d, '\r\n'].join('');
|
|
35
|
-
})
|
|
36
|
-
.join('\r\n'));
|
|
13
|
+
const title = (0, index_js_1.formatTitle)(failures.length);
|
|
14
|
+
const formattedFailures = failures.map((0, index_js_1.formatFailure)(failures.length, options));
|
|
15
|
+
return [...title, ...formattedFailures].join('\r\n');
|
|
37
16
|
};
|
|
38
17
|
exports.prettyPrint = prettyPrint;
|
|
39
18
|
//# sourceMappingURL=pretty-print.js.map
|
package/cjs/pretty-print.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pretty-print.js","sourceRoot":"","sources":["../../src/pretty-print.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pretty-print.js","sourceRoot":"","sources":["../../src/pretty-print.ts"],"names":[],"mappings":";;;AAAA,wCAA6D;AAE7D,8FAAgF;AAChF,+DAI0C;AAC1C,uFAG8C;AAEvC,MAAM,WAAW,GAAG,CACzB,KAAe,EACf,UAA8B,wDAAyB,EAC/C,EAAE;IACV,IAAI,IAAA,yBAAiB,EAAC,KAAK,CAAC,EAAE,CAAC;QAC7B,OAAO,6BAAkB,CAAC;IAC5B,CAAC;IAED,MAAM,QAAQ,GAAG,IAAA,gDAAiB,EAAI,KAAK,CAAC,CAAC;IAE7C,MAAM,KAAK,GAAG,IAAA,sBAAW,EAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3C,MAAM,iBAAiB,GAAG,QAAQ,CAAC,GAAG,CACpC,IAAA,wBAAa,EAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CACxC,CAAC;IAEF,OAAO,CAAC,GAAG,KAAK,EAAE,GAAG,iBAAiB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACvD,CAAC,CAAC;AAhBW,QAAA,WAAW,eAgBtB"}
|
|
@@ -5,7 +5,7 @@ const effect_1 = require("effect");
|
|
|
5
5
|
const get_error_location_from_file_path_js_1 = require("./get-error-location-from-file-path.js");
|
|
6
6
|
const get_source_code_js_1 = require("./get-source-code.js");
|
|
7
7
|
const get_sources_from_map_file_js_1 = require("./get-sources-from-map-file.js");
|
|
8
|
-
const getErrorRelatedSources = (sourceFile) => effect_1.Effect.gen(function* () {
|
|
8
|
+
const getErrorRelatedSources = (name, sourceFile) => effect_1.Effect.gen(function* () {
|
|
9
9
|
const location = (0, get_error_location_from_file_path_js_1.getErrorLocationFrom)(sourceFile);
|
|
10
10
|
if (location === undefined) {
|
|
11
11
|
return;
|
|
@@ -16,12 +16,13 @@ const getErrorRelatedSources = (sourceFile) => effect_1.Effect.gen(function* ()
|
|
|
16
16
|
const source = yield* (0, get_source_code_js_1.getSourceCode)(location);
|
|
17
17
|
return {
|
|
18
18
|
_tag: 'sources',
|
|
19
|
+
name,
|
|
19
20
|
runPath: `${filePath}:${line}:${column}`,
|
|
20
21
|
sourcesPath: undefined,
|
|
21
22
|
source,
|
|
22
23
|
};
|
|
23
24
|
}
|
|
24
|
-
return yield* (0, get_sources_from_map_file_js_1.getSourcesFromMapFile)(location);
|
|
25
|
+
return yield* (0, get_sources_from_map_file_js_1.getSourcesFromMapFile)(name, location);
|
|
25
26
|
});
|
|
26
27
|
exports.getErrorRelatedSources = getErrorRelatedSources;
|
|
27
28
|
//# sourceMappingURL=get-error-related-sources.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-error-related-sources.js","sourceRoot":"","sources":["../../../src/source-maps/get-error-related-sources.ts"],"names":[],"mappings":";;;AAEA,mCAAgC;AAGhC,iGAA8E;AAC9E,6DAAqD;AACrD,iFAIwC;AAEjC,MAAM,sBAAsB,GAAG,CACpC,UAAkB,EAKlB,EAAE,CACF,eAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,MAAM,QAAQ,GAAG,IAAA,2DAAoB,EAAC,UAAU,CAAC,CAAC;IAClD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,OAAO;IACT,CAAC;IAED,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAC;IAE5C,MAAM,gBAAgB,GACpB,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACxD,IAAI,gBAAgB,EAAE,CAAC;QACrB,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,IAAA,kCAAa,EAAC,QAAQ,CAAC,CAAC;QAE9C,OAAO;YACL,IAAI,EAAE,SAAkB;YACxB,OAAO,EAAE,GAAG,QAAQ,IAAI,IAAI,IAAI,MAAM,EAAE;YACxC,WAAW,EAAE,SAAS;YACtB,MAAM;SACP,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,CAAC,CAAC,IAAA,oDAAqB,EAAC,QAAQ,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"get-error-related-sources.js","sourceRoot":"","sources":["../../../src/source-maps/get-error-related-sources.ts"],"names":[],"mappings":";;;AAEA,mCAAgC;AAGhC,iGAA8E;AAC9E,6DAAqD;AACrD,iFAIwC;AAEjC,MAAM,sBAAsB,GAAG,CACpC,IAAY,EACZ,UAAkB,EAKlB,EAAE,CACF,eAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,MAAM,QAAQ,GAAG,IAAA,2DAAoB,EAAC,UAAU,CAAC,CAAC;IAClD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,OAAO;IACT,CAAC;IAED,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAC;IAE5C,MAAM,gBAAgB,GACpB,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACxD,IAAI,gBAAgB,EAAE,CAAC;QACrB,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,IAAA,kCAAa,EAAC,QAAQ,CAAC,CAAC;QAE9C,OAAO;YACL,IAAI,EAAE,SAAkB;YACxB,IAAI;YACJ,OAAO,EAAE,GAAG,QAAQ,IAAI,IAAI,IAAI,MAAM,EAAE;YACxC,WAAW,EAAE,SAAS;YACtB,MAAM;SACP,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,CAAC,CAAC,IAAA,oDAAqB,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AACtD,CAAC,CAAC,CAAC;AA/BQ,QAAA,sBAAsB,0BA+B9B"}
|
|
@@ -10,12 +10,13 @@ const effect_1 = require("effect");
|
|
|
10
10
|
const source_map_js_1 = require("source-map-js");
|
|
11
11
|
const index_js_1 = require("../logic/fs/read-json/index.js");
|
|
12
12
|
const get_source_code_js_1 = require("./get-source-code.js");
|
|
13
|
-
const getSourcesFromMapFile = (location) => (0, effect_1.pipe)(effect_1.Effect.gen(function* () {
|
|
13
|
+
const getSourcesFromMapFile = (name, location) => (0, effect_1.pipe)(effect_1.Effect.gen(function* () {
|
|
14
14
|
const fs = yield* FileSystem_1.FileSystem;
|
|
15
15
|
const fileExists = yield* fs.exists(`${location.filePath}.map`);
|
|
16
16
|
if (!fileExists) {
|
|
17
17
|
return {
|
|
18
18
|
_tag: 'location',
|
|
19
|
+
name,
|
|
19
20
|
...location,
|
|
20
21
|
filePath: location.filePath.replace(process.cwd(), ''),
|
|
21
22
|
};
|
|
@@ -42,6 +43,7 @@ const getSourcesFromMapFile = (location) => (0, effect_1.pipe)(effect_1.Effect.g
|
|
|
42
43
|
}, true);
|
|
43
44
|
return {
|
|
44
45
|
_tag: 'sources',
|
|
46
|
+
name,
|
|
45
47
|
runPath: `${location.filePath}:${location.line}:${location.column}`,
|
|
46
48
|
sourcesPath: `${absolutePath}:${sources.line}:${sources.column + 1}`,
|
|
47
49
|
source,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-sources-from-map-file.js","sourceRoot":"","sources":["../../../src/source-maps/get-sources-from-map-file.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA6B;AAG7B,4DAAyD;AACzD,mCAAsC;AACtC,iDAAqE;AAErE,6DAGwC;AAExC,6DAAsE;
|
|
1
|
+
{"version":3,"file":"get-sources-from-map-file.js","sourceRoot":"","sources":["../../../src/source-maps/get-sources-from-map-file.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA6B;AAG7B,4DAAyD;AACzD,mCAAsC;AACtC,iDAAqE;AAErE,6DAGwC;AAExC,6DAAsE;AAe/D,MAAM,qBAAqB,GAAG,CACnC,IAAY,EACZ,QAAuB,EAKvB,EAAE,CACF,IAAA,aAAI,EACF,eAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,uBAAU,CAAC;IAC7B,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC,QAAQ,MAAM,CAAC,CAAC;IAChE,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO;YACL,IAAI,EAAE,UAAmB;YACzB,IAAI;YACJ,GAAG,QAAQ;YACX,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC;SACvD,CAAC;IACJ,CAAC;IAED,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,IAAA,yBAAc,EAChC,GAAG,QAAQ,CAAC,QAAQ,MAAM,CAC3B,CAAC;IACF,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QAC7D,OAAO;IACT,CAAC;IAED,MAAM,QAAQ,GAAG,IAAI,iCAAiB,CAAC,IAAI,CAAC,CAAC;IAC7C,MAAM,OAAO,GAAG,QAAQ,CAAC,mBAAmB,CAAC;QAC3C,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,IAAI,EAAE,QAAQ,CAAC,IAAI;KACpB,CAAC,CAAC;IACH,IACE,OAAO,CAAC,MAAM,KAAK,IAAI;QACvB,OAAO,CAAC,IAAI,KAAK,IAAI;QACrB,OAAO,CAAC,MAAM,KAAK,IAAI,EACvB,CAAC;QACD,OAAO;IACT,CAAC;IAED,MAAM,YAAY,GAAG,mBAAI,CAAC,OAAO,CAC/B,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,EAClE,OAAO,CAAC,MAAM,CACf,CAAC;IACF,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,IAAA,kCAAa,EACjC;QACE,QAAQ,EAAE,YAAY;QACtB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,EACD,IAAI,CACL,CAAC;IAEF,OAAO;QACL,IAAI,EAAE,SAAkB;QACxB,IAAI;QACJ,OAAO,EAAE,GAAG,QAAQ,CAAC,QAAQ,IAAI,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,MAAM,EAAE;QACnE,WAAW,EAAE,GAAG,YAAY,IAAI,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;QACpE,MAAM;KACP,CAAC;AACJ,CAAC,CAAC,EACF,eAAM,CAAC,QAAQ,CAAC,2BAA2B,EAAE,EAAE,UAAU,EAAE,EAAE,QAAQ,EAAE,EAAE,CAAC,CAC3E,CAAC;AA/DS,QAAA,qBAAqB,yBA+D9B"}
|
|
@@ -17,7 +17,7 @@ const getSourcesFromSpan = ({ span, sources, location, }) => (0, effect_1.pipe)(
|
|
|
17
17
|
while (current !== undefined && current._tag === 'Span') {
|
|
18
18
|
const { name, attributes: allAttributes, status } = current;
|
|
19
19
|
const { attributes, stacktrace } = (0, split_spans_attributes_by_type_js_1.splitSpansAttributesByTypes)(allAttributes);
|
|
20
|
-
const sourcesOrLocation = yield* (0, maybe_map_sourcemaps_js_1.maybeMapSourcemaps)(stacktrace);
|
|
20
|
+
const sourcesOrLocation = yield* (0, maybe_map_sourcemaps_js_1.maybeMapSourcemaps)(name, stacktrace);
|
|
21
21
|
const duration = status._tag === 'Ended'
|
|
22
22
|
? +`${(status.endTime - status.startTime) / BigInt(1000000)}`
|
|
23
23
|
: undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-sources-from-span.js","sourceRoot":"","sources":["../../../src/source-maps/get-sources-from-span.ts"],"names":[],"mappings":";;;AAAA,mCAA8C;AAG9C,wGAA+F;AAK/F,uEAA+D;AAExD,MAAM,kBAAkB,GAAG,CAAC,EACjC,IAAI,EACJ,OAAO,EACP,QAAQ,GAKT,EAAE,EAAE,CACH,IAAA,aAAI,EACF,eAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO;YACL,KAAK,EAAE,EAAE;YACT,OAAO;YACP,QAAQ;SACT,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,GAAG,EAAE,CAAC;IAEjB,IAAI,OAAO,GAA+B,IAAI,CAAC;IAC/C,OAAO,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QACxD,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;QAE5D,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,GAC9B,IAAA,+DAA2B,EAAC,aAAa,CAAC,CAAC;QAE7C,MAAM,iBAAiB,GAAG,KAAK,CAAC,CAAC,IAAA,4CAAkB,EAAC,UAAU,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"get-sources-from-span.js","sourceRoot":"","sources":["../../../src/source-maps/get-sources-from-span.ts"],"names":[],"mappings":";;;AAAA,mCAA8C;AAG9C,wGAA+F;AAK/F,uEAA+D;AAExD,MAAM,kBAAkB,GAAG,CAAC,EACjC,IAAI,EACJ,OAAO,EACP,QAAQ,GAKT,EAAE,EAAE,CACH,IAAA,aAAI,EACF,eAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO;YACL,KAAK,EAAE,EAAE;YACT,OAAO;YACP,QAAQ;SACT,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,GAAG,EAAE,CAAC;IAEjB,IAAI,OAAO,GAA+B,IAAI,CAAC;IAC/C,OAAO,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QACxD,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;QAE5D,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,GAC9B,IAAA,+DAA2B,EAAC,aAAa,CAAC,CAAC;QAE7C,MAAM,iBAAiB,GAAG,KAAK,CAAC,CAAC,IAAA,4CAAkB,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QACtE,MAAM,QAAQ,GACZ,MAAM,CAAC,IAAI,KAAK,OAAO;YACrB,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,EAAE;YAC7D,CAAC,CAAC,SAAS,CAAC;QAEhB,OAAO,CAAC,IAAI,CACV,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC,CAC3D,CAAC;QACF,QAAQ,CAAC,IAAI,CACX,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,KAAK,UAAU,CAAC,CAC5D,CAAC;QACF,KAAK,CAAC,IAAI,CAAC;YACT,IAAI;YACJ,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC;YAC1C,sBAAsB,EAAE,QAAQ;YAChC,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,OAAO,EAAE,MAAM,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;SAC9D,CAAC,CAAC;QAEH,OAAO,GAAG,eAAM,CAAC,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAClD,CAAC;IAED,OAAO;QACL,KAAK;QACL,QAAQ;QACR,OAAO;KACR,CAAC;AACJ,CAAC,CAAC,EACF,eAAM,CAAC,QAAQ,CAAC,uBAAuB,CAAC,CACzC,CAAC;AA1DS,QAAA,kBAAkB,sBA0D3B"}
|
|
@@ -12,7 +12,7 @@ const getSourcesFromStack = (maybeStack) => (0, effect_1.pipe)(effect_1.Effect.g
|
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
const relevantStackEntries = (0, maybe_add_error_to_spans_stack_js_1.removeNodeModulesEntriesFromStack)(maybeStack);
|
|
15
|
-
const sourcesOrLocation = yield* (0, maybe_map_sourcemaps_js_1.maybeMapSourcemaps)(relevantStackEntries);
|
|
15
|
+
const sourcesOrLocation = yield* (0, maybe_map_sourcemaps_js_1.maybeMapSourcemaps)('', relevantStackEntries);
|
|
16
16
|
return {
|
|
17
17
|
sources: sourcesOrLocation.filter((el) => el._tag === 'sources'),
|
|
18
18
|
location: sourcesOrLocation.filter((el) => el._tag === 'location'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-sources-from-stack.js","sourceRoot":"","sources":["../../../src/source-maps/get-sources-from-stack.ts"],"names":[],"mappings":";;;AAAA,mCAAsC;AAEtC,wGAAqG;AACrG,uEAA+D;AAExD,MAAM,mBAAmB,GAAG,CAAC,UAA8B,EAAE,EAAE,CACpE,IAAA,aAAI,EACF,eAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO;YACL,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,EAAE;SACb,CAAC;IACJ,CAAC;IAED,MAAM,oBAAoB,GACxB,IAAA,qEAAiC,EAAC,UAAU,CAAC,CAAC;IAChD,MAAM,iBAAiB,GAAG,KAAK,CAAC,CAAC,IAAA,4CAAkB,
|
|
1
|
+
{"version":3,"file":"get-sources-from-stack.js","sourceRoot":"","sources":["../../../src/source-maps/get-sources-from-stack.ts"],"names":[],"mappings":";;;AAAA,mCAAsC;AAEtC,wGAAqG;AACrG,uEAA+D;AAExD,MAAM,mBAAmB,GAAG,CAAC,UAA8B,EAAE,EAAE,CACpE,IAAA,aAAI,EACF,eAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO;YACL,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,EAAE;SACb,CAAC;IACJ,CAAC;IAED,MAAM,oBAAoB,GACxB,IAAA,qEAAiC,EAAC,UAAU,CAAC,CAAC;IAChD,MAAM,iBAAiB,GAAG,KAAK,CAAC,CAAC,IAAA,4CAAkB,EACjD,EAAE,EACF,oBAAoB,CACrB,CAAC;IAEF,OAAO;QACL,OAAO,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC;QAChE,QAAQ,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,KAAK,UAAU,CAAC;KACnE,CAAC;AACJ,CAAC,CAAC,EACF,eAAM,CAAC,QAAQ,CAAC,wBAAwB,CAAC,CAC1C,CAAC;AAvBS,QAAA,mBAAmB,uBAuB5B"}
|
|
@@ -4,12 +4,12 @@ exports.maybeMapSourcemaps = void 0;
|
|
|
4
4
|
const effect_1 = require("effect");
|
|
5
5
|
const stack_regex_js_1 = require("../logic/stack/stack-regex.js");
|
|
6
6
|
const get_error_related_sources_js_1 = require("./get-error-related-sources.js");
|
|
7
|
-
const maybeMapSourcemaps = (stacktrace) => (0, effect_1.pipe)(effect_1.Effect.forEach(stacktrace, (stackLine) => effect_1.Effect.gen(function* () {
|
|
7
|
+
const maybeMapSourcemaps = (name, stacktrace) => (0, effect_1.pipe)(effect_1.Effect.forEach(stacktrace, (stackLine) => effect_1.Effect.gen(function* () {
|
|
8
8
|
const chunks = stackLine.trimStart().split(' ');
|
|
9
9
|
const mapFileReportedPath = chunks.length === 2
|
|
10
10
|
? chunks[1]
|
|
11
11
|
: chunks[chunks.length - 1].slice(1, -1);
|
|
12
|
-
const details = yield* (0, get_error_related_sources_js_1.getErrorRelatedSources)(mapFileReportedPath);
|
|
12
|
+
const details = yield* (0, get_error_related_sources_js_1.getErrorRelatedSources)(name, mapFileReportedPath);
|
|
13
13
|
if (details === undefined) {
|
|
14
14
|
return {
|
|
15
15
|
_tag: 'stack-entry',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maybe-map-sourcemaps.js","sourceRoot":"","sources":["../../../src/source-maps/maybe-map-sourcemaps.ts"],"names":[],"mappings":";;;AAEA,mCAAsC;AAGtC,kEAA6D;AAC7D,iFAAwE;AAgBjE,MAAM,kBAAkB,GAAG,CAChC,UAAoB,EAKpB,EAAE,CACF,IAAA,aAAI,EACF,eAAM,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,SAAS,EAAE,EAAE,CACvC,eAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,MAAM,MAAM,GAAG,SAAS,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAChD,MAAM,mBAAmB,GACvB,MAAM,CAAC,MAAM,KAAK,CAAC;QACjB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;QACX,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAE7C,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,IAAA,qDAAsB,
|
|
1
|
+
{"version":3,"file":"maybe-map-sourcemaps.js","sourceRoot":"","sources":["../../../src/source-maps/maybe-map-sourcemaps.ts"],"names":[],"mappings":";;;AAEA,mCAAsC;AAGtC,kEAA6D;AAC7D,iFAAwE;AAgBjE,MAAM,kBAAkB,GAAG,CAChC,IAAY,EACZ,UAAoB,EAKpB,EAAE,CACF,IAAA,aAAI,EACF,eAAM,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,SAAS,EAAE,EAAE,CACvC,eAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,MAAM,MAAM,GAAG,SAAS,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAChD,MAAM,mBAAmB,GACvB,MAAM,CAAC,MAAM,KAAK,CAAC;QACjB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;QACX,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAE7C,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,IAAA,qDAAsB,EAC3C,IAAI,EACJ,mBAAmB,CACpB,CAAC;IACF,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO;YACL,IAAI,EAAE,aAAsB;YAC5B,OAAO,EAAE,SAAS,CAAC,UAAU,CAAC,6BAAY,EAAE,KAAK,CAAC;SACnD,CAAC;IACJ,CAAC;IACD,IAAI,OAAO,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QAChC,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,GAAG,OAAO,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;IAC3D,IAAI,OAAO,CAAC,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;QACtC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC,CACH,EACD,eAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACnB,KAAK,CAAC,MAAM,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,KAAK,SAAS,CAAC,CAC3D,CACF,CAAC;AA1CS,QAAA,kBAAkB,sBA0C3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pretty-print-options.type.js","sourceRoot":"","sources":["../../../src/types/pretty-print-options.type.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"pretty-print-options.type.js","sourceRoot":"","sources":["../../../src/types/pretty-print-options.type.ts"],"names":[],"mappings":";;;AAOa,QAAA,yBAAyB,GAAuB;IAC3D,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,KAAK;IACf,YAAY,EAAE,IAAI;IAClB,cAAc,EAAE,IAAI;CACrB,CAAC"}
|
package/dts/index.d.ts
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Context, Effect, Layer } from 'effect';
|
|
2
|
+
declare const Logger_base: Context.TagClass<Logger, "Logger", {
|
|
3
|
+
readonly info: (message?: unknown, ...optionalParams: unknown[]) => Effect.Effect<void>;
|
|
4
|
+
readonly error: (message?: unknown, ...optionalParams: unknown[]) => Effect.Effect<void>;
|
|
5
|
+
}>;
|
|
6
|
+
export declare class Logger extends Logger_base {
|
|
7
|
+
}
|
|
8
|
+
export type LoggerLayer = (typeof Logger)['Service'];
|
|
9
|
+
export declare const LoggerConsoleLive: Layer.Layer<Logger, never, never>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const interruptedMessage = "\u2705 All fibers interrupted without errors.";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const missingSpansWarning: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const formatErrorTitle: (errorType: unknown, message: unknown, failuresLength: number, failureIndex: number) => string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const formatSpanAttributes: (attributes: Record<string, unknown>, isLastEntry: boolean) => string | never[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const formatSpanDuration: (durationInMs: number | bigint, isLastEntry: boolean) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const formatTitle: (errorsCount: number) => string[];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './format-error-title.js';
|
|
2
|
+
export * from './format-span-attributes.js';
|
|
3
|
+
export * from './format-span-duration.js';
|
|
4
|
+
export * from './maybe-warn-about-plain-strings.js';
|
|
5
|
+
export * from './spans-stack-trailing-char.js';
|
|
6
|
+
export * from './constants/missing-spans-warning.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const maybeWarnAboutPlainStrings: (isPlainString: boolean) => string[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Span } from 'effect/Tracer';
|
|
2
|
+
import type { PrettyPrintOptions } from '../../../../types/pretty-print-options.type.js';
|
|
3
|
+
type SpansAsTimeline = {
|
|
4
|
+
message: string;
|
|
5
|
+
stack: string[];
|
|
6
|
+
};
|
|
7
|
+
export declare const formatSpansAsTimeline: (span: Span | undefined, { stripCwd, reverseSpans }: PrettyPrintOptions) => SpansAsTimeline;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Span } from 'effect/Tracer';
|
|
2
|
+
import type { PrettyPrintOptions } from '../../../../types/pretty-print-options.type.js';
|
|
3
|
+
type MaybePrintSpansTimelineOutput = {
|
|
4
|
+
spanAttributesStack: string[] | undefined;
|
|
5
|
+
spansTimeline: string[];
|
|
6
|
+
};
|
|
7
|
+
export declare const maybePrintSpansTimeline: (span: Span | undefined, isPlainString: boolean, { stripCwd, reverseSpans }: PrettyPrintOptions) => MaybePrintSpansTimelineOutput;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ErrorData } from '../../capture-errors.js';
|
|
2
|
+
import type { PrettyPrintOptions } from '../../types/pretty-print-options.type.js';
|
|
3
|
+
export declare const formatCapturedError: (failuresCount: number, options: PrettyPrintOptions) => ({ errorType, message, stack, spans, sources, isPlainString }: ErrorData, index: number) => string;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { PrettyError } from '../../types/pretty-error.type.js';
|
|
2
|
+
import type { PrettyPrintOptions } from '../../types/pretty-print-options.type.js';
|
|
3
|
+
export declare const formatFailure: (failuresCount: number, options: PrettyPrintOptions) => ({ errorType, message, stack, span, isPlainString }: PrettyError, index: number) => string;
|