cspotcode / cspotcode/node-source-map-support

Improvements and bugfixes compared to `source-map-support`

Đang mở
#24 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
16
Fork
4
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Here is a changelog of improvements we have made relative to `source-map-support`

If you're here for the first time, you can `npm install @cspotcode/source-map-support` and `require('@cspotcode/source-map-support').install()` as a drop-in replacement for `npm install source-map-support`

This encompasses improvements in [`@cspotcode/source-map` and `@cspotcode/source-map-consumer`](https://github.com/cspotcode/source-map) since they were created for, and are primarily consumed by, this library.

# 0.8.1

* Fix bug where errors without a message would still have a trailing colon in the first line of their stack, e.g. `Error: ` instead of `Error` #39

# 0.8

*See #38 for all code changes*

## Changes

* Switch sourcemap consumer to @jridgewell/trace-mapping
* drops WASM requirement
* library is externally maintained
* Normalize cache keys to share single cache entry for both URIs and native paths

## Fixes

* Correctly render WASM stack frames
* Fixed bug where file:/// URLs in stack traces were not consistently percent-encoded
* ensure formatting of module paths within stack frames code snippets is consistent with vanilla node
* stack frame/snippet from nodejs may be native path or file URI
* CJS uses native paths
* ESM uses file URIs
* mapped frame should match: either native path or file URI
* Note: On windows, this means backslashes, starts with drive letter, no file:// prefix

## Other

* Add node 17 and 18 to test matrix
* Add tests for async, Promise.all, Promise.any stack frames
* Add tests for different path styles in sourcemaps: URIs, native paths, absolute and relative

# 0.7

## Adds

* Adds `uninstall()` method to safely remove all hooks from the environment
* #29
* Supports multiple instances of this library by sharing state via a global singleton
* Even if package manager creates multiple copies of this library in the dependency tree, they will cooperate and share installed hooks, cache, etc
* #28
* redirects `require("source-map-support")` to `require("@cspotcode/source-map-support")`
* Optionally notifies consuming code via callback so it can choose to log warnings to users
* Consuming code can opt-out of this behavior via option
* necessary because `source-map-support` does not implement #28
* #23, #30 @ejose19
* Add `@cspotcode/source-map-support/register-hook-require` entrypoint
* Same as `@cspotcode/source-map-support/register` but with `hookRequire` enabled
* #25

# 0.6

*includes 0.6.0 and 0.6.1*

## Adds

* bundles TypeScript types; no need for `@types/`
* #18, #13, evanw/node-source-map-support/issues/285
* colorized output matching node
* #17, #22, evanw/node-source-map-support/issues/263

## Fixes

* formatting of async stack frames
* #20, #12, evanw/node-source-map-support/issues/243
* Fixes broken `NodeError` formatting; will no longer strip codes from `NodeError`
* #3, evanw/node-source-map-support/issues/291
* `process.on('exit')` listeners should run before fatal error is logged
* #16, #15

## Performance

* use newer `source-map` dependency with WASM components for improved performance, maybe smaller install size? (haven't actually checked install size)
* #9
* Removes browser bundle for smaller package size
* #6
* Removes buffer-from dependency for smaller install size
* #8

## Removed

* Support for EOLed node versions. We test against and support node 12, 14, and 16
* #7
* Removes browser bundle for smaller package size
* #6

## Other

* Runs tests on CI
* #1

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.