Two-dimensional, meso-resolved numerical simulations are performed to investigate the complete shock-to-detonation transition (SDT) process in a mixture of liquid nitromethane (NM) and air-filled, circular cavities. The shock-induced initiation behaviors resulting from the cases with neat NM, NM with an array of regularly spaced cavities, and NM with randomly distributed cavities are examined. For the case with randomly distributed cavities, hundreds of cavities are explicitly resolved in the simulations using a diffuse-interface approach to treat two immiscible fluids and GPU-enabled parallel computing. Without invoking any empirically calibrated, phenomenological models, the reaction rate in the simulations is governed by Arrhenius kinetics. For the cases with neat NM, the resulting SDT process features a superdetonation that evolves from a thermal explosion after a delay following the passage of the incident shock wave and eventually catches up with the leading shock front. For the cases wherein mesoscale heterogeneities are explicitly considered, a gradual SDT process is captured. These two distinct initiation behaviors for neat NM and heterogeneous NM mixtures agree with experimental findings. Via examining the global reaction rate of the mixture, a unique time scale characterizing the SDT process, i.e., the overtake time, is measured for each simulation. For an input shock pressure less than approximately $9.4~mathrm{GPa}$, the overtake time resulting from a heterogeneous mixture is shorter than that for neat NM. This sensitizing effect is more pronounced for lower input shock pressures. A random distribution of cavities is found to be more effective in enhancing the SDT process than a regular array of cavities. Statistical analysis on the meso-resolved simulation data provides more insights into the mechanism of energy release underlying the SDT process.