Main orchestrator class for the MemberJunction code generation process.

This class coordinates a comprehensive code generation pipeline that transforms database schemas into a complete, type-safe, full-stack application. The process includes:

Pipeline Steps:

  1. Database Setup - Initialize connections and metadata
  2. Metadata Management - Analyze schema changes and update metadata
  3. SQL Generation - Create views, procedures, and indexes
  4. TypeScript Entities - Generate entity classes with validation
  5. Angular Components - Create forms and UI components
  6. GraphQL Resolvers - Generate API endpoints
  7. Action Classes - Create business logic containers
  8. Documentation - Generate schema JSON for AI/documentation
  9. Post-processing - Run commands and integrity checks

Customization: You can sub-class this class and override specific methods to customize the code generation process for your specific needs.

Example

const codeGen = new RunCodeGenBase();
await codeGen.Run(); // Full generation
await codeGen.Run(true); // Skip database operations

Constructors

Methods

Constructors

Methods

  • Main entry point for the complete code generation process.

    Orchestrates the entire pipeline from database schema analysis to final code output. The process is highly configurable through the configuration file and can be partially skipped for faster iteration during development.

    Process Flow:

    1. Initialize data sources and user context
    2. Execute pre-generation commands and scripts
    3. Manage metadata and schema changes
    4. Generate SQL objects (views, procedures, indexes)
    5. Generate TypeScript entity classes
    6. Generate Angular UI components
    7. Generate GraphQL API resolvers
    8. Generate Action business logic classes
    9. Create documentation JSON
    10. Run integrity checks
    11. Execute post-generation commands

    Parameters

    • skipDatabaseGeneration: boolean = false

      If true, skips all database-related operations (metadata management, SQL generation). Useful for faster UI-only regeneration.

    Returns Promise<void>

    Promise that resolves when generation is complete

    Throws

    Error if any critical step fails

  • Sets up the SQL Server data source and initializes the MemberJunction core metadata. This method establishes the database connection pool and configures the data provider that will be used throughout the code generation process.

    Override this method to customize the data source setup process for different database providers or connection configurations.

    Returns Promise<SQLServerDataProvider>

    Promise resolving to the configured SQLServerDataProvider instance

    Throws

    Error if connection setup fails