Improper handling of source maps with relative source roots
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- node.js, typescript
- Lĩnh vực
- devtools
Hướng nghiên cứu
Bắt đầu trong src/hooks/instrument.ts tại vị trí transform() được issue tham chiếu, sau đó kiểm tra nhánh WIP source-map-relative-root và tái hiện ví dụ TypeORM. Xác minh rằng một sourceRoot tương đối được phân giải dựa trên URL của source map thay vì thư mục làm việc, đồng thời xác nhận rằng location.path thu được là hợp lý.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Source maps can have sourceRoot property; it's defined as a string that's prepended to every entry in the sources list. The specification doesn't put any constraints on this field; consequently, this can be a relative directory (eg. ..).
In my understanding, the intended semantics is that it's to be resolved relative to the URL of the source map itself, eg. given { sourceRoot: '..', sources: 'a.js' } and source map at file:///example/source.js.map the resolved source URL should be ../a.js => file:///a.js.
appmap-node does not handle this case correctly. Consider for example typeorm-0.3.20; metadata-args/MetadataArgsStorage.js.map contains:
$ jq '{sources, sourceRoot}' node_modules/typeorm/metadata-args/MetadataArgsStorage.js.map
{
"sources": [
"../../src/metadata-args/MetadataArgsStorage.ts"
],
"sourceRoot": ".."
}
However, when instrumenting the file, relevant location.path in transform() (as determined by the debugger) reads nonsensical ../home/divide/projects/tmp/NestJS-TypeORM-Example/node_modules/typeorm/metadata-args/src/metadata-args/MetadataArgsStorage.ts (note the working directory in this run is /home/divide/projects/tmp/NestJS-TypeORM-Example/).
(The path as indicated by the source map would be incorrect in any case (file:////home/divide/projects/tmp/NestJS-TypeORM-Example/src/metadata-args/MetadataArgsStorage.ts by my reading) which seems to be a bug in typeorm build, but that's beside the point.)
Note: I started working on this issue, here's a WIP branch: https://github.com/getappmap/appmap-node/tree/wip/source-map-relative-root
- Ngôn ngữ chính
- TypeScript
- Star
- 13
- Fork
- 6
- Merge trung bình
- 4 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 5
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của getappmap/appmap-node
-
Instrument pre-ES6 classesĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
getappmap/appmap-node#183 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
getappmap/appmap-node#182 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Wrong parent in some async flowsĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
getappmap/appmap-node#180 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Support better-sqlite3Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
getappmap/appmap-node#179 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Support TypeORMĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
getappmap/appmap-node#178 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của getappmap/appmap-node
Issue tương tự
-
ui(ListToolbar): search takes the full row on a phone instead of sharing it with the result countĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
Maintainer thường phản hồi trong vòng 1 ngày
-
priority:high
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
immich-app/immich#32426 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation good first issue hacktoberfest help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
libredb/libredb-studio#1756 ·
Maintainer thường phản hồi trong vòng 1 ngày