eve-hub 0.5.3 → 0.5.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # eve-hub
2
2
 
3
+ ## 0.5.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 8f951a0: Change explainer: a `prs[]` entry without `number` publishes as a commit range (no fake PR number), and step names may index with brackets, e.g. `CODES[code]`.
8
+
3
9
  ## 0.5.3
4
10
 
5
11
  ### Patch Changes
@@ -21,14 +21,15 @@ export function firstSentence(text = "") {
21
21
  return sentence.length > 220 ? `${sentence.slice(0, 219).replace(/\s+\S*$/, "")}…` : sentence;
22
22
  }
23
23
 
24
- // Card fields from the fixture: what the change is, and which commits.
25
- export function cardOf(fixture, overview) {
24
+ // Card fields from the fixture: what the change is, and which commits. A
25
+ // change with no PRs (a local repo) names its branch instead.
26
+ export function cardOf(fixture, overview, branch) {
26
27
  const short = (sha) => String(sha ?? "").slice(0, 9);
27
- const prs = (fixture.prs ?? []).map((p) => `#${p.number}`);
28
+ const prs = (fixture.prs ?? []).filter((p) => p.number !== undefined).map((p) => `#${p.number}`);
28
29
  return {
29
30
  title: fixture.title ?? fixture.id,
30
31
  gist: firstSentence(overview?.thesis),
31
- subtitle: [fixture.repo, prs.join(" ")].filter(Boolean).join(" "),
32
+ subtitle: [fixture.repo, ...(prs.length ? prs : [branch])].filter(Boolean).join(" "),
32
33
  ref: `${short(fixture.base)}..${short(fixture.head)}`,
33
34
  };
34
35
  }
@@ -51,7 +52,7 @@ async function build(source, { sandbox }) {
51
52
  });
52
53
  const listing = await run(sandbox, ["find", data, "-type", "f", "-print0"]);
53
54
  for (const file of listing.split("\0").filter(Boolean)) files.push({ file: `data/${file.slice(data.length + 1)}`, data: await sandbox.readBinaryFile({ path: file }) });
54
- return { files, card: cardOf(fixture, overview), meta: { repo: fixture.repo, base, head, prs: (fixture.prs ?? []).map((p) => p.number) } };
55
+ return { files, card: cardOf(fixture, overview, source.branch), meta: { repo: fixture.repo, base, head, prs: (fixture.prs ?? []).flatMap((p) => p.number ?? []) } };
55
56
  } finally {
56
57
  await sandbox.removePath({ path: work, recursive: true, force: true });
57
58
  }