feat: complete TASK-WP0-01 toolchain skeleton
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "@dada/worker",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "tsc -p tsconfig.json",
|
||||
"typecheck": "tsc --noEmit -p tsconfig.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"better-sqlite3": "13.0.1",
|
||||
"drizzle-orm": "0.45.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/better-sqlite3": "7.6.13",
|
||||
"@types/node": "24.13.3",
|
||||
"typescript": "7.0.2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { parentPort } from "node:worker_threads";
|
||||
|
||||
export function handleWorkerProbe(message: unknown) {
|
||||
return message === "ping" ? "pong" : null;
|
||||
}
|
||||
|
||||
const workerPort = parentPort;
|
||||
|
||||
if (workerPort) {
|
||||
workerPort.on("message", (message: unknown) => {
|
||||
workerPort.postMessage(handleWorkerProbe(message));
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"lib": ["ES2024"],
|
||||
"types": ["node"],
|
||||
"outDir": "dist",
|
||||
"rootDir": "src"
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
||||
Reference in New Issue
Block a user