@intellectual-frontiers/libraries 0.2.1 → 0.4.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/src/versions.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * `versions`, how works are versioned (commons 0026-works-versioning): `check` finds a work whose files changed since the base and whose version did not grow by its scheme, `bump` writes the next
2
+ * `versions`, how works are versioned (commons 0026-works-versioning): `check` finds a record that is wrong, an identity that changed and a version that went back since the base (a version grows at the release, `release.ts`, and not at every push), `bump` writes the next
3
3
  * version into a work's record, `tag` creates the annotated (and, where Git is set to sign, signed) tag `<slug>-v<version>`, `notes` prints the release notes from the capabilities closed since the
4
4
  * last tag, `cite` writes `CITATION.cff` from the record, and `ledger` derives the ledger of releases from the tags.
5
5
  *
@@ -44,7 +44,6 @@ import {
44
44
  createTag,
45
45
  editionFacts,
46
46
  findBase,
47
- changedBetween,
48
47
  isAncestor,
49
48
  isDirty,
50
49
  isRepository,
@@ -149,7 +148,7 @@ const LEDGER = {
149
148
  };
150
149
 
151
150
  const HELP_SUMMARY: Readonly<Record<(typeof COMMANDS)[number], string>> = {
152
- check: "Find a work whose files changed and whose version did not grow.",
151
+ check: "Find a record that is wrong, an identity that changed and a version that went back (versions grow at the release).",
153
152
  bump: "Write the next version into a work's record.",
154
153
  tag: "Create the annotated tag of a work's version.",
155
154
  notes: "Print the release notes from the capabilities closed since the last tag.",
@@ -230,14 +229,11 @@ export async function checkVersions(repo: string, rev = "origin/main"): Promise<
230
229
  const baseTree =
231
230
  base.value.kind === "commit" ? await readTree(repo, base.value.commit) : ok<TreeFacts>({ paths: [], records: new Map() });
232
231
  if (baseTree.kind === "err") return notRunBecause(formatGitError(baseTree.error));
233
- const changed =
234
- base.value.kind === "commit" ? await changedBetween(repo, base.value.commit, headCommit.value) : ok<readonly string[]>([]);
235
- if (changed.kind === "err") return notRunBecause(formatGitError(changed.error));
236
232
  const editions = await editionFacts(repo, editionsNeeded(head.value, baseTree.value), headCommit.value);
237
233
  if (editions.kind === "err") return notRunBecause(formatGitError(editions.error));
238
234
  return {
239
235
  kind: "judged",
240
- findings: sortFindings(judgeWorks({ head: head.value, base: baseTree.value, changed: changed.value, editions: editions.value })),
236
+ findings: sortFindings(judgeWorks({ head: head.value, base: baseTree.value, changed: [], editions: editions.value })),
241
237
  works: workFolders(head.value.paths).length,
242
238
  from: base.value.kind === "commit" ? `the base ${base.value.commit.slice(0, 12)}` : "no base (the first commit)",
243
239
  };