shipseal 0.0.5 → 0.0.6

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
@@ -307,8 +307,11 @@ function deterministicCopy(facts, maxHighlights = 4) {
307
307
  const features = (facts.release?.features ?? []).map((item) => item.value);
308
308
  const fixes = (facts.release?.fixes ?? []).map((item) => item.value);
309
309
  const breaking = (facts.release?.breaking ?? []).map((item) => item.value);
310
- const headlineSource = breaking[0] ?? features[0] ?? fixes[0];
311
- const headline = headlineSource !== void 0 ? cleanLine(firstSentence(headlineSource)) : version === void 0 ? name : `${name} ${version}`;
310
+ const headline = [
311
+ ...breaking,
312
+ ...features,
313
+ ...fixes
314
+ ].map((line) => cleanLine(firstSentence(line))).find((line) => line.length <= HEADLINE_MAX_CHARS) ?? (version === void 0 ? name : `${name} ${version}`);
312
315
  const tagline = facts.project.tagline?.value;
313
316
  const subheadline = tagline !== void 0 && tagline.length > 0 ? cleanLine(tagline) : cleanLine(features[1] ?? fixes[1] ?? fixes[0] ?? `What's new in ${version ?? name}`);
314
317
  const highlights = [];
@@ -363,6 +366,12 @@ function firstSentence(text) {
363
366
  const collapsed = text.replace(/\s+/g, " ").trim();
364
367
  return /^(.+?[.?!])\s+[A-Z]/.exec(collapsed)?.[1] ?? collapsed;
365
368
  }
369
+ /**
370
+ * Longest headline that fits two lines at the minimum font size on a 1200 wide card.
371
+ * Measured rather than guessed: §13.1 originally said 48, which rejects most real changelog
372
+ * sentences, and the fitting pass comfortably handles more.
373
+ */
374
+ const HEADLINE_MAX_CHARS = 72;
366
375
  function cleanLine(text) {
367
376
  const stripped = text.replace(/\s*\u2014\s*/g, ": ").replace(/\s+\u2013\s+/g, ", ").replaceAll("–", "-").replaceAll("!", ".").replace(/\s+/g, " ").trim();
368
377
  const noTrail = stripped.endsWith(".") ? stripped.slice(0, -1) : stripped;
@@ -1460,7 +1469,9 @@ const releaseHighlights = {
1460
1469
  style: {
1461
1470
  display: "flex",
1462
1471
  flexDirection: "column",
1463
- gap: 16
1472
+ flexGrow: 1,
1473
+ justifyContent: props.highlights.length > 2 ? "flex-start" : "center",
1474
+ gap: props.highlights.length > 2 ? 16 : 20
1464
1475
  },
1465
1476
  children: props.highlights.map((line, index) => {
1466
1477
  const fitted = ctx.fitted[`highlight-${String(index)}`];
@@ -2343,9 +2354,10 @@ async function collectPackageJson(cwd, packagePath = "package.json") {
2343
2354
  const pkg = pkgSchema.safeParse(parsed);
2344
2355
  if (!pkg.success) return {};
2345
2356
  const fetchedAt = (/* @__PURE__ */ new Date()).toISOString();
2346
- const project = { name: fact(stripScope$1(pkg.data.name ?? basenameFromPath(cwd)), {
2357
+ const rawName = pkg.data.private === true ? void 0 : pkg.data.name;
2358
+ const project = { name: fact(stripScope$1(rawName ?? basenameFromPath(cwd)), {
2347
2359
  source: "package-json",
2348
- ref: `${packagePath}#name`,
2360
+ ref: rawName === void 0 ? `${packagePath} directory name` : `${packagePath}#name`,
2349
2361
  fetchedAt
2350
2362
  }) };
2351
2363
  if (pkg.data.description !== void 0 && pkg.data.description.length > 0) project.tagline = fact(pkg.data.description, {