Preheat the oven to fan 200C/ conventional 220C/gas 7. Roll out the pastry thinly and cut out a 24cm square. Cut into three, then in half to make six rectangles, and transfer to a baking sheet. Prick all over with a fork, brush with a little beaten egg and sprinkle with half the thyme. Bake for 12-15 minutes until pale golden, then press the pastries down lightly to flatten slightly and leave to cool on a wire rack.
Heat 3 tbsp of the olive oil in a small pan, add the onions and the remaining thyme and season with salt and pepper. Cook very gently, stirring often, for about 30 minutes until the onions are completely softened but not coloured. Remove from the heat and leave to cool.
Spread out the peppers over the grill pan, skin side up. Grill until the skins are evenly blackened. When cool enough, peel off the skins. Transfer to a dish and set aside.
Cut the aubergine into 12 slices and spread out over the grill pan. Brush lightly with olive oil and heat under the grill until lightly coloured, then turn over, brush again with olive oil and grill until just tender. Transfer to a dish, drizzle with a little more olive oil and add the garlic. Stir gently and leave to cool. (Up to this point, everything can be prepared up to a day ahead. Wrap the pastry in foil, cover the vegetables and store in the fridge.)
Up to an hour before serving, set the pastry rectangles on a baking sheet and spread each with a thin layer of onion. Arrange the yellow peppers, aubergine and tomatoes on top. Season with salt and pepper, drizzle with a little basil oil and bake for 5-8 minutes until warmed through. To serve, transfer to serving plates and pile a small handful of rocket on the side. Drizzle each portion with lemon juice and a little more basil oil.