Skip to content

Conversation

@pranaygp
Copy link
Collaborator

Improves code consistency by standardizing method naming conventions and
clarifying log messages across builders.

Changes:

  • Renamed buildClientLibrary() to createClientLibrary() in BaseBuilder to match
    the convention where "create" is used for protected/shared methods
  • Updated all callers in StandaloneBuilder and VercelBuildOutputAPIBuilder
  • Clarified log messages in StandaloneBuilder by removing "Vercel API" prefix
    since this builder is framework-agnostic

This establishes a clear pattern:

  • Public/template methods in subclasses: build* (buildStepsFunction, etc.)
  • Protected/shared methods in BaseBuilder: create* (createStepsBundle, etc.)

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

@changeset-bot
Copy link

changeset-bot bot commented Oct 26, 2025

🦋 Changeset detected

Latest commit: 1e73424

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 Oct 26, 2025 7:06am
example-nextjs-workflow-webpack Ready Ready Preview Comment Oct 26, 2025 7:06am
example-workflow Ready Ready Preview Comment Oct 26, 2025 7:06am
workbench-nitro-workflow Ready Ready Preview Comment Oct 26, 2025 7:06am
workflow-docs Ready Ready Preview Comment Oct 26, 2025 7:06am

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 @workflow/builders package was missing exports for STEP_QUEUE_TRIGGER and WORKFLOW_QUEUE_TRIGGER constants that were being imported by the @workflow/next package, causing TypeScript compilation to fail.

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 because STEP_QUEUE_TRIGGER and WORKFLOW_QUEUE_TRIGGER are not exported 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 module index file, causing TypeScript compilation failures 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 TypeScript exports cause build failure

What fails: TypeScript compiler fails on 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 module entry point, causing TypeScript compilation failures 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 lines 7-8 due to missing exports for STEP_QUEUE_TRIGGER and WORKFLOW_QUEUE_TRIGGER from @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.

🔧 Build Fix:

The constants STEP_QUEUE_TRIGGER and WORKFLOW_QUEUE_TRIGGER were defined in constants.ts but not exported from the main module 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 package

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 package

How to reproduce:

pnpm install
cd packages/errors && pnpm run build
cd ../builders && pnpm run build  
cd ../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:

Missing exports for STEP_QUEUE_TRIGGER and WORKFLOW_QUEUE_TRIGGER constants that are defined in constants.ts but not exported from the package index.

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 in packages/next/src/next-builder.ts due to missing exports from @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/cli/src/lib/builders/base-builder.ts (line 525):
Incomplete refactoring: The method buildClientLibrary() was not renamed to createClientLibrary() in this file, while the same method was renamed in packages/builders/src/base-builder.ts. This breaks the established naming convention pattern and leaves inconsistent code.

View Details
📝 Patch Details
diff --git a/packages/cli/src/lib/builders/base-builder.ts b/packages/cli/src/lib/builders/base-builder.ts
index 9ac184c..32f8afc 100644
--- a/packages/cli/src/lib/builders/base-builder.ts
+++ b/packages/cli/src/lib/builders/base-builder.ts
@@ -522,7 +522,7 @@ export const POST = workflowEntrypoint(workflowCode);`;
     await interimBundleCtx.dispose();
   }
 
-  protected async buildClientLibrary(): Promise<void> {
+  protected async createClientLibrary(): Promise<void> {
     if (!this.config.clientBundlePath) {
       // Silently exit since no client bundle was requested
       return;

Analysis

Incomplete refactoring: buildClientLibrary() not renamed to createClientLibrary()

What fails: Method naming inconsistency in packages/cli/src/lib/builders/base-builder.ts - the method buildClientLibrary() at line 525 violates the established naming convention pattern while all other protected methods use the create* prefix.

How to reproduce:

# Examine both base-builder files:
grep "protected async.*ClientLibrary" packages/builders/src/base-builder.ts
grep "protected async.*ClientLibrary" packages/cli/src/lib/builders/base-builder.ts

What was happening:

  • packages/builders/src/base-builder.ts line 525: protected async createClientLibrary()
  • packages/cli/src/lib/builders/base-builder.ts line 525: protected async buildClientLibrary() ← inconsistent

The refactoring PR introduced a clear naming pattern where protected/shared methods in BaseBuilder use the create* prefix (e.g., createStepsBundle, createWorkflowsBundle, createWebhookBundle). However, the CLI's base-builder.ts was not updated, leaving one method with the outdated build* prefix.

Expected behavior: All protected methods in BaseBuilder should follow the create* naming convention for consistency.

Fix applied: Renamed buildClientLibrary() to createClientLibrary() in packages/cli/src/lib/builders/base-builder.ts to align with the established pattern and match the implementation in packages/builders/src/base-builder.ts.

Improves code consistency by standardizing method naming conventions and
clarifying log messages across builders.

Changes:
- Renamed buildClientLibrary() to createClientLibrary() in BaseBuilder to match
  the convention where "create" is used for protected/shared methods
- Updated all callers in StandaloneBuilder and VercelBuildOutputAPIBuilder
- Clarified log messages in StandaloneBuilder by removing "Vercel API" prefix
  since this builder is framework-agnostic

This establishes a clear pattern:
- Public/template methods in subclasses: build* (buildStepsFunction, etc.)
- Protected/shared methods in BaseBuilder: create* (createStepsBundle, etc.)

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

Co-Authored-By: Claude <noreply@anthropic.com>
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.

2 participants