feat: 初始化项目

This commit is contained in:
R524809
2026-09-02 17:47:25 +08:00
parent 04c94e75db
commit 1a2caba2b3
51 changed files with 6793 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
{
"name": "@atlas/worker",
"version": "0.1.0",
"private": true,
"scripts": {
"build": "tsc -p tsconfig.json",
"dev": "tsx watch src/main.ts",
"start": "node dist/main.js",
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
"@atlas/contracts": "workspace:*",
"bullmq": "6.3.4"
},
"devDependencies": {
"@types/node": "26.3.0",
"tsx": "4.23.13",
"typescript": "7.0.2"
}
}
+20
View File
@@ -0,0 +1,20 @@
import { Queue } from 'bullmq';
const connection = { url: process.env.REDIS_URL ?? 'redis://localhost:6379' };
const dispatchQueue = new Queue('atlas-dispatch', { connection });
async function bootstrap() {
await dispatchQueue.waitUntilReady();
console.info(
'Atlas Worker is ready; it will consume transactional-outbox events after that module exists.',
);
}
void bootstrap();
async function shutdown() {
await dispatchQueue.close();
}
process.once('SIGINT', () => void shutdown());
process.once('SIGTERM', () => void shutdown());
+9
View File
@@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
"types": ["node"]
},
"include": ["src/**/*.ts"]
}