* feat: add type safety for builder configurations with discriminated unions
Improves type safety by creating discriminated union types for builder-specific
configurations, making it clear which configuration options are required for
each builder type.
Changes:
- Created BaseWorkflowConfig interface with common options
- Created StandaloneConfig, VercelBuildOutputConfig, and NextConfig types
- Made WorkflowConfig a discriminated union based on buildTarget
- Added documentation for each configuration type
- Exported new types from @workflow/builders
This enables better IntelliSense and type checking when constructing builder
configurations, preventing invalid configuration combinations at compile time.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor: consolidate builder configuration patterns
Extracts common builder configuration pattern into a reusable helper function,
improving consistency across framework integrations.
Changes:
- Created createBaseBuilderConfig() helper in @workflow/builders
- Updated @workflow/nitro builders to use the new helper
- Removed CommonBuildOptions constant from nitro package
- Added clear documentation for when bundle paths are not used
This makes it easier for framework integrations to create properly configured
builder instances without manually specifying unused bundle path properties.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* docs: add documentation and improve code clarity
Adds comprehensive JSDoc comments to BaseBuilder methods and improves code
documentation throughout the builders package.
Changes:
- Added class-level documentation for BaseBuilder
- Added JSDoc comments for all major public/protected methods
- Documented the discoveredEntries WeakMap caching mechanism
- Cleaned up TODO comment about debug file location
- Improved method parameter documentation
This makes the builders package more maintainable and easier to understand
for contributors and users extending the base builder functionality.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Apply suggestion from @vercel[bot]
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Nathan Rajlich <n@n8.io>
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
* refactor: consolidate builder configuration patterns
Extracts common builder configuration pattern into a reusable helper function,
improving consistency across framework integrations.
Changes:
- Created createBaseBuilderConfig() helper in @workflow/builders
- Updated @workflow/nitro builders to use the new helper
- Removed CommonBuildOptions constant from nitro package
- Added clear documentation for when bundle paths are not used
This makes it easier for framework integrations to create properly configured
builder instances without manually specifying unused bundle path properties.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* .
Signed-off-by: Nathan Rajlich <n@n8.io>
---------
Signed-off-by: Nathan Rajlich <n@n8.io>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Nathan Rajlich <n@n8.io>
This commit extracts builder infrastructure from @workflow/cli into a new
shared @workflow/builders package. This improves code organization by:
- Creating a dedicated package for builder functionality
- Allowing @workflow/next and @workflow/nitro to depend on builders directly
- Reducing coupling between framework integrations and the CLI
- Preparing for moving NextBuilder to @workflow/next in the next PR
Changes:
- Created new @workflow/builders package
- Moved BaseBuilder, BasicBuilder, and VercelBuildOutputAPIBuilder
- Moved esbuild plugins (swc, discover-entries, node-module)
- Moved WorkflowConfig and BuildTarget types
- Updated @workflow/cli to import from @workflow/builders
- Updated @workflow/nitro to import from @workflow/builders
- Re-exported types from CLI for backwards compatibility
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>