Thought the question was regarding specific books that teach programming via small projects it's worth mentioning a related topic here.
A Common Sense Guide to Data Structures and Algorithms by Jay Wengrow * 2nd Edition * not only covers the theory really well but goes on to provide code examples in popular high level languages explaining when and how best to use them usefully. At the end of each section are prompts where you extend the lesson into a small project and each chapter builds on the last. The author has a github repo so you can compare your project solution to his. It made a rather dry topic extremely fun and approachable.
A Common Sense Guide to Data Structures and Algorithms by Jay Wengrow * 2nd Edition * not only covers the theory really well but goes on to provide code examples in popular high level languages explaining when and how best to use them usefully. At the end of each section are prompts where you extend the lesson into a small project and each chapter builds on the last. The author has a github repo so you can compare your project solution to his. It made a rather dry topic extremely fun and approachable.