   fix:      "Bug Fixes"
   feature:  "Features"
   breaking: "Breaking Changes"
+  refactor: "Optimization"
 
 linkToIssue  = (issue) -> util.format issueLink, issue, issue
 linkToCommit = (hash) -> util.format commitLink, hash.substr(0, 8), hash


writeChangeLog = (stream, commits, version) ->
  sections =
    fix:    {}
    feature: {}
    breaking: {}

  for commit in commits

  message = commit.join " "
  if match = message.match /^([^\(]+)\(([\w\.]+)\):\s+(.+)/
    commitObj.type =
      if match[1] in ["fix", "feature", "refactor"] then match[1] else "breaking"

    commitObj.component = match[2]
    commitObj.message   = match[3]
