Skip to content

Conversation

@ericallam
Copy link
Member

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Aug 29, 2025

⚠️ No Changeset found

Latest commit: 137bb52

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 29, 2025

Walkthrough

The PR standardizes TypeScript imports by converting multiple value imports to type-only imports across components and routes (e.g., User, Prisma, TaskRunStatus, BatchTaskRunStatus, WorkerDeploymentStatus, RuntimeEnvironmentType, ProjectAlert types). Several unused imports are removed. In bulk action-related routes and stream handlers, enum references (BulkActionStatus, BulkActionType) are replaced with string literal comparisons ("PENDING", "CANCEL", "REPLAY"), updating related conditionals and switch cases. No exported/public API signatures change, and no runtime control flow is altered outside of the enum-to-string comparison adjustments.

Estimated code review effort

Mostly homogeneous type-only import refactors and unused import removals, with minor logic adjustments where enums were swapped for string literals in a few files. Limited surface area for behavioral changes and low logic density.

🎯 2 (Simple) | ⏱️ ~12 minutes

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ea-branch-83

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbit in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbit in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbit gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbit read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbit help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbit ignore or @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbit summary or @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbit or @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/webapp/app/components/BulkActionFilterSummary.tsx (1)

1-68: Remove all value imports from ‘@trigger.dev/database’ in apps/webapp
The guardrail script found prohibited value imports in numerous files (e.g. app/db.server.ts, app/hooks/useEnvironmentSwitcher.ts, app/models/orgIntegration.server.ts, etc.). Convert these to type-only imports (import type { … }) or move any runtime database logic into server-only modules. Enforce automatically with an ESLint rule such as @typescript-eslint/consistent-type-imports.

🧹 Nitpick comments (2)
apps/webapp/app/components/runs/v3/DeploymentStatus.tsx (1)

122-122: Typo in comment: “ommited” → “omitted”

Minor polish.

-// PENDING and CANCELED are not used so are ommited from the UI
+// PENDING and CANCELED are not used so are omitted from the UI
apps/webapp/app/components/runs/v3/TaskTriggerSource.tsx (1)

13-22: Make switch exhaustive to future-proof against new sources.

Add a default arm with a never exhaustiveness check to fail fast at compile time if a new TaskTriggerSource is introduced.

 export function TaskTriggerSourceIcon({
   source,
   className,
 }: {
   source: TaskTriggerSource;
   className?: string;
 }) {
   switch (source) {
     case "STANDARD": {
       return <TaskIconSmall className="size-[1.125rem] min-w-[1.125rem] text-tasks" />;
     }
     case "SCHEDULED": {
       return (
         <ClockIcon className={cn("size-[1.125rem] min-w-[1.125rem] text-schedules", className)} />
       );
     }
+    default: {
+      const _exhaustive: never = source;
+      return null;
+    }
   }
 }
 
 export function taskTriggerSourceDescription(source: TaskTriggerSource) {
   switch (source) {
     case "STANDARD": {
       return "Standard task";
     }
     case "SCHEDULED": {
       return "Scheduled task";
     }
+    default: {
+      const _exhaustive: never = source;
+      return "Task";
+    }
   }
 }

Also applies to: 25-34

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between b0b0df6 and 137bb52.

📒 Files selected for processing (16)
  • apps/webapp/app/components/BulkActionFilterSummary.tsx (1 hunks)
  • apps/webapp/app/components/navigation/AccountSideMenu.tsx (1 hunks)
  • apps/webapp/app/components/primitives/Avatar.tsx (1 hunks)
  • apps/webapp/app/components/runs/v3/BatchStatus.tsx (1 hunks)
  • apps/webapp/app/components/runs/v3/BulkAction.tsx (1 hunks)
  • apps/webapp/app/components/runs/v3/DeploymentStatus.tsx (1 hunks)
  • apps/webapp/app/components/runs/v3/ScheduleFilters.tsx (0 hunks)
  • apps/webapp/app/components/runs/v3/TaskRunStatus.tsx (1 hunks)
  • apps/webapp/app/components/runs/v3/TaskTriggerSource.tsx (1 hunks)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam._index/route.tsx (1 hunks)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.alerts/route.tsx (1 hunks)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.bulk-actions.$bulkActionParam/route.tsx (5 hunks)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.queues/route.tsx (1 hunks)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam/route.tsx (1 hunks)
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.bulkaction.$bulkActionParam.stream.tsx (3 hunks)
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.bulkaction.tsx (2 hunks)
💤 Files with no reviewable changes (1)
  • apps/webapp/app/components/runs/v3/ScheduleFilters.tsx
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx}: Always prefer using isomorphic code like fetch, ReadableStream, etc. instead of Node.js specific code
For TypeScript, we usually use types over interfaces
Avoid enums
No default exports, use function declarations

Files:

  • apps/webapp/app/components/BulkActionFilterSummary.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam._index/route.tsx
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.bulkaction.tsx
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.bulkaction.$bulkActionParam.stream.tsx
  • apps/webapp/app/components/primitives/Avatar.tsx
  • apps/webapp/app/components/runs/v3/DeploymentStatus.tsx
  • apps/webapp/app/components/runs/v3/BatchStatus.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.alerts/route.tsx
  • apps/webapp/app/components/runs/v3/BulkAction.tsx
  • apps/webapp/app/components/runs/v3/TaskRunStatus.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.queues/route.tsx
  • apps/webapp/app/components/runs/v3/TaskTriggerSource.tsx
  • apps/webapp/app/components/navigation/AccountSideMenu.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam/route.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.bulk-actions.$bulkActionParam/route.tsx
{packages/core,apps/webapp}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

We use zod a lot in packages/core and in the webapp

Files:

  • apps/webapp/app/components/BulkActionFilterSummary.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam._index/route.tsx
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.bulkaction.tsx
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.bulkaction.$bulkActionParam.stream.tsx
  • apps/webapp/app/components/primitives/Avatar.tsx
  • apps/webapp/app/components/runs/v3/DeploymentStatus.tsx
  • apps/webapp/app/components/runs/v3/BatchStatus.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.alerts/route.tsx
  • apps/webapp/app/components/runs/v3/BulkAction.tsx
  • apps/webapp/app/components/runs/v3/TaskRunStatus.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.queues/route.tsx
  • apps/webapp/app/components/runs/v3/TaskTriggerSource.tsx
  • apps/webapp/app/components/navigation/AccountSideMenu.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam/route.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.bulk-actions.$bulkActionParam/route.tsx
apps/webapp/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/webapp.mdc)

apps/webapp/**/*.{ts,tsx}: In the webapp, all environment variables must be accessed through the env export of env.server.ts, instead of directly accessing process.env.
When importing from @trigger.dev/core in the webapp, never import from the root @trigger.dev/core path; always use one of the subpath exports as defined in the package's package.json.

Files:

  • apps/webapp/app/components/BulkActionFilterSummary.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam._index/route.tsx
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.bulkaction.tsx
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.bulkaction.$bulkActionParam.stream.tsx
  • apps/webapp/app/components/primitives/Avatar.tsx
  • apps/webapp/app/components/runs/v3/DeploymentStatus.tsx
  • apps/webapp/app/components/runs/v3/BatchStatus.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.alerts/route.tsx
  • apps/webapp/app/components/runs/v3/BulkAction.tsx
  • apps/webapp/app/components/runs/v3/TaskRunStatus.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.queues/route.tsx
  • apps/webapp/app/components/runs/v3/TaskTriggerSource.tsx
  • apps/webapp/app/components/navigation/AccountSideMenu.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam/route.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.bulk-actions.$bulkActionParam/route.tsx
🧠 Learnings (12)
📓 Common learnings
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/webapp.mdc:0-0
Timestamp: 2025-07-18T17:49:47.180Z
Learning: Applies to apps/webapp/**/*.{ts,tsx} : When importing from `trigger.dev/core` in the webapp, never import from the root `trigger.dev/core` path; always use one of the subpath exports as defined in the package's package.json.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-18T17:49:24.468Z
Learning: Applies to internal-packages/database/**/*.{ts,tsx} : We use prisma in internal-packages/database for our database interactions using PostgreSQL
📚 Learning: 2025-08-18T10:07:17.368Z
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-08-18T10:07:17.368Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Define tasks using task({ id, run, ... }) with a unique id per project

Applied to files:

  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam._index/route.tsx
  • apps/webapp/app/components/runs/v3/TaskTriggerSource.tsx
📚 Learning: 2025-07-18T17:49:47.180Z
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/webapp.mdc:0-0
Timestamp: 2025-07-18T17:49:47.180Z
Learning: Applies to apps/webapp/**/*.{ts,tsx} : When importing from `trigger.dev/core` in the webapp, never import from the root `trigger.dev/core` path; always use one of the subpath exports as defined in the package's package.json.

Applied to files:

  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam._index/route.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.alerts/route.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.queues/route.tsx
  • apps/webapp/app/components/runs/v3/TaskTriggerSource.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam/route.tsx
📚 Learning: 2025-08-18T10:07:17.368Z
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-08-18T10:07:17.368Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Import Trigger.dev APIs from "trigger.dev/sdk/v3" when writing tasks or related utilities

Applied to files:

  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam._index/route.tsx
  • apps/webapp/app/components/runs/v3/TaskRunStatus.tsx
  • apps/webapp/app/components/runs/v3/TaskTriggerSource.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam/route.tsx
📚 Learning: 2025-08-18T10:07:17.368Z
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-08-18T10:07:17.368Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Do not use client.defineJob or any deprecated v2 patterns (e.g., eventTrigger) when defining tasks

Applied to files:

  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam._index/route.tsx
  • apps/webapp/app/components/runs/v3/TaskTriggerSource.tsx
📚 Learning: 2025-08-18T10:07:17.368Z
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-08-18T10:07:17.368Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Export every task (including subtasks) defined with task(), schedules.task(), or schemaTask()

Applied to files:

  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam._index/route.tsx
  • apps/webapp/app/components/runs/v3/TaskTriggerSource.tsx
📚 Learning: 2025-07-18T17:49:24.468Z
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-18T17:49:24.468Z
Learning: Applies to internal-packages/database/**/*.{ts,tsx} : We use prisma in internal-packages/database for our database interactions using PostgreSQL

Applied to files:

  • apps/webapp/app/components/primitives/Avatar.tsx
📚 Learning: 2025-08-18T10:07:17.368Z
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-08-18T10:07:17.368Z
Learning: When triggering tasks from backend code, prefer tasks.trigger/tasks.batchTrigger/batch.trigger with type-only imports for type safety

Applied to files:

  • apps/webapp/app/components/runs/v3/BatchStatus.tsx
  • apps/webapp/app/components/runs/v3/TaskTriggerSource.tsx
📚 Learning: 2025-08-18T10:07:17.368Z
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-08-18T10:07:17.368Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use schedules.task(...) for scheduled (cron) tasks; do not implement schedules as plain task() with external cron logic

Applied to files:

  • apps/webapp/app/components/runs/v3/TaskTriggerSource.tsx
📚 Learning: 2025-08-18T10:07:17.368Z
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-08-18T10:07:17.368Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use schemaTask({ schema, run, ... }) to validate payloads when input validation is required

Applied to files:

  • apps/webapp/app/components/runs/v3/TaskTriggerSource.tsx
📚 Learning: 2025-08-18T10:07:17.368Z
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-08-18T10:07:17.368Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use triggerAndWait() only from within a task context (not from generic app code) and handle result.ok or use unwrap() with error handling

Applied to files:

  • apps/webapp/app/components/runs/v3/TaskTriggerSource.tsx
📚 Learning: 2025-08-18T10:07:17.368Z
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-08-18T10:07:17.368Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use metadata API (metadata.current/get/set/append/stream, etc.) only inside run functions or lifecycle hooks

Applied to files:

  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam/route.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (23)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (1, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (3, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (7, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (5, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (6, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (8, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (4, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (3, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (5, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (6, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (2, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (7, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (8, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (1, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (4, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (2, 8)
  • GitHub Check: units / packages / 🧪 Unit Tests: Packages (1, 1)
  • GitHub Check: typecheck / typecheck
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - npm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - pnpm)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (23)
apps/webapp/app/components/BulkActionFilterSummary.tsx (1)

17-17: Type-only import prevents bundling @trigger.dev/database — LGTM

This aligns with the PR goal; no runtime value pulled into the client.

apps/webapp/app/components/primitives/Avatar.tsx (1)

9-9: Good switch to type-only Prisma import

parseAvatar only needs Prisma.JsonValue as a type; this keeps DB code out of the client bundle.

apps/webapp/app/components/runs/v3/DeploymentStatus.tsx (1)

7-7: Type-only import for WorkerDeploymentStatus — LGTM

No runtime dependency; comparisons use string literals, matching our “avoid enums” guideline.

apps/webapp/app/components/navigation/AccountSideMenu.tsx (1)

3-3: Type-only User import — LGTM

Prop types only; no runtime import pulled into the client.

apps/webapp/app/components/runs/v3/BulkAction.tsx (1)

2-2: Type-only imports for BulkAction types — LGTM

Switch/case remains on string literals; no runtime DB enum usage.

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam/route.tsx (1)

23-23: Scope verification to client-side code
Adjust the repo-wide check to only scan client bundles (e.g. apps/webapp/app/routes/**/*.tsx and apps/webapp/app/components/**/*.tsx) or explicitly exclude server-only files (**/*.server.ts, app/services/**, app/models/**), then confirm there are zero non-type imports from @trigger.dev/database in those client files.

apps/webapp/app/components/runs/v3/TaskTriggerSource.tsx (1)

2-2: Good: switched to import type to keep DB package out of the client bundle.

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam._index/route.tsx (1)

17-17: Good: TaskRunStatus is now a type-only import.

Used purely for typing in CustomTooltip, so this reduces client bundle surface without runtime changes.

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.queues/route.tsx (1)

20-20: Good: RuntimeEnvironmentType switched to a type import.

It’s only used in props for EnvironmentPauseResumeButton, so no runtime dependency on the DB package.

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.alerts/route.tsx (1)

16-16: Good: ProjectAlertChannelType and ProjectAlertType as type-only imports.

Matches the PR objective and keeps DB out of the client. The file already uses runtime-safe string literals and assert-never for exhaustiveness.

apps/webapp/app/components/runs/v3/TaskRunStatus.tsx (2)

14-14: Type-only import aligns with PR goal (prevents bundling).
Looks good and keeps @trigger.dev/database out of the client bundle.


14-14: Remove non-type @trigger.dev/database imports, replace root @trigger.dev/core imports with subpaths, and convert enum usages to literals

  • Prefix all imports from "@trigger.dev/database" with type (e.g. change import { TaskRun } to import type { TaskRun }) – currently ~80 non-type imports across apps/webapp (see grep output).
  • Swap all import { … } from "@trigger.dev/core" to the package’s subpath exports (e.g. @trigger.dev/core/tryCatch).
  • In app/v3/services/bulk/BulkActionV2.server.ts, replace every BulkActionStatus.* and BulkActionType.* occurrence with its string literal equivalent.
⛔ Skipped due to learnings
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/webapp.mdc:0-0
Timestamp: 2025-07-18T17:49:47.180Z
Learning: Applies to apps/webapp/**/*.{ts,tsx} : When importing from `trigger.dev/core` in the webapp, never import from the root `trigger.dev/core` path; always use one of the subpath exports as defined in the package's package.json.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-08-18T10:07:17.368Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Import Trigger.dev APIs from "trigger.dev/sdk/v3" when writing tasks or related utilities
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-08-18T10:07:17.368Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Do not use client.defineJob or any deprecated v2 patterns (e.g., eventTrigger) when defining tasks
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-08-18T10:07:17.368Z
Learning: When triggering tasks from backend code, prefer tasks.trigger/tasks.batchTrigger/batch.trigger with type-only imports for type safety
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-08-18T10:07:17.368Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Define tasks using task({ id, run, ... }) with a unique id per project
apps/webapp/app/components/runs/v3/BatchStatus.tsx (1)

2-2: Good: type-only import eliminates runtime dependency.
Keeps database package out of the client bundle.

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.bulk-actions.$bulkActionParam/route.tsx (5)

5-5: Type-only BulkActionType import is correct.
Prevents pulling @trigger.dev/database into the bundle.


242-242: Correct mapping to UI action prop.
Lowercasing derived from type is consistent with BulkActionFilterSummary API.


330-331: Copy check: suffix for CANCEL failures.
Verify this matches product wording (“already finished”) and appears only for CANCEL.


340-344: Switch on string literals is fine.
Reads cleanly after removing runtime enum; no issues.


138-146: BulkActionStatus string literal matches DB enum
Confirmed that the BulkActionStatus enum in schema.prisma is defined with uppercase values (PENDING, COMPLETED, ABORTED), so comparing bulkAction.status !== "PENDING" is correct. No changes needed.

apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.bulkaction.$bulkActionParam.stream.tsx (3)

6-6: Import cleanup LGTM.
Limiting to EnvironmentParamSchema keeps the module lean.


83-85: OK: status gating uses string literal "PENDING".
Matches the route page logic.


92-94: OK: iterator early-exit mirrors init condition.
Consistent with the string-literal migration.

apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.bulkaction.tsx (2)

2-2: Import change is fine.
No behavioral impact.


43-43: Good: type-only import for TaskRunListSearchFilters.
Prevents bundling unused runtime from the filters module.

@nicktrn nicktrn merged commit f5f14c4 into main Aug 29, 2025
31 checks passed
@nicktrn nicktrn deleted the ea-branch-83 branch August 29, 2025 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants