Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Build-test fixtures that no longer test what they claim

已關閉 適合新手
#8,827 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

已經有一個關聯 PR 被合併了。

  • #8838 來自 @cknitt —— 已合併

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
78/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
javascript, node.js, ocaml
領域
testing

研究方向

閱讀 tests/build_tests/rescript_tools_binary_path/input.js 及其 fixture 設定,接著檢查 weird_deps 和 weird_devdeps 的 rescript.json 檔案。為 rescript_tools_binary_path 新增一個 fixture package.json,並將其他 fixture 的 sources 設為空清單。完成標準是這些 fixture 能驗證預期的套件匯入行為,且不再列出已刪除的原始碼資料夾。

由索引模型根據 Issue 內容生成。

描述

Found by adversarial experiments on semantic analysts.

Each item below is a build-test fixture whose setup no longer matches its purpose.

  • rescript_tools_binary_path passes with the import it guards against.
    • input.js runs the compiled src/Main.mjs and src/Main.cjs inside the repository.
    • The fixture has no package.json, so Node resolves # specifiers in those files against the repository root package.json, which defines #cli/*.
    • The bug fixed by #8694 (@module("#cli/bins") emitted into user code) therefore does not reproduce here. The commit message of 45446347c says the test uses its own package.json, but none is checked in.
    • Reproduction at 8d51b9ce7 in tests/build_tests/rescript_tools_binary_path, with node_modules/rescript linked to the repo root as input.js does. The two files contain the JS that bsc emits for the pre-#8694 external:
      printf 'import * as Bins from "#cli/bins";\nconsole.log(Bins.rescript_tools_exe);\n' > src/Old.mjs
      printf 'let Bins = require("#cli/bins");\nconsole.log(Bins.rescript_tools_exe);\n' > src/Old.cjs
      node src/Old.mjs; node src/Old.cjs   # both print …/bin/rescript-tools.exe
      echo '{"name":"user-project","private":true}' > package.json
      node src/Old.mjs   # ERR_PACKAGE_IMPORT_NOT_DEFINED
      node src/Old.cjs   # Error: Cannot find module '#cli/bins'
      
    • With that package.json in place, the current Main.mjs and Main.cjs (importing rescript/tools) still print the binary path.
    • Fix: check in a fixture package.json.
  • weird_deps and weird_devdeps list deleted source folders.
主要語言
OCaml
星號
7.5k
分支
484
平均合併
20 小時 27 分鐘
30 天內合併 PR
120

環境準備

在 Codespaces 中開啟

在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

rescript-lang/rescript 的其他 Issue

查看 rescript-lang/rescript 的全部 Issue

相似的 Issue

更多 Testing & QA Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。