From c3cf4e37077a383e0243a7391dc0f3d7fb41b575 Mon Sep 17 00:00:00 2001 From: N0VAN0M4LY <224130499+N0VAN0M4LY@users.noreply.github.com> Date: Fri, 4 Dec 2026 21:09:57 +0800 Subject: [PATCH] feat(launcher): auto-detect decal cache from selected or recorded game folder Extend resolvePlayerDecalCacheFolder to resolve /cache/content when the player picks a game root folder directly. Add read-only decals:detectSource IPC so the install wizard auto-fills a detected decal cache from the chosen source (with one-click reset to placeholders) and the client details view offers one-click import from the recorded online sourcePath. --- apps/launcher/src/main/ipc/handlers.ts | 3 +- .../src/main/services/install/decals.ts | 19 +++++++ .../renderer/src/components/FolderField.tsx | 7 ++- .../src/renderer/src/i18n/locales/en.json | 6 +- .../src/renderer/src/i18n/locales/zh-CN.json | 6 +- .../renderer/src/pages/copies/CopySummary.tsx | 40 ++++++++++++- .../renderer/src/pages/install/DataStep.tsx | 25 +++++++- .../renderer/src/pages/install/WizardMain.tsx | 2 + .../src/pages/install/useInstallWizard.ts | 55 ++++++++++++++++-- apps/launcher/src/shared/ipc/channels.ts | 2 + apps/launcher/src/shared/ipc/contract.ts | 5 ++ .../patcher/src/decals/player-decal-cache.ts | 57 +++++++++++++------ 12 files changed, 196 insertions(+), 31 deletions(-) diff --git a/apps/launcher/src/main/ipc/handlers.ts b/apps/launcher/src/main/ipc/handlers.ts index 440393d..1429b20 100644 --- a/apps/launcher/src/main/ipc/handlers.ts +++ b/apps/launcher/src/main/ipc/handlers.ts @@ -11,7 +11,7 @@ import { exportDiagnostics, openLogsFolder } from '../services/diagnostics/diagn import { measureFolder } from '../services/game-folder/folder-size.ts'; import { inspectGameFolder, requireFolder } from '../services/game-folder/inspect-game-folder.ts'; import { inspectPickedTargetFolder } from '../services/game-folder/inspect-target-folder.ts'; -import { changeDecalSource, decalImportInProgress } from '../services/install/decals.ts'; +import { changeDecalSource, decalImportInProgress, detectDecalCacheSource } from '../services/install/decals.ts'; import { cancelInstall, checkGameFolder, dataFolderProblem, installGame, installationInProgress } from '../services/install/install-game.ts'; import { canonicalCopyPath, copyFolderMissing, createCopyDraft, hydrateCopiesStatus, listCopies, readInstallRecord, renameCopy, setCurrentCopy } from '../services/install/install-record.ts'; import { readInstalledLab } from '../services/launch/lab-handoff.ts'; @@ -164,6 +164,7 @@ export function registerIpcHandlers(): void { return updated; }); handle('copies:cancelMaintenance', () => cancelMaintenance()); + handle('decals:detectSource', async ({ path }) => ({ path: await detectDecalCacheSource(path) })); handle('saves:list', ({ copyId }) => getSaveList(copyId)); handle('saves:details', ({ copyId, userId }) => getSaveDetails(copyId, userId)); diff --git a/apps/launcher/src/main/services/install/decals.ts b/apps/launcher/src/main/services/install/decals.ts index e9eafe0..0c57305 100644 --- a/apps/launcher/src/main/services/install/decals.ts +++ b/apps/launcher/src/main/services/install/decals.ts @@ -22,6 +22,25 @@ export function decalCachePath(dataPath: string, cacheId: string): string { return join(dataPath, CACHE_FOLDER, cacheId); } +/** + * Read-only check whether a player-chosen or registered folder contains a usable decal cache + * (, /cache, or /cache/content). Returns the canonical cache/content path when + * valid, or null when absent, invalid, or unreadable. + */ +export async function detectDecalCacheSource(folderPath: string): Promise { + if (!folderPath || !isAbsolute(folderPath)) return null; + try { + const rawSource = await realpath(folderPath).catch(() => null); + if (!rawSource) return null; + const resolved = resolvePlayerDecalCacheFolder(rawSource); + const canonical = await realpath(resolved).catch(() => null); + if (!canonical) return null; + return playerDecalCacheProblem(canonical) === undefined ? canonical : null; + } catch { + return null; + } +} + async function cacheRoot(dataPath: string, steamDataConfirmed: boolean): Promise { if (!isAbsolute(dataPath)) throw new AppError('decal_import_failed'); const data = await canonicalCopyPath(dataPath); diff --git a/apps/launcher/src/renderer/src/components/FolderField.tsx b/apps/launcher/src/renderer/src/components/FolderField.tsx index 0a6d63e..8b93c39 100644 --- a/apps/launcher/src/renderer/src/components/FolderField.tsx +++ b/apps/launcher/src/renderer/src/components/FolderField.tsx @@ -5,18 +5,21 @@ interface FolderFieldProps { readonly path: string | null; /** Title of the folder dialog. */ readonly dialogTitle: string; + /** Optional starting directory when no path is chosen yet. */ + readonly defaultPath?: string | null | undefined; readonly disabled?: boolean; readonly onChosen: (path: string) => void; readonly onError: (error: unknown) => void; } /** A chosen folder and the button that opens the folder dialog. */ -export function FolderField({ path, dialogTitle, disabled = false, onChosen, onError }: FolderFieldProps) { +export function FolderField({ path, dialogTitle, defaultPath, disabled = false, onChosen, onError }: FolderFieldProps) { const { t } = useTranslation(); const choose = (): void => { + const startPath = path ?? defaultPath; ipcInvoke('dialog:pickFolder', { title: dialogTitle, - ...(path ? { defaultPath: path } : {}), + ...(startPath ? { defaultPath: startPath } : {}), }) .then(({ path: chosen }) => { if (chosen) onChosen(chosen); diff --git a/apps/launcher/src/renderer/src/i18n/locales/en.json b/apps/launcher/src/renderer/src/i18n/locales/en.json index 00849ed..6ae36fb 100644 --- a/apps/launcher/src/renderer/src/i18n/locales/en.json +++ b/apps/launcher/src/renderer/src/i18n/locales/en.json @@ -97,7 +97,9 @@ }, "decals": { "source": "Decal source", - "hint": "Import the online game's cache/content (or cache) folder for cached decals and downloadable skins. Placeholder decals are used when no cache is available.", + "hint": "Select the online game root folder, cache, or cache/content for cached decals and downloadable skins. Placeholder decals are used when no cache is available.", + "autoDetectedNotice": "Online decal cache detected automatically and will be imported during installation. Click the button above if you prefer placeholder decals.", + "importFromSource": "Import from online source", "choose": "Choose decal cache…", "useDefault": "Use placeholder decals", "importing": "Importing decal cache", @@ -1058,7 +1060,7 @@ "copy_not_found": "The selected client is no longer available.", "copies_write_failed": "The client registry could not be saved.", "copy_location_in_use": "The client or data location overlaps an existing client.", - "decal_source_invalid": "The selected folder does not contain a usable decal cache. Log into the online hangar once to populate it, then choose cache/content (or cache).", + "decal_source_invalid": "The selected folder does not contain a usable decal cache. Log into the online hangar once to populate it, then choose the online game root folder, cache, or cache/content.", "decal_import_failed": "The decal cache could not be imported into the client's data folder. See the launcher log.", "maintenance_busy": "Maintenance requires the game, local server and other client operations to be stopped.", "maintenance_location": "The operation would affect files outside the registered client or data folder.", diff --git a/apps/launcher/src/renderer/src/i18n/locales/zh-CN.json b/apps/launcher/src/renderer/src/i18n/locales/zh-CN.json index bf83c00..fdb0698 100644 --- a/apps/launcher/src/renderer/src/i18n/locales/zh-CN.json +++ b/apps/launcher/src/renderer/src/i18n/locales/zh-CN.json @@ -97,7 +97,9 @@ }, "decals": { "source": "贴花来源", - "hint": "可导入在线版游戏的 cache/content(或 cache),同时支持已缓存的真实贴花与可下载涂装。未导入时使用占位贴花。", + "hint": "可直接选择在线版游戏根目录、cache 或 cache/content,同时支持已缓存的真实贴花与可下载涂装。未导入时使用占位贴花。", + "autoDetectedNotice": "已自动检测到在线版贴花缓存,安装时将一并导入。如需使用占位贴花,可点击上方按钮取消。", + "importFromSource": "从在线版来源导入", "choose": "选择贴花缓存…", "useDefault": "使用占位贴花", "importing": "正在导入贴花缓存", @@ -1058,7 +1060,7 @@ "copy_not_found": "所选客户端已不可用。", "copies_write_failed": "无法保存客户端记录。", "copy_location_in_use": "客户端位置或数据目录与已有客户端重叠。", - "decal_source_invalid": "选定的目录缺少有效的贴花缓存。请先登录过在线版机库生成缓存,再选择在线版目录中的 cache/content(或 cache)。", + "decal_source_invalid": "选定的目录缺少有效的贴花缓存。请先登录过在线版机库生成缓存,再选择在线版游戏根目录、cache 或 cache/content。", "decal_import_failed": "无法把贴花缓存导入客户端数据目录。请查看启动器日志。", "maintenance_busy": "维护前需结束游戏、本地服务器和其他客户端操作。", "maintenance_location": "操作会影响登记的客户端或数据目录之外的文件。", diff --git a/apps/launcher/src/renderer/src/pages/copies/CopySummary.tsx b/apps/launcher/src/renderer/src/pages/copies/CopySummary.tsx index 062aa85..b8ca539 100644 --- a/apps/launcher/src/renderer/src/pages/copies/CopySummary.tsx +++ b/apps/launcher/src/renderer/src/pages/copies/CopySummary.tsx @@ -20,13 +20,46 @@ export function CopySummary({ record, supportedVersions, onShowFeatures, onReloc const { t, i18n } = useTranslation(); const [name, setName] = useState(record.name); const [importing, setImporting] = useState(false); + const [detectedSourceDecals, setDetectedSourceDecals] = useState(null); useEffect(() => setName(record.name), [record.id, record.name]); + // Read-only probe of the copy's registered online source for a usable decal cache. + useEffect(() => { + setDetectedSourceDecals(null); + if (!record.sourcePath) return; + let current = true; + ipcInvoke('decals:detectSource', { path: record.sourcePath }) + .then(({ path }) => { + if (current) setDetectedSourceDecals(path); + }) + .catch(() => { + if (current) setDetectedSourceDecals(null); + }); + return () => { + current = false; + }; + }, [record.id, record.sourcePath]); const missing = missingFeatures(record).length; const verified = isVerified(record.gameVersion, supportedVersions); + const importFromSource = async (): Promise => { + if (!detectedSourceDecals) return; + setImporting(true); + try { + await ipcInvoke('copies:setDecalSource', { id: record.id, path: detectedSourceDecals }); + } catch (error) { + onError(error); + } finally { + setImporting(false); + } + }; const applyDecals = async (chooseFolder: boolean): Promise => { setImporting(true); try { - const path = chooseFolder ? (await ipcInvoke('dialog:pickFolder', { title: t('decals.choose') })).path : null; + const path = chooseFolder + ? (await ipcInvoke('dialog:pickFolder', { + title: t('decals.choose'), + ...(record.sourcePath ? { defaultPath: record.sourcePath } : {}), + })).path + : null; if (chooseFolder && path === null) return; await ipcInvoke('copies:setDecalSource', { id: record.id, path }); } catch (error) { @@ -71,6 +104,11 @@ export function CopySummary({ record, supportedVersions, onShowFeatures, onReloc {folder(record.dataPath)} {t(importing ? 'decals.importing' : record.decalCacheId ? 'decals.imported' : 'decals.default')} + {detectedSourceDecals && ( + + )} diff --git a/apps/launcher/src/renderer/src/pages/install/DataStep.tsx b/apps/launcher/src/renderer/src/pages/install/DataStep.tsx index 2172f4c..ea9266e 100644 --- a/apps/launcher/src/renderer/src/pages/install/DataStep.tsx +++ b/apps/launcher/src/renderer/src/pages/install/DataStep.tsx @@ -8,6 +8,8 @@ interface DataStepProps { readonly dataPath: string; readonly dataProblem: DataFolderProblem | null; readonly decalSource: string | null; + readonly decalAutoDetected: boolean; + readonly defaultDecalPath?: string | null | undefined; readonly steamDataPath: string | null; readonly steamDataConfirmed: boolean; readonly onSteamDataConfirmed: (confirmed: boolean) => void; @@ -17,7 +19,19 @@ interface DataStepProps { } /** Step 3: where saves, caches and logs of the offline version are kept. */ -export function DataStep({ dataPath, dataProblem, decalSource, steamDataPath, steamDataConfirmed, onSteamDataConfirmed, onDataPath, onDecalSource, onError }: DataStepProps) { +export function DataStep({ + dataPath, + dataProblem, + decalSource, + decalAutoDetected, + defaultDecalPath, + steamDataPath, + steamDataConfirmed, + onSteamDataConfirmed, + onDataPath, + onDecalSource, + onError, +}: DataStepProps) { const { t } = useTranslation(); return ( <> @@ -35,9 +49,16 @@ export function DataStep({ dataPath, dataProblem, decalSource, steamDataPath, st )} - + {decalSource && } + {decalAutoDetected && decalSource && {t('decals.autoDetectedNotice')}} ); } diff --git a/apps/launcher/src/renderer/src/pages/install/WizardMain.tsx b/apps/launcher/src/renderer/src/pages/install/WizardMain.tsx index 88a24d8..166b184 100644 --- a/apps/launcher/src/renderer/src/pages/install/WizardMain.tsx +++ b/apps/launcher/src/renderer/src/pages/install/WizardMain.tsx @@ -44,6 +44,8 @@ export function WizardMain({ wizard, supportedVersions }: { readonly wizard: Ins steamDataConfirmed={wizard.steamDataConfirmed} onSteamDataConfirmed={wizard.setSteamDataConfirmed} decalSource={wizard.decalSource} + decalAutoDetected={wizard.decalAutoDetected} + defaultDecalPath={wizard.decalProbePath} onDataPath={wizard.setDataPath} onDecalSource={wizard.setDecalSource} onError={wizard.report} diff --git a/apps/launcher/src/renderer/src/pages/install/useInstallWizard.ts b/apps/launcher/src/renderer/src/pages/install/useInstallWizard.ts index db26eab..2b28307 100644 --- a/apps/launcher/src/renderer/src/pages/install/useInstallWizard.ts +++ b/apps/launcher/src/renderer/src/pages/install/useInstallWizard.ts @@ -40,7 +40,9 @@ export function useInstallWizard({ onInstalled }: WizardOptions) { problem: DataFolderProblem | null; confirmed: boolean; } | null>(null); - const [decalSource, setDecalSource] = useState(null); + const [decalSource, setDecalSourceState] = useState(null); + const [decalAutoDetected, setDecalAutoDetected] = useState(false); + const [decalManuallyEdited, setDecalManuallyEdited] = useState(false); const [check, setCheck] = useState(null); const [missingAccepted, setMissingAccepted] = useState(false); const [progress, setProgress] = useState(null); @@ -66,8 +68,34 @@ export function useInstallWizard({ onInstalled }: WizardOptions) { ? (source?.path ?? null) : null; const plannedStockSourcePath = source?.needsStockSource ? (stockSource?.path ?? null) : null; + const decalProbePath = stockSource?.path ?? source?.path ?? null; const dataInspectionKey = JSON.stringify([dataPath, plannedCopyPath, plannedSourcePath, plannedStockSourcePath]); + // Read-only probe of the player-selected source folder for a usable decal cache. + useEffect(() => { + if (!active || !decalProbePath || decalManuallyEdited) return; + let current = true; + ipcInvoke('decals:detectSource', { path: decalProbePath }) + .then(({ path }) => { + if (!current) return; + if (path) { + setDecalSourceState(path); + setDecalAutoDetected(true); + } else { + setDecalSourceState(null); + setDecalAutoDetected(false); + } + }) + .catch(() => { + if (!current) return; + setDecalSourceState(null); + setDecalAutoDetected(false); + }); + return () => { + current = false; + }; + }, [active, decalProbePath, decalManuallyEdited]); + useEffect(() => { if (!active || !dataPath) return; let current = true; @@ -119,6 +147,12 @@ export function useInstallWizard({ onInstalled }: WizardOptions) { useEffect(() => ipcOn('event:install-progress', setProgress), []); + const resetDecals = (): void => { + setDecalSourceState(null); + setDecalAutoDetected(false); + setDecalManuallyEdited(false); + }; + const start = (): void => { clear(); setMode('new'); @@ -130,7 +164,7 @@ export function useInstallWizard({ onInstalled }: WizardOptions) { setDraftId(null); setDataPath(''); setDataInspection(null); - setDecalSource(null); + resetDecals(); setActive(true); ipcInvoke('install:prepareCopy').then(({ id, dataPath: folder }) => { setDraftId(id); @@ -145,11 +179,13 @@ export function useInstallWizard({ onInstalled }: WizardOptions) { setStockSource(null); setChoice(nextMode === 'existing' ? { method: 'existing', target: null, steamConfirmed: false } : NO_CHOICE); setName(''); + resetDecals(); }; const chooseSource = (found: GameFolderInspection | null): void => { setSource(found); setStockSource(null); + resetDecals(); const isExisting = mode === 'existing' || found?.hasOfflineBackup || found?.needsStockSource; const defaultMethod = isExisting ? 'existing' : 'copy'; setChoice({ method: defaultMethod, target: null, steamConfirmed: false }); @@ -166,6 +202,17 @@ export function useInstallWizard({ onInstalled }: WizardOptions) { } }; + const chooseStockSource = (found: GameFolderInspection | null): void => { + setStockSource(found); + resetDecals(); + }; + + const setDecalSource = (path: string | null): void => { + setDecalSourceState(path); + setDecalAutoDetected(false); + setDecalManuallyEdited(true); + }; + const install = (): void => { if (!sourceUsable(source, stockSource) || !draftId || !dataReady) return; const directFolder = choice.method === 'in-place' || choice.method === 'existing'; @@ -230,9 +277,9 @@ export function useInstallWizard({ onInstalled }: WizardOptions) { }; return { - active, mode, step, index, source, stockSource, sourceSize, choice, name, dataPath, dataProblem, decalSource, check, missingAccepted, progress, cancelling, message, canGoOn, + active, mode, step, index, source, stockSource, sourceSize, choice, name, dataPath, dataProblem, decalSource, decalAutoDetected, decalProbePath, check, missingAccepted, progress, cancelling, message, canGoOn, steamDataPath: dataChecked?.inSteam ? dataChecked.path : null, steamDataConfirmed: dataChecked?.confirmed ?? false, - start, back, next, cancel, report, chooseMode, chooseSource, setStockSource, setChoice, setName, setDataPath, setSteamDataConfirmed, setDecalSource, setMissingAccepted, + start, back, next, cancel, report, chooseMode, chooseSource, setStockSource: chooseStockSource, setChoice, setName, setDataPath, setSteamDataConfirmed, setDecalSource, setMissingAccepted, }; } diff --git a/apps/launcher/src/shared/ipc/channels.ts b/apps/launcher/src/shared/ipc/channels.ts index c6c433e..20beb28 100644 --- a/apps/launcher/src/shared/ipc/channels.ts +++ b/apps/launcher/src/shared/ipc/channels.ts @@ -14,6 +14,8 @@ export const IPC_CHANNEL_PREFIXES = [ 'install:', /** Listing and managing installed copies. */ 'copies:', + /** Read-only detection of decal cache folders in player-selected or registered sources. */ + 'decals:', /** Settings shared by the saves of a game copy. */ 'tuning:', /** Additive mods repository, per-copy ordering/toggles, and presets. */ diff --git a/apps/launcher/src/shared/ipc/contract.ts b/apps/launcher/src/shared/ipc/contract.ts index 980c419..b941720 100644 --- a/apps/launcher/src/shared/ipc/contract.ts +++ b/apps/launcher/src/shared/ipc/contract.ts @@ -170,6 +170,11 @@ export const ipcContract = { input: z.void(), output: z.void(), }, + 'decals:detectSource': { + /** Read-only check for a usable decal cache inside a player-chosen or registered folder. */ + input: z.object({ path: z.string().min(1) }), + output: z.object({ path: z.string().nullable() }), + }, 'saves:list': { input: z.object({ copyId: CopyIdSchema }), output: SaveListSchema, diff --git a/packages/patcher/src/decals/player-decal-cache.ts b/packages/patcher/src/decals/player-decal-cache.ts index d98cb75..3a7afe3 100644 --- a/packages/patcher/src/decals/player-decal-cache.ts +++ b/packages/patcher/src/decals/player-decal-cache.ts @@ -1,8 +1,8 @@ /** * Decals and downloadable skins from the player's own online client: the player names the web - * cache folder of an installation they have played online with (/cache/content, or its - * parent /cache), and the build copies the cached textures into the game copy's - * cache/content. The offline version never looks for that folder itself. + * cache folder of an installation they have played online with (/cache/content, its parent + * /cache, or the game root ), and the build copies the cached textures into the game + * copy's cache/content. The offline version never looks for that folder itself. * * Two layouts exist across War Thunder builds (verified on 2.61.0.37 and 2.61.0.58): * 1. Modern vromfs-indexed cache (2.61+): cache/content/ holds dldata_s.info and the downloaded @@ -46,15 +46,16 @@ export interface PlayerDecalCache { } /** - * Resolve the actual cache/content folder when the player selects either /cache/content - * or its parent /cache folder. + * Resolve the actual cache/content folder when the player selects /cache/content, + * its parent /cache folder, or the game root . */ export function resolvePlayerDecalCacheFolder(source: string): string { if (!existsSync(source) || !statSync(source).isDirectory()) return source; if (directDecalCacheProblem(source) === undefined) return source; - const nested = join(source, 'content'); - if (existsSync(nested) && statSync(nested).isDirectory() && directDecalCacheProblem(nested) === undefined) { - return nested; + for (const candidate of [join(source, 'content'), join(source, WEB_CACHE_FOLDER)]) { + if (existsSync(candidate) && statSync(candidate).isDirectory() && directDecalCacheProblem(candidate) === undefined) { + return candidate; + } } return source; } @@ -76,9 +77,9 @@ export function ddsxPathForHash(hash: string): string | undefined { } /** - * Scan a player decal cache folder (cache/content, its parent cache folder, or an imported - * snapshot) and collect the normalized relative paths ("/.ddsx", lowercased) of - * all cached .ddsx files, skipping .wto-index. + * Scan a player decal cache folder (cache/content, its parent cache folder, the game root, or an + * imported snapshot) and collect the normalized relative paths ("/.ddsx", lowercased) + * of all cached .ddsx files, skipping .wto-index. */ export function scanCachedDdsxFiles(source: string): ReadonlySet { const folder = resolvePlayerDecalCacheFolder(source); @@ -338,10 +339,22 @@ function readSnapshotIndexFiles(folder: string): readonly AddedFile[] | undefine } function hasCachedDdsxTextures(folder: string): boolean { - for (const entry of readdirSync(folder, { withFileTypes: true })) { + let entries; + try { + entries = readdirSync(folder, { withFileTypes: true }); + } catch { + return false; + } + for (const entry of entries) { if (!entry.isDirectory() || entry.name === SNAPSHOT_INDEX_DIR) continue; const sub = join(folder, entry.name); - for (const child of readdirSync(sub, { withFileTypes: true })) { + let children; + try { + children = readdirSync(sub, { withFileTypes: true }); + } catch { + continue; + } + for (const child of children) { if (child.isFile() && child.name.toLowerCase().endsWith(DDSX_EXTENSION)) return true; } } @@ -351,8 +364,14 @@ function hasCachedDdsxTextures(folder: string): boolean { function findRegionalPack(contentFolder: string): string | undefined { const parent = dirname(contentFolder); if (parent === contentFolder || !existsSync(parent)) return undefined; + let entries; + try { + entries = readdirSync(parent, { withFileTypes: true }); + } catch { + return undefined; + } const candidates: Array<{ readonly path: string; readonly version: string; readonly mtimeMs: number }> = []; - for (const entry of readdirSync(parent, { withFileTypes: true })) { + for (const entry of entries) { if (!entry.isDirectory() || entry.isSymbolicLink()) continue; const match = BINARY_CACHE_DIR.exec(entry.name); if (!match) continue; @@ -395,7 +414,11 @@ function contains(parent: string, child: string): boolean { } function decalIndexes(folder: string): string[] { - return readdirSync(folder, { withFileTypes: true }) - .filter((entry) => entry.isFile() && DECALS_INDEX_FILE.test(entry.name)) - .map((entry) => entry.name); + try { + return readdirSync(folder, { withFileTypes: true }) + .filter((entry) => entry.isFile() && DECALS_INDEX_FILE.test(entry.name)) + .map((entry) => entry.name); + } catch { + return []; + } }