effect-errors 1.8.31 → 1.8.36
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 +2 -2
- package/cjs/capture-errors.js +4 -4
- package/cjs/capture-errors.js.map +1 -1
- package/cjs/dependencies/fs/index.js +18 -0
- package/cjs/dependencies/fs/index.js.map +1 -0
- package/cjs/dependencies/fs/read-json/index.js.map +1 -0
- package/cjs/dependencies/fs/read-json/json-parsing.error.js.map +1 -0
- package/cjs/dependencies/fs/read-json/parse-json.js.map +1 -0
- package/cjs/{logic → dependencies}/fs/read-json/read-json.js +5 -2
- package/cjs/dependencies/fs/read-json/read-json.js.map +1 -0
- package/cjs/{logic → dependencies}/logger/index.js +1 -0
- package/cjs/dependencies/logger/index.js.map +1 -0
- package/cjs/index.js +1 -2
- package/cjs/index.js.map +1 -1
- package/cjs/logic/errors/capture-errors-from-cause.js.map +1 -1
- package/cjs/logic/errors/extract-error-details.js +10 -10
- package/cjs/logic/errors/extract-error-details.js.map +1 -1
- package/cjs/logic/errors/index.js +18 -0
- package/cjs/logic/errors/index.js.map +1 -0
- package/cjs/logic/errors/parse-error.js +5 -5
- package/cjs/logic/errors/parse-error.js.map +1 -1
- package/cjs/logic/path/index.js +18 -0
- package/cjs/logic/path/index.js.map +1 -0
- package/cjs/logic/path/strip-cwd-path.js.map +1 -0
- package/cjs/logic/spans/index.js +19 -0
- package/cjs/logic/spans/index.js.map +1 -0
- package/cjs/logic/stack/filter-stack.js +2 -2
- package/cjs/logic/stack/filter-stack.js.map +1 -1
- package/cjs/logic/stack/index.js +19 -0
- package/cjs/logic/stack/index.js.map +1 -0
- package/cjs/pretty-print-from-captured-errors.js +6 -6
- package/cjs/pretty-print-from-captured-errors.js.map +1 -1
- package/cjs/pretty-print.js +8 -8
- package/cjs/pretty-print.js.map +1 -1
- package/cjs/{logic/pretty-printing → pretty-printing}/captured-errors/index.js +1 -0
- package/cjs/pretty-printing/captured-errors/index.js.map +1 -0
- package/cjs/pretty-printing/captured-errors/maybe-advise-spans-usage.js.map +1 -0
- package/cjs/{logic/pretty-printing → pretty-printing}/captured-errors/maybe-print-node-stacktrace.js +2 -2
- package/cjs/pretty-printing/captured-errors/maybe-print-node-stacktrace.js.map +1 -0
- package/cjs/{logic/pretty-printing → pretty-printing}/captured-errors/maybe-print-spans-timeline.js +7 -7
- package/cjs/pretty-printing/captured-errors/maybe-print-spans-timeline.js.map +1 -0
- package/cjs/{logic/pretty-printing → pretty-printing}/captured-errors/print-effect-stacktrace.js +5 -4
- package/cjs/pretty-printing/captured-errors/print-effect-stacktrace.js.map +1 -0
- package/cjs/pretty-printing/common/constants/interrupted-message.js.map +1 -0
- package/cjs/pretty-printing/common/constants/missing-spans-warning.js.map +1 -0
- package/cjs/pretty-printing/common/format-error-title.js.map +1 -0
- package/cjs/pretty-printing/common/format-span-attributes.js.map +1 -0
- package/cjs/pretty-printing/common/format-span-duration.js.map +1 -0
- package/cjs/pretty-printing/common/format-title.js.map +1 -0
- package/cjs/pretty-printing/common/index.js.map +1 -0
- package/cjs/pretty-printing/common/maybe-warn-about-plain-strings.js.map +1 -0
- package/cjs/pretty-printing/common/spans-stack-trailing-char.js.map +1 -0
- package/cjs/pretty-printing/failures/index.js.map +1 -0
- package/cjs/{logic/pretty-printing → pretty-printing}/failures/maybe-print-node-stacktrace.js +2 -2
- package/cjs/pretty-printing/failures/maybe-print-node-stacktrace.js.map +1 -0
- package/cjs/{logic/pretty-printing → pretty-printing}/failures/print-effect-stacktrace.js +2 -2
- package/cjs/pretty-printing/failures/print-effect-stacktrace.js.map +1 -0
- package/cjs/pretty-printing/failures/spans-timeline/extract-spans.js.map +1 -0
- package/cjs/pretty-printing/failures/spans-timeline/format/get-span-attributes.js +18 -0
- package/cjs/pretty-printing/failures/spans-timeline/format/get-span-attributes.js.map +1 -0
- package/cjs/{logic/pretty-printing → pretty-printing}/failures/spans-timeline/format/get-span-duration.js +2 -2
- package/cjs/pretty-printing/failures/spans-timeline/format/get-span-duration.js.map +1 -0
- package/cjs/pretty-printing/failures/spans-timeline/format/index.js.map +1 -0
- package/cjs/{logic/pretty-printing → pretty-printing}/failures/spans-timeline/format-spans-at-timeline.js +7 -7
- package/cjs/pretty-printing/failures/spans-timeline/format-spans-at-timeline.js.map +1 -0
- package/cjs/{logic/pretty-printing → pretty-printing}/failures/spans-timeline/maybe-print-spans-timeline.js +2 -2
- package/cjs/pretty-printing/failures/spans-timeline/maybe-print-spans-timeline.js.map +1 -0
- package/cjs/{logic/pretty-printing → pretty-printing}/format-captured-error.js +4 -5
- package/cjs/pretty-printing/format-captured-error.js.map +1 -0
- package/cjs/pretty-printing/format-failure.js +24 -0
- package/cjs/pretty-printing/format-failure.js.map +1 -0
- package/cjs/pretty-printing/index.js.map +1 -0
- package/cjs/runners/run-promise.js +4 -4
- package/cjs/runners/run-promise.js.map +1 -1
- package/cjs/runners/run-sync.js +4 -4
- package/cjs/runners/run-sync.js.map +1 -1
- package/cjs/source-maps/get-error-location-from-file-path.js +2 -2
- package/cjs/source-maps/get-error-location-from-file-path.js.map +1 -1
- package/cjs/source-maps/get-error-related-sources.js.map +1 -1
- package/cjs/source-maps/get-sources-from-map-file.js +4 -3
- package/cjs/source-maps/get-sources-from-map-file.js.map +1 -1
- package/cjs/source-maps/get-sources-from-span.js +2 -2
- package/cjs/source-maps/get-sources-from-span.js.map +1 -1
- package/cjs/source-maps/get-sources-from-stack.js +2 -2
- package/cjs/source-maps/get-sources-from-stack.js.map +1 -1
- package/cjs/source-maps/index.js +21 -0
- package/cjs/source-maps/index.js.map +1 -0
- package/cjs/source-maps/maybe-map-sourcemaps.js +2 -2
- package/cjs/source-maps/maybe-map-sourcemaps.js.map +1 -1
- package/cjs/source-maps/transform-raw-error.js +4 -4
- package/cjs/source-maps/transform-raw-error.js.map +1 -1
- package/cjs/types/error-span.type.js +3 -0
- package/cjs/types/error-span.type.js.map +1 -0
- package/cjs/types/index.js +20 -0
- package/cjs/types/index.js.map +1 -0
- package/dts/capture-errors.d.ts +3 -10
- package/dts/dependencies/fs/index.d.ts +1 -0
- package/dts/{logic → dependencies}/fs/read-json/read-json.d.ts +1 -1
- package/dts/{logic → dependencies}/logger/index.d.ts +1 -0
- package/dts/index.d.ts +3 -5
- package/dts/logic/errors/capture-errors-from-cause.d.ts +1 -1
- package/dts/logic/errors/index.d.ts +1 -0
- package/dts/logic/errors/parse-error.d.ts +1 -1
- package/dts/logic/path/index.d.ts +1 -0
- package/dts/logic/spans/index.d.ts +2 -0
- package/dts/logic/stack/index.d.ts +2 -0
- package/dts/pretty-print-from-captured-errors.d.ts +1 -1
- package/dts/pretty-print.d.ts +1 -1
- package/dts/{logic/pretty-printing → pretty-printing}/captured-errors/index.d.ts +1 -0
- package/dts/{logic/pretty-printing → pretty-printing}/captured-errors/maybe-advise-spans-usage.d.ts +1 -1
- package/dts/{logic/pretty-printing → pretty-printing}/captured-errors/maybe-print-node-stacktrace.d.ts +1 -1
- package/dts/{logic/pretty-printing → pretty-printing}/captured-errors/maybe-print-spans-timeline.d.ts +1 -1
- package/dts/{logic/pretty-printing → pretty-printing}/captured-errors/print-effect-stacktrace.d.ts +2 -1
- package/dts/{logic/pretty-printing → pretty-printing}/failures/maybe-print-node-stacktrace.d.ts +1 -1
- package/dts/{logic/pretty-printing → pretty-printing}/failures/print-effect-stacktrace.d.ts +1 -1
- package/dts/{logic/pretty-printing → pretty-printing}/failures/spans-timeline/format-spans-at-timeline.d.ts +1 -1
- package/dts/{logic/pretty-printing → pretty-printing}/failures/spans-timeline/maybe-print-spans-timeline.d.ts +1 -1
- package/dts/{logic/pretty-printing → pretty-printing}/format-captured-error.d.ts +2 -2
- package/dts/{logic/pretty-printing → pretty-printing}/format-failure.d.ts +1 -2
- package/dts/runners/run-promise.d.ts +1 -1
- package/dts/runners/run-sync.d.ts +1 -1
- package/dts/source-maps/get-error-related-sources.d.ts +1 -1
- package/dts/source-maps/get-sources-from-map-file.d.ts +1 -1
- package/dts/source-maps/get-sources-from-span.d.ts +1 -1
- package/dts/source-maps/get-sources-from-stack.d.ts +1 -1
- package/dts/source-maps/index.d.ts +4 -0
- package/dts/source-maps/maybe-map-sourcemaps.d.ts +1 -1
- package/dts/source-maps/transform-raw-error.d.ts +1 -1
- package/dts/types/error-span.type.d.ts +7 -0
- package/dts/types/index.d.ts +3 -0
- package/esm/capture-errors.js +2 -2
- package/esm/capture-errors.js.map +1 -1
- package/esm/dependencies/fs/index.js +2 -0
- package/esm/dependencies/fs/index.js.map +1 -0
- package/esm/dependencies/fs/read-json/index.js.map +1 -0
- package/esm/dependencies/fs/read-json/json-parsing.error.js.map +1 -0
- package/esm/dependencies/fs/read-json/parse-json.js.map +1 -0
- package/esm/{logic → dependencies}/fs/read-json/read-json.js +5 -2
- package/esm/dependencies/fs/read-json/read-json.js.map +1 -0
- package/esm/{logic → dependencies}/logger/index.js +1 -0
- package/esm/dependencies/logger/index.js.map +1 -0
- package/esm/index.js +1 -2
- package/esm/index.js.map +1 -1
- package/esm/logic/errors/capture-errors-from-cause.js.map +1 -1
- package/esm/logic/errors/extract-error-details.js +10 -10
- package/esm/logic/errors/extract-error-details.js.map +1 -1
- package/esm/logic/errors/index.js +2 -0
- package/esm/logic/errors/index.js.map +1 -0
- package/esm/logic/errors/parse-error.js +4 -4
- package/esm/logic/errors/parse-error.js.map +1 -1
- package/esm/logic/path/index.js +2 -0
- package/esm/logic/path/index.js.map +1 -0
- package/esm/logic/path/strip-cwd-path.js.map +1 -0
- package/esm/logic/spans/index.js +3 -0
- package/esm/logic/spans/index.js.map +1 -0
- package/esm/logic/stack/filter-stack.js +1 -1
- package/esm/logic/stack/filter-stack.js.map +1 -1
- package/esm/logic/stack/index.js +3 -0
- package/esm/logic/stack/index.js.map +1 -0
- package/esm/pretty-print-from-captured-errors.js +2 -2
- package/esm/pretty-print-from-captured-errors.js.map +1 -1
- package/esm/pretty-print.js +3 -3
- package/esm/pretty-print.js.map +1 -1
- package/esm/{logic/pretty-printing → pretty-printing}/captured-errors/index.js +1 -0
- package/esm/pretty-printing/captured-errors/index.js.map +1 -0
- package/esm/pretty-printing/captured-errors/maybe-advise-spans-usage.js.map +1 -0
- package/esm/{logic/pretty-printing → pretty-printing}/captured-errors/maybe-print-node-stacktrace.js +1 -1
- package/esm/pretty-printing/captured-errors/maybe-print-node-stacktrace.js.map +1 -0
- package/esm/{logic/pretty-printing → pretty-printing}/captured-errors/maybe-print-spans-timeline.js +2 -2
- package/esm/pretty-printing/captured-errors/maybe-print-spans-timeline.js.map +1 -0
- package/esm/{logic/pretty-printing → pretty-printing}/captured-errors/print-effect-stacktrace.js +4 -3
- package/esm/pretty-printing/captured-errors/print-effect-stacktrace.js.map +1 -0
- package/esm/pretty-printing/common/constants/interrupted-message.js.map +1 -0
- package/esm/pretty-printing/common/constants/missing-spans-warning.js.map +1 -0
- package/esm/pretty-printing/common/format-error-title.js.map +1 -0
- package/esm/pretty-printing/common/format-span-attributes.js.map +1 -0
- package/esm/pretty-printing/common/format-span-duration.js.map +1 -0
- package/esm/pretty-printing/common/format-title.js.map +1 -0
- package/esm/pretty-printing/common/index.js.map +1 -0
- package/esm/pretty-printing/common/maybe-warn-about-plain-strings.js.map +1 -0
- package/esm/pretty-printing/common/spans-stack-trailing-char.js.map +1 -0
- package/esm/pretty-printing/failures/index.js.map +1 -0
- package/esm/{logic/pretty-printing → pretty-printing}/failures/maybe-print-node-stacktrace.js +1 -1
- package/esm/pretty-printing/failures/maybe-print-node-stacktrace.js.map +1 -0
- package/esm/{logic/pretty-printing → pretty-printing}/failures/print-effect-stacktrace.js +1 -1
- package/esm/pretty-printing/failures/print-effect-stacktrace.js.map +1 -0
- package/esm/pretty-printing/failures/spans-timeline/extract-spans.js.map +1 -0
- package/esm/{logic/pretty-printing → pretty-printing}/failures/spans-timeline/format/get-span-attributes.js +2 -2
- package/esm/pretty-printing/failures/spans-timeline/format/get-span-attributes.js.map +1 -0
- package/esm/{logic/pretty-printing → pretty-printing}/failures/spans-timeline/format/get-span-duration.js +1 -1
- package/esm/pretty-printing/failures/spans-timeline/format/get-span-duration.js.map +1 -0
- package/esm/pretty-printing/failures/spans-timeline/format/index.js.map +1 -0
- package/esm/{logic/pretty-printing → pretty-printing}/failures/spans-timeline/format-spans-at-timeline.js +2 -2
- package/esm/pretty-printing/failures/spans-timeline/format-spans-at-timeline.js.map +1 -0
- package/esm/{logic/pretty-printing → pretty-printing}/failures/spans-timeline/maybe-print-spans-timeline.js +1 -1
- package/esm/pretty-printing/failures/spans-timeline/maybe-print-spans-timeline.js.map +1 -0
- package/esm/{logic/pretty-printing → pretty-printing}/format-captured-error.js +1 -2
- package/esm/pretty-printing/format-captured-error.js.map +1 -0
- package/esm/{logic/pretty-printing → pretty-printing}/format-failure.js +1 -1
- package/esm/pretty-printing/format-failure.js.map +1 -0
- package/esm/pretty-printing/index.js.map +1 -0
- package/esm/runners/run-promise.js +2 -2
- package/esm/runners/run-promise.js.map +1 -1
- package/esm/runners/run-sync.js +2 -2
- package/esm/runners/run-sync.js.map +1 -1
- package/esm/source-maps/get-error-location-from-file-path.js +1 -1
- package/esm/source-maps/get-error-location-from-file-path.js.map +1 -1
- package/esm/source-maps/get-error-related-sources.js.map +1 -1
- package/esm/source-maps/get-sources-from-map-file.js +3 -2
- 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/index.js +5 -0
- package/esm/source-maps/index.js.map +1 -0
- package/esm/source-maps/maybe-map-sourcemaps.js +1 -1
- package/esm/source-maps/maybe-map-sourcemaps.js.map +1 -1
- package/esm/source-maps/transform-raw-error.js +2 -2
- package/esm/source-maps/transform-raw-error.js.map +1 -1
- package/esm/types/error-span.type.js +2 -0
- package/esm/types/error-span.type.js.map +1 -0
- package/esm/types/index.js +4 -0
- package/esm/types/index.js.map +1 -0
- package/package.json +29 -26
- package/cjs/logic/fs/read-json/index.js.map +0 -1
- package/cjs/logic/fs/read-json/json-parsing.error.js.map +0 -1
- package/cjs/logic/fs/read-json/parse-json.js.map +0 -1
- package/cjs/logic/fs/read-json/read-json.js.map +0 -1
- package/cjs/logic/logger/index.js.map +0 -1
- package/cjs/logic/pretty-printing/captured-errors/index.js.map +0 -1
- package/cjs/logic/pretty-printing/captured-errors/maybe-advise-spans-usage.js.map +0 -1
- package/cjs/logic/pretty-printing/captured-errors/maybe-print-node-stacktrace.js.map +0 -1
- package/cjs/logic/pretty-printing/captured-errors/maybe-print-spans-timeline.js.map +0 -1
- package/cjs/logic/pretty-printing/captured-errors/print-effect-stacktrace.js.map +0 -1
- package/cjs/logic/pretty-printing/common/constants/interrupted-message.js.map +0 -1
- package/cjs/logic/pretty-printing/common/constants/missing-spans-warning.js.map +0 -1
- package/cjs/logic/pretty-printing/common/format-error-title.js.map +0 -1
- package/cjs/logic/pretty-printing/common/format-span-attributes.js.map +0 -1
- package/cjs/logic/pretty-printing/common/format-span-duration.js.map +0 -1
- package/cjs/logic/pretty-printing/common/format-title.js.map +0 -1
- package/cjs/logic/pretty-printing/common/index.js.map +0 -1
- package/cjs/logic/pretty-printing/common/maybe-warn-about-plain-strings.js.map +0 -1
- package/cjs/logic/pretty-printing/common/spans-stack-trailing-char.js.map +0 -1
- package/cjs/logic/pretty-printing/failures/index.js.map +0 -1
- package/cjs/logic/pretty-printing/failures/maybe-print-node-stacktrace.js.map +0 -1
- package/cjs/logic/pretty-printing/failures/print-effect-stacktrace.js.map +0 -1
- package/cjs/logic/pretty-printing/failures/spans-timeline/extract-spans.js.map +0 -1
- package/cjs/logic/pretty-printing/failures/spans-timeline/format/get-span-attributes.js +0 -18
- package/cjs/logic/pretty-printing/failures/spans-timeline/format/get-span-attributes.js.map +0 -1
- package/cjs/logic/pretty-printing/failures/spans-timeline/format/get-span-duration.js.map +0 -1
- package/cjs/logic/pretty-printing/failures/spans-timeline/format/index.js.map +0 -1
- package/cjs/logic/pretty-printing/failures/spans-timeline/format-spans-at-timeline.js.map +0 -1
- package/cjs/logic/pretty-printing/failures/spans-timeline/maybe-print-spans-timeline.js.map +0 -1
- package/cjs/logic/pretty-printing/format-captured-error.js.map +0 -1
- package/cjs/logic/pretty-printing/format-failure.js +0 -24
- package/cjs/logic/pretty-printing/format-failure.js.map +0 -1
- package/cjs/logic/pretty-printing/index.js.map +0 -1
- package/cjs/logic/strip-cwd-path.js.map +0 -1
- package/cjs/logic/util/big-int-replacer.js +0 -14
- package/cjs/logic/util/big-int-replacer.js.map +0 -1
- package/dts/logic/util/big-int-replacer.d.ts +0 -1
- package/esm/logic/fs/read-json/index.js.map +0 -1
- package/esm/logic/fs/read-json/json-parsing.error.js.map +0 -1
- package/esm/logic/fs/read-json/parse-json.js.map +0 -1
- package/esm/logic/fs/read-json/read-json.js.map +0 -1
- package/esm/logic/logger/index.js.map +0 -1
- package/esm/logic/pretty-printing/captured-errors/index.js.map +0 -1
- package/esm/logic/pretty-printing/captured-errors/maybe-advise-spans-usage.js.map +0 -1
- package/esm/logic/pretty-printing/captured-errors/maybe-print-node-stacktrace.js.map +0 -1
- package/esm/logic/pretty-printing/captured-errors/maybe-print-spans-timeline.js.map +0 -1
- package/esm/logic/pretty-printing/captured-errors/print-effect-stacktrace.js.map +0 -1
- package/esm/logic/pretty-printing/common/constants/interrupted-message.js.map +0 -1
- package/esm/logic/pretty-printing/common/constants/missing-spans-warning.js.map +0 -1
- package/esm/logic/pretty-printing/common/format-error-title.js.map +0 -1
- package/esm/logic/pretty-printing/common/format-span-attributes.js.map +0 -1
- package/esm/logic/pretty-printing/common/format-span-duration.js.map +0 -1
- package/esm/logic/pretty-printing/common/format-title.js.map +0 -1
- package/esm/logic/pretty-printing/common/index.js.map +0 -1
- package/esm/logic/pretty-printing/common/maybe-warn-about-plain-strings.js.map +0 -1
- package/esm/logic/pretty-printing/common/spans-stack-trailing-char.js.map +0 -1
- package/esm/logic/pretty-printing/failures/index.js.map +0 -1
- package/esm/logic/pretty-printing/failures/maybe-print-node-stacktrace.js.map +0 -1
- package/esm/logic/pretty-printing/failures/print-effect-stacktrace.js.map +0 -1
- package/esm/logic/pretty-printing/failures/spans-timeline/extract-spans.js.map +0 -1
- package/esm/logic/pretty-printing/failures/spans-timeline/format/get-span-attributes.js.map +0 -1
- package/esm/logic/pretty-printing/failures/spans-timeline/format/get-span-duration.js.map +0 -1
- package/esm/logic/pretty-printing/failures/spans-timeline/format/index.js.map +0 -1
- package/esm/logic/pretty-printing/failures/spans-timeline/format-spans-at-timeline.js.map +0 -1
- package/esm/logic/pretty-printing/failures/spans-timeline/maybe-print-spans-timeline.js.map +0 -1
- package/esm/logic/pretty-printing/format-captured-error.js.map +0 -1
- package/esm/logic/pretty-printing/format-failure.js.map +0 -1
- package/esm/logic/pretty-printing/index.js.map +0 -1
- package/esm/logic/strip-cwd-path.js.map +0 -1
- package/esm/logic/util/big-int-replacer.js +0 -10
- package/esm/logic/util/big-int-replacer.js.map +0 -1
- /package/cjs/{logic → dependencies}/fs/read-json/index.js +0 -0
- /package/cjs/{logic → dependencies}/fs/read-json/json-parsing.error.js +0 -0
- /package/cjs/{logic → dependencies}/fs/read-json/parse-json.js +0 -0
- /package/cjs/logic/{strip-cwd-path.js → path/strip-cwd-path.js} +0 -0
- /package/cjs/{logic/pretty-printing → pretty-printing}/captured-errors/maybe-advise-spans-usage.js +0 -0
- /package/cjs/{logic/pretty-printing → pretty-printing}/common/constants/interrupted-message.js +0 -0
- /package/cjs/{logic/pretty-printing → pretty-printing}/common/constants/missing-spans-warning.js +0 -0
- /package/cjs/{logic/pretty-printing → pretty-printing}/common/format-error-title.js +0 -0
- /package/cjs/{logic/pretty-printing → pretty-printing}/common/format-span-attributes.js +0 -0
- /package/cjs/{logic/pretty-printing → pretty-printing}/common/format-span-duration.js +0 -0
- /package/cjs/{logic/pretty-printing → pretty-printing}/common/format-title.js +0 -0
- /package/cjs/{logic/pretty-printing → pretty-printing}/common/index.js +0 -0
- /package/cjs/{logic/pretty-printing → pretty-printing}/common/maybe-warn-about-plain-strings.js +0 -0
- /package/cjs/{logic/pretty-printing → pretty-printing}/common/spans-stack-trailing-char.js +0 -0
- /package/cjs/{logic/pretty-printing → pretty-printing}/failures/index.js +0 -0
- /package/cjs/{logic/pretty-printing → pretty-printing}/failures/spans-timeline/extract-spans.js +0 -0
- /package/cjs/{logic/pretty-printing → pretty-printing}/failures/spans-timeline/format/index.js +0 -0
- /package/cjs/{logic/pretty-printing → pretty-printing}/index.js +0 -0
- /package/dts/{logic → dependencies}/fs/read-json/index.d.ts +0 -0
- /package/dts/{logic → dependencies}/fs/read-json/json-parsing.error.d.ts +0 -0
- /package/dts/{logic → dependencies}/fs/read-json/parse-json.d.ts +0 -0
- /package/dts/logic/{strip-cwd-path.d.ts → path/strip-cwd-path.d.ts} +0 -0
- /package/dts/{logic/pretty-printing → pretty-printing}/common/constants/interrupted-message.d.ts +0 -0
- /package/dts/{logic/pretty-printing → pretty-printing}/common/constants/missing-spans-warning.d.ts +0 -0
- /package/dts/{logic/pretty-printing → pretty-printing}/common/format-error-title.d.ts +0 -0
- /package/dts/{logic/pretty-printing → pretty-printing}/common/format-span-attributes.d.ts +0 -0
- /package/dts/{logic/pretty-printing → pretty-printing}/common/format-span-duration.d.ts +0 -0
- /package/dts/{logic/pretty-printing → pretty-printing}/common/format-title.d.ts +0 -0
- /package/dts/{logic/pretty-printing → pretty-printing}/common/index.d.ts +0 -0
- /package/dts/{logic/pretty-printing → pretty-printing}/common/maybe-warn-about-plain-strings.d.ts +0 -0
- /package/dts/{logic/pretty-printing → pretty-printing}/common/spans-stack-trailing-char.d.ts +0 -0
- /package/dts/{logic/pretty-printing → pretty-printing}/failures/index.d.ts +0 -0
- /package/dts/{logic/pretty-printing → pretty-printing}/failures/spans-timeline/extract-spans.d.ts +0 -0
- /package/dts/{logic/pretty-printing → pretty-printing}/failures/spans-timeline/format/get-span-attributes.d.ts +0 -0
- /package/dts/{logic/pretty-printing → pretty-printing}/failures/spans-timeline/format/get-span-duration.d.ts +0 -0
- /package/dts/{logic/pretty-printing → pretty-printing}/failures/spans-timeline/format/index.d.ts +0 -0
- /package/dts/{logic/pretty-printing → pretty-printing}/index.d.ts +0 -0
- /package/esm/{logic → dependencies}/fs/read-json/index.js +0 -0
- /package/esm/{logic → dependencies}/fs/read-json/json-parsing.error.js +0 -0
- /package/esm/{logic → dependencies}/fs/read-json/parse-json.js +0 -0
- /package/esm/logic/{strip-cwd-path.js → path/strip-cwd-path.js} +0 -0
- /package/esm/{logic/pretty-printing → pretty-printing}/captured-errors/maybe-advise-spans-usage.js +0 -0
- /package/esm/{logic/pretty-printing → pretty-printing}/common/constants/interrupted-message.js +0 -0
- /package/esm/{logic/pretty-printing → pretty-printing}/common/constants/missing-spans-warning.js +0 -0
- /package/esm/{logic/pretty-printing → pretty-printing}/common/format-error-title.js +0 -0
- /package/esm/{logic/pretty-printing → pretty-printing}/common/format-span-attributes.js +0 -0
- /package/esm/{logic/pretty-printing → pretty-printing}/common/format-span-duration.js +0 -0
- /package/esm/{logic/pretty-printing → pretty-printing}/common/format-title.js +0 -0
- /package/esm/{logic/pretty-printing → pretty-printing}/common/index.js +0 -0
- /package/esm/{logic/pretty-printing → pretty-printing}/common/maybe-warn-about-plain-strings.js +0 -0
- /package/esm/{logic/pretty-printing → pretty-printing}/common/spans-stack-trailing-char.js +0 -0
- /package/esm/{logic/pretty-printing → pretty-printing}/failures/index.js +0 -0
- /package/esm/{logic/pretty-printing → pretty-printing}/failures/spans-timeline/extract-spans.js +0 -0
- /package/esm/{logic/pretty-printing → pretty-printing}/failures/spans-timeline/format/index.js +0 -0
- /package/esm/{logic/pretty-printing → pretty-printing}/index.js +0 -0
package/cjs/{logic/pretty-printing → pretty-printing}/failures/maybe-print-node-stacktrace.js
RENAMED
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.maybePrintNodeStacktrace = void 0;
|
|
7
7
|
const picocolors_1 = __importDefault(require("picocolors"));
|
|
8
|
-
const
|
|
8
|
+
const stack_1 = require("./../../logic/stack/index.js");
|
|
9
9
|
const maybePrintNodeStacktrace = (stack, isPlainString, { stripCwd, hideStackTrace }) => {
|
|
10
10
|
if (hideStackTrace) {
|
|
11
11
|
return [];
|
|
@@ -14,7 +14,7 @@ const maybePrintNodeStacktrace = (stack, isPlainString, { stripCwd, hideStackTra
|
|
|
14
14
|
const line = [
|
|
15
15
|
'',
|
|
16
16
|
`${picocolors_1.default.bold(picocolors_1.default.red('◯'))} ${picocolors_1.default.red('Node Stacktrace')} 🚨`,
|
|
17
|
-
`${picocolors_1.default.red((0,
|
|
17
|
+
`${picocolors_1.default.red((0, stack_1.filterStack)(stack, 'node', stripCwd === true))}`,
|
|
18
18
|
`${picocolors_1.default.red('┴')}`,
|
|
19
19
|
].join('\r\n');
|
|
20
20
|
return [line];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maybe-print-node-stacktrace.js","sourceRoot":"","sources":["../../../../src/pretty-printing/failures/maybe-print-node-stacktrace.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA+B;AAE/B,wCAA2C;AAGpC,MAAM,wBAAwB,GAAG,CACtC,KAAyB,EACzB,aAAsB,EACtB,EAAE,QAAQ,EAAE,cAAc,EAAsB,EACtC,EAAE;IACZ,IAAI,cAAc,EAAE,CAAC;QACnB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,IAAI,GAAG;YACX,EAAE;YACF,GAAG,oBAAK,CAAC,IAAI,CAAC,oBAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,oBAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK;YAClE,GAAG,oBAAK,CAAC,GAAG,CAAC,IAAA,mBAAW,EAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,KAAK,IAAI,CAAC,CAAC,EAAE;YAC7D,GAAG,oBAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;SACpB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAEf,OAAO,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;IAED,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,MAAM,IAAI,GAAG;YACX,EAAE;YACF,GAAG,oBAAK,CAAC,IAAI,CAAC,2GAA2G,CAAC,EAAE;SAC7H,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAEf,OAAO,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC;AA7BW,QAAA,wBAAwB,4BA6BnC"}
|
|
@@ -5,12 +5,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.printEffectStacktrace = void 0;
|
|
7
7
|
const picocolors_1 = __importDefault(require("picocolors"));
|
|
8
|
-
const
|
|
8
|
+
const stack_1 = require("./../../logic/stack/index.js");
|
|
9
9
|
const printEffectStacktrace = (spanAttributesStack, { stripCwd }) => {
|
|
10
10
|
if (spanAttributesStack === undefined || spanAttributesStack.length === 0) {
|
|
11
11
|
return [];
|
|
12
12
|
}
|
|
13
|
-
const cleanedStack = `│ ${(0,
|
|
13
|
+
const cleanedStack = `│ ${(0, stack_1.filterStack)(spanAttributesStack.join('\r\n│ '), 'effect', stripCwd === true)}`;
|
|
14
14
|
const message = [
|
|
15
15
|
'',
|
|
16
16
|
`${picocolors_1.default.bold(picocolors_1.default.red('◯'))} ${picocolors_1.default.red('Sources')} 🕵️`,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"print-effect-stacktrace.js","sourceRoot":"","sources":["../../../../src/pretty-printing/failures/print-effect-stacktrace.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA+B;AAE/B,wCAA2C;AAGpC,MAAM,qBAAqB,GAAG,CACnC,mBAAyC,EACzC,EAAE,QAAQ,EAAsB,EACtB,EAAE;IACZ,IAAI,mBAAmB,KAAK,SAAS,IAAI,mBAAmB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1E,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,YAAY,GAAG,KAAK,IAAA,mBAAW,EAAC,mBAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC,EAAE,CAAC;IAEzG,MAAM,OAAO,GAAG;QACd,EAAE;QACF,GAAG,oBAAK,CAAC,IAAI,CAAC,oBAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,oBAAK,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM;QAC3D,GAAG,oBAAK,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE;QAC5B,GAAG,oBAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;KACpB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAEf,OAAO,CAAC,OAAO,CAAC,CAAC;AACnB,CAAC,CAAC;AAlBW,QAAA,qBAAqB,yBAkBhC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract-spans.js","sourceRoot":"","sources":["../../../../../src/pretty-printing/failures/spans-timeline/extract-spans.ts"],"names":[],"mappings":";;;AAAA,mCAAgC;AAGzB,MAAM,YAAY,GAAG,CAAC,IAAsB,EAAE,EAAE;IACrD,IAAI,OAAO,GAAwB,IAAI,CAAC;IAExC,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,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAVW,QAAA,YAAY,gBAUvB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSpanAttributes = void 0;
|
|
4
|
+
const common_1 = require("./../../../common/index.js");
|
|
5
|
+
const spans_1 = require("./../../../../logic/spans/index.js");
|
|
6
|
+
const getSpanAttributes = (allAttributes, isLastEntry) => {
|
|
7
|
+
if (allAttributes.size === 0) {
|
|
8
|
+
return { formattedAttributes: '', stack: [] };
|
|
9
|
+
}
|
|
10
|
+
const { attributes, stacktrace } = (0, spans_1.splitSpansAttributesByTypes)(allAttributes);
|
|
11
|
+
const formattedAttributes = (0, common_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/pretty-printing/failures/spans-timeline/format/get-span-attributes.ts"],"names":[],"mappings":";;;AAAA,iDAA4D;AAE5D,wCAA2D;AAEpD,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,mCAA2B,EAAC,aAAa,CAAC,CAAC;IAE9E,MAAM,mBAAmB,GAAG,IAAA,6BAAoB,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"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getSpanDuration = void 0;
|
|
4
|
-
const
|
|
4
|
+
const common_1 = require("./../../../common/index.js");
|
|
5
5
|
const getSpanDuration = (status, isLastEntry) => {
|
|
6
6
|
if (status._tag !== 'Ended') {
|
|
7
7
|
return '';
|
|
8
8
|
}
|
|
9
9
|
const duration = (status.endTime - status.startTime) / BigInt(1000000);
|
|
10
|
-
return (0,
|
|
10
|
+
return (0, common_1.formatSpanDuration)(duration, isLastEntry);
|
|
11
11
|
};
|
|
12
12
|
exports.getSpanDuration = getSpanDuration;
|
|
13
13
|
//# sourceMappingURL=get-span-duration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-span-duration.js","sourceRoot":"","sources":["../../../../../../src/pretty-printing/failures/spans-timeline/format/get-span-duration.ts"],"names":[],"mappings":";;;AAEA,iDAA0D;AAEnD,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,2BAAkB,EAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;AACnD,CAAC,CAAC;AARW,QAAA,eAAe,mBAQ1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/pretty-printing/failures/spans-timeline/format/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AACzC,yDAAuC"}
|
|
@@ -5,21 +5,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.formatSpansAsTimeline = void 0;
|
|
7
7
|
const picocolors_1 = __importDefault(require("picocolors"));
|
|
8
|
-
const
|
|
9
|
-
const
|
|
8
|
+
const path_1 = require("./../../../logic/path/index.js");
|
|
9
|
+
const common_1 = require("./../../common/index.js");
|
|
10
10
|
const extract_spans_js_1 = require("./extract-spans.js");
|
|
11
|
-
const
|
|
11
|
+
const index_js_1 = require("./format/index.js");
|
|
12
12
|
const formatSpansAsTimeline = (span, { stripCwd, reverseSpans }) => {
|
|
13
13
|
const spans = (0, extract_spans_js_1.extractSpans)(span);
|
|
14
14
|
const orderedSpans = reverseSpans === true ? spans.toReversed() : spans;
|
|
15
15
|
return orderedSpans.reduce((output, { name, status, attributes }, index) => {
|
|
16
16
|
const isFirstEntry = index === 0;
|
|
17
17
|
const isLastEntry = index === spans.length - 1;
|
|
18
|
-
const { formattedAttributes, stack } = (0,
|
|
18
|
+
const { formattedAttributes, stack } = (0, index_js_1.getSpanAttributes)(attributes, isLastEntry);
|
|
19
19
|
const maybeCircle = isFirstEntry ? `\r\n${picocolors_1.default.gray('◯')}` : '';
|
|
20
|
-
const trailing = (0,
|
|
21
|
-
const filePath = ` ${stripCwd !== undefined ? picocolors_1.default.underline(picocolors_1.default.bold((0,
|
|
22
|
-
const duration = picocolors_1.default.gray((0,
|
|
20
|
+
const trailing = (0, common_1.spanStackTrailingChar)(isLastEntry);
|
|
21
|
+
const filePath = ` ${stripCwd !== undefined ? picocolors_1.default.underline(picocolors_1.default.bold((0, path_1.stripCwdPath)(name))) : picocolors_1.default.underline(name)}`;
|
|
22
|
+
const duration = picocolors_1.default.gray((0, index_js_1.getSpanDuration)(status, isLastEntry));
|
|
23
23
|
const message = `${maybeCircle}\r\n${trailing}${picocolors_1.default.gray('─')}${filePath}${duration}${formattedAttributes}`;
|
|
24
24
|
return {
|
|
25
25
|
message: `${output.message}${message}`,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-spans-at-timeline.js","sourceRoot":"","sources":["../../../../../src/pretty-printing/failures/spans-timeline/format-spans-at-timeline.ts"],"names":[],"mappings":";;;;;;AACA,4DAA+B;AAE/B,sCAA2C;AAC3C,iDAA6D;AAG7D,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,8BAAqB,EAAC,WAAW,CAAC,CAAC;QACpD,MAAM,QAAQ,GAAG,IAAI,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,oBAAK,CAAC,SAAS,CAAC,oBAAK,CAAC,IAAI,CAAC,IAAA,mBAAY,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"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.maybePrintSpansTimeline = void 0;
|
|
4
|
-
const
|
|
4
|
+
const common_1 = require("./../../common/index.js");
|
|
5
5
|
const format_spans_at_timeline_js_1 = require("./format-spans-at-timeline.js");
|
|
6
6
|
const maybePrintSpansTimeline = (span, isPlainString, { stripCwd, reverseSpans }) => {
|
|
7
7
|
if (span === undefined) {
|
|
8
8
|
return {
|
|
9
9
|
spanAttributesStack: undefined,
|
|
10
|
-
spansTimeline: isPlainString === false ? [
|
|
10
|
+
spansTimeline: isPlainString === false ? [common_1.missingSpansWarning] : [],
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
const { stack, message } = (0, format_spans_at_timeline_js_1.formatSpansAsTimeline)(span, {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maybe-print-spans-timeline.js","sourceRoot":"","sources":["../../../../../src/pretty-printing/failures/spans-timeline/maybe-print-spans-timeline.ts"],"names":[],"mappings":";;;AAEA,iDAA2D;AAG3D,+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,4BAAmB,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"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.formatCapturedError = void 0;
|
|
4
|
+
const common_1 = require("./common/index.js");
|
|
4
5
|
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
6
|
const formatCapturedError = (failuresCount, options) => ({ errorType, message, stack, spans, sources, isPlainString }, index) => {
|
|
8
|
-
const title = (0,
|
|
9
|
-
const plainStringWarning = (0,
|
|
7
|
+
const title = (0, common_1.formatErrorTitle)(errorType, message, failuresCount, index);
|
|
8
|
+
const plainStringWarning = (0, common_1.maybeWarnAboutPlainStrings)(isPlainString);
|
|
10
9
|
const spansTimeline = (0, index_js_1.maybePrintSpansTimeline)(spans, isPlainString, options);
|
|
11
|
-
const spansUsageAdvice = (0,
|
|
10
|
+
const spansUsageAdvice = (0, index_js_1.maybeAdviseSpansUsage)(spans);
|
|
12
11
|
const effectStacktrace = (0, index_js_1.printEffectStacktrace)(sources, spans, options);
|
|
13
12
|
const nodeStacktrace = (0, index_js_1.maybePrintNodeStacktrace)(stack, isPlainString, options);
|
|
14
13
|
return [
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-captured-error.js","sourceRoot":"","sources":["../../../src/pretty-printing/format-captured-error.ts"],"names":[],"mappings":";;;AAAA,iDAG8B;AAI9B,yDAKoC;AAE7B,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,yBAAgB,EAAC,SAAS,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC;IACzE,MAAM,kBAAkB,GAAG,IAAA,mCAA0B,EAAC,aAAa,CAAC,CAAC;IACrE,MAAM,aAAa,GAAG,IAAA,kCAAuB,EAC3C,KAAK,EACL,aAAa,EACb,OAAO,CACR,CAAC;IACF,MAAM,gBAAgB,GAAG,IAAA,gCAAqB,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 spans_1 = require("./../logic/spans/index.js");
|
|
5
|
+
const common_1 = require("./common/index.js");
|
|
6
|
+
const index_js_1 = require("./failures/index.js");
|
|
7
|
+
const formatFailure = (failuresCount, options) => ({ errorType, message, stack, span, isPlainString }, index) => {
|
|
8
|
+
const title = (0, common_1.formatErrorTitle)(errorType, message, failuresCount, index);
|
|
9
|
+
const plainStringWarning = (0, common_1.maybeWarnAboutPlainStrings)(isPlainString);
|
|
10
|
+
const { spanAttributesStack, spansTimeline } = (0, index_js_1.maybePrintSpansTimeline)(span, isPlainString, options);
|
|
11
|
+
const effectStack = (0, spans_1.maybeAddErrorToSpansStack)(stack, spanAttributesStack);
|
|
12
|
+
const effectStacktrace = (0, index_js_1.printEffectStacktrace)(effectStack, options);
|
|
13
|
+
const nodeStacktrace = (0, index_js_1.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/pretty-printing/format-failure.ts"],"names":[],"mappings":";;;AAAA,wCAAyD;AACzD,iDAG8B;AAG9B,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,yBAAgB,EAAC,SAAS,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC;IACzE,MAAM,kBAAkB,GAAG,IAAA,mCAA0B,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,iCAAyB,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 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/pretty-printing/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,6DAA2C;AAC3C,2DAAyC;AACzC,4EAA0D"}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.runPromise = void 0;
|
|
4
4
|
const effect_1 = require("effect");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const runPromise = async (effect, options =
|
|
5
|
+
const _type_1 = require("./../types/index.js");
|
|
6
|
+
const pretty_print_js_1 = require("../pretty-print.js");
|
|
7
|
+
const runPromise = async (effect, options = _type_1.prettyPrintOptionsDefault) => await effect_1.Effect.runPromise((0, effect_1.pipe)(effect, effect_1.Effect.sandbox, effect_1.Effect.catchAll((e) => {
|
|
8
8
|
if (options.enabled === false) {
|
|
9
9
|
return effect_1.Effect.fail(e);
|
|
10
10
|
}
|
|
11
|
-
const prettyError = (0,
|
|
11
|
+
const prettyError = (0, pretty_print_js_1.prettyPrint)(e, options);
|
|
12
12
|
console.error(prettyError);
|
|
13
13
|
return effect_1.Effect.fail('❌ runPromise failure');
|
|
14
14
|
})));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-promise.js","sourceRoot":"","sources":["../../../src/runners/run-promise.ts"],"names":[],"mappings":";;;AAAA,mCAAsC;AAEtC,
|
|
1
|
+
{"version":3,"file":"run-promise.js","sourceRoot":"","sources":["../../../src/runners/run-promise.ts"],"names":[],"mappings":";;;AAAA,mCAAsC;AAEtC,iCAA2E;AAE3E,wDAAiD;AAE1C,MAAM,UAAU,GAAG,KAAK,EAC7B,MAA2B,EAC3B,UAA8B,iCAAyB,EAC3C,EAAE,CACd,MAAM,eAAM,CAAC,UAAU,CACrB,IAAA,aAAI,EACF,MAAM,EACN,eAAM,CAAC,OAAO,EACd,eAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE;IACpB,IAAI,OAAO,CAAC,OAAO,KAAK,KAAK,EAAE,CAAC;QAC9B,OAAO,eAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACxB,CAAC;IAED,MAAM,WAAW,GAAG,IAAA,6BAAW,EAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC5C,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IAE3B,OAAO,eAAM,CAAC,IAAI,CAAC,sBAA+B,CAAC,CAAC;AACtD,CAAC,CAAC,CACH,CACF,CAAC;AAnBS,QAAA,UAAU,cAmBnB"}
|
package/cjs/runners/run-sync.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.runSync = void 0;
|
|
4
4
|
const effect_1 = require("effect");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const runSync = (effect, options =
|
|
5
|
+
const _type_1 = require("./../types/index.js");
|
|
6
|
+
const pretty_print_js_1 = require("../pretty-print.js");
|
|
7
|
+
const runSync = (effect, options = _type_1.prettyPrintOptionsDefault) => effect_1.Effect.runSync((0, effect_1.pipe)(effect, effect_1.Effect.sandbox, effect_1.Effect.catchAll((e) => {
|
|
8
8
|
if (options.enabled === true) {
|
|
9
|
-
console.error((0,
|
|
9
|
+
console.error((0, pretty_print_js_1.prettyPrint)(e, options));
|
|
10
10
|
return effect_1.Effect.fail('❌ runSync failure');
|
|
11
11
|
}
|
|
12
12
|
return effect_1.Effect.fail(e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-sync.js","sourceRoot":"","sources":["../../../src/runners/run-sync.ts"],"names":[],"mappings":";;;AAAA,mCAAsC;AAEtC,
|
|
1
|
+
{"version":3,"file":"run-sync.js","sourceRoot":"","sources":["../../../src/runners/run-sync.ts"],"names":[],"mappings":";;;AAAA,mCAAsC;AAEtC,iCAA2E;AAE3E,wDAAiD;AAE1C,MAAM,OAAO,GAAG,CACrB,MAA2B,EAC3B,UAA8B,iCAAyB,EACpD,EAAE,CACL,eAAM,CAAC,OAAO,CACZ,IAAA,aAAI,EACF,MAAM,EACN,eAAM,CAAC,OAAO,EACd,eAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE;IACpB,IAAI,OAAO,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;QAC7B,OAAO,CAAC,KAAK,CAAC,IAAA,6BAAW,EAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;QAEvC,OAAO,eAAM,CAAC,IAAI,CAAC,mBAAmB,CAAU,CAAC;IACnD,CAAC;IAED,OAAO,eAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACxB,CAAC,CAAC,CACH,CACF,CAAC;AAlBS,QAAA,OAAO,WAkBhB"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getErrorLocationFrom = void 0;
|
|
4
|
-
const
|
|
4
|
+
const stack_1 = require("./../logic/stack/index.js");
|
|
5
5
|
const getErrorLocationFrom = (sourceFile) => {
|
|
6
|
-
const regex =
|
|
6
|
+
const regex = stack_1.sourceFileWithMapPointerRegex.exec(sourceFile);
|
|
7
7
|
if (regex === null || regex.length !== 7) {
|
|
8
8
|
return;
|
|
9
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-error-location-from-file-path.js","sourceRoot":"","sources":["../../../src/source-maps/get-error-location-from-file-path.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"get-error-location-from-file-path.js","sourceRoot":"","sources":["../../../src/source-maps/get-error-location-from-file-path.ts"],"names":[],"mappings":";;;AAAA,wCAA6D;AAQtD,MAAM,oBAAoB,GAAG,CAClC,UAAkB,EACS,EAAE;IAC7B,MAAM,KAAK,GAAG,qCAA6B,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC7D,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzC,OAAO;IACT,CAAC;IAED,MAAM,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAC1B,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACvB,MAAM,MAAM,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAEzB,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACpC,CAAC,CAAC;AAbW,QAAA,oBAAoB,wBAa/B"}
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"get-error-related-sources.js","sourceRoot":"","sources":["../../../src/source-maps/get-error-related-sources.ts"],"names":[],"mappings":";;;AAEA,mCAAgC;AAIhC,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"}
|
|
@@ -8,7 +8,7 @@ const node_path_1 = __importDefault(require("node:path"));
|
|
|
8
8
|
const FileSystem_1 = require("@effect/platform/FileSystem");
|
|
9
9
|
const effect_1 = require("effect");
|
|
10
10
|
const source_map_js_1 = require("source-map-js");
|
|
11
|
-
const
|
|
11
|
+
const fs_1 = require("./../dependencies/fs/index.js");
|
|
12
12
|
const get_source_code_js_1 = require("./get-source-code.js");
|
|
13
13
|
const getSourcesFromMapFile = (name, location) => (0, effect_1.pipe)(effect_1.Effect.gen(function* () {
|
|
14
14
|
const fs = yield* FileSystem_1.FileSystem;
|
|
@@ -21,8 +21,9 @@ const getSourcesFromMapFile = (name, location) => (0, effect_1.pipe)(effect_1.Ef
|
|
|
21
21
|
filePath: location.filePath.replace(process.cwd(), ''),
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
const data = yield* (0,
|
|
25
|
-
|
|
24
|
+
const data = yield* (0, fs_1.readJsonEffect)(`${location.filePath}.map`);
|
|
25
|
+
const hasNoData = data?.version === undefined || data?.sources === undefined;
|
|
26
|
+
if (hasNoData) {
|
|
26
27
|
return;
|
|
27
28
|
}
|
|
28
29
|
const consumer = new source_map_js_1.SourceMapConsumer(data);
|
|
@@ -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,
|
|
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,yCAAyE;AAGzE,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,mBAAc,EAChC,GAAG,QAAQ,CAAC,QAAQ,MAAM,CAC3B,CAAC;IACF,MAAM,SAAS,GACb,IAAI,EAAE,OAAO,KAAK,SAAS,IAAI,IAAI,EAAE,OAAO,KAAK,SAAS,CAAC;IAC7D,IAAI,SAAS,EAAE,CAAC;QACd,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,aAAa,GAAG,YAAY,CAAC,UAAU,CAC3C,GAAG,OAAO,CAAC,GAAG,EAAE,eAAe,CAChC,CAAC;IACF,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO;IACT,CAAC;IACD,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;IAC3C,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE;CACnD,CAAC,CACH,CAAC;AAzES,QAAA,qBAAqB,yBAyE9B"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getSourcesFromSpan = void 0;
|
|
4
4
|
const effect_1 = require("effect");
|
|
5
|
-
const
|
|
5
|
+
const spans_1 = require("./../logic/spans/index.js");
|
|
6
6
|
const maybe_map_sourcemaps_js_1 = require("./maybe-map-sourcemaps.js");
|
|
7
7
|
const getSourcesFromSpan = ({ span, sources, location, }) => (0, effect_1.pipe)(effect_1.Effect.gen(function* () {
|
|
8
8
|
if (span === undefined) {
|
|
@@ -16,7 +16,7 @@ const getSourcesFromSpan = ({ span, sources, location, }) => (0, effect_1.pipe)(
|
|
|
16
16
|
let current = span;
|
|
17
17
|
while (current !== undefined && current._tag === 'Span') {
|
|
18
18
|
const { name, attributes: allAttributes, status } = current;
|
|
19
|
-
const { attributes, stacktrace } = (0,
|
|
19
|
+
const { attributes, stacktrace } = (0, spans_1.splitSpansAttributesByTypes)(allAttributes);
|
|
20
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)}`
|
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"get-sources-from-span.js","sourceRoot":"","sources":["../../../src/source-maps/get-sources-from-span.ts"],"names":[],"mappings":";;;AAAA,mCAA8C;AAG9C,wCAA2D;AAM3D,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,mCAA2B,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"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getSourcesFromStack = void 0;
|
|
4
4
|
const effect_1 = require("effect");
|
|
5
|
-
const
|
|
5
|
+
const spans_1 = require("./../logic/spans/index.js");
|
|
6
6
|
const maybe_map_sourcemaps_js_1 = require("./maybe-map-sourcemaps.js");
|
|
7
7
|
const getSourcesFromStack = (maybeStack) => (0, effect_1.pipe)(effect_1.Effect.gen(function* () {
|
|
8
8
|
if (maybeStack === undefined) {
|
|
@@ -11,7 +11,7 @@ const getSourcesFromStack = (maybeStack) => (0, effect_1.pipe)(effect_1.Effect.g
|
|
|
11
11
|
location: [],
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
|
-
const relevantStackEntries = (0,
|
|
14
|
+
const relevantStackEntries = (0, spans_1.removeNodeModulesEntriesFromStack)(maybeStack);
|
|
15
15
|
const sourcesOrLocation = yield* (0, maybe_map_sourcemaps_js_1.maybeMapSourcemaps)('', relevantStackEntries);
|
|
16
16
|
return {
|
|
17
17
|
sources: sourcesOrLocation.filter((el) => el._tag === 'sources'),
|
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"get-sources-from-stack.js","sourceRoot":"","sources":["../../../src/source-maps/get-sources-from-stack.ts"],"names":[],"mappings":";;;AAAA,mCAAsC;AAEtC,wCAAiE;AAEjE,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,yCAAiC,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"}
|
|
@@ -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("./get-error-location-from-file-path.js"), exports);
|
|
18
|
+
__exportStar(require("./get-source-code.js"), exports);
|
|
19
|
+
__exportStar(require("./get-sources-from-map-file.js"), exports);
|
|
20
|
+
__exportStar(require("./transform-raw-error.js"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/source-maps/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yEAAuD;AACvD,uDAAqC;AACrC,iEAA+C;AAC/C,2DAAyC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.maybeMapSourcemaps = void 0;
|
|
4
4
|
const effect_1 = require("effect");
|
|
5
|
-
const
|
|
5
|
+
const stack_1 = require("./../logic/stack/index.js");
|
|
6
6
|
const get_error_related_sources_js_1 = require("./get-error-related-sources.js");
|
|
7
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(' ');
|
|
@@ -13,7 +13,7 @@ const maybeMapSourcemaps = (name, stacktrace) => (0, effect_1.pipe)(effect_1.Eff
|
|
|
13
13
|
if (details === undefined) {
|
|
14
14
|
return {
|
|
15
15
|
_tag: 'stack-entry',
|
|
16
|
-
runPath: stackLine.replaceAll(
|
|
16
|
+
runPath: stackLine.replaceAll(stack_1.stackAtRegex, 'at '),
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
if (details._tag === 'location') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maybe-map-sourcemaps.js","sourceRoot":"","sources":["../../../src/source-maps/maybe-map-sourcemaps.ts"],"names":[],"mappings":";;;AAEA,mCAAsC;AAGtC,
|
|
1
|
+
{"version":3,"file":"maybe-map-sourcemaps.js","sourceRoot":"","sources":["../../../src/source-maps/maybe-map-sourcemaps.ts"],"names":[],"mappings":";;;AAEA,mCAAsC;AAGtC,wCAA4C;AAE5C,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,oBAAY,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"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.transformRawError = void 0;
|
|
4
4
|
const effect_1 = require("effect");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
5
|
+
const path_1 = require("./../logic/path/index.js");
|
|
6
|
+
const stack_1 = require("./../logic/stack/index.js");
|
|
7
7
|
const get_sources_from_span_js_1 = require("./get-sources-from-span.js");
|
|
8
8
|
const get_sources_from_stack_js_1 = require("./get-sources-from-stack.js");
|
|
9
9
|
const transformRawError = ({ reverseSpans, stripCwd }) => ({ message, stack: maybeStack, span, errorType, isPlainString, }) => (0, effect_1.pipe)(effect_1.Effect.gen(function* () {
|
|
@@ -14,12 +14,12 @@ const transformRawError = ({ reverseSpans, stripCwd }) => ({ message, stack: may
|
|
|
14
14
|
});
|
|
15
15
|
let stack;
|
|
16
16
|
if (maybeStack !== undefined) {
|
|
17
|
-
stack = stripCwd === true ? (0,
|
|
17
|
+
stack = stripCwd === true ? (0, path_1.stripCwdPath)(maybeStack) : maybeStack;
|
|
18
18
|
}
|
|
19
19
|
return {
|
|
20
20
|
errorType,
|
|
21
21
|
message,
|
|
22
|
-
stack: stack?.replaceAll(
|
|
22
|
+
stack: stack?.replaceAll(stack_1.stackAtRegex, 'at ').split('\r\n'),
|
|
23
23
|
sources: sources.length > 0
|
|
24
24
|
? sources.map(({ _tag, ...data }) => data)
|
|
25
25
|
: undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform-raw-error.js","sourceRoot":"","sources":["../../../src/source-maps/transform-raw-error.ts"],"names":[],"mappings":";;;AAAA,mCAAsC;
|
|
1
|
+
{"version":3,"file":"transform-raw-error.js","sourceRoot":"","sources":["../../../src/source-maps/transform-raw-error.ts"],"names":[],"mappings":";;;AAAA,mCAAsC;AAEtC,sCAA2C;AAC3C,wCAA4C;AAI5C,yEAAgE;AAChE,2EAAkE;AAE3D,MAAM,iBAAiB,GAC5B,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAwB,EAAE,EAAE,CACrD,CAAC,EACC,OAAO,EACP,KAAK,EAAE,UAAU,EACjB,IAAI,EACJ,SAAS,EACT,aAAa,GACD,EAAE,EAAE,CAChB,IAAA,aAAI,EACF,eAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,IAAA,+CAAmB,EAAC,UAAU,CAAC,CAAC;IACpD,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC,CAAC,IAAA,6CAAkB,EAAC;QAC7D,IAAI;QACJ,GAAG,IAAI;KACR,CAAC,CAAC;IAEH,IAAI,KAAyB,CAAC;IAC9B,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,KAAK,GAAG,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,IAAA,mBAAY,EAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;IACpE,CAAC;IAED,OAAO;QACL,SAAS;QACT,OAAO;QACP,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,oBAAY,EAAE,KAAK,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC;QAC3D,OAAO,EACL,OAAO,CAAC,MAAM,GAAG,CAAC;YAChB,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC;YAC1C,CAAC,CAAC,SAAS;QACf,QAAQ,EACN,QAAQ,CAAC,MAAM,GAAG,CAAC;YACjB,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC;YAC3C,CAAC,CAAC,SAAS;QACf,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,KAAK;QACzD,aAAa;KACd,CAAC;AACJ,CAAC,CAAC,EACF,eAAM,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CACvC,CAAC;AAvCO,QAAA,iBAAiB,qBAuCxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-span.type.js","sourceRoot":"","sources":["../../../src/types/error-span.type.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
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("./error-span.type.js"), exports);
|
|
18
|
+
__exportStar(require("./pretty-error.type.js"), exports);
|
|
19
|
+
__exportStar(require("./pretty-print-options.type.js"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,yDAAuC;AACvC,iEAA+C"}
|
package/dts/capture-errors.d.ts
CHANGED
|
@@ -2,16 +2,9 @@ import type { PlatformError } from '@effect/platform/Error';
|
|
|
2
2
|
import type { FileSystem } from '@effect/platform/FileSystem';
|
|
3
3
|
import { Effect } from 'effect';
|
|
4
4
|
import { type Cause } from 'effect/Cause';
|
|
5
|
-
import type { JsonParsingError } from './
|
|
6
|
-
import type
|
|
7
|
-
import type {
|
|
8
|
-
export interface ErrorSpan {
|
|
9
|
-
name: string;
|
|
10
|
-
attributes: Record<string, unknown>;
|
|
11
|
-
durationInMilliseconds: number | undefined;
|
|
12
|
-
startTime: bigint;
|
|
13
|
-
endTime: bigint | undefined;
|
|
14
|
-
}
|
|
5
|
+
import type { JsonParsingError } from './dependencies/fs/index.js';
|
|
6
|
+
import { type ErrorLocation, type ErrorRelatedSources } from './source-maps/index.js';
|
|
7
|
+
import type { ErrorSpan } from './types/index.js';
|
|
15
8
|
export interface ErrorData {
|
|
16
9
|
errorType: unknown;
|
|
17
10
|
message: unknown;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './read-json/index.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { FileSystem } from '@effect/platform/FileSystem';
|
|
2
2
|
import { Effect } from 'effect';
|
|
3
|
-
export declare const readJsonEffect: <TJson>(filePath: string) => Effect.Effect<TJson, import("./json-parsing.error.js").JsonParsingError | import("@effect/platform/Error").PlatformError, FileSystem>;
|
|
3
|
+
export declare const readJsonEffect: <TJson>(filePath: string) => Effect.Effect<TJson | null, import("./json-parsing.error.js").JsonParsingError | import("@effect/platform/Error").PlatformError, FileSystem>;
|
|
@@ -2,6 +2,7 @@ import { Context, Effect, Layer } from 'effect';
|
|
|
2
2
|
declare const Logger_base: Context.TagClass<Logger, "Logger", {
|
|
3
3
|
readonly info: (message?: unknown, ...optionalParams: unknown[]) => Effect.Effect<void>;
|
|
4
4
|
readonly error: (message?: unknown, ...optionalParams: unknown[]) => Effect.Effect<void>;
|
|
5
|
+
readonly warn: (message?: unknown, ...optionalParams: unknown[]) => Effect.Effect<void>;
|
|
5
6
|
}>;
|
|
6
7
|
export declare class Logger extends Logger_base {
|
|
7
8
|
}
|
package/dts/index.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
+
export * from './capture-errors.js';
|
|
1
2
|
export * from './pretty-print.js';
|
|
2
3
|
export * from './pretty-print-from-captured-errors.js';
|
|
3
4
|
export * from './runners/run-promise.js';
|
|
4
5
|
export * from './runners/run-sync.js';
|
|
5
6
|
export * from './types/pretty-print-options.type.js';
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export type { ErrorRelatedSources } from './source-maps/get-sources-from-map-file.js';
|
|
9
|
-
export type { SourceCode } from './source-maps/get-source-code.ts';
|
|
10
|
-
export type { ErrorLocation } from './source-maps/get-error-location-from-file-path.js';
|
|
7
|
+
export type { ErrorRelatedSources, SourceCode, ErrorLocation, } from './source-maps/index.js';
|
|
8
|
+
export type { ErrorSpan } from './types/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './capture-errors-from-cause.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { PrettyError } from '
|
|
1
|
+
import { PrettyError } from './../../types/index.js';
|
|
2
2
|
export declare const parseError: (error: unknown) => PrettyError;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './strip-cwd-path.js';
|