From 935259f0815918a05e3267b45b0af202d2306783 Mon Sep 17 00:00:00 2001 From: lisonge Date: Tue, 9 Jan 2024 10:06:31 +0800 Subject: [PATCH] perf: check app config file --- src/rawApps.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/rawApps.ts b/src/rawApps.ts index 86c14161..cee4cda0 100644 --- a/src/rawApps.ts +++ b/src/rawApps.ts @@ -8,6 +8,9 @@ import type { RawApp } from './types'; const rawApps: RawApp[] = []; for await (const tsFp of walk(process.cwd() + '/src/apps')) { + if (!tsFp.endsWith('.ts')) { + throw new Error('invalid typescript app config file: ' + tsFp); + } const mod: { default: RawApp } = await import(url.pathToFileURL(tsFp).href); const appConfig = mod.default; if (path.basename(tsFp, '.ts') != appConfig.id) {