From 42d735cfa25e7545466ea877c55bdb19d4c65191 Mon Sep 17 00:00:00 2001 From: Neko Ayaka Date: Wed, 10 Dec 2025 15:11:09 +0800 Subject: [PATCH] style: lint --- .../deploy-cloudflare-workers-preview-deploy.yml | 2 +- .github/workflows/deploy-cloudflare-workers.yml | 2 +- packages/stage-ui/src/stores/chat.test.ts | 4 +++- packages/stage-ui/src/stores/providers.ts | 10 +++++----- packages/stage-ui/src/utils/opfs-loader.ts | 9 +++++++-- 5 files changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/workflows/deploy-cloudflare-workers-preview-deploy.yml b/.github/workflows/deploy-cloudflare-workers-preview-deploy.yml index 3abfee25a..24d792f08 100644 --- a/.github/workflows/deploy-cloudflare-workers-preview-deploy.yml +++ b/.github/workflows/deploy-cloudflare-workers-preview-deploy.yml @@ -73,7 +73,7 @@ jobs: # NOTICE: # # Here installing wrangler to global is required, or otherwise: - # ERR_PNPM_ADDING_TO_ROOT  Running this command will add the dependency to the workspace root... + # ERR_PNPM_ADDING_TO_ROOT Running this command will add the dependency to the workspace root... # error occurs. # # Since https://github.com/cloudflare/wrangler-action/pull/339#issuecomment-2667622947 rejected the -g support diff --git a/.github/workflows/deploy-cloudflare-workers.yml b/.github/workflows/deploy-cloudflare-workers.yml index a01a436eb..cb3835c83 100644 --- a/.github/workflows/deploy-cloudflare-workers.yml +++ b/.github/workflows/deploy-cloudflare-workers.yml @@ -57,7 +57,7 @@ jobs: # NOTICE: # # Here installing wrangler to global is required, or otherwise: - # ERR_PNPM_ADDING_TO_ROOT  Running this command will add the dependency to the workspace root... + # ERR_PNPM_ADDING_TO_ROOT Running this command will add the dependency to the workspace root... # error occurs. # # Since https://github.com/cloudflare/wrangler-action/pull/339#issuecomment-2667622947 rejected the -g support diff --git a/packages/stage-ui/src/stores/chat.test.ts b/packages/stage-ui/src/stores/chat.test.ts index 73ed449fe..a4ac69b39 100644 --- a/packages/stage-ui/src/stores/chat.test.ts +++ b/packages/stage-ui/src/stores/chat.test.ts @@ -56,7 +56,9 @@ vi.mock('./mods/api/channel-server', () => ({ initialize: mockInitialize, onContextUpdate: (cb: typeof contextUpdateHandler) => { contextUpdateHandler = cb - return () => { contextUpdateHandler = null } + return () => { + contextUpdateHandler = null + } }, sendContextUpdate: mockSendContextUpdate, }), diff --git a/packages/stage-ui/src/stores/providers.ts b/packages/stage-ui/src/stores/providers.ts index feeb4b82b..72bc1ba4f 100644 --- a/packages/stage-ui/src/stores/providers.ts +++ b/packages/stage-ui/src/stores/providers.ts @@ -1931,6 +1931,11 @@ export const useProvidersStore = defineStore('providers', () => { // Available providers (only those that are properly configured) const availableProviders = computed(() => Object.keys(providerMetadata).filter(providerId => configuredProviders.value[providerId])) + // Store available models for each provider + const availableModels = ref>({}) + const isLoadingModels = ref>({}) + const modelLoadError = ref>({}) + async function resetProviderSettings() { providerCredentials.value = {} configuredProviders.value = {} @@ -1943,11 +1948,6 @@ export const useProvidersStore = defineStore('providers', () => { await updateConfigurationStatus() } - // Store available models for each provider - const availableModels = ref>({}) - const isLoadingModels = ref>({}) - const modelLoadError = ref>({}) - // Function to fetch models for a specific provider async function fetchModelsForProvider(providerId: string) { const config = providerCredentials.value[providerId] diff --git a/packages/stage-ui/src/utils/opfs-loader.ts b/packages/stage-ui/src/utils/opfs-loader.ts index 5f5036987..1c57e037f 100644 --- a/packages/stage-ui/src/utils/opfs-loader.ts +++ b/packages/stage-ui/src/utils/opfs-loader.ts @@ -6,7 +6,7 @@ interface OPFSContext extends Live2DFactoryContext { declare global { interface FileSystemDirectoryHandle { - values(): AsyncIterableIterator + values: () => AsyncIterableIterator } } @@ -60,6 +60,7 @@ export class OPFSCache { try { const root = await navigator.storage.getDirectory() const dirHandle = await root.getDirectoryHandle(key, { create: false }) + // eslint-disable-next-line no-console console.debug(`[OPFS] Cache hit for ${key}`) const files = await OPFSCache.readDirectoryRecursive(dirHandle, '') @@ -68,13 +69,14 @@ export class OPFSCache { return files } } - catch (e) { + catch { // Cache Miss } return null } static async save(key: string, files: File[]): Promise { + // eslint-disable-next-line no-console console.debug(`[OPFS] Saving ${files.length} files to ${key}`) try { @@ -94,6 +96,7 @@ export class OPFSCache { // reconstruct settings files from ModelSettings const settings: ModelSettings = (files as any).settings if (settings) { + // eslint-disable-next-line no-console console.debug('[OPFS] Reconstructing settings file...') const settingsJson = JSON.stringify(settings.json) const settingsFileName = settings.url || 'model.model3.json' @@ -103,6 +106,7 @@ export class OPFSCache { } await Promise.all(writePromises) + // eslint-disable-next-line no-console console.debug(`[OPFS] Saved to cache`) } catch (e) { @@ -145,6 +149,7 @@ export class OPFSCache { } // cache miss + // eslint-disable-next-line no-console console.debug(`[OPFS] Cache miss for ${key}`) context.opfsKey = key