Skip to content

Commit

Permalink
Merge branch 'main' of github.com:VOICEVOX/voicevox
Browse files Browse the repository at this point in the history
VOICEVOX 側で UI のリデザインが行われた影響で、特に設定ダイヤログ系のコンフリクトが多発している
AivisSpeech で大幅にデザインをカスタムしている箇所を VOICEVOX 側に合わせるのは時間的にもコスト的に厳しいことから、当面の間 <script> 以下のロジックの差分のみマージし、HTML / SCSS 部分は極力 Quasar で書かれた (AivisSpeech で大幅にカスタマイズされた) 旧 UI を継続利用する方針とした
  • Loading branch information
tsukumijima committed Dec 1, 2024
2 parents 2086dea + 2646307 commit be788e2
Show file tree
Hide file tree
Showing 359 changed files with 33,048 additions and 23,549 deletions.
68 changes: 60 additions & 8 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,31 @@
/** @type {import('@typescript-eslint/utils').TSESLint.Linter.Config} */
const vueEslintParser = "vue-eslint-parser";
const vueEslintParserOptions = {
ecmaVersion: 2020,
parser: "@typescript-eslint/parser",
};
const tsEslintOptions = {
project: ["./tsconfig.json"],
tsconfigRootDir: __dirname,
};

const tsEslintRules = {
// Storeでよくasyncなしの関数を定義するので無効化
// TODO: いずれは有効化する
"@typescript-eslint/require-await": "off",

"@typescript-eslint/no-misused-promises": [
"error",
{
// (...) => voidに(...) => Promise<void>を渡すのは許可
// ただし特に強い意志でこれを許可しているわけではないので、
// もし問題が発生した場合は有効化する
// ref: https://canary.discord.com/channels/879570910208733277/893889888208977960/1267467454876225536
checksVoidReturn: false,
},
],
};

/** @type {import('@typescript-eslint/utils').TSESLint.Linter.ConfigType} */
module.exports = {
root: true,
env: {
Expand All @@ -15,18 +42,19 @@ module.exports = {
"plugin:storybook/recommended",
],
plugins: ["import"],
parser: "vue-eslint-parser",
parserOptions: {
ecmaVersion: 2020,
parser: "@typescript-eslint/parser",
},
ignorePatterns: ["dist_electron/**/*", "dist/**/*", "node_modules/**/*"],
parser: vueEslintParser,
parserOptions: vueEslintParserOptions,
ignorePatterns: [
"dist/**/*",
"dist_*/**/*",
"node_modules/**/*",
],
rules: {
"linebreak-style":
process.env.NODE_ENV === "production" && process.platform !== "win32"
? ["error", "unix"]
: "off",
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-console": process.env.NODE_ENV === "production" ? "off" : "off",
"no-constant-condition": ["error", { checkLoops: false }], // while(true) などを許可
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
// "prettier/prettier": [
Expand Down Expand Up @@ -96,6 +124,30 @@ module.exports = {
"no-console": "off",
},
},
{
files: ["*.ts", "*.mts"],
parser: "@typescript-eslint/parser",
extends: ["plugin:@typescript-eslint/recommended-type-checked"],
parserOptions: tsEslintOptions,
rules: tsEslintRules,
},
{
files: ["*.vue"],
parser: vueEslintParser,
parserOptions: { ...vueEslintParserOptions, ...tsEslintOptions },
extends: ["plugin:@typescript-eslint/recommended-type-checked"],
rules: {
...tsEslintRules,

// typescript-eslintにVueの型がanyとして認識されるので無効化
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-redundant-type-constituents": "off",
},
},
// Electronのメインプロセス以外でelectronのimportを禁止する
{
files: ["./src/**/*.ts", "./src/**/*.vue"],
Expand Down
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
src/openapi/**/* linguist-generated=true
openapi.json linguist-generated=true

**/__snapshots__/**/*.snap linguist-generated=true

*.woff2 linguist-vendored=true

* text=auto eol=lf
4 changes: 2 additions & 2 deletions .github/actions/download-engine/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ runs:
# アセットIDを取得してダウンロード
ASSET_ID=$(cat $TEMPDIR/assets_txt.json | jq -er '.id')
curl -sL -H 'Accept: application/octet-stream' \
curl -sSL --retry 3 --retry-delay 5 -H 'Accept: application/octet-stream' \
"https://${{ inputs.token }}@api.github.com/repos/${{ inputs.repo }}/releases/assets/$ASSET_ID" \
> $TEMPDIR/download_name.txt
Expand All @@ -83,7 +83,7 @@ runs:
for i in $(cat $TEMPDIR/download_name.txt); do
ASSET_ID=$(cat $TEMPDIR/target.json | jq -er "[.assets[] | select(.name == \"$i\")][0].id")
echo "Download asset id: $ASSET_ID, name: $i"
curl -sL -H 'Accept: application/octet-stream' \
curl -sSL --retry 3 --retry-delay 5 -H 'Accept: application/octet-stream' \
"https://${{ inputs.token }}@api.github.com/repos/${{ inputs.repo }}/releases/assets/$ASSET_ID" \
-o "$TEMPDIR/$i" &
done
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/DANGEROUS_trigger_preview_pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "Trigger preview-pages' workflow"

# プレビュー用ページのワークフローを起動する。
# 詳細: https://github.com/voicevox/preview-pages?tab=readme-ov-file#%E4%BB%95%E7%B5%84%E3%81%BF

on:
pull_request_target:
types:
- opened
- synchronize
- closed
- reopened
push:
branches:
- main
- project-*

jobs:
trigger:
runs-on: ubuntu-latest
if: github.repository_owner == 'VOICEVOX'
steps:
- name: Trigger Workflow
run: |
gh workflow run -R voicevox/preview-pages update_pages.yml
env:
GH_TOKEN: ${{ secrets.TRIGGER_PREVIEW_PAGES_TOKEN }}
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ jobs:
- name: Define Code Signing Envs
if: startsWith(matrix.os, 'windows-') && github.event.inputs.code_signing == 'true'
run: |
bash build/codesign_setup.bash
bash tools/codesign_setup.bash
THUMBPRINT="$(head -n 1 $THUMBPRINT_PATH)"
SIGNTOOL_PATH="$(head -n 1 $SIGNTOOL_PATH_PATH)"
echo "::add-mask::$THUMBPRINT"
Expand Down Expand Up @@ -192,7 +192,7 @@ jobs:
- name: Reset Code Signing Envs
if: startsWith(matrix.os, 'windows-') && github.event.inputs.code_signing == 'true'
run: |
bash build/codesign_cleanup.bash
bash tools/codesign_cleanup.bash
echo 'WIN_CERTIFICATE_SHA1=' >> $GITHUB_ENV
echo 'WIN_SIGNING_HASH_ALGORITHMS=' >> $GITHUB_ENV
echo 'SIGNTOOL_PATH=' >> $GITHUB_ENV
Expand Down Expand Up @@ -313,7 +313,7 @@ jobs:
- name: Define Code Signing Envs
if: startsWith(matrix.os, 'windows-') && github.event.inputs.code_signing == 'true'
run: |
bash build/codesign_setup.bash
bash tools/codesign_setup.bash
THUMBPRINT="$(head -n 1 $THUMBPRINT_PATH)"
SIGNTOOL_PATH="$(head -n 1 $SIGNTOOL_PATH_PATH)"
echo "::add-mask::$THUMBPRINT"
Expand Down Expand Up @@ -348,7 +348,7 @@ jobs:
- name: Reset Code Signing Envs
if: startsWith(matrix.os, 'windows-') && github.event.inputs.code_signing == 'true'
run: |
bash build/codesign_cleanup.bash
bash tools/codesign_cleanup.bash
echo 'WIN_CERTIFICATE_SHA1=' >> $GITHUB_ENV
echo 'WIN_SIGNING_HASH_ALGORITHMS=' >> $GITHUB_ENV
echo 'SIGNTOOL_PATH=' >> $GITHUB_ENV
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/build_preview_pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "Build Preview Pages"

# プレビュー用ページをビルドする。
# 詳細: https://github.com/voicevox/preview-pages?tab=readme-ov-file#%E4%BB%95%E7%B5%84%E3%81%BF

on:
push:
branches:
- master
- project-*
pull_request:

jobs:
# このJobの名前を変更したときは、voicevox/preview-pages側のscripts/collect.tsも変更すること。
build_preview_pages:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup environment
uses: ./.github/actions/setup-environment

- name: Build
run: |
# 追加のバージョン情報
if [ -n "${{ github.event.pull_request.head.sha }}" ]; then
LOCATION="PR#${{ github.event.pull_request.number }}"
SHORT_SHA=$(cut -c 1-7 <<< "${{ github.event.pull_request.head.sha }}")
else
LOCATION="${{ github.ref_name }}"
SHORT_SHA=$(cut -c 1-7 <<< "${{ github.sha }}")
fi
# Storybookのビルド
npm run storybook:build -- --output-dir $(pwd)/dist_preview/storybook
# ブラウザ版エディタのビルド
VITE_EXTRA_VERSION_INFO="${LOCATION} @ ${SHORT_SHA}" \
npm run browser:build -- --base ./ --outDir $(pwd)/dist_preview/editor
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: preview-pages
path: dist_preview
4 changes: 2 additions & 2 deletions .github/workflows/check_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: Check Version
on:
pull_request:
paths:
- "/.node-version"
- "/package.json"
- ".node-version"
- "package.json"
workflow_dispatch:

defaults:
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# Chromaticにmainブランチをpushする
# お試し運用中なので消滅する可能性あり

# TODO: Enable TurboSnap
# https://www.chromatic.com/docs/github-actions/#enable-turbosnap

name: "Chromatic"

on:
Expand All @@ -12,6 +9,11 @@ on:
- master
workflow_dispatch:

env:
# Chromatic用にNodeのメモリを増やす
# https://github.com/chromaui/chromatic-cli/issues/550#issuecomment-1150713820
NODE_OPTIONS: --max-old-space-size=16384

jobs:
chromatic:
name: Run Chromatic
Expand All @@ -29,3 +31,4 @@ jobs:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
buildScriptName: "storybook:build"
exitZeroOnChanges: true
onlyChanged: true
Loading

0 comments on commit be788e2

Please sign in to comment.