UNPKG

commit-helper-cli

Version:

CLI para padronizar mensagens de commit com tipos, escopos e integração com tarefas (ClickUp, Trello etc).

17 lines (13 loc) 522 B
export function buildCommitMessage({ type, scope, title, body, taskId, config }) { const emoji = type.emoji ? `${type.emoji} ` : ""; const scopeText = scope ? `(${scope})` : ""; let message = `${type.value}${scopeText}: ${emoji}${title.trim()}`; if (body && body.trim()) { message += `\n\n${body.trim()}`; } if (taskId && taskId.trim()) { const url = config.taskUrl?.replace("{id}", taskId.trim()) || ""; message += `\n\nRefs: ${taskId.trim()}${url ? ` (${url})` : ""}`; } return message; }