Skip to content

Conversation

@pranaygp
Copy link
Collaborator

Consolidates duplicated queue trigger configurations into shared constants
in @workflow/builders package, eliminating repetition across multiple builders.

Changes:

  • Created STEP_QUEUE_TRIGGER and WORKFLOW_QUEUE_TRIGGER constants
  • Updated VercelBuildOutputAPIBuilder to use shared constants
  • Updated NextBuilder (both in @workflow/next and @workflow/cli) to use constants
  • Exported constants from @workflow/builders index

This ensures consistent queue configuration across all builders and makes
future updates to these settings easier to manage from a single location.

🤖 Generated with Claude Code

Co-Authored-By: Claude [email protected]

@changeset-bot
Copy link

changeset-bot bot commented Oct 26, 2025

🦋 Changeset detected

Latest commit: 3f2990b

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

This PR includes changesets to release 7 packages
Name Type
@workflow/builders Patch
@workflow/cli Patch
@workflow/next Patch
@workflow/nitro Patch
workflow Patch
@workflow/world-testing Patch
@workflow/ai Patch

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 26, 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 Nov 3, 2025 10:28pm
example-nextjs-workflow-webpack Ready Ready Preview Comment Nov 3, 2025 10:28pm
example-workflow Ready Ready Preview Comment Nov 3, 2025 10:28pm
workbench-nitro-workflow Ready Ready Preview Comment Nov 3, 2025 10:28pm
workbench-sveltekit-workflow Error Error Nov 3, 2025 10:28pm
workbench-vite-workflow Ready Ready Preview Comment Nov 3, 2025 10:28pm
workflow-docs Ready Ready Preview Comment Nov 3, 2025 10:28pm

@pranaygp pranaygp marked this pull request as draft October 26, 2025 06:32
@pranaygp pranaygp marked this pull request as ready for review October 26, 2025 06:34
@pranaygp pranaygp force-pushed the pranaygp/extract-queue-trigger-config branch from 69042df to c1efef8 Compare October 26, 2025 06:44
@pranaygp pranaygp force-pushed the pranaygp/move-next-builder-to-next-package branch from dae68ac to c1e7d6c Compare October 26, 2025 06:44
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.

🔧 Build Fix:

Missing exports in @workflow/builders package caused TypeScript compilation to fail when trying to import STEP_QUEUE_TRIGGER and WORKFLOW_QUEUE_TRIGGER constants. These constants existed in constants.ts but were not exported from the main index file.

View Details
📝 Patch Details
diff --git a/packages/builders/src/index.ts b/packages/builders/src/index.ts
index 32a74a6..a305ca5 100644
--- a/packages/builders/src/index.ts
+++ b/packages/builders/src/index.ts
@@ -8,3 +8,4 @@ export { applySwcTransform } from './apply-swc-transform.js';
 export { createDiscoverEntriesPlugin } from './discover-entries-esbuild-plugin.js';
 export { createNodeModuleErrorPlugin } from './node-module-esbuild-plugin.js';
 export { createSwcPlugin } from './swc-esbuild-plugin.js';
+export { STEP_QUEUE_TRIGGER, WORKFLOW_QUEUE_TRIGGER } from './constants.js';

Analysis

Missing exports cause TypeScript compilation failure in @workflow/next package

What fails: TypeScript compiler fails on packages/next/src/next-builder.ts due to missing exports STEP_QUEUE_TRIGGER and WORKFLOW_QUEUE_TRIGGER from @workflow/builders

How to reproduce:

cd packages/next && pnpm run build

Result:

src/next-builder.ts(7,3): error TS2305: Module '"@workflow/builders"' has no exported member 'STEP_QUEUE_TRIGGER'.
src/next-builder.ts(8,3): error TS2305: Module '"@workflow/builders"' has no exported member 'WORKFLOW_QUEUE_TRIGGER'.

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.

🔧 Build Fix:

The STEP_QUEUE_TRIGGER and WORKFLOW_QUEUE_TRIGGER constants were defined in constants.ts but not exported from the main package index, causing import failures in dependent packages.

View Details
📝 Patch Details
diff --git a/packages/builders/src/index.ts b/packages/builders/src/index.ts
index 32a74a6..a305ca5 100644
--- a/packages/builders/src/index.ts
+++ b/packages/builders/src/index.ts
@@ -8,3 +8,4 @@ export { applySwcTransform } from './apply-swc-transform.js';
 export { createDiscoverEntriesPlugin } from './discover-entries-esbuild-plugin.js';
 export { createNodeModuleErrorPlugin } from './node-module-esbuild-plugin.js';
 export { createSwcPlugin } from './swc-esbuild-plugin.js';
+export { STEP_QUEUE_TRIGGER, WORKFLOW_QUEUE_TRIGGER } from './constants.js';

Analysis

Missing exports cause TypeScript compilation failure

What fails: TypeScript compiler fails on packages/next/src/next-builder.ts due to missing exports STEP_QUEUE_TRIGGER and WORKFLOW_QUEUE_TRIGGER from the @workflow/builders package

How to reproduce:

cd packages/next && pnpm run build

Result:

src/next-builder.ts(7,3): error TS2305: Module '"@workflow/builders"' has no exported member 'STEP_QUEUE_TRIGGER'.
src/next-builder.ts(8,3): error TS2305: Module '"@workflow/builders"' has no exported member 'WORKFLOW_QUEUE_TRIGGER'.

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/builders/src/index.ts (line 11):
The new constants STEP_QUEUE_TRIGGER and WORKFLOW_QUEUE_TRIGGER are not exported from the @workflow/builders package index, but multiple files are importing them from @workflow/builders expecting them to be available as package exports. This will cause runtime module resolution failures.

View Details
📝 Patch Details
diff --git a/packages/builders/src/index.ts b/packages/builders/src/index.ts
index 32a74a6..a305ca5 100644
--- a/packages/builders/src/index.ts
+++ b/packages/builders/src/index.ts
@@ -8,3 +8,4 @@ export { applySwcTransform } from './apply-swc-transform.js';
 export { createDiscoverEntriesPlugin } from './discover-entries-esbuild-plugin.js';
 export { createNodeModuleErrorPlugin } from './node-module-esbuild-plugin.js';
 export { createSwcPlugin } from './swc-esbuild-plugin.js';
+export { STEP_QUEUE_TRIGGER, WORKFLOW_QUEUE_TRIGGER } from './constants.js';

Analysis

Missing constant exports from @workflow/builders package index

What fails: TypeScript module resolution for STEP_QUEUE_TRIGGER and WORKFLOW_QUEUE_TRIGGER constants when imported from @workflow/builders package

How to reproduce:

cd packages/cli && pnpm run typecheck

Result: Compilation errors:

src/lib/builders/next-build.ts(7,3): error TS2305: Module '"@workflow/builders"' has no exported member 'STEP_QUEUE_TRIGGER'.
src/lib/builders/next-build.ts(8,3): error TS2305: Module '"@workflow/builders"' has no exported member 'WORKFLOW_QUEUE_TRIGGER'.
src/lib/builders/vercel-build-output-api.ts(5,3): error TS2305: Module '"@workflow/builders"' has no exported member 'STEP_QUEUE_TRIGGER'.
src/lib/builders/vercel-build-output-api.ts(6,3): error TS2305: Module '"@workflow/builders"' has no exported member 'WORKFLOW_QUEUE_TRIGGER'.

Expected: Constants should be exported from packages/builders/src/index.ts so they can be imported from @workflow/builders package entry point. The constants are defined in packages/builders/src/constants.ts but not re-exported by the package's public API.

Files affected:

  • packages/cli/src/lib/builders/next-build.ts - imports from @workflow/builders
  • packages/cli/src/lib/builders/vercel-build-output-api.ts - imports from @workflow/builders
  • packages/next/src/next-builder.ts - imports from @workflow/builders

Fix: Export the constants from the package index file so they are available via the public API.

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.

🔧 Build Fix:

The STEP_QUEUE_TRIGGER and WORKFLOW_QUEUE_TRIGGER constants were defined in constants.ts but not exported from the main module index, causing TypeScript compilation errors when other packages tried to import them.

View Details
📝 Patch Details
diff --git a/packages/builders/src/index.ts b/packages/builders/src/index.ts
index 32a74a6..a305ca5 100644
--- a/packages/builders/src/index.ts
+++ b/packages/builders/src/index.ts
@@ -8,3 +8,4 @@ export { applySwcTransform } from './apply-swc-transform.js';
 export { createDiscoverEntriesPlugin } from './discover-entries-esbuild-plugin.js';
 export { createNodeModuleErrorPlugin } from './node-module-esbuild-plugin.js';
 export { createSwcPlugin } from './swc-esbuild-plugin.js';
+export { STEP_QUEUE_TRIGGER, WORKFLOW_QUEUE_TRIGGER } from './constants.js';

Analysis

Missing exports cause TypeScript compilation failure

What fails: TypeScript compiler fails on packages/next/src/next-builder.ts lines 7-8 due to missing exports STEP_QUEUE_TRIGGER and WORKFLOW_QUEUE_TRIGGER from @workflow/builders module

How to reproduce:

cd packages/next && pnpm run build

Result:

src/next-builder.ts(7,3): error TS2305: Module '"@workflow/builders"' has no exported member 'STEP_QUEUE_TRIGGER'.
src/next-builder.ts(8,3): error TS2305: Module '"@workflow/builders"' has no exported member 'WORKFLOW_QUEUE_TRIGGER'.

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.

🔧 Build Fix:

The STEP_QUEUE_TRIGGER and WORKFLOW_QUEUE_TRIGGER constants were defined in constants.ts but not exported from the main index.ts file, causing TypeScript compilation errors when other packages tried to import them.

View Details
📝 Patch Details
diff --git a/packages/builders/src/index.ts b/packages/builders/src/index.ts
index 32a74a6..a305ca5 100644
--- a/packages/builders/src/index.ts
+++ b/packages/builders/src/index.ts
@@ -8,3 +8,4 @@ export { applySwcTransform } from './apply-swc-transform.js';
 export { createDiscoverEntriesPlugin } from './discover-entries-esbuild-plugin.js';
 export { createNodeModuleErrorPlugin } from './node-module-esbuild-plugin.js';
 export { createSwcPlugin } from './swc-esbuild-plugin.js';
+export { STEP_QUEUE_TRIGGER, WORKFLOW_QUEUE_TRIGGER } from './constants.js';

Analysis

Missing exports in @workflow/builders cause TypeScript compilation failure

What fails: TypeScript compiler fails on packages/next/src/next-builder.ts due to missing exports STEP_QUEUE_TRIGGER and WORKFLOW_QUEUE_TRIGGER from @workflow/builders module

How to reproduce:

cd packages/next && pnpm run build

Result:

src/next-builder.ts(7,3): error TS2305: Module '"@workflow/builders"' has no exported member 'STEP_QUEUE_TRIGGER'.
src/next-builder.ts(8,3): error TS2305: Module '"@workflow/builders"' has no exported member 'WORKFLOW_QUEUE_TRIGGER'.

@pranaygp pranaygp marked this pull request as draft October 26, 2025 06:49
@pranaygp pranaygp marked this pull request as ready for review October 26, 2025 06:50
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.

🔧 Build Fix:

The STEP_QUEUE_TRIGGER and WORKFLOW_QUEUE_TRIGGER constants were defined in constants.ts but missing from the main package exports, causing TypeScript compilation errors when other packages tried to import them.

View Details
📝 Patch Details
diff --git a/packages/builders/src/index.ts b/packages/builders/src/index.ts
index 32a74a6..a305ca5 100644
--- a/packages/builders/src/index.ts
+++ b/packages/builders/src/index.ts
@@ -8,3 +8,4 @@ export { applySwcTransform } from './apply-swc-transform.js';
 export { createDiscoverEntriesPlugin } from './discover-entries-esbuild-plugin.js';
 export { createNodeModuleErrorPlugin } from './node-module-esbuild-plugin.js';
 export { createSwcPlugin } from './swc-esbuild-plugin.js';
+export { STEP_QUEUE_TRIGGER, WORKFLOW_QUEUE_TRIGGER } from './constants.js';

Analysis

Missing exports cause TypeScript compilation failure

What fails: TypeScript compiler fails on packages/next/src/next-builder.ts due to missing exports STEP_QUEUE_TRIGGER and WORKFLOW_QUEUE_TRIGGER from @workflow/builders package

How to reproduce:

turbo run build --filter=@workflow/next

Result:

src/next-builder.ts(7,3): error TS2305: Module '"@workflow/builders"' has no exported member 'STEP_QUEUE_TRIGGER'.
src/next-builder.ts(8,3): error TS2305: Module '"@workflow/builders"' has no exported member 'WORKFLOW_QUEUE_TRIGGER'.

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.

🔧 Build Fix:

The TypeScript configuration was overriding the base configuration's modern module resolution with the legacy "moduleResolution": "node" setting, preventing proper resolution of the @workflow/core/runtime import.

View Details
📝 Patch Details
diff --git a/packages/next/tsconfig.json b/packages/next/tsconfig.json
index 1397247..3628e17 100644
--- a/packages/next/tsconfig.json
+++ b/packages/next/tsconfig.json
@@ -2,9 +2,7 @@
   "extends": "@workflow/tsconfig/base.json",
   "compilerOptions": {
     "outDir": "dist",
-    "target": "es2022",
-    "module": "commonjs",
-    "moduleResolution": "node"
+    "target": "es2022"
   },
   "include": ["src"],
   "exclude": ["node_modules", "**/*.test.ts"]

Analysis

TypeScript module resolution error in @workflow/next package

What fails: TypeScript compilation fails in src/runtime.ts at line 4, column 15, when attempting to import from @workflow/core/runtime

How to reproduce:

cd packages/next && pnpm run build

Result:

src/runtime.ts(4,15): error TS2307: Cannot find module '@workflow/core/runtime' or its corresponding type declarations.
  There are types at '/vercel/path0/packages/next/node_modules/@workflow/core/dist/runtime.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'.

Root cause: The packages/next/tsconfig.json was overriding the base configuration's moduleResolution: "node16" with moduleResolution: "node", which cannot properly resolve package.json exports for the @workflow/core/runtime subpath import.

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.

🔧 Build Fix:

The TypeScript module resolution setting "node" cannot resolve ES module imports from @workflow/core/runtime, causing build compilation to fail. Updated to "bundler" resolution with "ES2022" module format to properly handle mixed module types.

View Details
📝 Patch Details
diff --git a/packages/next/tsconfig.json b/packages/next/tsconfig.json
index 1397247..47f244f 100644
--- a/packages/next/tsconfig.json
+++ b/packages/next/tsconfig.json
@@ -3,8 +3,8 @@
   "compilerOptions": {
     "outDir": "dist",
     "target": "es2022",
-    "module": "commonjs",
-    "moduleResolution": "node"
+    "module": "ES2022",
+    "moduleResolution": "bundler"
   },
   "include": ["src"],
   "exclude": ["node_modules", "**/*.test.ts"]

Analysis

TypeScript module resolution failure prevents build compilation

What fails: TypeScript compiler fails on packages/next/src/runtime.ts(4,15) due to module resolution mismatch between CommonJS and ES modules

How to reproduce:

cd packages/next && pnpm run build

Result:

src/runtime.ts(4,15): error TS2307: Cannot find module '@workflow/core/runtime' or its corresponding type declarations.
  There are types at '/vercel/path0/packages/next/node_modules/@workflow/core/dist/runtime.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'.

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.

🔧 Build Fix:

The TypeScript configuration overrides the base moduleResolution setting with legacy "node" resolution, preventing import of @workflow/core/runtime in modern ES module workspace setup.

View Details
📝 Patch Details
diff --git a/packages/next/tsconfig.json b/packages/next/tsconfig.json
index 1397247..a78dbf4 100644
--- a/packages/next/tsconfig.json
+++ b/packages/next/tsconfig.json
@@ -1,10 +1,7 @@
 {
   "extends": "@workflow/tsconfig/base.json",
   "compilerOptions": {
-    "outDir": "dist",
-    "target": "es2022",
-    "module": "commonjs",
-    "moduleResolution": "node"
+    "outDir": "dist"
   },
   "include": ["src"],
   "exclude": ["node_modules", "**/*.test.ts"]

Analysis

TypeScript module resolution failure in @workflow/next package

What fails: TypeScript compilation in packages/next/src/runtime.ts fails with module resolution error for @workflow/core/runtime import

How to reproduce:

cd packages/next && pnpm run build

Result:

src/runtime.ts(4,15): error TS2307: Cannot find module '@workflow/core/runtime' or its corresponding type declarations.
  There are types at '/vercel/path0/packages/next/node_modules/@workflow/core/dist/runtime.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'.

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.

🔧 Build Fix:

The TypeScript configuration uses legacy moduleResolution: "node" which cannot resolve imports from ESM packages like @workflow/core. The error suggests updating to modern module resolution.

View Details
📝 Patch Details
diff --git a/packages/next/tsconfig.json b/packages/next/tsconfig.json
index 1397247..615e7d9 100644
--- a/packages/next/tsconfig.json
+++ b/packages/next/tsconfig.json
@@ -3,8 +3,8 @@
   "compilerOptions": {
     "outDir": "dist",
     "target": "es2022",
-    "module": "commonjs",
-    "moduleResolution": "node"
+    "module": "nodenext",
+    "moduleResolution": "nodenext"
   },
   "include": ["src"],
   "exclude": ["node_modules", "**/*.test.ts"]

Analysis

TypeScript module resolution error in @workflow/next package

What fails: TypeScript compiler fails on src/runtime.ts due to incompatible module resolution settings when importing from @workflow/core/runtime

How to reproduce:

cd packages/next && pnpm run build

Result:

src/runtime.ts(4,15): error TS2307: Cannot find module '@workflow/core/runtime' or its corresponding type declarations.
  There are types at '/vercel/sandbox/primary/packages/next/node_modules/@workflow/core/dist/runtime.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'.

@pranaygp pranaygp force-pushed the pranaygp/move-next-builder-to-next-package branch from 8696674 to 4f44c89 Compare November 3, 2025 22:22
@pranaygp pranaygp force-pushed the pranaygp/extract-queue-trigger-config branch from ff5da65 to ff3bb3f Compare November 3, 2025 22:22
@pranaygp pranaygp changed the base branch from pranaygp/move-next-builder-to-next-package to graphite-base/76 November 3, 2025 22:25
@pranaygp pranaygp force-pushed the pranaygp/extract-queue-trigger-config branch from ff3bb3f to c92ceeb Compare November 3, 2025 22:25
@graphite-app graphite-app bot changed the base branch from graphite-base/76 to main November 3, 2025 22:25
Consolidates duplicated queue trigger configurations into shared constants
in @workflow/builders package, eliminating repetition across multiple builders.

Changes:
- Created STEP_QUEUE_TRIGGER and WORKFLOW_QUEUE_TRIGGER constants
- Updated VercelBuildOutputAPIBuilder to use shared constants
- Updated NextBuilder (both in @workflow/next and @workflow/cli) to use constants
- Exported constants from @workflow/builders index

This ensures consistent queue configuration across all builders and makes
future updates to these settings easier to manage from a single location.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@TooTallNate TooTallNate merged commit 5dfa4eb into main Nov 4, 2025
25 of 26 checks passed
@TooTallNate TooTallNate deleted the pranaygp/extract-queue-trigger-config branch November 4, 2025 06:35
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.

4 participants