Skip to content

Conversation

@pranaygp
Copy link
Collaborator

Adds reusable helper methods to BaseBuilder for common path operations,
reducing code duplication and improving readability in builder subclasses.

Changes:

  • Added resolvePath() helper in BaseBuilder
  • Added ensureDirectory() helper in BaseBuilder
  • Updated StandaloneBuilder (both in @workflow/builders and @workflow/cli)
    to use the new helpers
  • Removed unnecessary imports from StandaloneBuilder

This simplifies path handling code from:
const path = resolve(this.config.workingDir, this.config.somePath);
await mkdir(dirname(path), { recursive: true });

To:
const path = this.resolvePath(this.config.somePath);
await this.ensureDirectory(path);

🤖 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: bfd4924

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

Adds reusable helper methods to BaseBuilder for common path operations,
reducing code duplication and improving readability in builder subclasses.

Changes:
- Added resolvePath() helper in BaseBuilder
- Added ensureDirectory() helper in BaseBuilder
- Updated StandaloneBuilder (both in @workflow/builders and @workflow/cli)
  to use the new helpers
- Removed unnecessary imports from StandaloneBuilder

This simplifies path handling code from:
  const path = resolve(this.config.workingDir, this.config.somePath);
  await mkdir(dirname(path), { recursive: true });

To:
  const path = this.resolvePath(this.config.somePath);
  await this.ensureDirectory(path);

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

Co-Authored-By: Claude <[email protected]>
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