Skip to content

Commit 9ba077b

Browse files
authored
Merge branch 'main' into improve/dictionary
2 parents 47e357b + 15c3d36 commit 9ba077b

File tree

151 files changed

+5636
-1668
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+5636
-1668
lines changed

Diff for: .env.production

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ VITE_DEFAULT_ENGINE_INFOS=`[
1010
}
1111
]`
1212
VITE_OFFICIAL_WEBSITE_URL=https://voicevox.hiroshiba.jp/
13-
VITE_LATEST_UPDATE_INFOS_URL=https://raw.githubusercontent.com/VOICEVOX/voicevox_blog/master/src/data/updateInfos.json
13+
VITE_LATEST_UPDATE_INFOS_URL=https://voicevox.hiroshiba.jp/updateInfos.json
1414
VITE_GTM_CONTAINER_ID=GTM-DUMMY

Diff for: .env.test

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1+
# テスト用の.envファイル。モックを使う。
2+
13
VITE_APP_NAME=voicevox
24
VITE_DEFAULT_ENGINE_INFOS=`[
35
{
4-
"uuid": "074fc39e-678b-4c13-8916-ffca8d505d1d",
5-
"name": "VOICEVOX Engine",
6-
"executionEnabled": true,
7-
"executionFilePath": "../voicevox_engine/run.exe",
6+
"name": "Mock Engine",
7+
"uuid": "00000000-0000-0000-0000-000000000000",
8+
"executionEnabled": false,
9+
"executionFilePath": "dummy/path",
810
"executionArgs": [],
9-
"host": "http://127.0.0.1:50021"
11+
"host": "mock://mock"
1012
}
1113
]`
1214
VITE_OFFICIAL_WEBSITE_URL=https://voicevox.hiroshiba.jp/
13-
VITE_LATEST_UPDATE_INFOS_URL=https://raw.githubusercontent.com/VOICEVOX/voicevox_blog/master/src/data/updateInfos.json
15+
VITE_LATEST_UPDATE_INFOS_URL=https://voicevox.hiroshiba.jp/updateInfos.json
1416
VITE_GTM_CONTAINER_ID=GTM-DUMMY

Diff for: .github/actions/download-engine/action.yml

+7
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,13 @@ runs:
8585
mkdir -p $DEST
8686
mv $TEMPDIR/tmp-extract/$TARGET/* $DEST
8787
88+
# 実行ファイルのパーミッションを変更
89+
if [ "${{ runner.os }}" = "Windows" ]; then
90+
chmod +x $DEST/run.exe
91+
else
92+
chmod +x $DEST/run
93+
fi
94+
8895
echo "::group::ll $DEST"
8996
ls -al $DEST
9097
echo "::endgroup::"

Diff for: .github/actions/setup-environment/action.yml

-8
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,5 @@ runs:
3333
restore-keys: |
3434
${{ env.cache-version }}-${{ runner.os }}--electron-builder-cache-
3535
36-
- name: Cache external dependencies
37-
uses: actions/cache@v4
38-
with:
39-
path: ./build/vendored
40-
key: ${{ env.cache-version }}-${{ runner.os }}--vendored-${{ hashFiles('build/*.js') }}
41-
restore-keys: |
42-
${{ env.cache-version }}-${{ runner.os }}--vendored-
43-
4436
- shell: bash
4537
run: npm ci

Diff for: .github/workflows/build.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ on:
2626
default: false
2727

2828
env:
29-
VOICEVOX_ENGINE_VERSION: 0.22.0
30-
VOICEVOX_RESOURCE_VERSION: 0.22.0
29+
VOICEVOX_ENGINE_VERSION: 0.22.2
30+
VOICEVOX_RESOURCE_VERSION: 0.22.2
3131
VOICEVOX_EDITOR_VERSION:
3232
|- # releaseタグ名か、workflow_dispatchでのバージョン名か、999.999.999-developが入る
3333
${{ github.event.release.tag_name || github.event.inputs.version || '999.999.999-develop' }}

Diff for: .github/workflows/merge_gatekeeper.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: "Merge Gatekeeper"
2+
3+
# auto mergeとmerge queue用のチェッカー。
4+
# Approve数が足りているか、すべてのテストが通っているかを確認します。
5+
# 詳細: https://github.com/VOICEVOX/merge-gatekeeper
6+
7+
on:
8+
pull_request_target:
9+
types: [auto_merge_enabled]
10+
merge_group:
11+
types: [checks_requested]
12+
13+
jobs:
14+
merge_gatekeeper:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: voicevox/merge-gatekeeper@main
18+
with:
19+
token: ${{ secrets.GATEKEEPER_TOKEN }}
20+
required_score: 2
21+
score_rules: |
22+
#maintainer: 2
23+
#reviewer: 1
24+
- uses: upsidr/merge-gatekeeper@v1
25+
with:
26+
token: ${{ secrets.GITHUB_TOKEN }}
27+
self: merge_gatekeeper
28+
# https://github.com/upsidr/merge-gatekeeper/issues/71#issuecomment-1660607977
29+
ref: ${{ github.event.pull_request && github.event.pull_request.head.sha || github.ref }}
30+
timeout: 18000 # 5 hours

Diff for: .github/workflows/test.yml

+10-14
Original file line numberDiff line numberDiff line change
@@ -98,20 +98,6 @@ jobs:
9898
dest: ${{ github.workspace }}/voicevox_engine
9999
target: ${{ matrix.voicevox_engine_asset_name }}
100100

101-
- name: Setup
102-
run: |
103-
# run.exe
104-
chmod +x ${{ steps.download-engine.outputs.run_path }}
105-
106-
# .env
107-
sed -i -e 's|"074fc39e-678b-4c13-8916-ffca8d505d1d"|"208cf94d-43d2-4cf5-abc0-9783cac36d29"|' .env.test
108-
sed -i -e 's|"../voicevox_engine/run.exe"|"${{ steps.download-engine.outputs.run_path }}"|' .env.test
109-
# GitHub Actions 環境だとたまに50021が封じられていることがあるので、ランダムなポートを使うようにする
110-
PORT=$(node -r net -e "server=net.createServer();server.listen(0,()=>{console.log(server.address().port);server.close()})")
111-
sed -i -e 's|"host": "http://127.0.0.1:50021"|"host": "http://127.0.0.1:'$PORT'"|' .env.test
112-
sed -i -e 's|"executionArgs": \[\],|"executionArgs": ["--port='$PORT'"],|' .env.test
113-
cp .env.test .env
114-
115101
- name: Run npm run test:browser-e2e
116102
run: |
117103
if [ -n "${{ runner.debug }}" ]; then
@@ -125,6 +111,14 @@ jobs:
125111
126112
- name: Run npm run test:electron-e2e
127113
run: |
114+
# .env
115+
cp tests/env/.env.test-electron .env
116+
sed -i -e 's|"path/to/engine"|"${{ steps.download-engine.outputs.run_path }}"|' .env
117+
# GitHub Actions 環境だとたまに50021が封じられていることがあるので、ランダムなポートを使うようにする
118+
PORT=$(node -r net -e "server=net.createServer();server.listen(0,()=>{console.log(server.address().port);server.close()})")
119+
sed -i -e 's|random_port|'$PORT'|' .env
120+
cat .env # ログ用
121+
128122
if [ -n "${{ runner.debug }}" ]; then
129123
export DEBUG="pw:browser*"
130124
fi
@@ -134,6 +128,8 @@ jobs:
134128
npm run test:electron-e2e
135129
fi
136130
131+
rm .env
132+
137133
- name: Run npm run test:storybook-vrt
138134
run: |
139135
if [ -n "${{ runner.debug }}" ]; then

Diff for: openapi.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package-lock.json

+26-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"glob": "11.0.0",
5858
"hotkeys-js": "3.13.6",
5959
"immer": "9.0.21",
60+
"kuromoji": "github:VOICEVOX/kuromoji.js#0.0.1",
6061
"markdown-it": "13.0.2",
6162
"move-file": "3.0.0",
6263
"multistream": "4.1.0",

Diff for: playwright.config.ts

+11-24
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,22 @@
1-
import type { PlaywrightTestConfig, Project } from "@playwright/test";
2-
import { z } from "zod";
1+
/**
2+
* e2eテストと .env の設計:
3+
* - デフォルトで .env.test を読み込む。
4+
* モックエンジンが使われる。
5+
* - Electronテストはテストファイル内で様々な .env を読み込む。
6+
* テスト条件によって用意したい環境が異なるため。
7+
*/
38

9+
import type { PlaywrightTestConfig, Project } from "@playwright/test";
410
import dotenv from "dotenv";
5-
dotenv.config({ override: true });
11+
12+
dotenv.config({ path: ".env.test", override: true });
613

714
let project: Project;
815
let webServers: PlaywrightTestConfig["webServer"];
916
const isElectron = process.env.VITE_TARGET === "electron";
1017
const isBrowser = process.env.VITE_TARGET === "browser";
1118
const isStorybook = process.env.TARGET === "storybook";
1219

13-
// エンジンの起動が必要
14-
const defaultEngineInfosEnv = process.env.VITE_DEFAULT_ENGINE_INFOS ?? "[]";
15-
const envSchema = z // FIXME: electron起動時のものと共通化したい
16-
.object({
17-
host: z.string(),
18-
executionFilePath: z.string(),
19-
executionArgs: z.array(z.string()),
20-
executionEnabled: z.boolean(),
21-
})
22-
.passthrough()
23-
.array();
24-
const engineInfos = envSchema.parse(JSON.parse(defaultEngineInfosEnv));
25-
26-
const engineServers = engineInfos
27-
.filter((info) => info.executionEnabled)
28-
.map((info) => ({
29-
command: `${info.executionFilePath} ${info.executionArgs.join(" ")}`,
30-
url: `${info.host}/version`,
31-
reuseExistingServer: !process.env.CI,
32-
}));
3320
const viteServer = {
3421
command: "vite --mode test --port 7357",
3522
port: 7357,
@@ -46,7 +33,7 @@ if (isElectron) {
4633
webServers = [viteServer];
4734
} else if (isBrowser) {
4835
project = { name: "browser", testDir: "./tests/e2e/browser" };
49-
webServers = [viteServer, ...engineServers];
36+
webServers = [viteServer];
5037
} else if (isStorybook) {
5138
project = { name: "storybook", testDir: "./tests/e2e/storybook" };
5239
webServers = [storybookServer];

Diff for: public/qAndA.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
Windows/Mac/Linux 搭載の PC に対応しています。
1010

1111
※Windows:Windows 10・Windows 11
12-
※Mac:macOS 12(Monterey)以降
12+
※Mac:macOS 13(Ventura)以降
1313
※Linux:Ubuntu 20.04・Ubuntu 22.04
1414

1515
#### GPU 版

Diff for: public/updateInfos.json

+15
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
11
[
2+
{
3+
"version": "0.22.3",
4+
"descriptions": ["キャラクター「ぞん子」を追加"],
5+
"contributors": []
6+
},
7+
{
8+
"version": "0.22.2",
9+
"descriptions": ["キャラクター「中部つるぎ」を追加"],
10+
"contributors": []
11+
},
12+
{
13+
"version": "0.22.1",
14+
"descriptions": ["バグ修正"],
15+
"contributors": ["Hiroshiba", "sevenc-nanashi"]
16+
},
217
{
318
"version": "0.22.0",
419
"descriptions": [

Diff for: src/backend/browser/browserConfig.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { BaseConfigManager, Metadata } from "@/backend/common/ConfigManager";
55
import { ConfigType, EngineId, engineSettingSchema } from "@/type/preload";
66
import { ensureNotNullish } from "@/helpers/errorHelper";
77
import { UnreachableError } from "@/type/utility";
8+
import { isMac } from "@/helpers/platform";
89

910
const dbName = `${import.meta.env.VITE_APP_NAME}-web`;
1011
const settingStoreKey = "config";
@@ -20,7 +21,7 @@ const defaultEngineId = EngineId(defaultEngine.uuid);
2021
export async function getConfigManager() {
2122
await configManagerLock.acquire("configManager", async () => {
2223
if (!configManager) {
23-
configManager = new BrowserConfigManager();
24+
configManager = new BrowserConfigManager({ isMac });
2425
await configManager.initialize();
2526
}
2627
});

Diff for: src/backend/browser/fakePath.ts

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { z } from "zod";
2+
import { uuid4 } from "@/helpers/random";
3+
4+
const fakePathSchema = z
5+
.string()
6+
.regex(/^<browser-dummy-[0-9a-f]+>-.+$/)
7+
.brand("FakePath");
8+
export type FakePath = z.infer<typeof fakePathSchema>;
9+
10+
export const isFakePath = (path: string): path is FakePath => {
11+
return fakePathSchema.safeParse(path).success;
12+
};
13+
14+
export const createFakePath = (name: string): FakePath => {
15+
return fakePathSchema.parse(`<browser-dummy-${uuid4()}>-${name}`);
16+
};

0 commit comments

Comments
 (0)