From 91dafc26a751e905ae5196cd8b095c2276c9c614 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=93=E3=81=8B=E3=82=8A?= <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Tue, 25 Nov 2025 07:23:21 +0900 Subject: [PATCH] =?UTF-8?q?refactor(frontend/aiscript):=20AiScript?= =?UTF-8?q?=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3=E5=8F=96=E5=BE=97?= =?UTF-8?q?=E3=83=BB=E5=88=A4=E5=AE=9A=E3=83=AD=E3=82=B8=E3=83=83=E3=82=AF?= =?UTF-8?q?=E3=82=92=E7=B5=B1=E4=B8=80=20(#16845)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor(frontend): AiScriptバージョン取得・判定ロジックを統一 * fix --- packages/frontend/src/aiscript/common.ts | 7 ------- packages/frontend/src/pages/flash/flash.vue | 16 +++++++++++++--- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/packages/frontend/src/aiscript/common.ts b/packages/frontend/src/aiscript/common.ts index 806a9b5965..ba5dfb8368 100644 --- a/packages/frontend/src/aiscript/common.ts +++ b/packages/frontend/src/aiscript/common.ts @@ -6,13 +6,6 @@ import { errors, utils } from '@syuilo/aiscript'; import type { values } from '@syuilo/aiscript'; -const extractVersionIdentifier = /^\/\/\/\s*@\s*(\d+)\.(\d+)\.\d+$/m; - -export function getAiScriptVersion(script: string): { major: number; minor: number } | undefined { - const match = extractVersionIdentifier.exec(script); - return match ? { major: Number(match[1]), minor: Number(match[2]) } : undefined; -} - export function assertStringAndIsIn(value: values.Value | undefined, expects: A): asserts value is values.VStr & { value: A[number] } { utils.assertString(value); const str = value.value; diff --git a/packages/frontend/src/pages/flash/flash.vue b/packages/frontend/src/pages/flash/flash.vue index f6da46be22..2913aaae64 100644 --- a/packages/frontend/src/pages/flash/flash.vue +++ b/packages/frontend/src/pages/flash/flash.vue @@ -63,6 +63,8 @@ SPDX-License-Identifier: AGPL-3.0-only