Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
386e4f6
chore: add request headers
ElasticBottle Sep 18, 2025
95f3116
chore(crawler): remove apify reliance
ElasticBottle Sep 18, 2025
23f21a5
chore: add new command to copy workspace package
ElasticBottle Sep 18, 2025
d8bc46a
chore(tasks): initial commit
ElasticBottle Sep 18, 2025
dc86161
feat(task): happy path with site crawler
ElasticBottle Sep 18, 2025
214fe6f
chore(crawler): remove package
ElasticBottle Sep 18, 2025
f419a48
feat(seo): new seo site
ElasticBottle Sep 18, 2025
15fda09
chore(task): update task stuff
ElasticBottle Sep 18, 2025
a182c8a
chore: misc stuff
ElasticBottle Sep 18, 2025
4d57fb8
feat(task): expose api
ElasticBottle Sep 18, 2025
622f4c8
chore: update seo wrangler
ElasticBottle Sep 19, 2025
760698d
chore: reduce cpu usage from constant watching
ElasticBottle Sep 19, 2025
ceafc88
feat(task): add metadata support to track progress
ElasticBottle Sep 19, 2025
df456a2
chore(db): clean up schema to support seo project
ElasticBottle Sep 19, 2025
d2913e0
feat(task): add llm parsing for site data
ElasticBottle Sep 19, 2025
d3a8790
chore: add env variables
ElasticBottle Sep 19, 2025
41f99d8
chore(seo): update env var for site url
ElasticBottle Sep 20, 2025
29eb44c
chore(seo): display better message for arktype parsing failure
ElasticBottle Sep 20, 2025
3d974b8
refactor(seo): update onboarding steps name
ElasticBottle Sep 20, 2025
6cd154e
refactor(seo): update site layout to support org name in slug
ElasticBottle Sep 20, 2025
ebd77b4
chore(mentions): remove mentions web app
ElasticBottle Sep 20, 2025
85a5378
chore: save stuff
ElasticBottle Sep 20, 2025
d7ef5f8
feat(api-seo): add seo's api
ElasticBottle Sep 20, 2025
5dae428
chore(ui): add icons
ElasticBottle Sep 20, 2025
0f55c11
feat(seo): onboarding
ElasticBottle Sep 20, 2025
827766e
fix: type, lint and format errors
ElasticBottle Sep 20, 2025
a995f0b
chore: update lockfile
ElasticBottle Sep 20, 2025
9e902d5
chore: update docker
ElasticBottle Sep 20, 2025
9cbff6b
ci: add trigger task deployment
ElasticBottle Sep 20, 2025
940f073
ci: update trigger dev ci to include staging platform
ElasticBottle Sep 20, 2025
e59ca3f
ci: update trigger deployment
ElasticBottle Sep 20, 2025
9063560
chore: add custom project ID given env stage
ElasticBottle Sep 20, 2025
cb718a7
chore: update env variables
ElasticBottle Sep 20, 2025
d13e5ba
chore: add user profile token
ElasticBottle Sep 20, 2025
dbea142
chore: try building
ElasticBottle Sep 20, 2025
d7181ac
fix: build scripts in package.json
ElasticBottle Sep 20, 2025
c505737
chore: force missing env vars to fail
ElasticBottle Sep 20, 2025
995d703
docs: update return type docs string
ElasticBottle Sep 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
456 changes: 456 additions & 0 deletions .cursor/rules/trigger.advanced-tasks.mdc

Large diffs are not rendered by default.

351 changes: 351 additions & 0 deletions .cursor/rules/trigger.config.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,351 @@
---
description: Configure your Trigger.dev project with a trigger.config.ts file
globs: **/trigger.config.ts
alwaysApply: false
---
# Trigger.dev Configuration (v4)

**Complete guide to configuring `trigger.config.ts` with build extensions**

## Basic Configuration

```ts
import { defineConfig } from "@trigger.dev/sdk";

export default defineConfig({
project: "<project-ref>", // Required: Your project reference
dirs: ["./trigger"], // Task directories
runtime: "node", // "node", "node-22", or "bun"
logLevel: "info", // "debug", "info", "warn", "error"

// Default retry settings
retries: {
enabledInDev: false,
default: {
maxAttempts: 3,
minTimeoutInMs: 1000,
maxTimeoutInMs: 10000,
factor: 2,
randomize: true,
},
},

// Build configuration
build: {
autoDetectExternal: true,
keepNames: true,
minify: false,
extensions: [], // Build extensions go here
},

// Global lifecycle hooks
onStart: async ({ payload, ctx }) => {
console.log("Global task start");
},
onSuccess: async ({ payload, output, ctx }) => {
console.log("Global task success");
},
onFailure: async ({ payload, error, ctx }) => {
console.log("Global task failure");
},
});
```

## Build Extensions

### Database & ORM

#### Prisma

```ts
import { prismaExtension } from "@trigger.dev/build/extensions/prisma";

extensions: [
prismaExtension({
schema: "prisma/schema.prisma",
version: "5.19.0", // Optional: specify version
migrate: true, // Run migrations during build
directUrlEnvVarName: "DIRECT_DATABASE_URL",
typedSql: true, // Enable TypedSQL support
}),
];
```

#### TypeScript Decorators (for TypeORM)

```ts
import { emitDecoratorMetadata } from "@trigger.dev/build/extensions/typescript";

extensions: [
emitDecoratorMetadata(), // Enables decorator metadata
];
```

### Scripting Languages

#### Python

```ts
import { pythonExtension } from "@trigger.dev/build/extensions/python";

extensions: [
pythonExtension({
scripts: ["./python/**/*.py"], // Copy Python files
requirementsFile: "./requirements.txt", // Install packages
devPythonBinaryPath: ".venv/bin/python", // Dev mode binary
}),
];

// Usage in tasks
const result = await python.runInline(`print("Hello, world!")`);
const output = await python.runScript("./python/script.py", ["arg1"]);
```

### Browser Automation

#### Playwright

```ts
import { playwright } from "@trigger.dev/build/extensions/playwright";

extensions: [
playwright({
browsers: ["chromium", "firefox", "webkit"], // Default: ["chromium"]
headless: true, // Default: true
}),
];
```

#### Puppeteer

```ts
import { puppeteer } from "@trigger.dev/build/extensions/puppeteer";

extensions: [puppeteer()];

// Environment variable needed:
// PUPPETEER_EXECUTABLE_PATH: "/usr/bin/google-chrome-stable"
```

#### Lightpanda

```ts
import { lightpanda } from "@trigger.dev/build/extensions/lightpanda";

extensions: [
lightpanda({
version: "latest", // or "nightly"
disableTelemetry: false,
}),
];
```

### Media Processing

#### FFmpeg

```ts
import { ffmpeg } from "@trigger.dev/build/extensions/core";

extensions: [
ffmpeg({ version: "7" }), // Static build, or omit for Debian version
];

// Automatically sets FFMPEG_PATH and FFPROBE_PATH
// Add fluent-ffmpeg to external packages if using
```

#### Audio Waveform

```ts
import { audioWaveform } from "@trigger.dev/build/extensions/audioWaveform";

extensions: [
audioWaveform(), // Installs Audio Waveform 1.1.0
];
```

### System & Package Management

#### System Packages (apt-get)

```ts
import { aptGet } from "@trigger.dev/build/extensions/core";

extensions: [
aptGet({
packages: ["ffmpeg", "imagemagick", "curl=7.68.0-1"], // Can specify versions
}),
];
```

#### Additional NPM Packages

Only use this for installing CLI tools, NOT packages you import in your code.

```ts
import { additionalPackages } from "@trigger.dev/build/extensions/core";

extensions: [
additionalPackages({
packages: ["wrangler"], // CLI tools and specific versions
}),
];
```

#### Additional Files

```ts
import { additionalFiles } from "@trigger.dev/build/extensions/core";

extensions: [
additionalFiles({
files: ["wrangler.toml", "./assets/**", "./fonts/**"], // Glob patterns supported
}),
];
```

### Environment & Build Tools

#### Environment Variable Sync

```ts
import { syncEnvVars } from "@trigger.dev/build/extensions/core";

extensions: [
syncEnvVars(async (ctx) => {
// ctx contains: environment, projectRef, env
return [
{ name: "SECRET_KEY", value: await getSecret(ctx.environment) },
{ name: "API_URL", value: ctx.environment === "prod" ? "api.prod.com" : "api.dev.com" },
];
}),
];
```

#### ESBuild Plugins

```ts
import { esbuildPlugin } from "@trigger.dev/build/extensions";
import { sentryEsbuildPlugin } from "@sentry/esbuild-plugin";

extensions: [
esbuildPlugin(
sentryEsbuildPlugin({
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
authToken: process.env.SENTRY_AUTH_TOKEN,
}),
{ placement: "last", target: "deploy" } // Optional config
),
];
```

## Custom Build Extensions

```ts
import { defineConfig } from "@trigger.dev/sdk";

const customExtension = {
name: "my-custom-extension",

externalsForTarget: (target) => {
return ["some-native-module"]; // Add external dependencies
},

onBuildStart: async (context) => {
console.log(`Build starting for ${context.target}`);
// Register esbuild plugins, modify build context
},

onBuildComplete: async (context, manifest) => {
console.log("Build complete, adding layers");
// Add build layers, modify deployment
context.addLayer({
id: "my-layer",
files: [{ source: "./custom-file", destination: "/app/custom" }],
commands: ["chmod +x /app/custom"],
});
},
};

export default defineConfig({
project: "my-project",
build: {
extensions: [customExtension],
},
});
```

## Advanced Configuration

### Telemetry

```ts
import { PrismaInstrumentation } from "@prisma/instrumentation";
import { OpenAIInstrumentation } from "@langfuse/openai";

export default defineConfig({
// ... other config
telemetry: {
instrumentations: [new PrismaInstrumentation(), new OpenAIInstrumentation()],
exporters: [customExporter], // Optional custom exporters
},
});
```

### Machine & Performance

```ts
export default defineConfig({
// ... other config
defaultMachine: "large-1x", // Default machine for all tasks
maxDuration: 300, // Default max duration (seconds)
enableConsoleLogging: true, // Console logging in development
});
```

## Common Extension Combinations

### Full-Stack Web App

```ts
extensions: [
prismaExtension({ schema: "prisma/schema.prisma", migrate: true }),
additionalFiles({ files: ["./public/**", "./assets/**"] }),
syncEnvVars(async (ctx) => [...envVars]),
];
```

### AI/ML Processing

```ts
extensions: [
pythonExtension({
scripts: ["./ai/**/*.py"],
requirementsFile: "./requirements.txt",
}),
ffmpeg({ version: "7" }),
additionalPackages({ packages: ["wrangler"] }),
];
```

### Web Scraping

```ts
extensions: [
playwright({ browsers: ["chromium"] }),
puppeteer(),
additionalFiles({ files: ["./selectors.json", "./proxies.txt"] }),
];
```

## Best Practices

- **Use specific versions**: Pin extension versions for reproducible builds
- **External packages**: Add modules with native addons to the `build.external` array
- **Environment sync**: Use `syncEnvVars` for dynamic secrets
- **File paths**: Use glob patterns for flexible file inclusion
- **Debug builds**: Use `--log-level debug --dry-run` for troubleshooting

Extensions only affect deployment, not local development. Use `external` array for packages that shouldn't be bundled.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ storage

# installed files
node_modules
dist
out
.cache
.claude
Expand Down
5 changes: 4 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
DOTENV_PUBLIC_KEY="029b5432287e802a315a922dd9d54d39c60a9c2b90352e6e182c7ebd760852b510"

VITE_APP_URL="https://{env.PULL_REQUEST}.rectangularlabs.com"
VITE_MENTIONS_URL="https://{env.PULL_REQUEST}.mentions.rectangularlabs.com"
VITE_SEO_URL="https://{env.PULL_REQUEST}.seo.rectangularlab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nykz1iLt6gnNSs4yacQpAqeQqyD5MzQ=="
TRIGGER_SECRET_KEY="encrypted:BJuy27GWKGa05sHyHespRWuUDuvEKrn3BWvn2jhbC8k88tIeV2nsiL5bZVzY1BlegqFVKe6pcm0nmerZD1H9u2gQ0coi/BoluXEA29oFGsfw0bgLFp3wlA4MeFmYelzf2o45pJlY9DXC6ostTou2/afYZdYMB1rHRxyh25E="
TRIGGER_PROJECT_ID="encrypted:BP3z3xgCc+FE8B9ngJL4F1/Mh95qTYsJ7wPraD2IEY6SoGKt+UJJHCad+IMZEO0R10G9NnRmOOcK7ota0ncbwQ8L/HH2D22mmHcub5rpw18vDc1Udlb923Z00j+bIgN+qDEmLWMs8McxAc/MMxfItfhNg99l3iBqk4U="
5 changes: 4 additions & 1 deletion .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ DOTENV_PUBLIC_KEY_PRODUCTION="03741dc2723a48fc90ce0be37d246e96d1ee68ff34af5f702d

# .env.production
VITE_APP_URL="https://rectangularlabs.com"
VITE_MENTIONS_URL="https://mentions.rectangularlabs.com"
VITE_SEO_URL="https://seo.rectangularlabs.com"

AUTH_ENCRYPTION_KEY="encrypted:BB7GTM5rZHiQxZ8UNUnajRL+QRCxDuSZvOfcrsqrQIFtLTrM/p0Xhc6zDnZnDDnShczhi4m1eaHq5cZWBuzjMUfv2CpnU4yPxZYuOMRsKjY1mQ/DztxYMT5tH42+QCMxA1bU6sJCdDnWwFPqx0DcL30oxCkxuaWzBmeHpmEPAcjV/NHtZ9pbm87cdXtj"
AUTH_GITHUB_ID="encrypted:BGhstwS69Y3j8JlzPfLKAXSSB0OYXBmLDzq0BFT0q5ujVp6yzziNzfiV3Miom6sIk6PQCcGYud4cwyQWAp/G/Vu3f3vBvIvTwjB05xR8ZFW5P3Eb1a4L5k2wT2/tr5ANY0P4i9T14j4zy6nNhXafU7f8fiVA"
AUTH_GITHUB_SECRET="encrypted:BJ42L6e6x7bgwQW8AiYjl53L+Gu81RklwcApDtP5xkZkOPZNU714g9BP3HQrdjWuQTmyDlEi9WPfS89M93Wqm6AGhUnZFdU48/EXhphZzHCed6cXKzTyWQROfM0hXwtaoFzecPKeJyEwBfT3SBe61fq88nX+oyniGToLi+4PMmQCBUuCfor+/YA="

DATABASE_URL="encrypted:BILowGq6zORIhEi96PxHyCIANFDPnlbXZFc1rKzdC82fUHBWAbF/MZaYD2+Mb8+bDmVRMlAdd6wONZsQc62U2H5gP/1gUjafBV5jwCOkvuu4I2eNR6qPwDOixfidkVsnt7h16nO7whQ9AM9R0faoBUw3f0BMB7uyKfJmr9b/T6bVX94oCVLy3nVCnjkD8lt5rPQHR+Yqper3Onc1u24HDjGXIaQQN9o2nv1zfYXYgtqhhIYNRnUiJUPNri/i2ocEzLGFuCowU/ac5AAEqy0="
GOOGLE_GENERATIVE_AI_API_KEY="encrypted:BDZa7EK7Vm8lSHNIttoWwrxvx44wvX5lGXIiCodWuD3mVAjLgqzPchI7UWrGoxyJkuYXdbhxw5AYcaIhaZBVKCzVdXKkCx5x+0WNZjzHNAYGI/diPsTDl8MNGx/J43csJ12Yc7rYJGLdOFiD/hSqgiDJCTqMvweNXtniMnD4sSMMU/JFe6Fhqw=="
TRIGGER_SECRET_KEY="encrypted:BCBR73LyqV9Zo8J3vz5h3hljSwg0XZehyt56nRdsGyZMR0l44Xw59Uc48inCjueR3BTlv9VVeAv/YplTFRfevZ2U4EJ5lt3WRUX0jSAqCn7PhK6K4CXQUsyRAzl7itFhc6L29aGFbP3mvb5vDXwCngbymnBK6BCCQ5FLRTA="
TRIGGER_PROJECT_ID="encrypted:BOKJYM+aJcoLofNjhGSlf7zVlH85eS7WxD3BJVkbvcbmgMpB2MVQOJgb3XZ8lcu2B+vAYXQAD7zRd7EskH24r+GWqrXNShQecIySJPxKrWqvbft5OQazgixdfEr87z7vtmEezUeV8B6MeA1D7pBZGUCubGdyfJ0DJ1Q="
Loading
Loading