Socket
Book a DemoInstallSign in
Socket

@auto-engineer/emmett-generator

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@auto-engineer/emmett-generator

Code generation plugin for the Auto Engineer CLI that scaffolds event-driven backends using the Emmett event sourcing framework. This plugin takes FlowLang specifications and generates GraphQL servers with commands, events, projections, and queries.

0.8.1
latest
npmnpm
Version published
Maintainers
2
Created
Source

@auto-engineer/emmett-generator

Code generation plugin for the Auto Engineer CLI that scaffolds event-driven backends using the Emmett event sourcing framework. This plugin takes FlowLang specifications and generates GraphQL servers with commands, events, projections, and queries.

Installation

This is a plugin for the Auto Engineer CLI. Install both the CLI and this plugin:

npm install -g @auto-engineer/cli
npm install @auto-engineer/emmett-generator

Configuration

Add this plugin to your auto.config.ts:

export default {
  plugins: [
    '@auto-engineer/emmett-generator',
    // ... other plugins
  ],
};

Commands

This plugin provides the following commands:

  • generate:server - Generate a GraphQL server from flow specifications

What does this plugin do?

The Emmett Generator transforms high-level flow specifications into event-driven backends. It generates:

Command Handlers

  • Command validation and business logic stubs
  • Event emission patterns
  • Error handling and domain validation
  • Integration with the Emmett command bus

Event Sourcing Infrastructure

  • Event store configuration
  • Event versioning and migration support
  • Projection builders for read models
  • Event stream processing

GraphQL API Layer

  • Type-safe GraphQL schema generation
  • Mutation resolvers for commands
  • Query resolvers for projections
  • Subscription support for real-time updates

Testing Infrastructure

  • Comprehensive test suites for all generated components
  • Behavioral tests for command handlers
  • Integration tests for the GraphQL API
  • Test data factories and fixtures

Generated Project Structure

When you run auto generate:server, the plugin creates a complete backend project:

server/
├── src/
│   ├── domain/
│   │   ├── commands/           # Command handlers
│   │   ├── events/            # Event definitions
│   │   ├── projections/       # Read model projections
│   │   └── queries/           # Query handlers
│   ├── graphql/
│   │   ├── resolvers/         # GraphQL resolvers
│   │   └── schema.ts          # Generated schema
│   ├── infrastructure/
│   │   ├── eventStore.ts      # Event store setup
│   │   └── commandBus.ts      # Command bus configuration
│   └── server.ts              # Application entry point
├── tests/                     # Generated test suites
└── package.json

Features

Type-Safe Code Generation

All generated code is fully typed using TypeScript, ensuring compile-time safety and developer experience.

Event-Driven Architecture

Built on Emmett's event sourcing patterns:

  • Commands represent intent to change state
  • Events capture what actually happened
  • Projections create read models from events
  • Queries serve data to GraphQL clients

Infrastructure

Generated servers include:

  • Error handling and logging
  • Health checks and monitoring endpoints
  • Environment-based configuration
  • Database migration scripts

Templates

Uses EJS templating system for code generation:

  • Command handler templates
  • Event definition templates
  • GraphQL resolver templates
  • Test suite templates

Integration with FlowLang

This plugin is designed to work with @auto-engineer/flowlang specifications:

  • Define your business flows using FlowLang DSL
  • Export the flow schema using auto export:schema
  • Generate the backend using auto generate:server
  • The generator reads the schema and creates appropriate handlers

Example Workflow

# 1. Create a flow specification project
auto create:example

# 2. Define your business flows in flows/
# Edit flows/order-management.flow.ts

# 3. Generate the backend server
auto generate:server

# 4. The generated server is ready to run:
cd server
npm install
npm run start

Advanced Features

Custom Templates

Override default templates by providing your own EJS files:

  • Place custom templates in .auto-engineer/templates/
  • Templates follow the same structure as built-in ones
  • Supports partial overrides for specific components

Plugin Integration

Works with other Auto Engineer plugins:

  • @auto-engineer/server-implementer: AI-powered implementation of generated stubs
  • @auto-engineer/backend-checks: Validation of generated code
  • @auto-engineer/react-graphql-generator: Frontend generation from server schema

Configuration Options

Customize generation behavior through auto.config.ts:

export default {
  plugins: [
    [
      '@auto-engineer/emmett-generator',
      {
        outputDir: './backend',
        templateOverrides: './templates',
        generateMigrations: true,
      },
    ],
  ],
};

The Emmett Generator bridges the gap between high-level business requirements and backend infrastructure, enabling development of scalable, maintainable applications.

FAQs

Package last updated on 29 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.