Member Junction
    Preparing search index...

    Checkpoint state manager for the MJ installer.

    Tracks per-phase completion status and persists it to a JSON file in the install target directory. The engine writes checkpoint state after each phase so that interrupted installs can be resumed from the last completed phase.

    const state = new InstallState('/path/to/install', 'v5.1.0');
    state.MarkCompleted('preflight');
    state.MarkCompleted('scaffold');
    await state.Save();

    // Later, resume:
    const loaded = await InstallState.Load('/path/to/install');
    console.log(loaded?.GetPhaseStatus('preflight')); // 'completed'
    console.log(loaded?.GetPhaseStatus('configure')); // 'pending'
    Index

    Constructors

    Accessors

    Methods

    • Find the first phase that is neither completed nor skipped. Used by the engine to determine the resume point after loading checkpoint state.

      Parameters

      • orderedPhases: PhaseId[]

        Ordered list of all phase identifiers.

      Returns PhaseId

      The first incomplete phase ID, or null if all phases are done.

    • Persist the current state to disk as .mj-install-state.json. Called by the engine after each phase completes, fails, or is skipped.

      Returns Promise<void>

      Error if the file cannot be written (e.g., permission denied).

    • Check whether a checkpoint state file exists at the given directory.

      Parameters

      • dir: string

        Directory to check.

      Returns Promise<boolean>

      true if .mj-install-state.json exists and is accessible.