How to Make It
Preheat oven to 425ºF. Heat oil in a Dutch oven over medium. Add onions, thyme, and salt; cook, partially covered, stirring occasionally, until onions caramelize, about 45 minutes. Discard thyme stems. Stir in vinegar and pepper.
Unroll piecrust on a sheet of parchment paper, and use a rolling pin to roll out to a 13-inch circle. Pile onion mixture in middle of circle and spread evenly, leaving a 2-inch border; sprinkle cheese over onion filling. Fold edges of dough over filling.
Whisk together egg and water in a small bowl; brush over dough. Bake in preheated oven until crust is golden, about 20 minutes. Let cool 5 minutes before slicing.