function writeZip(writer, files, comment = '') {
  const encodedFiles = files.map(encodeFile);
  const compressedFiles = encodedFiles.map(compressFileWithStore);
  // TODO collate directoryRecords from file bases.
  const fileRecords = compressedFiles.map(makeFileRecord);
  writeZipRecords(writer, fileRecords, comment);
}
@param {BufferWriter} writer
@param {Array<import('./types.js').ArchivedFile>} files
@param {string} comment