mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-19 11:06:25 +08:00
build: allow node package depends on workspace packages (#11963)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added a unified CLI entry point for server operations and introduced a new CLI executable alias. - Centralized and simplified server startup, allowing selection between CLI and server modes. - Added static migration module aggregation for easier migration management. - **Bug Fixes** - Improved platform-specific native module loading for better compatibility and reliability. - **Refactor** - Streamlined server build, startup, and artifact management processes. - Reorganized and simplified workflow and configuration files for backend services. - Transitioned export styles and import mechanisms for native modules to enhance maintainability. - **Chores** - Removed unused dependencies and configuration files. - Updated test cases to reflect refined server flavor logic. - Adjusted package and build configurations for consistency and clarity. - **Revert** - Removed legacy scripts and loaders no longer needed after refactor. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -1,20 +1,11 @@
|
||||
/// <reference types="./global.d.ts" />
|
||||
import './prelude';
|
||||
|
||||
import { Logger } from '@nestjs/common';
|
||||
import { run as runCli } from './cli';
|
||||
import { run as runServer } from './server';
|
||||
|
||||
import { createApp } from './app';
|
||||
import { Config, URLHelper } from './base';
|
||||
|
||||
const app = await createApp();
|
||||
const config = app.get(Config);
|
||||
const url = app.get(URLHelper);
|
||||
const listeningHost = '0.0.0.0';
|
||||
|
||||
await app.listen(config.server.port, listeningHost);
|
||||
|
||||
const logger = new Logger('App');
|
||||
|
||||
logger.log(`AFFiNE Server is running in [${env.DEPLOYMENT_TYPE}] mode`);
|
||||
logger.log(`Listening on http://${listeningHost}:${config.server.port}`);
|
||||
logger.log(`And the public server should be recognized as ${url.home}`);
|
||||
if (env.flavors.script) {
|
||||
await runCli();
|
||||
} else {
|
||||
await runServer();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user