Skip to content

Commit 143577b

Browse files
authored
Merge branch 'main' into add/loop_2224
2 parents 6a012cd + a12d9ca commit 143577b

File tree

10 files changed

+11091
-17616
lines changed

10 files changed

+11091
-17616
lines changed

.github/actions/setup-environment/action.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@ runs:
1111
echo "ELECTRON_BUILDER_CACHE=${{ runner.temp }}/electron-builder-cache" >> $GITHUB_ENV
1212
echo "cache-version=1" >> $GITHUB_ENV
1313
14+
- name: Setup pnpm
15+
uses: pnpm/action-setup@v4
16+
1417
- name: Setup Node
1518
uses: actions/setup-node@v4
1619
with:
1720
node-version-file: ".node-version"
18-
cache: "npm"
21+
cache: "pnpm"
1922

2023
- name: Cache Electron
2124
uses: actions/cache@v4
@@ -34,4 +37,4 @@ runs:
3437
${{ env.cache-version }}-${{ runner.os }}--electron-builder-cache-
3538
3639
- shell: bash
37-
run: npm ci
40+
run: pnpm install --frozen-lockfile

.github/workflows/build.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,14 @@ jobs:
158158
159159
$sed -i 's/"version": "999.999.999"/"version": "${{ env.VOICEVOX_EDITOR_VERSION }}"/' package.json
160160
161+
- name: Setup pnpm
162+
uses: pnpm/action-setup@v4
163+
161164
- name: Setup Node
162165
uses: actions/setup-node@v4
163166
with:
164167
node-version-file: ".node-version"
165-
cache: "npm"
168+
cache: "pnpm"
166169

167170
- name: Cache Electron
168171
uses: actions/cache@v4
@@ -181,7 +184,7 @@ jobs:
181184
${{ env.cache-version }}-${{ runner.os }}--electron-builder-cache-
182185
183186
- name: Install dependencies
184-
run: npm ci
187+
run: pnpm i --frozen-lockfile
185188

186189
- name: Checkout Product Version Resource
187190
uses: actions/checkout@v4
@@ -221,7 +224,7 @@ jobs:
221224
$sed -i 's/VITE_GTM_CONTAINER_ID=.*/VITE_GTM_CONTAINER_ID='"$gtm_id"'/' .env.production
222225
223226
- name: Generate public/licenses.json
224-
run: npm run license:generate -- -o public/licenses.json
227+
run: pnpm run license:generate -o public/licenses.json
225228

226229
- name: Define Code Signing Envs
227230
if: startsWith(matrix.os, 'windows-') && github.event.inputs.code_signing == 'true'
@@ -251,7 +254,7 @@ jobs:
251254

252255
# https://github.com/electron-userland/electron-builder/issues/3179
253256
USE_HARD_LINKS: false
254-
run: npm run electron:build -- --dir
257+
run: pnpm run electron:build --dir
255258

256259
- name: Reset Code Signing Envs
257260
if: startsWith(matrix.os, 'windows-') && github.event.inputs.code_signing == 'true'
@@ -284,7 +287,7 @@ jobs:
284287
rm "${{ matrix.app_asar_dir }}/app.asar"
285288
286289
mv voicevox_engine/licenses.json engine_licenses.json
287-
npm run license:merge -- -o "${{ matrix.app_asar_dir }}/app/dist/licenses.json" -i engine_licenses.json -i "${{ matrix.app_asar_dir }}/app/dist/licenses.json"
290+
pnpm run license:merge -o "${{ matrix.app_asar_dir }}/app/dist/licenses.json" -i engine_licenses.json -i "${{ matrix.app_asar_dir }}/app/dist/licenses.json"
288291
289292
# Repack asar
290293
npx asar pack "${{ matrix.app_asar_dir }}/app" "${{ matrix.app_asar_dir }}/app.asar"
@@ -413,14 +416,14 @@ jobs:
413416
LINUX_ARTIFACT_NAME: ${{ matrix.linux_artifact_name }}
414417
LINUX_EXECUTABLE_NAME: ${{ matrix.linux_executable_name }}
415418
run: |
416-
npm run electron:build -- --prepackaged prepackage/
419+
pnpm run electron:build --prepackaged prepackage/
417420
418421
- name: Build Electron (for macOS)
419422
if: endsWith(matrix.installer_artifact_name, '-dmg') # macOS
420423
env:
421424
MACOS_ARTIFACT_NAME: ${{ matrix.macos_artifact_name }}
422425
run: |
423-
npm run electron:build -- --prepackaged prepackage/VOICEVOX.app
426+
pnpm run electron:build --prepackaged prepackage/VOICEVOX.app
424427
425428
- name: Reset Code Signing Envs
426429
if: startsWith(matrix.os, 'windows-') && github.event.inputs.code_signing == 'true'

.github/workflows/build_preview_pages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ jobs:
3333
fi
3434
3535
# Storybookのビルド
36-
npm run storybook:build -- --output-dir $(pwd)/dist_preview/storybook
36+
pnpm run storybook:build --output-dir $(pwd)/dist_preview/storybook
3737
3838
# ブラウザ版エディタのビルド
3939
VITE_EXTRA_VERSION_INFO="${LOCATION} @ ${SHORT_SHA}" \
40-
npm run browser:build -- --base ./ --outDir $(pwd)/dist_preview/editor
40+
pnpm run browser:build --base ./ --outDir $(pwd)/dist_preview/editor
4141
4242
- name: Upload artifact
4343
uses: actions/upload-artifact@v4

.github/workflows/test.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
- uses: actions/checkout@v4
4646
- name: Setup environment
4747
uses: ./.github/actions/setup-environment
48-
- run: npm run electron:build
48+
- run: pnpm run electron:build
4949

5050
# unit テスト
5151
unit-test:
@@ -57,7 +57,7 @@ jobs:
5757

5858
- name: Run test
5959
run: |
60-
npm run test:unit
60+
pnpm run test:unit
6161
6262
# e2e テスト
6363
e2e-test:
@@ -98,7 +98,7 @@ jobs:
9898
dest: ${{ github.workspace }}/voicevox_engine
9999
target: ${{ matrix.voicevox_engine_asset_name }}
100100

101-
- name: Run npm run test:browser-e2e
101+
- name: Run pnpm run test:browser-e2e
102102
run: |
103103
if [ -n "${{ runner.debug }}" ]; then
104104
export DEBUG="pw:browser*"
@@ -107,9 +107,9 @@ jobs:
107107
if [[ ${{ needs.config.outputs.shouldUpdateSnapshots }} == 'true' ]]; then
108108
ARGS="--update-snapshots"
109109
fi
110-
npm run test:browser-e2e -- $ARGS
110+
pnpm run test:browser-e2e $ARGS
111111
112-
- name: Run npm run test:electron-e2e
112+
- name: Run pnpm run test:electron-e2e
113113
run: |
114114
# .env
115115
cp tests/env/.env.test-electron .env
@@ -123,14 +123,14 @@ jobs:
123123
export DEBUG="pw:browser*"
124124
fi
125125
if [[ ${{ matrix.os }} == ubuntu-* ]]; then
126-
xvfb-run --auto-servernum npm run test:electron-e2e
126+
xvfb-run --auto-servernum pnpm run test:electron-e2e
127127
else
128-
npm run test:electron-e2e
128+
pnpm run test:electron-e2e
129129
fi
130130
131131
rm .env
132132
133-
- name: Run npm run test:storybook-vrt
133+
- name: Run pnpm run test:storybook-vrt
134134
run: |
135135
if [ -n "${{ runner.debug }}" ]; then
136136
export DEBUG="pw:browser*"
@@ -139,7 +139,7 @@ jobs:
139139
if [[ ${{ needs.config.outputs.shouldUpdateSnapshots }} == 'true' ]]; then
140140
ARGS="--update-snapshots"
141141
fi
142-
npm run test:storybook-vrt -- $ARGS
142+
pnpm run test:storybook-vrt $ARGS
143143
144144
- name: Upload playwright report to artifact
145145
if: failure()
@@ -239,9 +239,9 @@ jobs:
239239
uses: ./.github/actions/setup-environment
240240

241241
- name: Disallowed licenses check
242-
run: npm run license:generate -- -o voicevox_licenses.json
242+
run: pnpm run license:generate -o voicevox_licenses.json
243243

244-
- run: npm run typecheck
245-
- run: npm run lint
246-
- run: npm run markdownlint
247-
- run: npm run typos
244+
- run: pnpm run typecheck
245+
- run: pnpm run lint
246+
- run: pnpm run markdownlint
247+
- run: pnpm run typos

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
engine-strict=true
22
save-exact=true
33
@jsr:registry=https://npm.jsr.io
4+
manage-package-manager-versions=true

CONTRIBUTING.md

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ VOICEVOXには、下記のような貢献の仕方があります。
7878
### 2. 開発環境の構築
7979

8080
- 必須ツール
81+
8182
- [Node.js](https://nodejs.org/en/download/releases/)\
8283
[こちら](https://github.com/VOICEVOX/voicevox/blob/main/.node-version)に記載されているバージョンのインストーラを入手し、インストールします。
8384

@@ -119,8 +120,13 @@ git clone git@github.com:(個人のGitHubアカウント名)/voicevox.git
119120
### 5. 必要なプログラムをダウンロードする
120121

121122
- 手順4で手に入れたフォルダを開いて、コマンドプロンプトを開きます。
122-
- 環境を準備するコマンド `npm ci`
123-
を実行してください。自動的にダウンロードされます。
123+
- 環境を準備する以下のコマンドを実行してください。自動的にダウンロードされます。
124+
125+
```bash
126+
npm install -g pnpm
127+
pnpm i
128+
```
129+
124130
- ツールの組み合わせや実装に関する警告が表示されますが、開発環境を作るうえでは無視して差し支えありません。
125131

126132
### 6. エンジンを指定する
@@ -150,7 +156,7 @@ VITE_DEFAULT_ENGINE_INFOS=`[
150156

151157
### 7. 始動してみる
152158

153-
- `npm run electron:serve`を実行します。
159+
- `pnpm run electron:serve`を実行します。
154160
- 設定が正しければ、開発環境が起動するはずです。
155161

156162
## プロジェクトへの貢献手順
@@ -222,46 +228,46 @@ VITE_DEFAULT_ENGINE_INFOS=`[
222228
- 記述コードがコーディングルールに沿っていることを確認します。(特に今回の作業によって警告やエラーが増えていないかどうかに注目してください)
223229

224230
```bash
225-
npm run lint
226-
npm run fmt
231+
pnpm run lint
232+
pnpm run fmt
227233
```
228234

229235
- TypeScriptの型チェックを行います。
230236

231237
```bash
232-
npm run typecheck
238+
pnpm run typecheck
233239
```
234240

235241
- Markdownの記述が正しいことを確認します。
236242

237243
```bash
238-
npm run markdownlint ./*/*.md
244+
pnpm run markdownlint ./*/*.md
239245
```
240246

241247
- 命名に使っている英語が誤っていないことを確認します。
242248

243249
```bash
244-
npm run typos
250+
pnpm run typos
245251
```
246252

247253
- 個人環境でVOICEVOXを実行し、提出前に、一通り動くことを確認します。
248254

249255
```bash
250-
npm run electron:serve
256+
pnpm run electron:serve
251257
```
252258

253259
- 使用するライブラリのライセンスに使用出来ないものが使われていないことを確認します。
254260

255261
```bash
256-
npm run license:generate -- -o voicevox_licenses.json
262+
pnpm run license:generate -- -o voicevox_licenses.json
257263
```
258264

259265
- e2eテストの内容を確認します。
260266

261267
```bash
262-
npm run test:unit
263-
npm run test:browser-e2e
264-
npm run test:electron-e2e
268+
pnpm run test:unit
269+
pnpm run test:browser-e2e
270+
pnpm run test:electron-e2e
265271
```
266272

267273
- e2eテストは実際には自分が提出する範囲外の指摘をしたり、完全に警告が消えないことがあります。

0 commit comments

Comments
 (0)