Prep the pan and oven: Heat the oven to 350°F (175°C). Grease and line a 9x13-inch pan with parchment, or grease two 8-inch round cake pans and line the bottoms.
Mix dry ingredients: In a large bowl, whisk flour, brown sugar, granulated sugar, cinnamon, nutmeg, baking powder, baking soda, and salt until no lumps remain.
Add wet ingredients: Whisk in eggs, oil, applesauce, and vanilla until just combined.
The batter will be thick but spreadable.
Fold in carrots and add-ins: Stir in grated carrots and, if using, pineapple, nuts, and raisins. Mix gently to avoid overworking the batter.
Bake: Spread evenly in the pan. Bake 28–35 minutes for a 9x13 or 22–28 minutes for 8-inch rounds, until the center springs back and a toothpick comes out clean with a few moist crumbs.
Cool completely: Let the cake cool in the pan for 10 minutes, then transfer to a rack to cool fully before frosting.
Make the frosting: Beat cream cheese and butter until smooth and fluffy, 2–3 minutes.
Add powdered sugar, vanilla, and salt. Beat until creamy and spreadable. Adjust sugar to your preferred sweetness.
Frost: For a 9x13, spread frosting over the cooled cake.
For layers, frost between layers and over the top and sides.
Finish: Sprinkle with chopped nuts or a light dusting of cinnamon if you like. Slice and serve.