NestJS framework support#840
Conversation
🦋 Changeset detectedLatest commit: fe8c6d1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
🧪 E2E Test Results❌ Some tests failed Summary
❌ Failed Tests💻 Local Development (2 failed)astro-stable (2 failed):
🌍 Community Worlds (161 failed)mongodb (40 failed):
redis (40 failed):
starter (41 failed):
turso (40 failed):
Details by Category✅ ▲ Vercel Production
❌ 💻 Local Development
✅ 📦 Local Production
✅ 🐘 Local Postgres
✅ 🪟 Windows
❌ 🌍 Community Worlds
✅ 📋 Other
❌ Some E2E test jobs failed:
Check the workflow run for details. |
📊 Benchmark Results
workflow with no steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) workflow with 1 step💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) workflow with 10 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Next.js (Turbopack) | Express Promise.all with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) | Nitro Promise.all with 25 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Nitro | Express Promise.race with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) Promise.race with 25 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Nitro | Express Stream Benchmarks (includes TTFB metrics)workflow with stream💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) SummaryFastest Framework by WorldWinner determined by most benchmark wins
Fastest World by FrameworkWinner determined by most benchmark wins
Column Definitions
Worlds:
|
This adds a @workflow/nest package that provides NestJS integration for the Workflow DevKit. The integration includes: - NestLocalBuilder: Extends BaseBuilder to generate workflow bundles in .nestjs/workflow directory - WorkflowModule: NestJS module that can be imported via forRoot() with configuration options - WorkflowController: Handles the /.well-known/workflow/v1/* endpoints for workflow execution, step execution, and webhooks The workbench/nest example app demonstrates how to use the integration with a standard NestJS application, including: - API endpoints for triggering workflows and testing - Integration with the e2e test suite - Support for both ESM and body parsing Also updates: - Test matrix to include NestJS in CI - Workflow package to export nest module - Builders package to support 'nest' build target - Biome config to support parameter decorators used by NestJS Signed-off-by: Peter Wielander <mittgfu@gmail.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
NestJS preserves source maps in production builds, so update the hasStepSourceMaps() function to return true for NestJS. Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Add support for overriding the import path in generated _workflows.ts. This is useful when workflows are compiled to a different location than the source files, enabling future symlink support scenarios. Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
| @@ -0,0 +1,11 @@ | |||
| // Workflow-only file (no steps) | |||
There was a problem hiding this comment.
all the workflows should be symlinks from example
| const relativeWorkflowsPath = runtimePath | ||
| ? runtimePath | ||
| : path.relative(outputDir, workflowsDir).replace(/\\/g, '/'); |
There was a problem hiding this comment.
Am worried about this and if it's actually relevant or needed just for nest (spoke offline)
- Update resolve-symlinks.sh to handle src/workflows symlinks - Replace committed workflow files with symlink to example/workflows - Disable typeCheck in NestJS build (symlinked files cause path issues) - Fix @repo path alias to resolve to repo root - Remove redundant local paths-alias-test.ts file The symlinks are resolved to real files by resolve-symlinks.sh in CI, enabling workflow file sharing across workbenches while maintaining compatibility with production builds. Signed-off-by: Peter Wielander <mittgfu@gmail.com>
| }, | ||
| "experimental": { | ||
| "plugins": [ | ||
| ["@workflow/swc-plugin", { "mode": "client" }] |
There was a problem hiding this comment.
erm I don't think nestjs users should have to setup the swc plugin explicitly. we don't/shouldn't do this on any of the other frameworks
There was a problem hiding this comment.
the swc plugin should be configured by the framework integration (see the other builders)
| "@types/express": "^5.0.0", | ||
| "@types/node": "^22.10.7", | ||
| "@workflow/ai": "workspace:*", | ||
| "@workflow/swc-plugin": "workspace:*", |
There was a problem hiding this comment.
this shouldn't be a dep. workflow (and henceworkflow/nest) is all you need
pranaygp
left a comment
There was a problem hiding this comment.
the user shouldn't be setting up an swcrc. that's to be configured by the builders. infact I believe we ignore any project level swcrc in next for example :)
The --runtime-path option was added for potential symlink scenarios but is not being used. Revert to keep the script simple. Also fix whitespace in resolve-symlinks.sh. Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Move the NestJS-specific parser option to nested biome.json files in packages/nest and workbench/nest, keeping the root config cleaner. Signed-off-by: Peter Wielander <mittgfu@gmail.com>
- Add @swc/core and @workflow/swc-plugin to packages/nest - Remove @swc/cli and @swc/core from workbench/nest - Keep @workflow/swc-plugin in workbench (required by .swcrc resolution) - Add @workflow/nest as devDependency in workbench The swc-plugin must remain a direct dependency in the workbench because SWC's plugin resolution requires it to be resolvable from the project's node_modules (referenced by name in .swcrc). Signed-off-by: Peter Wielander <mittgfu@gmail.com>
The SWC dependencies were added to try making them transitively available to the workbench, but pnpm's strict isolation prevents this. The @workflow/swc-plugin must remain a direct devDependency in the NestJS workbench because NestJS's SWC builder reads .swcrc which references the plugin by name - it must be resolvable from the project's node_modules. This is different from other frameworks (Nitro, Vite, Next.js) which integrate the workflow plugin into their build systems internally. Signed-off-by: Peter Wielander <mittgfu@gmail.com>
- Add @swc/core and @workflow/swc-plugin to packages/nest dependencies - Remove @workflow/swc-plugin from workbench/nest - Add .npmrc with public-hoist-pattern to make swc-plugin resolvable The workbench app now only depends on @workflow/nest (like other workbenches), and pnpm hoisting ensures the swc-plugin is available for NestJS's SWC builder to resolve from .swcrc. Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Instead of requiring users to configure pnpm hoisting for @workflow/swc-plugin, @workflow/nest now provides a CLI command that generates .swcrc with the resolved plugin path. This eliminates the need for root-level .npmrc changes. Changes: - Add workflow-nest CLI with 'init' command that generates .swcrc - Remove .npmrc public-hoist-pattern configuration - Update workbench/nest to use the CLI in prebuild/predev scripts - Add .swcrc to .gitignore (contains machine-specific absolute paths) Users can now simply run 'npx @workflow/nest init' after installing the package. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
The workflow-nest bin command isn't available in CI because pnpm install runs before the packages are built. Use node to run the CLI directly from the dist folder instead. Also add README.md to packages/nest with setup instructions and explanation of the CLI approach. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
| "@workflow/ai": "workspace:*", | ||
| "@workflow/nest": "workspace:*", |
There was a problem hiding this comment.
I don't think these 2 are needed?
workflow/nest is already re-exporting @workflow/nest, and @worklfow/ai should not be a dev dep?
Add workbench app + local world tests for NestJS.
Can be merged safely since tests pass and there's no public project or docs associated. Docs and Vercel prod tests will be added in #850 once this is merged