Skip to content

Commit 3955654

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/redis-worker-package
2 parents ba57e06 + adca199 commit 3955654

File tree

141 files changed

+13813
-5332
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+13813
-5332
lines changed

.cursor/mcp.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
"url": "http://localhost:3333/sse"
55
}
66
}
7-
}
7+
}

.cursor/rules/writing-tasks.mdc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: Guidelines for writing Trigger.dev tasks
3-
globs: **/trigger/**/*.ts, **/trigger/**/*.tsx
3+
globs: **/trigger/**/*.ts, **/trigger/**/*.tsx,**/trigger/**/*.js,**/trigger/**/*.jsx
44
alwaysApply: false
55
---
66
# How to write Trigger.dev tasks
@@ -832,7 +832,7 @@ npm add @trigger.dev/react-hooks
832832

833833
All hooks require a Public Access Token. You can provide it directly to each hook:
834834

835-
```typescriptx
835+
```typescript
836836
import { useRealtimeRun } from "@trigger.dev/react-hooks";
837837

838838
function MyComponent({ runId, publicAccessToken }) {
@@ -845,7 +845,7 @@ function MyComponent({ runId, publicAccessToken }) {
845845

846846
Or use the `TriggerAuthContext` provider:
847847

848-
```typescriptx
848+
```typescript
849849
import { TriggerAuthContext } from "@trigger.dev/react-hooks";
850850

851851
function SetupTrigger({ publicAccessToken }) {
@@ -859,7 +859,7 @@ function SetupTrigger({ publicAccessToken }) {
859859

860860
For Next.js App Router, wrap the provider in a client component:
861861

862-
```typescriptx
862+
```typescript
863863
// components/TriggerProvider.tsx
864864
"use client";
865865

@@ -879,7 +879,7 @@ export function TriggerProvider({ accessToken, children }) {
879879
Several approaches for Next.js App Router:
880880

881881
1. **Using cookies**:
882-
```typescriptx
882+
```typescript
883883
// Server action
884884
export async function startRun() {
885885
const handle = await tasks.trigger<typeof exampleTask>("example", { foo: "bar" });
@@ -899,7 +899,7 @@ export default function RunPage({ params }) {
899899
```
900900

901901
2. **Using query parameters**:
902-
```typescriptx
902+
```typescript
903903
// Server action
904904
export async function startRun() {
905905
const handle = await tasks.trigger<typeof exampleTask>("example", { foo: "bar" });
@@ -908,7 +908,7 @@ export async function startRun() {
908908
```
909909

910910
3. **Server-side token generation**:
911-
```typescriptx
911+
```typescript
912912
// Page component
913913
export default async function RunPage({ params }) {
914914
const publicAccessToken = await generatePublicAccessToken(params.id);
@@ -938,7 +938,7 @@ export async function generatePublicAccessToken(runId: string) {
938938

939939
Data fetching hooks that use SWR for caching:
940940

941-
```typescriptx
941+
```typescript
942942
"use client";
943943
import { useRun } from "@trigger.dev/react-hooks";
944944
import type { myTask } from "@/trigger/myTask";

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,5 @@ apps/**/public/build
5858
.yarn
5959
*.tsbuildinfo
6060
/packages/cli-v3/src/package.json
61+
.husky
62+
/packages/react-hooks/src/package.json

.vscode/launch.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,15 @@
138138
"type": "node-terminal",
139139
"request": "launch",
140140
"name": "Debug RunEngine tests",
141-
"command": "pnpm run test --filter @internal/run-engine",
142-
"cwd": "${workspaceFolder}",
141+
"command": "pnpm run test ./src/engine/tests/releaseConcurrencyQueue.test.ts -t 'Should manage token bucket and queue correctly'",
142+
"cwd": "${workspaceFolder}/internal-packages/run-engine",
143143
"sourceMaps": true
144144
},
145145
{
146146
"type": "node-terminal",
147147
"request": "launch",
148148
"name": "Debug RunQueue tests",
149-
"command": "pnpm run test ./src/engine/tests/waitpoints.test.ts",
149+
"command": "pnpm run test ./src/run-queue/index.test.ts",
150150
"cwd": "${workspaceFolder}/internal-packages/run-engine",
151151
"sourceMaps": true
152152
}

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
"search.exclude": {
66
"**/node_modules/**": true,
77
"packages/cli-v3/e2e": true
8-
}
8+
},
9+
"vitest.disableWorkspaceWarning": true
910
}
185 KB
Loading

apps/webapp/app/components/BlankStatePanels.tsx

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
ClockIcon,
77
PlusIcon,
88
RectangleGroupIcon,
9+
RectangleStackIcon,
910
ServerStackIcon,
1011
Squares2X2Icon,
1112
} from "@heroicons/react/20/solid";
@@ -368,35 +369,28 @@ export function AlertsNoneDeployed() {
368369
);
369370
}
370371

371-
function AlertsNoneProd() {
372+
export function QueuesHasNoTasks() {
373+
const organization = useOrganization();
374+
const project = useProject();
375+
const environment = useEnvironment();
376+
372377
return (
373-
<div className="space-y-8">
374-
<InfoPanel
375-
icon={BellAlertIcon}
376-
iconClassName="text-red-500"
377-
title="Adding alerts"
378-
panelClassName="max-w-full"
378+
<InfoPanel
379+
title="You have no queues"
380+
icon={RectangleStackIcon}
381+
iconClassName="text-purple-500"
382+
panelClassName="max-w-full"
383+
>
384+
<Paragraph spacing variant="small">
385+
This means you haven't got any tasks yet in this environment.
386+
</Paragraph>
387+
<LinkButton
388+
to={v3EnvironmentPath(organization, project, environment)}
389+
variant="tertiary/medium"
379390
>
380-
<Paragraph spacing variant="small">
381-
You can get alerted when deployed runs fail.
382-
</Paragraph>
383-
<Paragraph spacing variant="small">
384-
We don't support alerts in the Development environment. Switch to a deployed environment
385-
to setup alerts.
386-
</Paragraph>
387-
<div className="flex gap-3">
388-
<LinkButton
389-
to={docsPath("troubleshooting-alerts")}
390-
variant="docs/medium"
391-
LeadingIcon={BookOpenIcon}
392-
className="inline-flex"
393-
>
394-
How to setup alerts
395-
</LinkButton>
396-
</div>
397-
</InfoPanel>
398-
<SwitcherPanel />
399-
</div>
391+
Add tasks
392+
</LinkButton>
393+
</InfoPanel>
400394
);
401395
}
402396

apps/webapp/app/components/SetupCommands.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
import { createContext, useContext, useState } from "react";
22
import { useAppOrigin } from "~/hooks/useAppOrigin";
33
import { useProject } from "~/hooks/useProject";
4-
import { InlineCode } from "./code/InlineCode";
54
import {
65
ClientTabs,
76
ClientTabsContent,
87
ClientTabsList,
98
ClientTabsTrigger,
109
} from "./primitives/ClientTabs";
1110
import { ClipboardField } from "./primitives/ClipboardField";
12-
import { Paragraph } from "./primitives/Paragraph";
1311
import { Header3 } from "./primitives/Headers";
1412

1513
type PackageManagerContextType = {

apps/webapp/app/components/admin/debugTooltip.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
TooltipProvider,
77
TooltipTrigger,
88
} from "~/components/primitives/Tooltip";
9+
import { useOptionalEnvironment } from "~/hooks/useEnvironment";
910
import { useIsImpersonating, useOptionalOrganization } from "~/hooks/useOrganizations";
1011
import { useOptionalProject } from "~/hooks/useProject";
1112
import { useHasAdminAccess, useUser } from "~/hooks/useUser";
@@ -35,6 +36,7 @@ export function AdminDebugTooltip({ children }: { children?: React.ReactNode })
3536
function Content({ children }: { children: React.ReactNode }) {
3637
const organization = useOptionalOrganization();
3738
const project = useOptionalProject();
39+
const environment = useOptionalEnvironment();
3840
const user = useUser();
3941

4042
return (
@@ -62,6 +64,22 @@ function Content({ children }: { children: React.ReactNode }) {
6264
</Property.Item>
6365
</>
6466
)}
67+
{environment && (
68+
<>
69+
<Property.Item>
70+
<Property.Label>Environment ID</Property.Label>
71+
<Property.Value>{environment.id}</Property.Value>
72+
</Property.Item>
73+
<Property.Item>
74+
<Property.Label>Environment type</Property.Label>
75+
<Property.Value>{environment.type}</Property.Value>
76+
</Property.Item>
77+
<Property.Item>
78+
<Property.Label>Environment paused</Property.Label>
79+
<Property.Value>{environment.paused ? "Yes" : "No"}</Property.Value>
80+
</Property.Item>
81+
</>
82+
)}
6583
</Property.Table>
6684
<div className="pt-2">{children}</div>
6785
</div>

apps/webapp/app/components/layout/AppLayout.tsx

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import { useOptionalOrganization } from "~/hooks/useOrganizations";
21
import { cn } from "~/utils/cn";
3-
import { useShowUpgradePrompt } from "../billing/UpgradePrompt";
42

53
/** This container is used to surround the entire app, it correctly places the nav bar */
64
export function AppContainer({ children }: { children: React.ReactNode }) {
@@ -13,19 +11,7 @@ export function MainBody({ children }: { children: React.ReactNode }) {
1311

1412
/** This container should be placed around the content on a page */
1513
export function PageContainer({ children }: { children: React.ReactNode }) {
16-
const organization = useOptionalOrganization();
17-
const showUpgradePrompt = useShowUpgradePrompt(organization);
18-
19-
return (
20-
<div
21-
className={cn(
22-
"grid overflow-hidden",
23-
showUpgradePrompt.shouldShow ? "grid-rows-[5rem_1fr]" : "grid-rows-[2.5rem_1fr]"
24-
)}
25-
>
26-
{children}
27-
</div>
28-
);
14+
return <div className="grid grid-rows-[auto_1fr] overflow-hidden">{children}</div>;
2915
}
3016

3117
export function PageBody({

0 commit comments

Comments
 (0)