forked from FoundKeyGang/FoundKey
remove some default exports
This commit is contained in:
parent
d6452795b0
commit
410c519953
7 changed files with 7 additions and 10 deletions
|
@ -8,7 +8,7 @@ import chalkTemplate from 'chalk-template';
|
|||
import semver from 'semver';
|
||||
|
||||
import Logger from '@/services/logger.js';
|
||||
import loadConfig from '@/config/load.js';
|
||||
import { loadConfig } from '@/config/load.js';
|
||||
import { Config } from '@/config/types.js';
|
||||
import { showMachineInfo } from '@/misc/show-machine-info.js';
|
||||
import { envOption } from '@/env.js';
|
||||
|
|
|
@ -23,7 +23,7 @@ const path = process.env.NODE_ENV === 'test'
|
|||
? `${dir}/test.yml`
|
||||
: `${dir}/default.yml`;
|
||||
|
||||
export default function load(): Config {
|
||||
export function loadConfig(): Config {
|
||||
const meta = JSON.parse(fs.readFileSync(`${_dirname}/../../../../built/meta.json`, 'utf-8'));
|
||||
const clientManifest = JSON.parse(fs.readFileSync(`${_dirname}/../../../../built/_client_dist_/manifest.json`, 'utf-8'));
|
||||
let config = yaml.load(fs.readFileSync(path, 'utf-8')) as Source;
|
||||
|
|
|
@ -8,7 +8,7 @@ import { dirname } from 'node:path';
|
|||
import Koa from 'koa';
|
||||
import cors from '@koa/cors';
|
||||
import Router from '@koa/router';
|
||||
import sendDriveFile from './send-drive-file.js';
|
||||
import { sendDriveFile } from './send-drive-file.js';
|
||||
|
||||
const _filename = fileURLToPath(import.meta.url);
|
||||
const _dirname = dirname(_filename);
|
||||
|
|
|
@ -27,8 +27,7 @@ const commonReadableHandlerGenerator = (ctx: Koa.Context) => (e: Error): void =>
|
|||
ctx.set('Cache-Control', 'max-age=300');
|
||||
};
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default async function(ctx: Koa.Context) {
|
||||
export async function sendDriveFile(ctx: Koa.Context) {
|
||||
const key = ctx.params.key;
|
||||
|
||||
// Fetch drive file
|
||||
|
|
|
@ -4,7 +4,7 @@ import config from '@/config/index.js';
|
|||
import { User } from '@/models/entities/user.js';
|
||||
import { Notes, DriveFiles, UserProfiles, Users } from '@/models/index.js';
|
||||
|
||||
export default async function(user: User) {
|
||||
export async function packFeed(user: User) {
|
||||
const author = {
|
||||
link: `${config.url}/@${user.username}`,
|
||||
name: user.name || user.username,
|
||||
|
|
|
@ -26,7 +26,7 @@ import { MINUTE, DAY } from '@/const.js';
|
|||
import { genOpenapiSpec } from '../api/openapi/gen-spec.js';
|
||||
import { urlPreviewHandler } from './url-preview.js';
|
||||
import { manifestHandler } from './manifest.js';
|
||||
import packFeed from './feed.js';
|
||||
import { packFeed } from './feed.js';
|
||||
|
||||
const _filename = fileURLToPath(import.meta.url);
|
||||
const _dirname = dirname(_filename);
|
||||
|
|
|
@ -95,9 +95,7 @@ class Publisher {
|
|||
};
|
||||
}
|
||||
|
||||
const publisher = new Publisher();
|
||||
|
||||
export default publisher;
|
||||
export const publisher = new Publisher();
|
||||
|
||||
export const publishInternalEvent = publisher.publishInternalEvent;
|
||||
export const publishUserEvent = publisher.publishUserEvent;
|
||||
|
|
Loading…
Reference in a new issue