Preheat oven to 350°F (175°C) and line a 12-cup muffin tin.
Whisk together all dry ingredients in a large bowl.
In another bowl, whisk oil, eggs, and vanilla until smooth.
Gently mix wet ingredients into dry ingredients until just combined.
Fold in grated carrots and optional pineapple, nuts, and raisins.
Fill liners ⅔ full and bake 18–22 minutes, until a toothpick comes out clean.
Cool 5 minutes in pan, then transfer to a wire rack to cool completely.
Beat cream cheese and butter until smooth; add powdered sugar, vanilla, and salt and beat until fluffy.
Frost cooled cupcakes, garnish if desired, and serve or store airtight.