Member Junction
    Preparing search index...

    Main orchestrator class for the MemberJunction code generation process.

    Index

    Constructors

    Properties

    commandFailures: { context: string; message: string }[] = []

    BEFORE/AFTER external command failures captured during a pipeline run, so the structured result can fail (success=false, non-zero exit) AND report which command failed — instead of the legacy log-only path that exited 0 regardless.

    Methods

    • Core CodeGen pipeline logic shared by Run() and RunInProcess(). Accepts an existing data source — does NOT create connections or call process.exit().

      Parameters

      • dataSource: DataSourceResult
      • skipDatabaseGeneration: boolean = false
      • skipFileGeneration: boolean = false

      Returns Promise<boolean>

    • Record any failed entries from a BEFORE/AFTER command batch, paired by index.

      Parameters

      • phase: string
      • cmds: {
            args: string[];
            command: string;
            timeout?: number | null;
            when: string;
            workingDirectory: string;
        }[]
        • args: string[]

          Command line arguments

        • command: string

          The command to execute

        • Optionaltimeout?: number | null

          Optional timeout in milliseconds

        • when: string

          When to run the command (e.g., 'before', 'after')

        • workingDirectory: string

          Working directory to run the command from

      • results: CommandExecutionResult[]

      Returns void

    • Parameters

      • skipDatabaseGeneration: boolean = false
      • skipFileGeneration: boolean = false

      Returns Promise<void>

    • Runs the file-generation phase of CodeGen: GraphQL resolvers, entity subclasses (core + non-core), Angular components, DB schema JSON, and action subclasses. Extracted so the caller can skip this phase entirely via --skipfiles / skip_file_generation = true without re-indenting the existing generator logic.

      Parameters

      Returns Promise<boolean>

      true on success, false if any generator reported a fatal error.

    • Run CodeGen in-process with an existing data source. Does NOT create a new DB connection or call process.exit(). Designed for use by RuntimeSchemaManager inside a running MJAPI process.

      Parameters

      • dataSource: DataSourceResult
      • skipDatabaseGeneration: boolean = false
      • OptionalworkingDirectory: string
      • skipFileGeneration: boolean = false

      Returns Promise<boolean>

    • Run CodeGen and return a structured MJCLIResult instead of calling process.exit(). Used by the pluggable mj codegen plugin so the runtime host can render the result per --format before the CLI exits.

      Parameters

      • skipDatabaseGeneration: boolean = false
      • skipFileGeneration: boolean = false

      Returns Promise<MJCLIResult>

    • Acquire the per-platform data source for a CodeGen run.

      Dispatches via MJGlobal.Instance.ClassFactory.CreateInstance(CodeGenDatabaseProvider, platform) — the same factory pattern used elsewhere in CodeGen (see e.g. manage-metadata.ts's get dbProvider()). The actual pool / provider / user-loading lives on the resolved subclass's SetupDataSource() method, so adding a new platform means registering a new provider, not touching the orchestrator.

      Throws when no provider is registered for configInfo.dbPlatformClassFactory.CreateInstance returns the abstract base on a missed lookup, so we disambiguate by constructor identity.

      Returns Promise<DataSourceResult>