Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 24
node-version: 26

- name: 版を上げてブランチを push
id: bump
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 24
node-version: 26

# npm の tarball キャッシュ(setup-node の cache: npm)では、postinstall が
# 落とす Electron 本体や node-llama-cpp のバイナリは毎回取り直しになり、
Expand All @@ -97,7 +97,7 @@ jobs:
uses: actions/cache@v4
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ runner.arch }}-node24-${{ steps.deps.outputs.key }}
key: node-modules-${{ runner.os }}-${{ runner.arch }}-node26-${{ steps.deps.outputs.key }}

- name: 依存関係をインストール
if: steps.node-modules-cache.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -151,7 +151,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 24
node-version: 26

# キーに runner.os を含むので、macOS の node_modules とは混ざらない。
# キーは lockfile から版を除いた中身で作る。版上げのたびにキャッシュを外さないため(scripts/version-bump.mjs)。
Expand All @@ -165,7 +165,7 @@ jobs:
uses: actions/cache@v4
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ runner.arch }}-node24-${{ steps.deps.outputs.key }}
key: node-modules-${{ runner.os }}-${{ runner.arch }}-node26-${{ steps.deps.outputs.key }}

- name: 依存関係をインストール
if: steps.node-modules-cache.outputs.cache-hit != 'true'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 24
node-version: 26

# タグ上で保存したキャッシュは次のタグから見えないので、main の CI が作った分を
# 読むだけにする(ここで保存しても使われず、後処理の時間だけがかかる)。
Expand All @@ -82,7 +82,7 @@ jobs:
uses: actions/cache/restore@v4
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ runner.arch }}-node24-${{ steps.deps.outputs.key }}
key: node-modules-${{ runner.os }}-${{ runner.arch }}-node26-${{ steps.deps.outputs.key }}

- name: 依存関係をインストール
if: steps.node-modules-cache.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -199,7 +199,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 24
node-version: 26

# main の CI(test-windows)が作ったキャッシュを読むだけにする。キーは ci.yml と揃える。
# キーは lockfile から版を除いた中身で作る。版上げのたびにキャッシュを外さないため(scripts/version-bump.mjs)。
Expand All @@ -213,7 +213,7 @@ jobs:
uses: actions/cache/restore@v4
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ runner.arch }}-node24-${{ steps.deps.outputs.key }}
key: node-modules-${{ runner.os }}-${{ runner.arch }}-node26-${{ steps.deps.outputs.key }}

- name: 依存関係をインストール
if: steps.node-modules-cache.outputs.cache-hit != 'true'
Expand Down
10 changes: 10 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# 依存の導入を、乗っ取られた版や改ざんされた取得元から守るための設定。
#
# 公開から 7 日経っていない版は解決の候補にしない。乗っ取られたアカウントから出た版の
# 多くは数日で見つかって取り下げられるため、出たばかりの版を避けるだけで大半を外せる。
# 急ぎで新しい版が要るとき(脆弱性の修正など)は、そのパッケージを確かめたうえで
# `npm install <pkg>@<版> --min-release-age=0` のように一度だけ外す。
min-release-age=7
# git 参照の依存はレジストリの署名・完全性の検証を通らず、取得時に prepare スクリプトも走る。
# 今の依存には無いので、入ってこないように拒む。
allow-git=none
8 changes: 8 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ npx vitest run -t "テスト名の一部"
`@voidzero-dev/vite-plus-core` に差し替える前提で、electron-vite 5 の peerDependencies
(`vite ^5 || ^6 || ^7`)と合わないため入れていない。electron-vite が Vite 8 に対応したら見直す。
一括整形のコミットは `.git-blame-ignore-revs` に載せてある(`git config blame.ignoreRevsFile .git-blame-ignore-revs`)。
- **依存の install スクリプトは走らせない**。npm 11.20 以降は `package.json` の `allowScripts` に許可したものだけを
走らせるので、今は全部を `false` にしてある(`esbuild` / `node-llama-cpp` / `fsevents` / `electron-winstaller`。
どれもビルド済みバイナリが optionalDependencies で入るか、使っていない Squirrel 用で、止めても動く)。
古い npm は `allowScripts` を無視して全部走らせるため、`devEngines` で npm 11.20 未満を止めている。
ルートの `postinstall`(`install-electron` とパッチ)は自分のスクリプトなので走る。依存を足して
`npm warn install-scripts` が出たら、中身を読んでから `npm install-scripts approve <pkg>`(版を固定して許可)か
`deny` にする。`.npmrc` の `min-release-age=7` で公開から 7 日未満の版は入らない(乗っ取られた版の多くは数日で取り下げられる)。
依存を上げたら lockfile の `resolved` がレジストリだけか、増えたパッケージは何か、`npm audit signatures` が通るかを見る。
- `dev` / `typecheck` / `test` の前に `scripts/check-node-modules.mjs` が走り、
`node_modules` が `package-lock.json` と食い違っていれば止める。worktree を別ブランチに
使い回すと lockfile だけが進み、古い依存(例: Electron 33 のまま)が型エラーなど
Expand Down
6 changes: 3 additions & 3 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 開発時の Node は Active LTS(24 系)に揃える。
# 25 系は非 LTS で、vitest など一部ツールの engines 制約から外れる。
# 開発時の Node は Active LTS(26 系)に揃える。
# 奇数版(25・27 系)は非 LTS で、vitest など一部ツールの engines 制約から外れる。
[tools]
node = "24"
node = "26"
Loading
Loading