Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: インポート一覧をチェックするように #2513

Merged
merged 10 commits into from
Jan 31, 2025

Conversation

sevenc-nanashi
Copy link
Member

内容

dist/{main.js,preload.js}のimport/requireの一覧をチェックし、怪しいモノがあれば弾くようにします。

関連 Issue

スクリーンショット・動画など

(なし)

その他

(なし)

@sevenc-nanashi sevenc-nanashi requested a review from a team as a code owner January 29, 2025 22:47
@sevenc-nanashi sevenc-nanashi requested review from Hiroshiba and Copilot and removed request for a team and Hiroshiba January 29, 2025 22:47
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • package.json: Language not supported

tools/checkSuspiciousImports.mts Show resolved Hide resolved
@voicevox-preview-pages
Copy link

voicevox-preview-pages bot commented Jan 29, 2025

🚀 プレビュー用ページを作成しました 🚀

更新時点でのコミットハッシュ:93dfa80

Copy link
Member

@Hiroshiba Hiroshiba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whyがわからなくなってるかもです・・・!

まずこのPRの意図としては、pnpmelectron-builderを組み合わせるとバンドルがうまく行かないことがあり、その条件に当てはまるものをチェックするため・・・とかですよね!

で、この意図はコードとして書かれないので、なぜ存在してどういうときにコードを消せるのかわからなくなってるかもです。

どうするのが良さそうでしょうか? 👀
(いろいろ解決策を考えましたが、あえてオープンに聞いてみてます)

@sevenc-nanashi
Copy link
Member Author

あー、Issue URLをdoc commentに書くとかですかね?

Copy link
Member

@Hiroshiba Hiroshiba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

すみません遅くなりました!
ほぼLGTMです!!

ちなみになのですが、今viteでチェックしてるけど、別途CIでチェックに変えられたりしないですかね・・・?
というのもこれだとelectronが実行されるたびに実行されちゃうんだよなーと。
(eslintとかもvite使うたびに実行されるのでなんとかしたい気持ち)

tools/checkSuspiciousImports.mts Outdated Show resolved Hide resolved
allowedInTryCatchModules?: string[];
list?: boolean;
};
export function checkSuspiciousImports(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(判断コメント)

このファイルのコードは相当文脈が深く、何やってるか雰囲気はわかるけどぶっちゃけメンテは大変そうな気がしています。
特にacornライブラリを使う周りが専門知識。(どうしようもない)

なのでこのコードのメンテは @sevenc-nanashi さんに頼らせていただけると頼もしいです!!

vite.config.mts Outdated Show resolved Hide resolved
@sevenc-nanashi
Copy link
Member Author

electronが実行されるたびに実行されちゃう

electron:buildとかのbuild系でNODE_ENV=productionをつけて、NODE_ENV === productionならプラグイン追加とかですかね?

@Hiroshiba
Copy link
Member

あ、prodのときのみ実行良いですね!!
NODE_ENV設定する形が良さそう!!

Copy link
Member

@Hiroshiba Hiroshiba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!

ありがとうございます、マージします!!!
どんどんこうやってリファクタリングしていきたいですね!!!!!

@Hiroshiba Hiroshiba enabled auto-merge January 31, 2025 19:00
@Hiroshiba Hiroshiba added this pull request to the merge queue Jan 31, 2025
Merged via the queue into VOICEVOX:main with commit 757841c Jan 31, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants