Skip to content

Conversation

@pi0
Copy link
Collaborator

@pi0 pi0 commented Oct 25, 2025

Resolves #22

This PR adds support for workflows/ dir from:

  • Project root dir
  • Project source dir (if specified, which is usually server/) from all scan layers
  • Custom dirs provided via workflows: { dirs: [] } nitro config

@changeset-bot
Copy link

changeset-bot bot commented Oct 25, 2025

🦋 Changeset detected

Latest commit: 660ed20

The changes in this PR will be included in the next version bump.

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

@vercel
Copy link
Contributor

vercel bot commented Oct 25, 2025

@pi0 is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Collaborator

@pranaygp pranaygp left a comment

Choose a reason for hiding this comment

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

I think pathe should be a dep of nitro, instead of a peerdep for the user - otherwise lgtm

Added support for custom workflows directories in Nitro.
Copy link
Contributor

@vercel vercel bot left a comment

Choose a reason for hiding this comment

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

Additional Comments:

packages/nitro/package.json (lines 28-33):
The package imports pathe in src/builders.ts and src/index.ts, but it's not declared as a dependency. This will cause a module resolution error at runtime.

View Details
📝 Patch Details
diff --git a/packages/nitro/package.json b/packages/nitro/package.json
index 94194ca..644cf86 100644
--- a/packages/nitro/package.json
+++ b/packages/nitro/package.json
@@ -30,7 +30,8 @@
     "@workflow/swc-plugin": "workspace:*",
     "@workflow/cli": "workspace:*",
     "@workflow/core": "workspace:*",
-    "exsolve": "^1.0.7"
+    "exsolve": "^1.0.7",
+    "pathe": "^2.0.3"
   },
   "devDependencies": {
     "@types/node": "catalog:",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index afa6df0..35dd2d7 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -488,6 +488,9 @@ importers:
       exsolve:
         specifier: ^1.0.7
         version: 1.0.7
+      pathe:
+        specifier: ^2.0.3
+        version: 2.0.3
     devDependencies:
       '@types/node':
         specifier: 'catalog:'
@@ -1004,6 +1007,10 @@ importers:
         version: 5.9.3
 
   workbench/nitro:
+    dependencies:
+      pathe:
+        specifier: ^2.0.3
+        version: 2.0.3
     devDependencies:
       ai:
         specifier: 'catalog:'

Analysis

Missing dependency declaration for pathe in @workflow/nitro

What fails: TypeScript compilation of packages/nitro fails with "Cannot find module 'pathe'" error in both src/builders.ts and src/index.ts

How to reproduce:

cd packages/nitro
npm run build

Result:

src/builders.ts(5,31): error TS2307: Cannot find module 'pathe' or its corresponding type declarations.
src/index.ts(2,22): error TS2307: Cannot find module 'pathe' or its corresponding type declarations.

Expected: Build should succeed as both files import from pathe module (lines 5 in builders.ts and line 2 in index.ts)

Root cause: While the code imports pathe with:

  • packages/nitro/src/builders.ts line 5: import { join, resolve } from 'pathe';
  • packages/nitro/src/index.ts line 2: import { join } from 'pathe';

The dependency was not declared in packages/nitro/package.json. This causes module resolution to fail at build time.

Fix: Added "pathe": "^2.0.3" to the dependencies section of packages/nitro/package.json to match the version already used in workbench/nitro-v3/package.json.

@vercel
Copy link
Contributor

vercel bot commented Oct 28, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
example-nextjs-workflow-turbopack Ready Ready Preview Comment Oct 28, 2025 7:47pm
example-nextjs-workflow-webpack Ready Ready Preview Comment Oct 28, 2025 7:47pm
workbench-nitro-workflow Ready Ready Preview Comment Oct 28, 2025 7:47pm
workflow-docs Ready Ready Preview Comment Oct 28, 2025 7:47pm

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.

Cannot get the example on Nitro to run

4 participants