diff --git a/build/prepare.js b/build/prepare.js index e66345e6..7bd65e12 100644 --- a/build/prepare.js +++ b/build/prepare.js @@ -88,10 +88,10 @@ const UIConfig = { }; for (const package of modules) { - config.references.push({ path: package }); const basedir = path.resolve(process.cwd(), package); const files = fs.readdirSync(basedir); if (!files.includes('src') && !files.filter((i) => i.endsWith('.ts')).length && package !== 'packages/utils') continue; + config.references.push({ path: package }); const expectedConfig = JSON.stringify((files.includes('src') ? configSrc : configFlat)(package)); const configPath = path.resolve(basedir, 'tsconfig.json'); const currentConfig = fs.existsSync(configPath) ? fs.readFileSync(configPath, 'utf-8') : ''; diff --git a/packages/hydrooj/src/plugin-api.ts b/packages/hydrooj/src/plugin-api.ts index 5d88860d..b79e89f1 100644 --- a/packages/hydrooj/src/plugin-api.ts +++ b/packages/hydrooj/src/plugin-api.ts @@ -45,7 +45,10 @@ export * as validator from './lib/validator'; export { default as rank } from './lib/rank'; export { default as paginate } from './lib/paginate'; export * from './service/decorators'; -export { Handler, ConnectionHandler, captureAllRoutes } from './service/server'; +export { + Handler, ConnectionHandler, captureAllRoutes, + httpServer, wsServer, router, +} from './service/server'; export { UiContextBase } from './service/layers/base'; export * as StorageService from './service/storage'; export { EventMap } from './service/bus'; diff --git a/packages/ui-default/package.json b/packages/ui-default/package.json index b6d6093c..18762cf4 100644 --- a/packages/ui-default/package.json +++ b/packages/ui-default/package.json @@ -3,7 +3,7 @@ "version": "4.40.11", "author": "undefined ", "license": "AGPL-3.0", - "main": "hydro.js", + "main": "index.ts", "repository": "https://github.com/hydro-dev/Hydro.git", "preferUnplugged": true, "scripts": { diff --git a/test/main.ts b/test/main.ts index 6f0e8b67..791a2d44 100644 --- a/test/main.ts +++ b/test/main.ts @@ -2,7 +2,6 @@ import assert from 'assert'; import autocannon from 'autocannon'; import { writeFileSync } from 'fs-extra'; import * as supertest from 'supertest'; -import * as bus from 'hydrooj/src/service/bus'; const Root = { username: 'root', @@ -17,7 +16,7 @@ describe('App', () => { let timeout; const resolve = () => setTimeout(() => { clearTimeout(timeout); - agent = supertest.agent(require('hydrooj/src/service/server').httpServer); + agent = supertest.agent(require('hydrooj').httpServer); done(); }, 2000); process.send = ((send) => (data) => {