From 1e734248bd8c5f7923885661b5a3de12a349042b Mon Sep 17 00:00:00 2001 From: Pranay Prakash Date: Sat, 25 Oct 2025 23:47:04 -0700 Subject: [PATCH] refactor: standardize method naming and clarify log messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .changeset/standardize-naming.md | 6 ++++++ packages/builders/src/base-builder.ts | 2 +- packages/builders/src/standalone.ts | 14 ++++---------- packages/builders/src/vercel-build-output-api.ts | 2 +- packages/cli/src/lib/builders/standalone.ts | 14 ++++---------- .../src/lib/builders/vercel-build-output-api.ts | 2 +- 6 files changed, 17 insertions(+), 23 deletions(-) create mode 100644 .changeset/standardize-naming.md diff --git a/.changeset/standardize-naming.md b/.changeset/standardize-naming.md new file mode 100644 index 00000000..a6dcaec8 --- /dev/null +++ b/.changeset/standardize-naming.md @@ -0,0 +1,6 @@ +--- +"@workflow/builders": patch +"@workflow/cli": patch +--- + +Standardize method naming conventions diff --git a/packages/builders/src/base-builder.ts b/packages/builders/src/base-builder.ts index a7a127d0..f5bbcd32 100644 --- a/packages/builders/src/base-builder.ts +++ b/packages/builders/src/base-builder.ts @@ -522,7 +522,7 @@ export const POST = workflowEntrypoint(workflowCode);`; await interimBundleCtx.dispose(); } - protected async buildClientLibrary(): Promise { + protected async createClientLibrary(): Promise { if (!this.config.clientBundlePath) { // Silently exit since no client bundle was requested return; diff --git a/packages/builders/src/standalone.ts b/packages/builders/src/standalone.ts index b08d71da..274ca145 100644 --- a/packages/builders/src/standalone.ts +++ b/packages/builders/src/standalone.ts @@ -16,7 +16,7 @@ export class StandaloneBuilder extends BaseBuilder { await this.buildWorkflowsBundle(options); await this.buildWebhookFunction(); - await this.buildClientLibrary(); + await this.createClientLibrary(); } private async buildStepsBundle({ @@ -28,10 +28,7 @@ export class StandaloneBuilder extends BaseBuilder { tsBaseUrl?: string; tsPaths?: Record; }): Promise { - console.log( - 'Creating Vercel API steps bundle at', - this.config.stepsBundlePath - ); + console.log('Creating steps bundle at', this.config.stepsBundlePath); const stepsBundlePath = resolve( this.config.workingDir, @@ -59,7 +56,7 @@ export class StandaloneBuilder extends BaseBuilder { tsPaths?: Record; }): Promise { console.log( - 'Creating vercel API workflows bundle at', + 'Creating workflows bundle at', this.config.workflowsBundlePath ); @@ -80,10 +77,7 @@ export class StandaloneBuilder extends BaseBuilder { } private async buildWebhookFunction(): Promise { - console.log( - 'Creating vercel API webhook bundle at', - this.config.webhookBundlePath - ); + console.log('Creating webhook bundle at', this.config.webhookBundlePath); const webhookBundlePath = resolve( this.config.workingDir, diff --git a/packages/builders/src/vercel-build-output-api.ts b/packages/builders/src/vercel-build-output-api.ts index 4875c657..be886967 100644 --- a/packages/builders/src/vercel-build-output-api.ts +++ b/packages/builders/src/vercel-build-output-api.ts @@ -25,7 +25,7 @@ export class VercelBuildOutputAPIBuilder extends BaseBuilder { await this.buildWebhookFunction(options); await this.createBuildOutputConfig(outputDir); - await this.buildClientLibrary(); + await this.createClientLibrary(); } private async buildStepsFunction({ diff --git a/packages/cli/src/lib/builders/standalone.ts b/packages/cli/src/lib/builders/standalone.ts index e98afe46..95facd0c 100644 --- a/packages/cli/src/lib/builders/standalone.ts +++ b/packages/cli/src/lib/builders/standalone.ts @@ -16,7 +16,7 @@ export class StandaloneBuilder extends BaseBuilder { await this.buildWorkflowsBundle(options); await this.buildWebhookFunction(); - await this.buildClientLibrary(); + await this.createClientLibrary(); } private async buildStepsBundle({ @@ -28,10 +28,7 @@ export class StandaloneBuilder extends BaseBuilder { tsBaseUrl?: string; tsPaths?: Record; }): Promise { - console.log( - 'Creating Vercel API steps bundle at', - this.config.stepsBundlePath - ); + console.log('Creating steps bundle at', this.config.stepsBundlePath); const stepsBundlePath = resolve( this.config.workingDir, @@ -59,7 +56,7 @@ export class StandaloneBuilder extends BaseBuilder { tsPaths?: Record; }): Promise { console.log( - 'Creating vercel API workflows bundle at', + 'Creating workflows bundle at', this.config.workflowsBundlePath ); @@ -80,10 +77,7 @@ export class StandaloneBuilder extends BaseBuilder { } private async buildWebhookFunction(): Promise { - console.log( - 'Creating vercel API webhook bundle at', - this.config.webhookBundlePath - ); + console.log('Creating webhook bundle at', this.config.webhookBundlePath); const webhookBundlePath = resolve( this.config.workingDir, diff --git a/packages/cli/src/lib/builders/vercel-build-output-api.ts b/packages/cli/src/lib/builders/vercel-build-output-api.ts index 912b0fc1..d5f72ecc 100644 --- a/packages/cli/src/lib/builders/vercel-build-output-api.ts +++ b/packages/cli/src/lib/builders/vercel-build-output-api.ts @@ -28,7 +28,7 @@ export class VercelBuildOutputAPIBuilder extends BaseBuilder { await this.buildWebhookFunction(options); await this.createBuildOutputConfig(outputDir); - await this.buildClientLibrary(); + await this.createClientLibrary(); } private async buildStepsFunction({