forked from VOICEVOX/voicevox
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'loadEnvEngineInfosに切り出し' into 指定されているVVPPがなかったら確認後にインスト…
…ールし、使えるようにするようにする
- Loading branch information
Showing
6 changed files
with
34 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* デフォルトエンジンの環境変数関連のモジュール | ||
*/ | ||
|
||
import { z } from "zod"; | ||
|
||
import { engineIdSchema } from "@/type/preload"; | ||
|
||
/** .envに書くデフォルトエンジン情報のスキーマ */ | ||
export const envEngineInfoSchema = z.object({ | ||
uuid: engineIdSchema, | ||
host: z.string(), | ||
name: z.string(), | ||
executionEnabled: z.boolean(), | ||
executionFilePath: z.string(), | ||
executionArgs: z.array(z.string()), | ||
path: z.string().optional(), | ||
}); | ||
export type EnvEngineInfoType = z.infer<typeof envEngineInfoSchema>; | ||
|
||
/** 環境変数を経由して.envを読み込む */ | ||
export function loadEnvEngineInfos(): EnvEngineInfoType[] { | ||
const defaultEngineInfosEnv = | ||
import.meta.env.VITE_DEFAULT_ENGINE_INFOS ?? "[]"; | ||
|
||
const envSchema = envEngineInfoSchema.array(); | ||
return envSchema.parse(JSON.parse(defaultEngineInfosEnv)); | ||
} |
2 changes: 1 addition & 1 deletion
2
src/domain/defaultEngine.ts → ...omain/defaultEngine/latetDefaultEngine.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/** | ||
* デフォルトエンジン関連のモジュール | ||
* デフォルトエンジンの最新情報関連のモジュール | ||
*/ | ||
|
||
import { z } from "zod"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters