@intellectual-frontiers/libraries 0.1.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/dist/affected.d.ts +15 -2
- package/dist/affected.js +51 -20
- package/dist/dev.d.ts +81 -0
- package/dist/dev.js +347 -0
- package/dist/family.d.ts +58 -0
- package/dist/family.js +124 -0
- package/dist/generate-ontology.d.ts +2 -0
- package/dist/generate-ontology.js +33 -1
- package/dist/generate-workflows.js +2 -10
- package/dist/libraries.d.ts +8 -0
- package/dist/libraries.js +30 -4
- package/dist/link.d.ts +12 -0
- package/dist/link.js +98 -0
- package/dist/oscal-register.d.ts +2 -1
- package/dist/oscal-register.js +112 -88
- package/dist/pack-library.js +6 -1
- package/dist/plan.d.ts +28 -0
- package/dist/plan.js +135 -0
- package/dist/releasing.d.ts +176 -0
- package/dist/releasing.js +680 -0
- package/dist/versions.js +4 -7
- package/dist/workflows/definitions.d.ts +33 -30
- package/dist/workflows/definitions.js +200 -272
- package/dist/workflows/model.d.ts +15 -3
- package/dist/workflows/render.js +10 -2
- package/package.json +24 -4
- package/src/affected.ts +56 -17
- package/src/dev.ts +368 -0
- package/src/family.ts +143 -0
- package/src/generate-ontology.ts +34 -1
- package/src/generate-workflows.ts +3 -11
- package/src/libraries.ts +35 -3
- package/src/link.ts +97 -0
- package/src/oscal-register.ts +139 -117
- package/src/pack-library.ts +6 -1
- package/src/plan.ts +143 -0
- package/src/releasing.ts +735 -0
- package/src/versions.ts +3 -7
- package/src/workflows/definitions.ts +260 -387
- package/src/workflows/model.ts +11 -3
- package/src/workflows/render.ts +10 -2
package/dist/versions.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `versions`, how works are versioned (commons 0026-works-versioning): `check` finds a
|
|
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
|
*
|
|
@@ -29,7 +29,7 @@ import { stdio } from "@intellectual-frontiers/system";
|
|
|
29
29
|
import { dayOf, decodeHarnessRecord, formatRecordError } from "@intellectual-frontiers/mizan/changes/declaration";
|
|
30
30
|
import { citationOf } from "@intellectual-frontiers/mizan/versions/cite";
|
|
31
31
|
import { releaseGate } from "@intellectual-frontiers/mizan/versions/gate";
|
|
32
|
-
import { commitsSince, commitSeconds, createTag, editionFacts, findBase,
|
|
32
|
+
import { commitsSince, commitSeconds, createTag, editionFacts, findBase, isAncestor, isDirty, isRepository, readTags, readTree, readWorkingTree, resolveCommit, signingConfigured, tagAncestry, tagsMerged, text as gitText, } from "@intellectual-frontiers/mizan/versions/git";
|
|
33
33
|
import { editionsNeeded, judgeWorks, recordFindings, versionProblems, } from "@intellectual-frontiers/mizan/versions/judge";
|
|
34
34
|
import { lastRelease, ledgerJson, ledgerText, readEarlier, readLedger, tagNameOf, } from "@intellectual-frontiers/mizan/versions/ledger";
|
|
35
35
|
import { impactOfCommits, notesOf } from "@intellectual-frontiers/mizan/versions/notes";
|
|
@@ -85,7 +85,7 @@ const LEDGER = {
|
|
|
85
85
|
against: value({ help: "An earlier `ledger --json` output: a tag of it that moved or is gone is a finding.", valueName: "FILE" }),
|
|
86
86
|
};
|
|
87
87
|
const HELP_SUMMARY = {
|
|
88
|
-
check: "Find a
|
|
88
|
+
check: "Find a record that is wrong, an identity that changed and a version that went back (versions grow at the release).",
|
|
89
89
|
bump: "Write the next version into a work's record.",
|
|
90
90
|
tag: "Create the annotated tag of a work's version.",
|
|
91
91
|
notes: "Print the release notes from the capabilities closed since the last tag.",
|
|
@@ -157,15 +157,12 @@ export async function checkVersions(repo, rev = "origin/main") {
|
|
|
157
157
|
const baseTree = base.value.kind === "commit" ? await readTree(repo, base.value.commit) : ok({ paths: [], records: new Map() });
|
|
158
158
|
if (baseTree.kind === "err")
|
|
159
159
|
return notRunBecause(formatGitError(baseTree.error));
|
|
160
|
-
const changed = base.value.kind === "commit" ? await changedBetween(repo, base.value.commit, headCommit.value) : ok([]);
|
|
161
|
-
if (changed.kind === "err")
|
|
162
|
-
return notRunBecause(formatGitError(changed.error));
|
|
163
160
|
const editions = await editionFacts(repo, editionsNeeded(head.value, baseTree.value), headCommit.value);
|
|
164
161
|
if (editions.kind === "err")
|
|
165
162
|
return notRunBecause(formatGitError(editions.error));
|
|
166
163
|
return {
|
|
167
164
|
kind: "judged",
|
|
168
|
-
findings: sortFindings(judgeWorks({ head: head.value, base: baseTree.value, changed:
|
|
165
|
+
findings: sortFindings(judgeWorks({ head: head.value, base: baseTree.value, changed: [], editions: editions.value })),
|
|
169
166
|
works: workFolders(head.value.paths).length,
|
|
170
167
|
from: base.value.kind === "commit" ? `the base ${base.value.commit.slice(0, 12)}` : "no base (the first commit)",
|
|
171
168
|
};
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
* are written once, the workflow of each library of commons is made from its manifest, and the rest are written here as values. Nothing is read from a file but the manifests, and nothing is written.
|
|
4
4
|
*
|
|
5
5
|
* @remarks
|
|
6
|
-
* `workflows(
|
|
7
|
-
*
|
|
8
|
-
* The workflows run on the same triggers, with the same jobs and steps and the same names as the hand-written ones they replaced, so that the names of their checks do not change.
|
|
6
|
+
* `workflows()` gives every workflow, in the order of their files' names; the libraries are proved by one workflow, `ci`, whose plan reads which libraries a change affects and runs a matrix of those (the folder, the
|
|
7
|
+
* name and the `verify` command of a manifest, 0027-commons-libraries FR-012, and what else the library needs from `LIBRARY_CI`, the facts of CI that a manifest does not hold: a library without a record has `verify` on Linux and nothing else).
|
|
9
8
|
*
|
|
10
9
|
* @limits
|
|
11
10
|
* It does not run a workflow or read one; a library that registers needs no entry of `LIBRARY_CI` unless its CI is more than `verify`.
|
|
@@ -14,7 +13,7 @@
|
|
|
14
13
|
*
|
|
15
14
|
* @module
|
|
16
15
|
*/
|
|
17
|
-
import { type CompositeAction, type
|
|
16
|
+
import { type CompositeAction, type Workflow } from "./model.js";
|
|
18
17
|
/** The versions the workflows pin (FR-005): each once. */
|
|
19
18
|
export declare const PIN: {
|
|
20
19
|
readonly checkout: "actions/checkout@v4";
|
|
@@ -30,36 +29,40 @@ export declare const PIN: {
|
|
|
30
29
|
export declare const NODE_VERSION = "26.13.1";
|
|
31
30
|
/** The canary of Bun that runs the linter until a release does (FR-028 of 0005-typescript-runtime). */
|
|
32
31
|
export declare const BUN_LINT_VERSION = "1.4.4-canary.20261115.1";
|
|
33
|
-
/**
|
|
34
|
-
export type
|
|
35
|
-
|
|
36
|
-
readonly verify: string;
|
|
37
|
-
/** The paths whose change affects it, which the library's workflow runs on (0027-commons-libraries FR-022). */
|
|
38
|
-
readonly paths: readonly string[];
|
|
39
|
-
/** Where it is published (0027-commons-libraries FR-015 to FR-017): the registries, `github` and, where a decision says so, `npm`. */
|
|
40
|
-
readonly distribution: readonly string[];
|
|
41
|
-
};
|
|
42
|
-
/** What a library's CI needs that its manifest does not say. */
|
|
32
|
+
/** The systems other than Linux that a library's CI may ask for: only a library with code of its own for one of them (paths, processes, sockets, scheduled jobs) names it. */
|
|
33
|
+
export type OtherSystem = "windows-latest" | "macos-latest";
|
|
34
|
+
/** What a library's CI needs that its manifest does not say: Linux and `verify` are for every library, and these are the rest. */
|
|
43
35
|
export type LibraryCi = {
|
|
44
|
-
/** The
|
|
45
|
-
readonly comment: string;
|
|
46
|
-
/** The steps after `verify`, in the job `verify`. */
|
|
47
|
-
readonly afterVerify?: readonly Step[];
|
|
48
|
-
/** The command that runs the tests on Node 26, the backup runtime, in a job of its own. */
|
|
36
|
+
/** The command that runs the tests on Node 26, the backup runtime, in the same job as `verify`. */
|
|
49
37
|
readonly nodeTests?: string;
|
|
50
|
-
/**
|
|
51
|
-
readonly
|
|
38
|
+
/** A command that runs after `verify`, in the same job. */
|
|
39
|
+
readonly after?: string;
|
|
40
|
+
/** The systems besides Linux where `verify` and the tests on Node run too, because the library has code of its own for them. */
|
|
41
|
+
readonly systems?: readonly OtherSystem[];
|
|
52
42
|
};
|
|
53
|
-
/** The facts of CI of the libraries that have more than `verify
|
|
43
|
+
/** The facts of CI of the libraries that have more than `verify` on Linux, by the library's name; a library with no record has `verify` on Linux only. */
|
|
54
44
|
export declare const LIBRARY_CI: Readonly<Record<string, LibraryCi>>;
|
|
55
|
-
/**
|
|
56
|
-
export
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
*/
|
|
61
|
-
|
|
45
|
+
/** A cell of the matrix of a job of `ci`: a library, and where it runs where it is not on Linux. */
|
|
46
|
+
export type Cell = {
|
|
47
|
+
readonly name: string;
|
|
48
|
+
readonly folder: string;
|
|
49
|
+
readonly verify: string;
|
|
50
|
+
/** The command that runs the tests on Node 26, or the empty string. */
|
|
51
|
+
readonly node: string;
|
|
52
|
+
/** The command that runs after `verify`, or the empty string. */
|
|
53
|
+
readonly after: string;
|
|
54
|
+
/** Whether the packing is checked in this cell: the library changed its `exports` (or the packer changed), or the run is of everything. A push does not pack otherwise; the release does. */
|
|
55
|
+
readonly pack: boolean;
|
|
56
|
+
/** The runner, for a cell that is not on Linux. */
|
|
57
|
+
readonly os?: OtherSystem;
|
|
58
|
+
};
|
|
59
|
+
/** The cell of a library on a system (`ubuntu-latest`, where it names none), from its manifest and its record of CI; `pack` says whether the packing is checked in it. */
|
|
60
|
+
export declare function cellOf(l: {
|
|
61
|
+
readonly name: string;
|
|
62
|
+
readonly folder: string;
|
|
63
|
+
readonly verify: string;
|
|
64
|
+
}, os?: OtherSystem, pack?: boolean): Cell;
|
|
62
65
|
/** Every workflow, the libraries'' made from their manifests, in the order of their files' names. */
|
|
63
|
-
export declare function workflows(
|
|
66
|
+
export declare function workflows(): readonly Workflow[];
|
|
64
67
|
/** The composite actions of `.github/actions/`: the pinned Bun, which every workflow uses. */
|
|
65
68
|
export declare const ACTIONS: readonly CompositeAction[];
|