@archme/cli 0.25.3 → 0.26.0

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
@@ -18982,14 +18982,15 @@ function observeGithubPull(p) {
18982
18982
  // Before the merge it is GitHub's throwaway test merge.
18983
18983
  mergeCommitSha: p.merged_at ? p.merge_commit_sha ?? null : null,
18984
18984
  headRepo: p.head.repo?.full_name ?? null,
18985
- baseRepo: p.base.repo?.full_name ?? null
18985
+ baseRepo: p.base.repo?.full_name ?? null,
18986
+ draft: p.draft === true
18986
18987
  };
18987
18988
  }
18988
18989
  function metaKey(o2) {
18989
18990
  return createHash3("sha256").update(JSON.stringify([o2.title, o2.body])).digest("hex").slice(0, 16);
18990
18991
  }
18991
18992
  function record(o2, prev, action) {
18992
- const r = { head: o2.headSha, state: o2.state, meta: metaKey(o2), html: true };
18993
+ const r = { head: o2.headSha, state: o2.state, meta: metaKey(o2), html: true, draft: o2.draft };
18993
18994
  const seq = action === "synchronize" ? (prev?.seq ?? 0) + 1 : prev?.seq;
18994
18995
  if (seq !== void 0) r.seq = seq;
18995
18996
  return r;
@@ -19001,9 +19002,12 @@ function decideAction(prev, o2) {
19001
19002
  if (wasOpen && !isOpen) return "closed";
19002
19003
  if (!wasOpen && isOpen) return "reopened";
19003
19004
  if (isOpen && prev.head !== o2.headSha) return "synchronize";
19005
+ if (isOpen && prev.draft !== void 0 && prev.draft !== o2.draft) {
19006
+ return o2.draft ? "converted_to_draft" : "ready_for_review";
19007
+ }
19004
19008
  if (!isOpen && prev.state !== o2.state) return "edited";
19005
19009
  if (prev.meta !== void 0 && prev.meta !== metaKey(o2)) return "edited";
19006
- if (isOpen && !prev.html) return "edited";
19010
+ if (isOpen && (!prev.html || prev.draft === void 0)) return "edited";
19007
19011
  return null;
19008
19012
  }
19009
19013
  function toItem(o2, action, sent) {
@@ -19023,6 +19027,7 @@ function toItem(o2, action, sent) {
19023
19027
  body_html: o2.bodyHtml,
19024
19028
  head_repo: o2.headRepo,
19025
19029
  ...o2.baseRepo ? { base_repo: o2.baseRepo } : {},
19030
+ draft: o2.draft,
19026
19031
  ...action === "synchronize" && sent.seq !== void 0 ? { seq: sent.seq } : {}
19027
19032
  };
19028
19033
  }
@@ -19072,6 +19077,7 @@ function parsePrPollState(raw) {
19072
19077
  if (typeof r.meta === "string") entry.meta = r.meta;
19073
19078
  if (Number.isInteger(r.seq) && r.seq > 0) entry.seq = r.seq;
19074
19079
  if (r.html === true) entry.html = true;
19080
+ if (typeof r.draft === "boolean") entry.draft = r.draft;
19075
19081
  prs[k] = entry;
19076
19082
  }
19077
19083
  }
@@ -19791,6 +19797,10 @@ async function pollPrsOnce(entry, deps) {
19791
19797
  deps.log(
19792
19798
  fork ? ` ${repo}: PR #${item.number} ${item.action} \u2192 held: it comes from a fork, and a locally watched repo does not review fork pull requests (there is no way to approve one without the GitHub App).` : ` ${repo}: PR #${item.number} ${item.action} \u2192 held: the server did not approve it for review (its head repo could not be confirmed as this repo, e.g. GitHub did not report it).`
19793
19799
  );
19800
+ } else if (kind === "draft_held") {
19801
+ deps.log(
19802
+ ` ${repo}: PR #${item.number} ${item.action} \u2192 draft: not reviewed until it is marked ready for review, or Scan is pressed in ArchMe.`
19803
+ );
19794
19804
  } else if (kind !== void 0) {
19795
19805
  deps.log(` ${repo}: PR #${item.number} ${item.action} \u2192 ${kind}`);
19796
19806
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@archme/cli",
3
- "version": "0.25.3",
3
+ "version": "0.26.0",
4
4
  "description": "Map your codebase into a living architecture diagram: run `archme init` in a repo to scan it, `archme daemon start` to keep it current on every commit.",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "image": "ghcr.io/architectme/archme-job",
3
- "digest": "sha256:46805fb6e8c6d858d5139da90026a47041ddb492304e4b316b9ef3097d4fdc2f"
3
+ "digest": "sha256:eba064bd85a35bf697038defe2bfcadad4c508bc810ef552431344760874e061"
4
4
  }