shipseal 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -312,18 +312,13 @@ function deterministicCopy(facts, maxHighlights = 4) {
312
312
  const tagline = facts.project.tagline?.value;
313
313
  const subheadline = tagline !== void 0 && tagline.length > 0 ? cleanLine(tagline) : cleanLine(features[1] ?? fixes[1] ?? fixes[0] ?? `What's new in ${version ?? name}`);
314
314
  const highlights = [];
315
- for (const line of features) {
316
- if (highlights.length >= maxHighlights) break;
317
- highlights.push(cleanLine(line));
318
- }
319
- for (const line of fixes) {
320
- if (highlights.length >= maxHighlights) break;
321
- highlights.push(cleanLine(line));
322
- }
323
- for (const line of breaking) {
324
- if (highlights.length >= maxHighlights) break;
325
- highlights.push(`Breaking: ${cleanLine(line)}`);
326
- }
315
+ const addHighlight = (line, prefix = "") => {
316
+ if (highlights.length >= maxHighlights) return;
317
+ highlights.push(`${prefix}${cleanLine(firstSentence(line))}`);
318
+ };
319
+ for (const line of breaking) addHighlight(line, "Breaking: ");
320
+ for (const line of features) addHighlight(line);
321
+ for (const line of fixes) addHighlight(line);
327
322
  return {
328
323
  headline,
329
324
  subheadline,
@@ -369,7 +364,7 @@ function firstSentence(text) {
369
364
  return /^(.+?[.?!])\s+[A-Z]/.exec(collapsed)?.[1] ?? collapsed;
370
365
  }
371
366
  function cleanLine(text) {
372
- const stripped = text.replaceAll("", ":").replaceAll("–", "-").replaceAll("!", ".").trim();
367
+ const stripped = text.replace(/\s*\u2014\s*/g, ": ").replace(/\s+\u2013\s+/g, ", ").replaceAll("–", "-").replaceAll("!", ".").replace(/\s+/g, " ").trim();
373
368
  const noTrail = stripped.endsWith(".") ? stripped.slice(0, -1) : stripped;
374
369
  const first = noTrail.at(0);
375
370
  if (first === void 0) return noTrail;
@@ -1965,7 +1960,7 @@ function listItems(block) {
1965
1960
  let current;
1966
1961
  for (const raw of block.split("\n")) {
1967
1962
  const trimmed = raw.trim();
1968
- if (trimmed.startsWith("- ") || trimmed.startsWith("* ")) {
1963
+ if (!/^\s+/.test(raw) && (trimmed.startsWith("- ") || trimmed.startsWith("* "))) {
1969
1964
  if (current !== void 0) items.push(current);
1970
1965
  current = trimmed;
1971
1966
  continue;