Prep the pans and oven. Heat oven to 350°F (175°C). Grease and line two 8-inch round cake pans with parchment, or grease a 9x13-inch pan. Lightly dust the sides with flour and tap out excess.
Mix dry ingredients. In a large bowl, whisk flour, baking powder, baking soda, salt, cinnamon, ginger, and nutmeg until well combined.
Combine sugars and wet ingredients. In another bowl, whisk granulated sugar, brown sugar, eggs, oil, applesauce (or pineapple), and vanilla until smooth and slightly thickened, about 30–45 seconds.
Bring it together. Add the wet mixture to the dry ingredients.
Stir gently with a spatula just until a few streaks of flour remain. Do not overmix.
Fold in carrots and add-ins. Stir in the grated carrots and any optional nuts or raisins until evenly distributed and no dry pockets remain.
Fill the pans. Divide the batter evenly between the two round pans, or pour into the 9x13-inch pan. Smooth the top with a spatula.
Bake. For 8-inch rounds, bake 25–30 minutes.
For a 9x13-inch pan, bake 30–35 minutes. The cake is done when the center springs back and a toothpick comes out with a few moist crumbs.
Cool completely. Set pans on a wire rack. Let the cakes cool in the pans for 10 minutes, then run a knife around the edges and turn out onto the rack.
Peel off parchment and cool fully before frosting.
Make the frosting. Beat the cream cheese and butter together until smooth and fluffy, 2–3 minutes. Add vanilla and salt. Gradually beat in powdered sugar, starting with 2 1/2 cups, until creamy and spreadable.
Add more sugar for a thicker frosting.
Assemble. For a layer cake, place one layer on a stand, spread frosting on top, then add the second layer and frost the top and sides. For a 9x13-inch cake, spread frosting over the cooled cake in the pan. Garnish with chopped nuts if you like.