mirror of https://github.com/buster-so/buster.git
create basic turbo repo setup
This commit is contained in:
parent
a9e8ac6240
commit
10dfdb50dc
|
@ -64,6 +64,9 @@ Cargo.lock
|
|||
# Node.js dependencies
|
||||
node_modules/
|
||||
|
||||
# Turborepo
|
||||
.turbo
|
||||
|
||||
.secrets
|
||||
|
||||
/prds
|
||||
|
@ -83,4 +86,5 @@ drizzle/.env.*
|
|||
drizzle/*.log
|
||||
drizzle/meta/
|
||||
|
||||
**/evals/**/*.eval.private.ts
|
||||
**/evals/**/*.eval.private.ts
|
||||
*.tsbuildinfo
|
||||
|
|
File diff suppressed because it is too large
Load Diff
46
package.json
46
package.json
|
@ -1,13 +1,16 @@
|
|||
{
|
||||
"name": "buster",
|
||||
"private": true,
|
||||
"packageManager": "npm@10.0.0",
|
||||
"workspaces": [
|
||||
"packages/*",
|
||||
"trigger",
|
||||
"server"
|
||||
"server",
|
||||
"web"
|
||||
],
|
||||
"scripts": {
|
||||
"ai:dev": "npm run --cwd packages/ai dev",
|
||||
"build": "turbo build",
|
||||
"check": "biome check ${1:-.}",
|
||||
"check:fix": "biome check --write ${1:-.}",
|
||||
"ci:check": "npm run check && npm run typecheck",
|
||||
|
@ -19,69 +22,72 @@
|
|||
"db:studio": "npm run db:studio --workspace=@buster/database",
|
||||
"db:check": "npm run db:check --workspace=@buster/database",
|
||||
"db:setup": "npm run db:setup --workspace=@buster/database",
|
||||
"dev": "turbo dev",
|
||||
"evals": "bash scripts/evals.sh",
|
||||
"format": "biome format ${1:-.}",
|
||||
"format:fix": "biome format --write ${1:-.}",
|
||||
"test": "vitest run",
|
||||
"test:coverage": "vitest run --coverage",
|
||||
"lint": "turbo lint",
|
||||
"test": "turbo test",
|
||||
"test:coverage": "turbo test:coverage",
|
||||
"test:file": "vitest run ${1:-}",
|
||||
"test:ui": "vitest --ui",
|
||||
"test:watch": "vitest watch",
|
||||
"test:watch": "turbo test:watch",
|
||||
"test:watch:file": "vitest watch ${1:-}",
|
||||
"trigger:deploy": "npm run deploy --workspace=@buster/trigger",
|
||||
"trigger:dev": "dotenv -e .env -- npm run dev --workspace=@buster/trigger",
|
||||
"trigger:test": "npm run test --workspace=@buster/trigger",
|
||||
"trigger:test:integration": "npm run test:integration --workspace=@buster/trigger"
|
||||
"trigger:test:integration": "npm run test:integration --workspace=@buster/trigger",
|
||||
"typecheck": "turbo typecheck"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ai-sdk/amazon-bedrock": "^2.2.10",
|
||||
"@ai-sdk/anthropic": "^1.2.12",
|
||||
"@ai-sdk/openai": "^1.3.22",
|
||||
"@aws-sdk/credential-providers": "^3.828.0",
|
||||
"@aws-sdk/credential-providers": "^3.830.0",
|
||||
"@google-cloud/bigquery": "^7.9.4",
|
||||
"@mastra/core": "^0.10.5",
|
||||
"@mastra/evals": "^0.10.3",
|
||||
"@mastra/libsql": "^0.10.2",
|
||||
"@mastra/core": "^0.10.6",
|
||||
"@mastra/evals": "^0.10.4",
|
||||
"@mastra/libsql": "^0.10.3",
|
||||
"@mastra/loggers": "^0.10.2",
|
||||
"@mastra/memory": "^0.10.3",
|
||||
"@mastra/pg": "^0.10.3",
|
||||
"@mastra/memory": "^0.10.4",
|
||||
"@mastra/pg": "^0.11.0",
|
||||
"@mendable/firecrawl-js": "^1.25.5",
|
||||
"@supabase/supabase-js": "^2.50.0",
|
||||
"@trigger.dev/sdk": "^3.3.17",
|
||||
"ai": "^4.3.16",
|
||||
"dotenv-cli": "^8.0.0",
|
||||
"drizzle-orm": "^0.44.2",
|
||||
"glob": "^11.0.2",
|
||||
"hono": "^4.7.11",
|
||||
"minimatch": "^10.0.2",
|
||||
"glob": "^11.0.3",
|
||||
"hono": "^4.8.0",
|
||||
"minimatch": "^10.0.3",
|
||||
"mssql": "^11.0.1",
|
||||
"mysql2": "^3.14.1",
|
||||
"pg": "^8.16.0",
|
||||
"pg": "^8.16.1",
|
||||
"postgres": "^3.4.7",
|
||||
"snowflake-sdk": "^2.1.0",
|
||||
"yaml": "^2.8.0",
|
||||
"zod": "^3.25.62"
|
||||
"zod": "^3.25.67"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "^1.9.4",
|
||||
"@trigger.dev/build": "^3.3.17",
|
||||
"turbo": "^2.3.4",
|
||||
"@types/bun": "latest",
|
||||
"@types/mssql": "^9.1.7",
|
||||
"@types/node": "^20.17.57",
|
||||
"@types/pg": "^8.15.4",
|
||||
"@types/snowflake-sdk": "^1.6.24",
|
||||
"@types/uuid": "^10.0.0",
|
||||
"@vitest/coverage-v8": "^3.2.3",
|
||||
"@vitest/ui": "^3.2.3",
|
||||
"@vitest/coverage-v8": "^3.2.4",
|
||||
"@vitest/ui": "^3.2.4",
|
||||
"autoevals": "^0.0.129",
|
||||
"axios": "^1.9.0",
|
||||
"braintrust": "^0.0.206",
|
||||
"dotenv": "^16.5.0",
|
||||
"drizzle-kit": "^0.31.1",
|
||||
"typescript": "^5.8.3",
|
||||
"uuid": "^11.1.0",
|
||||
"vite-tsconfig-paths": "^5.1.4",
|
||||
"vitest": "^3.2.3"
|
||||
"vitest": "^3.2.4"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"bun": "^1.2.15",
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
"clean": "rm -rf dist && tsc --build --clean",
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest watch",
|
||||
"test:coverage": "vitest run --coverage"
|
||||
"test:coverage": "vitest run --coverage",
|
||||
"typecheck": "tsc --noEmit"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -3,10 +3,11 @@
|
|||
"module": "src/index.ts",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "tsc --build",
|
||||
"dev": "mastra dev --dir src",
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest watch",
|
||||
"test:coverage": "vitest run --coverage",
|
||||
"typecheck": "tsc --noEmit"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -51,4 +51,4 @@ jspm_packages/
|
|||
*.tgz
|
||||
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
.yarn-integrity
|
||||
|
|
|
@ -14,9 +14,15 @@
|
|||
"test:introspection": "vitest run tests/integration/data-source-introspection.test.ts",
|
||||
"lint": "eslint src/ tests/",
|
||||
"lint:fix": "eslint src/ tests/ --fix",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"clean": "rm -rf dist"
|
||||
},
|
||||
"keywords": ["database", "data-source", "introspection", "sql"],
|
||||
"keywords": [
|
||||
"database",
|
||||
"data-source",
|
||||
"introspection",
|
||||
"sql"
|
||||
],
|
||||
"author": "Buster Team",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
|
@ -25,4 +31,4 @@
|
|||
"devDependencies": {
|
||||
"@types/pg-cursor": "^2.7.2"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -10,6 +10,7 @@
|
|||
"test": "bun test",
|
||||
"test:watch": "bun test --watch",
|
||||
"test:coverage": "bun test --coverage",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"db:generate": "drizzle-kit generate",
|
||||
"db:migrate": "drizzle-kit migrate",
|
||||
"db:push": "drizzle-kit push",
|
||||
|
@ -19,4 +20,4 @@
|
|||
"db:check": "drizzle-kit check",
|
||||
"db:setup": "bun run src/setup.ts setup"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
/dist/*
|
|
@ -5,6 +5,7 @@
|
|||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"scripts": {
|
||||
"build": "tsc --build",
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest watch",
|
||||
"test:coverage": "vitest run --coverage",
|
||||
|
@ -14,4 +15,4 @@
|
|||
"format": "biome format .",
|
||||
"format:fix": "biome format --write ."
|
||||
}
|
||||
}
|
||||
}
|
|
@ -22,10 +22,11 @@
|
|||
"build": "tsc",
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest watch",
|
||||
"test:coverage": "vitest run --coverage"
|
||||
"test:coverage": "vitest run --coverage",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@buster/database": "*"
|
||||
},
|
||||
"devDependencies": {}
|
||||
}
|
||||
}
|
|
@ -8,6 +8,9 @@
|
|||
},
|
||||
"scripts": {
|
||||
"build": "tsc --build",
|
||||
"test": "vitest"
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest watch",
|
||||
"test:coverage": "vitest run --coverage",
|
||||
"typecheck": "tsc --noEmit"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,10 +5,12 @@
|
|||
"module": "src/index.ts",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"test": "vitest",
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest",
|
||||
"test:ui": "vitest --ui",
|
||||
"test:coverage": "vitest --coverage",
|
||||
"build": "tsc --build",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"dev": "bun run src/index.ts"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -3,14 +3,17 @@
|
|||
"scripts": {
|
||||
"dev": "bun --max-old-space-size=512 run --hot src/index.ts",
|
||||
"build": "bun build src/index.ts --outdir ./dist --target bun",
|
||||
"start": "bun --max-old-space-size=512 run dist/index.js",
|
||||
"prod": "bun run build && bun run start"
|
||||
"start": "bun run dist/index.js",
|
||||
"prod": "bun run build && bun run start",
|
||||
"test": "bun test",
|
||||
"test:watch": "bun test --watch",
|
||||
"test:coverage": "bun test --coverage",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@hono/zod-validator": "^0.7.0",
|
||||
"hono": "^4.7.11",
|
||||
"hono-pino": "^0.8.0",
|
||||
"pino": "^9.7.0",
|
||||
"pino-pretty": "^13.0.0"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -88,6 +88,7 @@ describe('createChatHandler', () => {
|
|||
organizationId: '550e8400-e29b-41d4-a716-446655440000',
|
||||
role: 'admin',
|
||||
});
|
||||
vi.mocked(tasks.trigger).mockResolvedValue({ id: 'task-handle-123' } as any);
|
||||
});
|
||||
|
||||
it('should create a new chat with prompt', async () => {
|
||||
|
@ -150,19 +151,16 @@ describe('createChatHandler', () => {
|
|||
});
|
||||
|
||||
it('should handle trigger errors gracefully', async () => {
|
||||
vi.mocked(tasks.trigger).mockRejectedValue(new Error('Trigger failed'));
|
||||
vi.mocked(tasks.trigger).mockReset().mockRejectedValue(new Error('Trigger failed'));
|
||||
const consoleSpy = vi.spyOn(console, 'error').mockImplementation(() => {});
|
||||
|
||||
const result = await createChatHandler({ prompt: 'Hello' }, mockUser);
|
||||
await expect(createChatHandler({ prompt: 'Hello' }, mockUser)).rejects.toMatchObject({
|
||||
code: ChatErrorCode.INTERNAL_ERROR,
|
||||
message: 'An unexpected error occurred while creating the chat',
|
||||
details: { originalError: 'Trigger failed' },
|
||||
});
|
||||
|
||||
expect(consoleSpy).toHaveBeenCalledWith(
|
||||
'Failed to trigger analyst agent task:',
|
||||
expect.objectContaining({
|
||||
error: expect.any(Error),
|
||||
messageId: 'msg-123',
|
||||
})
|
||||
);
|
||||
expect(result).toEqual(mockChat); // Should still return the chat
|
||||
expect(consoleSpy).toHaveBeenCalledWith('Chat creation failed:', expect.any(Object));
|
||||
|
||||
consoleSpy.mockRestore();
|
||||
});
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
"outDir": "dist",
|
||||
"rootDir": "src",
|
||||
"tsBuildInfoFile": "dist/.tsbuildinfo",
|
||||
|
||||
// Server path mapping (local aliases) - these extend the base config
|
||||
"baseUrl": "./",
|
||||
"paths": {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"scripts": {
|
||||
"dev": "npx trigger.dev@latest dev",
|
||||
"deploy": "npx trigger.dev@latest deploy",
|
||||
"build": "npx trigger.dev@latest build",
|
||||
"build": "echo 'No build step required for Trigger.dev v3 - uses deploy command'",
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest",
|
||||
"test:integration": "vitest run tests/integration",
|
||||
|
|
|
@ -0,0 +1,79 @@
|
|||
{
|
||||
"$schema": "https://turbo.build/schema.json",
|
||||
"ui": "tui",
|
||||
"tasks": {
|
||||
"build": {
|
||||
"dependsOn": [
|
||||
"^build"
|
||||
],
|
||||
"inputs": [
|
||||
"$TURBO_DEFAULT$",
|
||||
".env*"
|
||||
],
|
||||
"outputs": [
|
||||
"dist/**",
|
||||
".next/**",
|
||||
"!.next/cache/**"
|
||||
]
|
||||
},
|
||||
"dev": {
|
||||
"cache": false,
|
||||
"persistent": true
|
||||
},
|
||||
"lint": {
|
||||
"dependsOn": [
|
||||
"^build"
|
||||
]
|
||||
},
|
||||
"typecheck": {
|
||||
"dependsOn": [
|
||||
"^build"
|
||||
],
|
||||
"inputs": [
|
||||
"$TURBO_DEFAULT$",
|
||||
"tsconfig.json"
|
||||
]
|
||||
},
|
||||
"test": {
|
||||
"inputs": [
|
||||
"$TURBO_DEFAULT$",
|
||||
"**/*.test.{ts,tsx,js,jsx}",
|
||||
"**/*.spec.{ts,tsx,js,jsx}",
|
||||
"tests/**/*"
|
||||
],
|
||||
"outputs": [
|
||||
"coverage/**"
|
||||
]
|
||||
},
|
||||
"test:watch": {
|
||||
"cache": false,
|
||||
"persistent": true
|
||||
},
|
||||
"test:coverage": {
|
||||
"dependsOn": [
|
||||
"^build"
|
||||
],
|
||||
"inputs": [
|
||||
"$TURBO_DEFAULT$",
|
||||
"**/*.test.{ts,tsx,js,jsx}",
|
||||
"**/*.spec.{ts,tsx,js,jsx}",
|
||||
"tests/**/*"
|
||||
],
|
||||
"outputs": [
|
||||
"coverage/**"
|
||||
]
|
||||
},
|
||||
"test:ui": {
|
||||
"cache": false,
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"globalDependencies": [
|
||||
".env",
|
||||
".env.local",
|
||||
".env.development",
|
||||
".env.production",
|
||||
"tsconfig.json",
|
||||
"tsconfig.base.json"
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue