Skip to content

Commit

Permalink
Merge branch 'main' into feature/VOICEVOX#2011
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiroshiba authored Dec 29, 2024
2 parents 253e843 + 13cb1d5 commit 47c42c7
Show file tree
Hide file tree
Showing 86 changed files with 4,124 additions and 914 deletions.
2 changes: 1 addition & 1 deletion .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ VITE_DEFAULT_ENGINE_INFOS=`[
}
]`
VITE_OFFICIAL_WEBSITE_URL=https://voicevox.hiroshiba.jp/
VITE_LATEST_UPDATE_INFOS_URL=https://raw.githubusercontent.com/VOICEVOX/voicevox_blog/master/src/data/updateInfos.json
VITE_LATEST_UPDATE_INFOS_URL=https://voicevox.hiroshiba.jp/updateInfos.json
VITE_GTM_CONTAINER_ID=GTM-DUMMY
2 changes: 1 addition & 1 deletion .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ VITE_DEFAULT_ENGINE_INFOS=`[
}
]`
VITE_OFFICIAL_WEBSITE_URL=https://voicevox.hiroshiba.jp/
VITE_LATEST_UPDATE_INFOS_URL=https://raw.githubusercontent.com/VOICEVOX/voicevox_blog/master/src/data/updateInfos.json
VITE_LATEST_UPDATE_INFOS_URL=https://voicevox.hiroshiba.jp/updateInfos.json
VITE_GTM_CONTAINER_ID=GTM-DUMMY
8 changes: 0 additions & 8 deletions .github/actions/setup-environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,5 @@ runs:
restore-keys: |
${{ env.cache-version }}-${{ runner.os }}--electron-builder-cache-
- name: Cache external dependencies
uses: actions/cache@v4
with:
path: ./build/vendored
key: ${{ env.cache-version }}-${{ runner.os }}--vendored-${{ hashFiles('build/*.js') }}
restore-keys: |
${{ env.cache-version }}-${{ runner.os }}--vendored-
- shell: bash
run: npm ci
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ on:
default: false

env:
VOICEVOX_ENGINE_VERSION: 0.22.0
VOICEVOX_RESOURCE_VERSION: 0.22.0
VOICEVOX_ENGINE_VERSION: 0.22.2
VOICEVOX_RESOURCE_VERSION: 0.22.2
VOICEVOX_EDITOR_VERSION:
|- # releaseタグ名か、workflow_dispatchでのバージョン名か、999.999.999-developが入る
${{ github.event.release.tag_name || github.event.inputs.version || '999.999.999-develop' }}
Expand Down
28 changes: 26 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"glob": "11.0.0",
"hotkeys-js": "3.13.6",
"immer": "9.0.21",
"kuromoji": "github:VOICEVOX/kuromoji.js#0.0.1",
"markdown-it": "13.0.2",
"move-file": "3.0.0",
"multistream": "4.1.0",
Expand Down
2 changes: 1 addition & 1 deletion public/qAndA.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Windows/Mac/Linux 搭載の PC に対応しています。

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

#### GPU 版
Expand Down
15 changes: 15 additions & 0 deletions public/updateInfos.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
[
{
"version": "0.22.3",
"descriptions": ["キャラクター「ぞん子」を追加"],
"contributors": []
},
{
"version": "0.22.2",
"descriptions": ["キャラクター「中部つるぎ」を追加"],
"contributors": []
},
{
"version": "0.22.1",
"descriptions": ["バグ修正"],
"contributors": ["Hiroshiba", "sevenc-nanashi"]
},
{
"version": "0.22.0",
"descriptions": [
Expand Down
3 changes: 2 additions & 1 deletion src/backend/browser/browserConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { BaseConfigManager, Metadata } from "@/backend/common/ConfigManager";
import { ConfigType, EngineId, engineSettingSchema } from "@/type/preload";
import { ensureNotNullish } from "@/helpers/errorHelper";
import { UnreachableError } from "@/type/utility";
import { isMac } from "@/helpers/platform";

const dbName = `${import.meta.env.VITE_APP_NAME}-web`;
const settingStoreKey = "config";
Expand All @@ -20,7 +21,7 @@ const defaultEngineId = EngineId(defaultEngine.uuid);
export async function getConfigManager() {
await configManagerLock.acquire("configManager", async () => {
if (!configManager) {
configManager = new BrowserConfigManager();
configManager = new BrowserConfigManager(isMac);
await configManager.initialize();
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/backend/browser/sandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import {
EngineId,
EngineSettingType,
EngineSettings,
HotkeySettingType,
Sandbox,
} from "@/type/preload";
import { AssetTextFileNames } from "@/type/staticResources";
import { HotkeySettingType } from "@/domain/hotkeyAction";

const toStaticPath = (fileName: string) =>
`${import.meta.env.BASE_URL}/${fileName}`.replaceAll(/\/\/+/g, "/");
Expand Down
31 changes: 22 additions & 9 deletions src/backend/common/ConfigManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@ import AsyncLock from "async-lock";
import {
AcceptTermsStatus,
ConfigType,
configSchema,
getConfigSchema,
DefaultStyleId,
defaultHotkeySettings,
HotkeySettingType,
ExperimentalSettingType,
HotkeyCombination,
VoiceId,
PresetKey,
} from "@/type/preload";
import { ensureNotNullish } from "@/helpers/errorHelper";
import { loadEnvEngineInfos } from "@/domain/defaultEngine/envEngineInfo";
import {
HotkeyCombination,
getDefaultHotkeySettings,
HotkeySettingType,
} from "@/domain/hotkeyAction";
import { isMac } from "@/helpers/platform";

const lockKey = "save";

Expand Down Expand Up @@ -306,6 +309,8 @@ export abstract class BaseConfigManager {

protected abstract getAppVersion(): string;

constructor(protected isMac: boolean) {}

public reset() {
this.config = this.getDefaultConfig();
this._save();
Expand All @@ -320,7 +325,9 @@ export abstract class BaseConfigManager {
migration(data);
}
}
this.config = this.migrateHotkeySettings(configSchema.parse(data));
this.config = this.migrateHotkeySettings(
getConfigSchema(this.isMac).parse(data),
);
this._save();
} else {
this.reset();
Expand All @@ -341,10 +348,16 @@ export abstract class BaseConfigManager {
this._save();
}

/** 全ての設定を取得する。テスト用。 */
public getAll(): ConfigType {
if (!this.config) throw new Error("Config is not initialized");
return this.config;
}

private _save() {
void this.lock.acquire(lockKey, async () => {
await this.save({
...configSchema.parse({
...getConfigSchema(this.isMac).parse({
...this.config,
}),
__internal__: {
Expand Down Expand Up @@ -379,7 +392,7 @@ export abstract class BaseConfigManager {
private migrateHotkeySettings(data: ConfigType): ConfigType {
const COMBINATION_IS_NONE = HotkeyCombination("####");
const loadedHotkeys = structuredClone(data.hotkeySettings);
const hotkeysWithoutNewCombination = defaultHotkeySettings.map(
const hotkeysWithoutNewCombination = getDefaultHotkeySettings(isMac).map(
(defaultHotkey) => {
const loadedHotkey = loadedHotkeys.find(
(loadedHotkey) => loadedHotkey.action === defaultHotkey.action,
Expand All @@ -394,7 +407,7 @@ export abstract class BaseConfigManager {
const migratedHotkeys = hotkeysWithoutNewCombination.map((hotkey) => {
if (hotkey.combination === COMBINATION_IS_NONE) {
const newHotkey = ensureNotNullish(
defaultHotkeySettings.find(
getDefaultHotkeySettings(isMac).find(
(defaultHotkey) => defaultHotkey.action === hotkey.action,
),
);
Expand All @@ -421,6 +434,6 @@ export abstract class BaseConfigManager {
}

protected getDefaultConfig(): ConfigType {
return configSchema.parse({});
return getConfigSchema(this.isMac).parse({});
}
}
3 changes: 2 additions & 1 deletion src/backend/electron/electronConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { app } from "electron";
import { writeFileSafely } from "./fileHelper";
import { BaseConfigManager, Metadata } from "@/backend/common/ConfigManager";
import { ConfigType } from "@/type/preload";
import { isMac } from "@/helpers/platform";

export class ElectronConfigManager extends BaseConfigManager {
protected getAppVersion() {
Expand Down Expand Up @@ -35,7 +36,7 @@ let configManager: ElectronConfigManager | undefined;

export function getConfigManager(): ElectronConfigManager {
if (!configManager) {
configManager = new ElectronConfigManager();
configManager = new ElectronConfigManager(isMac);
}
return configManager;
}
1 change: 0 additions & 1 deletion src/backend/electron/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,6 @@ app.on("second-instance", async (_event, _argv, _workDir, rawData) => {
log.info("Second instance launched with vvproj file");
ipcMainSendProxy.LOAD_PROJECT_FILE(win, {
filePath: data.filePath,
confirm: true,
});
}
if (win) {
Expand Down
33 changes: 33 additions & 0 deletions src/components/Base/BaseSlider.stories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import type { Meta, StoryObj } from "@storybook/vue3";

import { ref } from "vue";
import BaseSlider from "./BaseSlider.vue";

const meta: Meta<typeof BaseSlider> = {
component: BaseSlider,
args: {
modelValue: 50,
min: 0,
max: 100,
step: 1,
},
render: (args) => ({
components: { BaseSlider },
setup() {
const model = ref(Number(args.modelValue));
return { args, model };
},
template: `<BaseSlider v-bind="args" v-model="model"></BaseSlider>`,
}),
};

export default meta;
type Story = StoryObj<typeof BaseSlider>;

export const Default: Story = {};

export const Disabled: Story = {
args: {
disabled: true,
},
};
Loading

0 comments on commit 47c42c7

Please sign in to comment.