https://www.finecooking.com/recipe/salted-dark-chocolate-rugelach
In the bowl of a stand mixer fitted with the paddle attachment (or in a large bowl using a hand-held electric mixer), cream the cream cheese, butter, and sugar on medium speed until light and fluffy, 2 minutes. Add the flour and salt, and then mix just until a smooth dough forms. Divide into 4 equal disks if making crescent shapes or 4 equal squares if making pillow shapes. Wrap in plastic and chill for 1 hour or up to overnight.
Combine the chocolate, butter, sugar, and salt in a heatproof bowl over a small saucepan of simmering water. Whisk until melted and smooth. Cool completely, and chill until the consistency of peanut butter.
Position a rack in the center of the oven, and heat the oven to 375 degree F. Line 2 large rimmed baking sheets with silicone baking mats or parchment lightly coated with cooking spray.
To shape crescents, remove one dough disk from the refrigerator, and place on a lightly floured work surface. Roll into a 9-inch circle. Spread one-fourth of the filling on the dough, leaving a 1/2-inch edge, and then slice into 12 wedges. Roll each wedge into a crescent shape from the outside edge in.
Alternatively, to make pillow shapes, remove one dough square from the refrigerator, and place on a lightly floured work surface. Roll the dough into an 8-inch square. Spread one-fourth of the filling on the dough, leaving a 1/2-inch edge at the top and bottom. Slice the square in half. Starting at a long end, roll each half into a cylinder from the outside in, and then cut each rolled half into six evenly sized pieces.
In a small bowl, whisk the egg and milk. Arrange 12 rugelach on one of the prepared baking sheets. Brush with the egg wash, and dust lightly with the flaky salt, if you like. Bake until golden-brown, 16 to 21 minutes. Repeat with the remaining dough and filling. Cool completely and dust with confectioners' sugar before serving.