feat(create): add Inngest add-on #440
OpenLinell(GitHub profile, opens in a new tab)wants to merge 7 commits into
main fromrefs/pull/440/headopened - packages/create/src/frameworks/react/add-ons/inngest/assets/src/routes/demo/inngest.tsx lines 7 to 23Resolvedby Linell(GitHub profile, opens in a new tab)@@ -0,0 +1,12 @@1+import { createFileRoute } from '@tanstack/react-router'2+import { createServerFn } from '@tanstack/react-start'3+import { useState } from 'react'4+import { inngest } from '../../inngest/client'5+import { helloWorld } from '../../inngest/functions'6+7+const sendHelloEvent = createServerFn({ method: 'POST' })8+ .inputValidator((name: string) => name)9+ .handler(async ({ data: name }) => {10+ const { ids } = await inngest.send(helloWorld.create({ name }))11+ return { eventId: ids[0] }12+ })packages/create/src/frameworks/react/add-ons/inngest/assets/src/routes/demo/inngest.tsx lines 112 to 115Resolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -0,0 +79,21 @@79+ {result}80+ </code>81+ </div>82+ )}83+84+ {error && (85+ <div className="rounded-xl border border-[rgba(200,70,70,0.3)] bg-[rgba(200,70,70,0.08)] p-4 text-sm text-[#c04646]">86+ {error}87+ </div>88+ )}89+ </div>90+ </section>91+92+ <section className="island-shell mt-8 rounded-2xl p-6">93+ <p className="island-kicker mb-2">Quick Start</p>94+ <ul className="m-0 list-disc space-y-2 pl-5 text-sm text-[var(--sea-ink-soft)]">95+ <li>96+ Uncomment <code>INNGEST_DEV=1</code> in <code>.env.local</code>{' '}97+ during development — without it, the SDK defaults to cloud mode and98+ will try to authenticate against Inngest Cloud.You can also use `INNGEST_DEV=1 pnpm dev` to start the application.99+ </li>packages/create/src/frameworks/react/add-ons/inngest/info.json lines 15 to 16Resolvedby Linell(GitHub profile, opens in a new tab)@@ -0,0 +1,16 @@1+{2+ "name": "Inngest",3+ "description": "Add Inngest for durable workflows, background jobs, and AI agents.",4+ "phase": "add-on",5+ "modes": ["file-router"],6+ "type": "add-on",7+ "category": "workflows",8+ "color": "#2C9B63",9+ "priority": 140,10+ "link": "https://www.inngest.com",11+ "routes": [12+ {13+ "url": "/demo/inngest",14+ "name": "Inngest",15+ "path": "src/routes/demo/inngest.tsx",16+ "jsName": "InngestDemo"
- packages/cli/tests-e2e/inngest-smoke.spec.ts line 48OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -0,0 +28,21 @@28+29+function signRequest(body: string) {30+ const ts = Math.floor(Date.now() / 1000).toString()31+ const key = SIGNING_KEY.replace(/^signkey-\w+-/, '')32+ const sig = createHmac('sha256', key).update(body + ts).digest('hex')33+ return `t=${ts}&s=${sig}`34+}35+36+// Clicks before hydration are no-ops, so retry until the result shows up.37+async function clickUntilHydrated(button: Locator, result: Locator) {38+ await expect(async () => {39+ await button.click()40+ await expect(result).toBeVisible({ timeout: 2_000 })41+ }).toPass({ timeout: 30_000 })42+}43+44+test('@blocking production Inngest app rejects the demo sender and serves the signed callback', async ({45+ page,46+}) => {47+ const inngestApi = await startMockInngest()48+ const fixture = await createReactAppFixture({packages/create/src/frameworks/react/add-ons/inngest/README.md line 16OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -0,0 +1,16 @@1+## Inngest2+3+This add-on wires up [Inngest](https://www.inngest.com) for durable workflows, background jobs, and AI agents — a client, a sample event and function, the `serve()` API route, and an interactive demo page.4+5+### Run it locally6+7+Inngest needs two processes: your app and the Inngest Dev Server.8+9+First, uncomment `INNGEST_DEV=1` in `.env.local`. In v4 the SDK defaults to **cloud mode** and requires a signing key — `INNGEST_DEV=1` points it at your local Dev Server instead. **Don't set it in production.**10+11+```bash12+# Terminal 1 — your app13+npm run dev # or INNGEST_DEV=1 npm run dev14+15+# Terminal 2 — Inngest Dev Server (UI at http://localhost:8288)16+npx inngest-cli@latest dev
- packages/cli/tests-e2e/inngest-smoke.spec.ts line 91OutdatedResolvedby Linell(GitHub profile, opens in a new tab)@@ -0,0 +71,21 @@71+ 'The Inngest demo sender is disabled in production.',72+ )73+ expect(inngestApi.requests).toEqual([])74+ } finally {75+ await fixture.stop()76+ await fixture.cleanup()77+ await inngestApi.close()78+ }79+})80+81+test('@blocking development Inngest app sends the demo event to the local Inngest server', async ({82+ page,83+}) => {84+ const inngestApi = await startMockInngest()85+ const fixture = await createReactAppFixture({86+ appName: 'react-inngest-dev-app',87+ addOns: ['inngest'],88+ serverEnv: {89+ INNGEST_DEV: '1',90+ INNGEST_BASE_URL: inngestApi.url,91+ },packages/cli/tests-e2e/inngest-smoke.spec.ts line 96OutdatedResolvedby Linell(GitHub profile, opens in a new tab)@@ -0,0 +76,21 @@76+ await fixture.cleanup()77+ await inngestApi.close()78+ }79+})80+81+test('@blocking development Inngest app sends the demo event to the local Inngest server', async ({82+ page,83+}) => {84+ const inngestApi = await startMockInngest()85+ const fixture = await createReactAppFixture({86+ appName: 'react-inngest-dev-app',87+ addOns: ['inngest'],88+ serverEnv: {89+ INNGEST_DEV: '1',90+ INNGEST_BASE_URL: inngestApi.url,91+ },92+ })93+ try {94+ await optimizePageForFastE2E(page)95+ await page.goto(`${fixture.url}/demo/inngest`)96+ await page.getByRole('button', { name: 'Send demo/hello.world' }).click()
Linell(GitHub profile, opens in a new tab) changed the title
Sign in to join this conversation.
Walkthrough
Adds a React Inngest add-on with a configured client, typed event and function, API route, demo page, environment template, setup documentation, and workflow category support. It also adds end-to-end tests for development and production behavior.
Changes: Inngest add-on
packages/create/src/frameworks/react/add-ons/inngest/info.json,packages/create/src/frameworks/react/add-ons/inngest/package.json,packages/create/src/types.ts,packages/create/src/frameworks/react/add-ons/inngest/assets/src/inngest/*,packages/create/src/frameworks/react/add-ons/inngest/assets/src/routes/api/inngest.ts,.changeset/inngest-addon.mdworkflowscategory, and adds a project-specific client, typed event and function, and API route. The changeset marks minor releases for@tanstack/cliand@tanstack/create.packages/create/src/frameworks/react/add-ons/inngest/assets/src/routes/demo/inngest.tsx,packages/create/src/frameworks/react/add-ons/inngest/assets/_dot_env.local.append,packages/create/src/frameworks/react/add-ons/inngest/README.mdpackages/cli/tests-e2e/helpers.ts,packages/cli/tests-e2e/inngest-smoke.spec.tsEstimated code review effort: 3 (Moderate) | ~25 minutes
Change: Feature
Sequence Diagram(s)#
Possibly related PRs
.env.localappend template.Merge Risk:
Minimal · up to
b08f4The smoke-test fixture directs events to its local mock rather than an inherited endpoint. No identified issue currently blocks merging.
Pre-merge checks:
4 · 
1
Full details: Docstring Coverage
Explanation
Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 4 functions across 4 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches
Generate unit tests (beta)
Warning
Some tools did not complete. Review the errors below.
packages/cli/tests-e2e/inngest-smoke.spec.ts
Parsing error: "parserOptions.project" has been provided for
@typescript-eslint/parser. The file was not found in any of the provided project(s): packages/cli/tests-e2e/inngest-smoke.spec.tsTip
🎯 Customize your risk assessments
Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.
✅ Automatic approvals, with your rules
Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.
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