[Bug]: test-utils sourcemaps point to sources that are not in the package
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 88/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- react, typescript
- 領域
- build-system
調査の方向性
build-tools/tasks/test-utils.jsを読み、そのTypeScriptコンパイラーオプションをbuild-tools/tasks/typescript.jsと比較してください。issueでは、test-utilsのビルドに--inlineSourcesを追加することが提案されています。生成されたtest-utils/内の.js.mapファイルにsourcesContentが含まれていることを確認し、ツールがパッケージ外のソースファイルを探さずにマップを解決できることを検証してください。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- TypeScript
- スター
- 2.7k
- フォーク
- 248
- 平均マージ
- 2日 7時間
- マージ済み PR(30日)
- 89
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
cloudscape-design/components のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
cloudscape-design/components#5261 ·
メンテナーはふだん 2 日以内に返信
-
[Bug]: PropertyFilter `virtualScroll` is ignored for enum token value lists対応中かも @Mittalnew が 4 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
cloudscape-design/components#5244 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
cloudscape-design/components#5184 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
cloudscape-design/components#5152 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
Select accepts selection after becoming disabled while open対応中かも @Xapollon430 が 7 日前に担当しました。 オープン
難易度 3/5 半日 初心者へのやさしさ 25/100
cloudscape-design/components#5231 ·
メンテナーはふだん 2 日以内に返信
cloudscape-design/components の issue をすべて見る
似ている issue
-
Add: Tom Sings TV HDオープンapproved check:passed streams:add
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
duolicious/duolicious#1943 ·
メンテナーはふだん 1 日以内に返信
-
bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
nightly-labs/openbot#6451 ·
メンテナーはふだん 1 日以内に返信
-
level1 nsoc26
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
GauravKarakoti/SecureFlow#1719 ·
メンテナーはふだん 1 日以内に返信
-
complexity: easy good first issue impact: low
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ueberdosis/hocuspocus#1211 ·
メンテナーはふだん 1 日以内に返信