What do you want to make & why do you want to prep far in advance?
I think if I wanted to make something with onions and garlic, I would cook/fry them and keep like that in a tupperware in the fridge.
But in practice I prep and cook the full dish.
Onions tend to go off, get sulfuric, once cut.