ProtectedbuildResolve dirty-schema emit options for one generator call.
--skipdb (files only) and fileEmit.dirtySchemaOnly === false rebuild
every schema; write-if-changed still keeps mtimes stable. A full run with
no new/modified entities yields an empty Set — the generator then only
writes schema files that are missing.
ProtectedexecuteCore CodeGen pipeline logic shared by Run() and RunInProcess(). Accepts an existing data source — does NOT create connections or call process.exit().
ProtectedrecordRecord any failed entries from a BEFORE/AFTER command batch, paired by index.
Returns just this batch's failures. Callers log what they get back rather than walking
commandFailures, which accumulates across phases — iterating the whole array in the
AFTER handler re-logged every BEFORE failure a second time.
Command line arguments
The command to execute
OptionalisDaemon?: boolean | nullMarks a long-running service that never exits on its own (e.g. npm start).
For these, reaching timeout without having crashed IS the pass — the command
is a boot check and the timeout is the observation window. Exiting before the
timeout is still a failure, because a service that comes down on its own
crashed. Requires a positive timeout; without one the process would never be
killed and CodeGen would wait forever.
Optionaltimeout?: number | nullOptional timeout in milliseconds
When to run the command (e.g., 'before', 'after')
Working directory to run the command from
ProtectedRecordRecords a step failure for the end-of-run list, and logs it now.
ProtectedrunRuns 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.
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.
OptionalworkingDirectory: stringRun 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.
Use SetupDataSource.
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.dbPlatform —
ClassFactory.CreateInstance returns the abstract base on a missed
lookup, so we disambiguate by constructor identity.
StaticCRUDStaticFormatFormats the end-of-run failure list. Returns an empty string when there are none.
StaticSkipTrue when a CORE file-generation pass has no in-scope entities, so it must not run (#3384). Those
passes rewrite whole files from the entity list, so running one on an empty list (the core schema
left out of includeSchemas, or excluded) would empty its output. The skip is logged as a warning.
name of the pass, for the log
the pass's scope-narrowed entity list
Every step failure captured during a pipeline run: BEFORE/AFTER commands, SQL scripts, metadata management, the SQL pass, validators, file generation and integrity checks. The pipeline runs every step to the end, then fails (success=false, non-zero exit) with this full list, instead of stopping at the first failure or logging and reporting success.