[Bug]: test-utils sourcemaps point to sources that are not in the package
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 88/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- react, typescript
- Lĩnh vực
- build-system
Hướng nghiên cứu
Đọc build-tools/tasks/test-utils.js và so sánh các tùy chọn trình biên dịch TypeScript của tệp này với build-tools/tasks/typescript.js. Issue đề xuất thêm --inlineSources vào bản build test-utils. Xác nhận các tệp .js.map được tạo trong test-utils/ có sourcesContent, sau đó kiểm tra xem các công cụ có thể phân giải các map mà không tìm tệp nguồn bên ngoài package hay không.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Browser
No response
Package version
3.0.1410
React version
No response
Description
Summary
The .js.map files in test-utils/ do not embed their sources, and their sources paths point outside the package. Tools that follow the maps cannot find the sources. Vite, for example, logs one warning for each test-utils file that it transforms:
Sourcemap for "node_modules/@cloudscape-design/components/test-utils/dom/index.js" points to a source file outside its package: "node_modules/src/test-utils/dom/index.ts"
The component sourcemaps do not have this problem.
Steps to reproduce
- Install
@cloudscape-design/components. - Open
node_modules/@cloudscape-design/components/test-utils/dom/index.js.map.
Actual result
"sources": ["../../../../src/test-utils/dom/index.ts"]
There is no sourcesContent. Four levels up from test-utils/dom/ is outside the package, so the path resolves to node_modules/src/test-utils/dom/index.ts, which does not exist. All .js.map files in test-utils/ are the same.
Expected result
The test-utils maps embed their sources, as the component maps do. For example, internal/base-component/index.js.map has the same kind of path (../../../../src/internal/base-component/index.ts), but it also has sourcesContent, so tools do not need the file.
Cause
build-tools/tasks/typescript.js compiles the components with --sourceMap --inlineSources --declarationMap. build-tools/tasks/test-utils.js compiles test-utils with --sourceMap only:
await execa('tsc', ['-p', config, '--outDir', outDir, '--tsBuildInfoFile', `./lib/${theme.name}-test-utils.tsbuildinfo`, '--sourceMap'], ...);
The sources paths are relative to the build output folder (lib/components/test-utils/...), which is two levels deeper than the published package. Without --inlineSources, the maps need the .ts files at those paths, and the package does not include them.
Proposed fix
In build-tools/tasks/test-utils.js, add '--inlineSources' after '--sourceMap', the same as build-tools/tasks/typescript.js. Optionally also add '--declarationMap' to match the components.
Related
Source code
No response
Reproduction
No response
Code of Conduct
- I agree to follow this project's Code of Conduct
- I checked the current issues for duplicate problems
- Ngôn ngữ chính
- TypeScript
- Star
- 2.7k
- Fork
- 248
- Merge trung bình
- 2 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 89
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 cloudscape-design/components
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
cloudscape-design/components#5261 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[Bug]: PropertyFilter `virtualScroll` is ignored for enum token value listsCó thể đã có người làm @Mittalnew đã nhận 4 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
cloudscape-design/components#5244 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[Bug]: Circular app layout navigation and help icons are shifted upward in the official demoĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
cloudscape-design/components#5184 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
cloudscape-design/components#5152 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Select accepts selection after becoming disabled while openCó thể đã có người làm @Xapollon430 đã nhận 7 ngày trước. Đang mở
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 25/100
cloudscape-design/components#5231 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của cloudscape-design/components
Issue tương tự
-
pending close triaging
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 74/100
anomalyco/opencode#63090 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ai-driven-qa bug claude Cosmetic
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/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 76/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 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ai-driven-qa bug claude Minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
linagora/twake-mail-admin#609 ·
Maintainer thường phản hồi trong vòng 1 ngày