Commit Graph

7 Commits

Author SHA1 Message Date
Nathan Rajlich 86f62f2779 Refactor e2e tests to no longer use "trigger" endpoint (#958)
## Summary

Refactors the E2E tests to call `start()` from `workflow/api` directly instead of going through the `/api/trigger` HTTP endpoint in each workbench app. This removes a layer of indirection — the tests now use the same API that users would use to start workflows programmatically.

### Before

```ts
const run = await triggerWorkflow('addTenWorkflow', [123]);
const returnValue = await getWorkflowReturnValue(run.runId);
```

- `triggerWorkflow()` sent an HTTP POST to `/api/trigger` on the workbench app
- The workbench app looked up the workflow function, called `start()`, and returned the run ID
- `getWorkflowReturnValue()` polled `GET /api/trigger?runId=...` until the workflow completed

### After

```ts
const run = await start(await e2e('addTenWorkflow'), [123]);
const returnValue = await run.returnValue;
```

- `e2e()` / `getWorkflowMetadata()` fetches the manifest from `/.well-known/workflow/v1/manifest.json` to look up the correct `workflowId`
- `start()` is called directly from the test process via the configured World
- `run.returnValue` polls for completion via the World (no HTTP polling endpoint needed)

### Changes

**`packages/core/e2e/e2e.test.ts`**
- Removed `triggerWorkflow()` and `getWorkflowReturnValue()` helpers
- Added `fetchManifest()` to fetch and cache the workflow manifest from the deployment
- Added `getWorkflowMetadata(file, fn)` to look up `{ workflowId }` from the manifest
- Added `e2e(fn)` shorthand for the common case of `workflows/99_e2e.ts`
- All tests call `start()` and `run.returnValue` directly
- Error tests use `.catch()` to inspect `WorkflowRunFailedError`
- Output stream tests use `run.getReadable()` directly (skipped on local world where cross-process streaming isn't supported)
- `beforeAll` configures the local World with the correct data directory and base URL
- Pages Router tests use `startWorkflowViaHttp()` to specifically validate the HTTP trigger path

**Workbench apps (hono, express, fastify, nest)**
- Removed `/api/trigger` route handlers
- Kept `/api/hook`, `/api/test-direct-step-call`, `/api/test-health-check` endpoints
- Re-added `_workflows.js` side-effect import for hono/express/fastify to maintain Nitro's HMR dependency graph

**Deleted trigger-only route files** from: nextjs-turbopack, nextjs-webpack, vite, sveltekit, astro, nuxt, nitro-v2, nitro-v3, example

**`.github/workflows/tests.yml`**
- Added `WORKFLOW_PUBLIC_MANIFEST: '1'` to all E2E test jobs

### Dependencies

Stacked on #963 which adds `WORKFLOW_PUBLIC_MANIFEST` support to all framework builders.
2026-02-06 16:25:47 -08:00
JJ Kasper 8b1f9d06d2 Update turbo inputs to include shared config (#752)
* Update turbo inputs to include shared config

* Apply suggestions from code review

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>

---------

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
2026-01-08 14:39:50 -08:00
Pranay Prakash a8f48c5a08 add benchmarking (#460) 2025-11-29 21:21:49 -08:00
Nathan Rajlich aa5ff3ccd9 Disable Turborepo cache for CI related tasks (#329)
* Disable Turborepo cache for CI related tasks

Disable cache for all tasks except "build"

* Checkout swc-plugin test fixture files with Unix newlines for Windows (#331)
2025-11-24 13:35:43 -08:00
Nathan Rajlich 0668077cda Remove redundant "outputs" configuration from root turbo.json (#302)
Signed-off-by: Nathan Rajlich <n@n8.io>
2025-11-11 09:13:39 -08:00
Adrian 05714f7924 feat: add sveltekit support (#131)
* add workbench sveltekit

* add sveltekit package

* fix: use js for generated server routes in svelte

* add test routes for sveltekit workbench

* updates from debugging

* feat: add sveltekit build target

* update user sign up workflow workbench sveltekit

* fix: base builder missing GET route handler for sveltekit

* feat: add vercel builder and check for vercel env

* refactor: workflowPlugin for sveltekit

* ci: add tests to workbench sveltekit

* fix: no start command and vercel builder outputs

* fix: base builder conditions

* .

* add auto adapter sveltekit

* fix: disable checking origin for cross site ci stuff

* allow all trusted origins in svelte config

* fix: add catch for error thrown when waiting for ops

* fix: sveltekit workbench adapter

* test

* test

* refactor: move vercel builder on config resolved

* update package json

* add demo workflow trigger

* test letting sveltekit handle route generation

* fix: exclude git ignore for local builder outputs

* update config

* add debug logs

* update debug

* update turbo.json

* fix env check

* another output

* use top-level await

* ensure vercel functions are patched

* change hook

* update

* fix spread

* debug

* update

* chore: remove vercel builder

* chore: update comments in sveltekit workflow package

* chore: remove console comment

* refactor: workflow svelte plugin

* refactor: simplify local builder config

* chore: remove unused deps

* chore: add comment for workbench svelte app

* chore: add sveltekit export to workflow

* export sveltekit from workflow

* lockfile

* chore: remove unused deps svelte workbench

* update styling

* add sveltekit getting started docs

* update sveltekit docs getting started

* changeset

* Apply suggestion from @vercel[bot]

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>

* use proper env var

* Update packages/sveltekit/src/index.ts

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>

* Update docs/content/docs/getting-started/sveltekit.mdx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Document CSRF protection bypass in SvelteKit workbench config (#157)

* Initial plan

* docs: add CSRF security warning to svelte.config.js

Co-authored-by: adriandlam <93681064+adriandlam@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: adriandlam <93681064+adriandlam@users.noreply.github.com>

* refactor: deduplicate SvelteKit request conversion logic (#156)

* Initial plan

* refactor: extract duplicated SvelteKit request conversion to helper

Co-authored-by: adriandlam <93681064+adriandlam@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: adriandlam <93681064+adriandlam@users.noreply.github.com>

* docs: fix getting staretd sveltekit missing folder

* chore: cleanup sveltekit builder after rebase

* lockfile

* fix: sveltekit building logic in base builder

* refactor: move sveltekit builder logic to its own package

* fix: console log base builder

* changeset

* test

* feat: create hmr plugin

* fix: add initial build on load

* fix: check all files for workflows and steps

* add comments for plugin todo

* remove catching error

* fix: missing context for nodejs envs causing waitUntil to fail

* fix: setting global request conext in vercel environments

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
2025-11-03 21:15:33 -08:00
Gal Schlezinger 4ca9a3edbd Introducing Workflow DevKit
build durable, resilient, and observable workflows.

Co-authored-by: Nathan Rajlich <n@n8.io>
Co-authored-by: Pranay Prakash <pranay.gp@gmail.com>
Co-authored-by: Adrian <me@adriandlam.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Vercel Release Bot <88769842+vercel-release-bot@users.noreply.github.com>
Co-authored-by: Peter Wielander <mittgfu@gmail.com>
Co-authored-by: Hayden Bleasel <hello@haydenbleasel.com>
Co-authored-by: Gal Schlezinger <gal@spitfire.co.il>
Co-authored-by: Manuel Muñoz Solera <mamuso@mamuso.net>
Co-authored-by: Garrett <garrett.tolbert@vercel.com>
Co-authored-by: Lars Grammel <lars.grammel@gmail.com>
Co-authored-by: Pooya Parsa <pyapar@gmail.com>
Co-authored-by: Tom Dale <tom@tomdale.net>
Co-authored-by: Vishal Yathish <135551666+visyat@users.noreply.github.com>
Co-authored-by: josh <144584931+dancer@users.noreply.github.com>
2025-10-23 12:07:52 +03:00