Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests, improved ESM support, switch to @jridgewell/trace-mapping, etc #38

Merged
merged 24 commits into from
May 1, 2022

Conversation

cspotcode
Copy link
Owner

@cspotcode cspotcode commented Apr 23, 2022

This ended up being a jumbo PR doing lots of improvements for the next release.

Implements and closes #37

TypeStrong/ts-node#1726
TypeStrong/ts-node#1729

Also adds tests for ESM and for ts-node's style of sourcemap.

Full list of changes:

  • switch to @jridgewell/trace-mapping; away from fork of source-map-consumer
    • goal is to use lib that is maintained by someone else, and reap improved performance
  • add node 17 and 18 to test matrix
  • normalize cache keys: URI and native path shared cache entry
  • add tests for ESM (previously was only CJS)
  • add tests for new path styles in sourcemaps: absolute paths, file URIs
  • ensure formatting of stack frames and path above snippet is consistent with generated JS
    • 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
  • add test for async stack frames
    • async, Promise.all, Promise.any
  • add support for wasm stack frames
  • Fixed bug where file:/// URLs in stack traces were not consistently percent-encoded
  • re-add browser-source-map-support.js so that legacy stuff which tries to get it from us will succeed

@cspotcode cspotcode marked this pull request as ready for review April 27, 2022 11:13
@cspotcode cspotcode changed the title Switch to @jridgewell/trace-mapping Tests, improved ESM support, and switch to @jridgewell/trace-mapping Apr 29, 2022
@cspotcode cspotcode changed the title Tests, improved ESM support, and switch to @jridgewell/trace-mapping Tests, improved ESM support, switch to @jridgewell/trace-mapping, etc May 1, 2022
@cspotcode cspotcode merged commit d8f1231 into master May 1, 2022
cspotcode added a commit that referenced this pull request May 1, 2022
commit 990c03d
Author: Andrew Bradley <cspotcode@gmail.com>
Date:   Sun May 1 14:53:52 2022 -0400

    clean up TODOs

commit 50c71dd
Author: Andrew Bradley <cspotcode@gmail.com>
Date:   Sun May 1 14:30:37 2022 -0400

    re-add browser-source-map-support so that legacy stuff that tries to get it from us will work

commit 944a35d
Author: Andrew Bradley <cspotcode@gmail.com>
Date:   Sun May 1 13:53:13 2022 -0400

    fix

commit e150661
Author: Andrew Bradley <cspotcode@gmail.com>
Date:   Sun May 1 13:22:55 2022 -0400

    fix

commit 69893db
Author: Andrew Bradley <cspotcode@gmail.com>
Date:   Sun May 1 01:14:27 2022 -0400

    fix?

commit 3a68f09
Author: Andrew Bradley <cspotcode@gmail.com>
Date:   Sun May 1 00:43:42 2022 -0400

    fix tests on node 12 and 14

commit da3e63f
Author: Andrew Bradley <cspotcode@gmail.com>
Date:   Sun May 1 00:31:29 2022 -0400

    add tests and support for wasm stack frames

commit 727cbe6
Author: Andrew Bradley <cspotcode@gmail.com>
Date:   Sat Apr 30 18:30:13 2022 -0400

    fix test

commit e9adffc
Author: Andrew Bradley <cspotcode@gmail.com>
Date:   Sat Apr 30 18:18:22 2022 -0400

    add tests for async stack frames: async, Promise.all, Promise.any

commit 6d3de7e
Author: Andrew Bradley <cspotcode@gmail.com>
Date:   Fri Apr 29 18:13:29 2022 -0400

    WIP

commit fc3f549
Author: Andrew Bradley <cspotcode@gmail.com>
Date:   Fri Apr 29 18:08:39 2022 -0400

    WIP

commit 0582d53
Author: Andrew Bradley <cspotcode@gmail.com>
Date:   Fri Apr 29 16:41:34 2022 -0400

    fix

commit 69012b9
Author: Andrew Bradley <abradley@brightcove.com>
Date:   Fri Apr 29 18:04:15 2022 +0000

    Ensure source snippets also output URLs/paths in the correct format, matching stack frame

commit 2b315b8
Author: Andrew Bradley <abradley@brightcove.com>
Date:   Fri Apr 29 14:55:27 2022 +0000

    Test that paths in mapped stack frames match expected format: either file:/ or native path

commit 5b79f38
Author: Andrew Bradley <cspotcode@gmail.com>
Date:   Fri Apr 29 02:30:26 2022 -0400

    fix

commit 0677a3c
Author: Andrew Bradley <abradley@brightcove.com>
Date:   Fri Apr 29 03:14:56 2022 +0000

    fix CI

commit 9784717
Author: Andrew Bradley <abradley@brightcove.com>
Date:   Thu Apr 28 22:11:49 2022 +0000

    fix

commit c0f5b1e
Author: Andrew Bradley <abradley@brightcove.com>
Date:   Thu Apr 28 16:35:48 2022 +0000

    fix esm/file URI support

commit d9cc113
Author: Andrew Bradley <abradley@brightcove.com>
Date:   Wed Apr 27 11:12:16 2022 +0000

    WIP

commit 84fb85a
Author: Andrew Bradley <abradley@brightcove.com>
Date:   Tue Apr 26 10:08:02 2022 +0000

    WIP

commit ce5e122
Author: Andrew Bradley <abradley@brightcove.com>
Date:   Sat Apr 23 20:14:21 2022 +0000

    use resolve-uri for handling relative paths

commit 62cb778
Author: Andrew Bradley <cspotcode@gmail.com>
Date:   Sat Apr 23 13:23:48 2022 -0400

    refactor tests to include ESM and other variants of sourcemap

commit 12a2b6f
Author: Andrew Bradley <abradley@brightcove.com>
Date:   Sat Apr 23 00:26:02 2022 +0000

    Fix?

commit c6aa032
Author: Andrew Bradley <cspotcode@gmail.com>
Date:   Thu Apr 21 14:07:26 2022 -0400

    switch to @jridgewell/trace-mapping
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switch to @jridgewell/trace-mapping for sourcemap parsing
1 participant