Dependency analysis

オープン
#8,499 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
静か
技術スタック
javascript

調査の方向性

リンクされている res-dep-issue の例から始め、その main ブランチと rescript-11-cjs ブランチを比較し、pnpm 形式のリンク失敗を再現します。次に、コンパイラの依存関係分析のエントリポイントを読み、package.json の依存関係をどのようにチェックすべきかを判断します。提案した分析によって誤った依存関係を確実に特定でき、Knip との統合への明確な道筋があることを完了条件とします。

索引モデルが issue の本文から書いたものです。

説明

Currently it is very hard to analyze where a dependency will be imported, for example:

type t

@module("dep") external make: unit => t = "make"

let timeMake = () => {
  Js.Console.timeStart("make")
  let t = make()
  Js.Console.timeEnd("make")
  t
} 

A consuming module may import dep directly, or it may not depending on which function is used and if there is an interface file.

If dependencies, devDependencies, and peerDependencies are not properly set this may become a problem for certain package manager setups. A small change could end up causing a runtime error. It could be particularly insidious if it is a rarely used or lazy loaded binding.

Due to the different dependency types often being misunderstood and the complexity of analysis, I believe ReScript should have the ability to check package.json dependencies for correctness.

I've had Claude create an example project here that failures when using pnpm style linking. The main branch uses ReScript 12 and ESM, but there is also a rescript-11-cjs branch for reference.

BTW it could be helpful if this feature was implemented in a way that we could integrate with Knip as a plugin

主要言語
OCaml
スター
7.5k
フォーク
485
平均マージ
1日 2時間
マージ済み PR(30日)
55

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

rescript-lang/rescript のほかの issue

rescript-lang/rescript の issue をすべて見る

似ている issue

Build System の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。