Skip to content

Conversation

@pranaygp
Copy link
Collaborator

Extracts repeated package.json and .vc-config.json generation logic into
reusable helper methods in BaseBuilder, eliminating code duplication across
VercelBuildOutputAPIBuilder.

Changes:

  • Added createPackageJson() helper method to BaseBuilder
  • Added createVcConfig() helper method with sensible defaults
  • Updated VercelBuildOutputAPIBuilder (both in @workflow/builders and @workflow/cli)
    to use the new helper methods
  • Reduced configuration code from ~20 lines per function to ~3 lines

This makes the build code more maintainable and ensures consistent configuration
across all Vercel Build Output API functions.

🤖 Generated with Claude Code

Co-Authored-By: Claude [email protected]

@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 4, 2025 6:50am
example-nextjs-workflow-webpack Ready Ready Preview Comment Nov 4, 2025 6:50am
example-workflow Ready Ready Preview Comment Nov 4, 2025 6:50am
workbench-nitro-workflow Ready Ready Preview Comment Nov 4, 2025 6:50am
workbench-nuxt-workflow Ready Ready Preview Comment Nov 4, 2025 6:50am
workbench-sveltekit-workflow Ready Ready Preview Comment Nov 4, 2025 6:50am
workbench-vite-workflow Ready Ready Preview Comment Nov 4, 2025 6:50am
workflow-docs Ready Ready Preview Comment Nov 4, 2025 6:50am

@changeset-bot
Copy link

changeset-bot bot commented Oct 26, 2025

🦋 Changeset detected

Latest commit: 6377dc7

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

This PR includes changesets to release 8 packages
Name Type
@workflow/builders Patch
@workflow/cli Patch
@workflow/next Patch
@workflow/nitro Patch
@workflow/sveltekit 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

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 exports in index.ts, causing TypeScript compilation errors 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 @workflow/builders

How to reproduce:

cd packages/builders && pnpm build
cd ../next && pnpm 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 module's main index file, causing import failures in other 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 at lines 7-8 due to missing exports STEP_QUEUE_TRIGGER and WORKFLOW_QUEUE_TRIGGER from the @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 from @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'.

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 entry point, 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 in @workflow/next package

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

How to reproduce:

pnpm 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 STEP_QUEUE_TRIGGER and WORKFLOW_QUEUE_TRIGGER constants were defined in constants.ts but not exported from the main package index, causing TypeScript compilation errors when importing 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 in @workflow/next

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

How to reproduce:

cd packages/next && pnpm 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
@pranaygp pranaygp force-pushed the pranaygp/extract-queue-trigger-config branch from c1efef8 to ed3fe8c Compare October 26, 2025 06:53
@pranaygp pranaygp force-pushed the pranaygp/deduplicate-config-generation branch from 80c6b7d to a2278db Compare October 26, 2025 06:53
@pranaygp pranaygp force-pushed the pranaygp/extract-queue-trigger-config branch 2 times, most recently from c92ceeb to 3f2990b Compare November 3, 2025 22:26
@pranaygp pranaygp force-pushed the pranaygp/deduplicate-config-generation branch from b3da019 to 9a111f9 Compare November 3, 2025 22:26
Base automatically changed from pranaygp/extract-queue-trigger-config to main November 4, 2025 06:35
Extracts repeated package.json and .vc-config.json generation logic into
reusable helper methods in BaseBuilder, eliminating code duplication across
VercelBuildOutputAPIBuilder.

Changes:
- Added createPackageJson() helper method to BaseBuilder
- Added createVcConfig() helper method with sensible defaults
- Updated VercelBuildOutputAPIBuilder (both in @workflow/builders and @workflow/cli)
  to use the new helper methods
- Reduced configuration code from ~20 lines per function to ~3 lines

This makes the build code more maintainable and ensures consistent configuration
across all Vercel Build Output API functions.

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

Co-Authored-By: Claude <[email protected]>
@TooTallNate TooTallNate merged commit 4585222 into main Nov 4, 2025
30 checks passed
@TooTallNate TooTallNate deleted the pranaygp/deduplicate-config-generation branch November 4, 2025 06:55
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