Repository navigation
Node を 26 系に上げて依存を更新し、依存の install スクリプトを止める - #154
Merged
Merged
Conversation
npm 11.20 の allowScripts で依存の install スクリプトをすべて拒否として記録する。 esbuild・node-llama-cpp・fsevents はビルド済みバイナリが optionalDependencies で入り、 electron-winstaller は使っていない Squirrel 用なので、止めてもテスト・ビルド・起動は通る。 古い npm は allowScripts を無視して全部走らせるため、devEngines で npm 11.20 未満を止める。 .npmrc で公開から 7 日未満の版(min-release-age)と git 参照の依存(allow-git)を拒む。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
24 系は Maintenance LTS に移った。@types/node は Electron 44 に同梱の Node(24 系)に 合わせて 24 系のままにする。メジャー版の上がる依存(electron 45・vite 8・electron-vite 6・ @vitejs/plugin-react 6・sherpa-onnx-node 2・oxfmt 0.79)は個別に確かめるため入れない。 node_modules のキャッシュのキーも Node の版に合わせて変える。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
devEngines を engines の後ろに入れていて、fmt:check で落ちていた。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
変更内容
Node と依存の更新
mise.toml・各ワークフローのsetup-node・node_modulesのキャッシュのキー(node24→node26)を揃えた。@types/nodeは 24 系のまま。Electron 44 に入っている Node が 24.22.2 なので、26 の型を入れると本番では使えない API を型検査で見逃すため。サプライチェーン攻撃への対策
allowScriptsで、esbuild/node-llama-cpp/fsevents/electron-winstallerをすべて拒否(false)として記録した。前の 3 つはビルド済みのバイナリが optionalDependencies で入り、electron-winstallerは使っていない Squirrel 用のビルドにしか使わないので、止めても動く。ルートのpostinstall(install-electronとパッチ)は走る。allowScriptsを無視して全部走らせるため、devEnginesで npm 11.20 未満をEBADDEVENGINESで止める。.npmrcを追加:min-release-age=7で公開から 7 日未満の版を入れない(乗っ取られた版の多くは数日で取り下げられる)。allow-git=noneで git 参照の依存も拒む。更新の手順
スクリプトを止めた状態(
--ignore-scripts)で lockfile を作り、中身を確かめてから入れた。resolvedはすべてregistry.npmjs.orgで、全パッケージに sha512 のintegrityがある@rollup/rollup-android-x64だけ(rollup 4.68.4 自身の optionalDependencies。SLSA の来歴つき)npm audit signatures: 472 パッケージの署名を検証、127 に来歴(attestation)があるOnPostInstallCommand.js)は旧版と同じ残っている audit の指摘
npm auditの moderate 6 件は、electron-builder 内部のminimatchの ReDoS で、ビルドの道具の中だけの話。npm が示す修正は electron-builder を 25 系に下げるものなので入れていない。確認
npm run typecheck && npm run lint && npm testが通る(Node 26 で。fmt:check・buildも通過、テスト 1993 件)docs/decisions.html)を確認した — Node の版や依存の導入に触れる ADR は無かったほかに手元で確かめたこと:
getLlama({ build: 'never' }))NSAudioCaptureUsageDescriptionが入っている(ルートの postinstall が走っている)npm ciがEBADDEVENGINESで止まる注意: マージ後は、手元の開発環境(Windows を含む)でも Node 26 にしてから
npm ciし直す必要がある。🤖 Generated with Claude Code