Migrate project to pnpm monorepo

Restructure the repository into a pnpm workspace under packages/ (core, webui, runtime). Move source files for core and webui into packages/*, add package manifests for @snowluma/core and @snowluma/runtime, and remove the old launcher package.json. Update root package.json to be a monorepo controller (scripts delegate to pnpm filters, set packageManager and Node engine). Configure build outputs to emit into the repo-root dist/ (vite config changes) so the existing release pipeline continues to work. Add .npmrc with mirrors, expand .gitignore for monorepo layout, add tsconfig base and package-level tsconfigs, and add vitest config for the core package. Adjust injector native search paths and update tests import paths to the new package layout. Small CI/workflow comment added to clarify build behavior and README updated with monorepo structure and common commands.
This commit is contained in:
手瓜一十雪 committed 2026-05-03 14:02:29 +08:00
1 parent 6bba36bba6
commit 39f1672b29
122 files changed
+279 -85

No files matched your search

+45
View File
@@ -0,0 +1,45 @@
import { NtqqHandler } from './protocol/ntqq-handler';
import { BridgeManager } from './bridge/manager';
import { OneBotManager } from './onebot/manager';
import { loadRuntimeConfig } from './common/runtime';
import { createLogger } from './utils/logger';
import { HookManager } from './hook/hook-manager';
const runtimeConfig = loadRuntimeConfig();
const log = createLogger('App');
async function main() {
log.info('SnowLuma starting');
const ntqq = new NtqqHandler();
const bridgeManager = new BridgeManager();
const oneBotManager = new OneBotManager();
const hookManager = new HookManager(ntqq, bridgeManager);
// Bind bridge manager to NTQQ handler (receives all parsed packets)
bridgeManager.bind(ntqq);
oneBotManager.bind(bridgeManager);
if (typeof __BUILD_WEBUI__ !== 'undefined' && __BUILD_WEBUI__) {
try {
log.info('WebUI is enabled, starting...');
const { initWebUI } = await import('./webui/server');
initWebUI(runtimeConfig.webuiPort || 8080, oneBotManager, hookManager);
} catch (err) {
log.error('Failed to start WebUI: ', err);
}
}
// Graceful shutdown
process.on('SIGINT', () => {
log.warn('Shutting down...');
oneBotManager.dispose();
hookManager.dispose();
process.exit(0);
});
}
main().catch((error) => {
log.error(error instanceof Error ? (error.stack ?? error.message) : String(error));
process.exit(1);
});