Skip to content

Commit 8ba2794

Browse files
feat: setup shared package for common utilities and types
1 parent 6fe0651 commit 8ba2794

3 files changed

Lines changed: 44 additions & 0 deletions

File tree

packages/shared/package.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "@taskflow/shared",
3+
"version": "0.1.0",
4+
"private": true,
5+
"type": "module",
6+
"main": "dist/index.js",
7+
"types": "dist/index.d.ts",
8+
"exports": {
9+
".": {
10+
"import": "./dist/index.js",
11+
"types": "./dist/index.d.ts"
12+
}
13+
},
14+
"scripts": {
15+
"build": "tsc",
16+
"dev": "tsc --watch",
17+
"typecheck": "tsc --noEmit",
18+
"clean": "rm -rf dist"
19+
},
20+
"devDependencies": {
21+
"typescript": "^5.7.0"
22+
}
23+
}

packages/shared/src/index.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Types
2+
export type { Job, JobStatus, JobPriority, CreateJobInput } from "./types/job.js";
3+
export type { QueueStats } from "./types/queue.js";
4+
export type { WorkerInfo, WorkerStatus } from "./types/worker.js";
5+
export type { JobSchedule, CreateScheduleInput } from "./types/schedule.js";
6+
export type { PaginationMeta, ApiResponse, ApiErrorResponse } from "./types/api.js";
7+
8+
// Constants
9+
export { QUEUE_NAMES, ALL_QUEUES, type QueueName } from "./constants/queues.js";
10+
export { PRIORITY_MAP, JOB_DEFAULTS } from "./constants/priorities.js";
11+
12+
// Utils
13+
export { isValidQueue, isValidPriority, isValidCron } from "./utils/validation.js";

packages/shared/tsconfig.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "../../tsconfig.base.json",
3+
"compilerOptions": {
4+
"rootDir": "src",
5+
"outDir": "dist"
6+
},
7+
"include": ["src"]
8+
}

0 commit comments

Comments
 (0)