Files
Nathan Rajlich 1ffc078e8e perf(core): precompile workflow vm.Script at module init
Compile the workflow bundle's `vm.Script` for each known workflow source
filename when `workflowEntrypoint` is constructed (module-init time),
rather than lazily on the first queue delivery's replay. Builders inline
the deduplicated, sorted set of workflow filenames into generated routes
via the new `workflowFilenames` entrypoint option, so the first replay is
a cache hit instead of paying the bundle parse/compile on the critical
path.
2026-06-18 14:07:53 -07:00
..
2026-06-17 17:20:44 -07:00
2026-06-17 17:20:44 -07:00

@workflow/builders

Shared builder infrastructure for Workflow SDK. This package provides the base builder class and utilities used by framework-specific integrations.

Overview

This package contains the core build logic for transforming workflow source files into deployable bundles. It is used by:

  • @workflow/cli - For standalone/basic builds
  • @workflow/next - For Next.js integration
  • @workflow/nitro - For Nitro/Nuxt integration

Key Components

  • BaseBuilder: Abstract base class providing common build logic
  • Build plugins: esbuild plugins for workflow transformations
  • SWC integration: Compiler plugin integration for workflow directives

Usage

This package is typically not used directly. Instead, use one of the framework-specific packages that extend BaseBuilder:

import { BaseBuilder } from '@workflow/builders';

class MyBuilder extends BaseBuilder {
  async build(): Promise<void> {
    // Implement builder-specific logic
  }
}

Architecture

The builder system uses:

  1. esbuild for bundling and tree-shaking
  2. SWC for transforming workflow directives ("use workflow", "use step")
  3. Enhanced resolve for TypeScript path mapping

License

MIT