mirror of
https://github.com/AIsouler/GKD_subscription.git
synced 2025-12-21 17:25:11 +08:00
chore: @gkd-kit/api
This commit is contained in:
@@ -4,15 +4,17 @@ import url from 'node:url';
|
||||
import picocolors from 'picocolors';
|
||||
import { pinyin } from 'pinyin-pro';
|
||||
import { walk } from './file';
|
||||
import type { RawApp } from './types';
|
||||
import type { RawAppAddProp } from './types';
|
||||
import { OPEN_AD_ORDER } from './utils';
|
||||
|
||||
const rawApps: RawApp[] = [];
|
||||
const rawApps: RawAppAddProp[] = [];
|
||||
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 mod: { default: RawAppAddProp } = await import(
|
||||
url.pathToFileURL(tsFp).href
|
||||
);
|
||||
const appConfig = mod.default;
|
||||
if (path.basename(tsFp, '.ts') != appConfig.id) {
|
||||
throw new Error(
|
||||
|
||||
Reference in New Issue
Block a user