The d3-geomap package comes bundled with several TopoJSON files, including one for the whole world with country borders and different TopoJSON files for many countries with administrative regions, such as states or provinces.
If you need to create your own TopoJSON files from a shapefile, I recommend using mapshaper. See the Makefile in d3-geomap's source repository for how the TopoJSON files in this package were created.