Cook the pasta according to the package directions minus a minute or 2. While the pasta is cooking, make the sauce.
Add 1 tablespoon of the olive oil to a hot skillet. Place the artichoke hearts in a single layer in the pan. Cook until lightly brown, turning as needed, 4-5 minutes. Remove from the pan and set aside.
Add the remaining olive oil to the pan and add the onions and garlic. Cook a few minutes until they soften and smell wonderful.
Add the beans and tomatoes and toss to combine. Add the vegetable stock and cook for 4 minutes or so. If the mixture seems dry, add a little more stock.
Return the Artichokes to the skillet. When the pasta is cooked, reserve one cup of the pasta water. Drain the pasta and add to the skillet.
Add the pasta water, parsley and pepper flakes to the skillet along with the cheese. Toss everything to combine and allow to cook for another few minutes until the cheese has melted.