@mark1russell7/site-pages 0.2.2 → 0.2.3

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.
@@ -0,0 +1,212 @@
1
+ /**
2
+ * The data shapes of `releases.json` and `status.json`. The standalone pages read them, and a site
3
+ * can read the same JSON with its own components.
4
+ */
5
+ /** A link with its text, for example a pull request, a commit or a page on npm. */
6
+ interface Link {
7
+ label: string;
8
+ url: string;
9
+ }
10
+ /**
11
+ * The kind of a version. The oldest version is "first". `X.0.0` with `X` of 1 or more is "major".
12
+ * A version with the PATCH number 0 is "minor". Each other version is "patch".
13
+ */
14
+ type ReleaseKind = "first" | "major" | "minor" | "patch";
15
+ /** One change of a release: one commit, and the packages whose changelogs list it. */
16
+ interface ReleaseChange {
17
+ /** The short SHA of the commit, or null for an entry without a commit. */
18
+ commit: string | null;
19
+ /** The first sentence of the entry, as inline Markdown. */
20
+ text: string;
21
+ /** The npm names of the packages, sorted. */
22
+ packages: string[];
23
+ }
24
+ /** One version of the repository. `releases.json` holds an array of them, the newest version first. */
25
+ interface Release {
26
+ version: string;
27
+ /** The ISO date of the version: from the git tag, the GitHub release, npm, or the changelog commit. */
28
+ date: string;
29
+ kind: ReleaseKind;
30
+ /** The changes, the change with the most packages first. */
31
+ changes: ReleaseChange[];
32
+ /** The pages of the version: the GitHub release, the changelog section and the npm page. */
33
+ links: Link[];
34
+ }
35
+ /** A release of the GitHub repository, as `githubReleases` gives it. */
36
+ interface GitHubRelease {
37
+ tag: string;
38
+ name: string;
39
+ /** The text of the release, as Markdown. */
40
+ body: string;
41
+ /** The ISO date of the publication. */
42
+ publishedAt: string;
43
+ url: string;
44
+ prerelease: boolean;
45
+ }
46
+ /** The result of `githubReleases`. Without a token, or after an error, it has only the reason. */
47
+ type GitHubReleases = {
48
+ available: true;
49
+ releases: GitHubRelease[];
50
+ } | {
51
+ available: false;
52
+ reason: string;
53
+ };
54
+ /** The publication time of one version of one package on npm. */
55
+ interface NpmVersionTime {
56
+ name: string;
57
+ version: string;
58
+ date: string;
59
+ }
60
+ /** The result of `npmPublishTimes`: the times that npm gave, and a message for each package that failed. */
61
+ interface NpmPublishTimes {
62
+ times: NpmVersionTime[];
63
+ problems: string[];
64
+ }
65
+ /** The class of a status. The board shows the open classes in this sequence, and "done" last. */
66
+ type StatusClass = "waiting" | "blocked" | "progress" | "open" | "later" | "done";
67
+ /** One row of a table of the roadmap file. The text fields are inline Markdown. */
68
+ interface BoardItem {
69
+ id: string;
70
+ title: string;
71
+ /** The text of the Status cell, as the roadmap has it. */
72
+ status: string;
73
+ statusClass: StatusClass;
74
+ owner?: string;
75
+ area?: string;
76
+ /** The IDs that the item needs, as the roadmap has them. */
77
+ needs?: string;
78
+ /** The nearest heading above the table, as plain text. */
79
+ section: string;
80
+ /** The line of the row in the roadmap file. */
81
+ line: number;
82
+ links: Link[];
83
+ }
84
+ /** The combined state of the checks of the last commit of a pull request. */
85
+ type CheckState = "success" | "failure" | "pending" | "none";
86
+ /** An open pull request of the repository. */
87
+ interface BoardPullRequest {
88
+ number: number;
89
+ title: string;
90
+ url: string;
91
+ author: string;
92
+ branch: string;
93
+ draft: boolean;
94
+ createdAt: string;
95
+ updatedAt: string;
96
+ labels: string[];
97
+ checks: CheckState;
98
+ }
99
+ /** An open issue of the repository. */
100
+ interface BoardIssue {
101
+ number: number;
102
+ title: string;
103
+ url: string;
104
+ author: string;
105
+ createdAt: string;
106
+ updatedAt: string;
107
+ labels: string[];
108
+ }
109
+ /** The numbers of open pull requests and open issues on GitHub. A list can hold fewer than the total. */
110
+ interface OpenWorkTotals {
111
+ pullRequests: number;
112
+ issues: number;
113
+ }
114
+ /** The result of `githubOpenWork`. Without a token, or after an error, it has only the reason. */
115
+ type GitHubOpenWork = {
116
+ available: true;
117
+ pullRequests: BoardPullRequest[];
118
+ issues: BoardIssue[];
119
+ totals: OpenWorkTotals;
120
+ } | {
121
+ available: false;
122
+ reason: string;
123
+ };
124
+ /** One measure of `kpi.json`. */
125
+ interface KpiMeasure {
126
+ /** The name of the measure, in lowercase words with single hyphens. */
127
+ id: string;
128
+ value: number;
129
+ unit?: string;
130
+ }
131
+ /** One engine that made the data of `kpi.json`. */
132
+ interface KpiEngine {
133
+ /** The name of the engine, for example its npm name. */
134
+ name: string;
135
+ version: string;
136
+ }
137
+ /** The content of `kpi.json`, format `kpi/1`. */
138
+ interface KpiFile {
139
+ format: "kpi/1";
140
+ /** The name of the project, in lowercase words with single hyphens. */
141
+ project: string;
142
+ /** The ISO time of the data in UTC, and not the time of the build. */
143
+ at: string;
144
+ /** The full commit of the build. */
145
+ commit: string;
146
+ measures: KpiMeasure[];
147
+ /** The engines that made the data. The Status page shows them. */
148
+ engines?: KpiEngine[];
149
+ }
150
+ /** The data of the status page, as `status.json` holds it. */
151
+ interface StatusBoardData {
152
+ /** The ISO time of the build that read the data. */
153
+ generatedAt: string;
154
+ /** The commit of the build, or null. */
155
+ commit: string | null;
156
+ /** The roadmap file in the repository (null without a roadmap), and the repository on GitHub ("owner/name"). */
157
+ source: {
158
+ roadmap: string | null;
159
+ github: string;
160
+ };
161
+ items: BoardItem[];
162
+ pullRequests: BoardPullRequest[];
163
+ issues: BoardIssue[];
164
+ /** The GitHub part. When GitHub was not available, the board shows the reason. */
165
+ github: {
166
+ available: boolean;
167
+ reason?: string;
168
+ totals?: OpenWorkTotals;
169
+ };
170
+ /** The content of `kpi.json`, when the site has that file. */
171
+ kpi?: KpiFile;
172
+ }
173
+ /** The name of the format. A new format gets a new name, so that an old reader refuses it. */
174
+ declare const KPI_FORMAT = "kpi/1";
175
+ /** The name of the file at the root of the built site. */
176
+ declare const KPI_FILE = "kpi.json";
177
+ /** The data of `kpi.json`, without the name of the format. */
178
+ type KpiInput = Omit<KpiFile, "format">;
179
+ /** An error in the data of `kpi.json`. The field `problems` has one line for each fault. */
180
+ declare class KpiError extends Error {
181
+ readonly problems: readonly string[];
182
+ constructor(problems: readonly string[]);
183
+ }
184
+ /**
185
+ * This function gives the faults of a parsed `kpi.json`, or an empty list.
186
+ *
187
+ * @param value - The parsed file.
188
+ * @param now - The time of the check, in milliseconds. A time of the data after this time is a fault.
189
+ */
190
+ declare function kpiProblems(value: unknown, now?: number): string[];
191
+ /**
192
+ * This function gives the checked content of `kpi.json`. The file has only its known fields, in a fixed order.
193
+ *
194
+ * @throws KpiError when the data is not correct
195
+ */
196
+ declare function kpiFile(input: KpiInput, now?: number): KpiFile;
197
+ /** This function gives the text of `kpi.json`. */
198
+ declare function kpiText(file: KpiFile): string;
199
+ /**
200
+ * This function reads the text of a `kpi.json`.
201
+ *
202
+ * @throws KpiError when the text is not correct
203
+ */
204
+ declare function readKpi(text: string, now?: number): KpiFile;
205
+ /**
206
+ * This function writes `kpi.json` into the built output folder of a site, and gives the path of the file.
207
+ *
208
+ * @throws KpiError when the data is not correct
209
+ */
210
+ declare function writeKpi(out: string, input: KpiInput, now?: number): string;
211
+ export { OpenWorkTotals as C, StatusBoardData as D, ReleaseKind as E, StatusClass as O, NpmVersionTime as S, ReleaseChange as T, KpiEngine as _, kpiFile as a, Link as b, readKpi as c, BoardItem as d, BoardPullRequest as f, GitHubReleases as g, GitHubRelease as h, KpiInput as i, writeKpi as l, GitHubOpenWork as m, KPI_FORMAT as n, kpiProblems as o, CheckState as p, KpiError as r, kpiText as s, KPI_FILE as t, BoardIssue as u, KpiFile as v, Release as w, NpmPublishTimes as x, KpiMeasure as y };
212
+ //# sourceMappingURL=kpi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kpi.d.ts","names":[],"sources":["../../src/data/types.ts","../../src/data/kpi.ts"],"mappings":";;;;;UAMiB;EACf;EACA;;;;;;KAWU;;UAGK;;EAEf;;EAEA;;EAEA;;;UAIe;EACf;;EAEA;EACA,MAAM;;EAEN,SAAS;;EAET,OAAO;;;UAIQ;EACf;EACA;;EAEA;;EAEA;EACA;EACA;;;KAIU;EAAmB;EAAiB,UAAU;;EAAsB;EAAkB;;;UAGjF;EACf;EACA;EACA;;;UAIe;EACf,OAAO;EACP;;;KAQU;;UAGK;EACf;EACA;;EAEA;EACA,aAAa;EACb;EACA;;EAEA;;EAEA;;EAEA;EACA,OAAO;;;KAIG;;UAGK;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,QAAQ;;;UAIO;EACf;EACA;EACA;EACA;EACA;EACA;EACA;;;UAIe;EACf;EACA;;;KAIU;EACN;EAAiB,cAAc;EAAoB,QAAQ;EAAc,QAAQ;;EACjF;EAAkB;;;UAGP;;EAEf;EACA;EACA;;;UAIe;;EAEf;EACA;;;UAIe;EACf;;EAEA;;EAEA;;EAEA;EACA,UAAU;;EAEV,UAAU;;;UAIK;;EAEf;;EAEA;;EAEA;IAAU;IAAwB;;EAClC,OAAO;EACP,cAAc;EACd,QAAQ;;EAER;IAAU;IAAoB;IAAiB,SAAS;;;EAExD,MAAM;;;cCtKK;;cAGA;;KAGD,WAAW,KAAK;;cAef,iBAAiB;WACnB;EAET,YAAY;;;;;;;;iBAqCE,YAAY,gBAAgB;;;;;;iBAiC5B,QAAQ,OAAO,UAAU,eAAe;;iBASxC,QAAQ,MAAM;;;;;;iBASd,QAAQ,cAAc,eAAe;;;;;;iBAkBrC,SAAS,aAAa,OAAO,UAAU"}
@@ -0,0 +1,222 @@
1
+ import { execFileSync } from "node:child_process";
2
+ import { mkdirSync, writeFileSync } from "node:fs";
3
+ import { join } from "node:path";
4
+ // src/data/git.ts
5
+ /**
6
+ * The git source: the tags with their dates, the commit of the build and the GitHub remote. Each
7
+ * function gives an empty result when git or the repository is not available.
8
+ */
9
+ /** This function starts git in a folder and gives its output, or null when git fails. */
10
+ function git(repoDir, ...args) {
11
+ try {
12
+ return execFileSync("git", args, {
13
+ cwd: repoDir,
14
+ encoding: "utf8",
15
+ stdio: [
16
+ "ignore",
17
+ "pipe",
18
+ "ignore"
19
+ ],
20
+ windowsHide: true
21
+ });
22
+ } catch {
23
+ return null;
24
+ }
25
+ }
26
+ /** This function tells if the clone is shallow. A shallow clone has not all the tags and commits. */
27
+ function isShallow(repoDir) {
28
+ return git(repoDir, "rev-parse", "--is-shallow-repository")?.trim() === "true";
29
+ }
30
+ /** This function gives each tag of the repository with its date. An annotated tag has its own date. */
31
+ function gitTagDates(repoDir) {
32
+ const output = git(repoDir, "for-each-ref", "--format=%(refname:strip=2) %(creatordate:iso-strict)", "refs/tags");
33
+ if (!output) return [];
34
+ const tags = [];
35
+ for (const line of output.split(/\r?\n/)) {
36
+ const match = /^(\S+) (\S+)$/.exec(line.trim());
37
+ if (match?.[1] && match[2]) tags.push({
38
+ tag: match[1],
39
+ date: match[2]
40
+ });
41
+ }
42
+ return tags;
43
+ }
44
+ /**
45
+ * This function gives the date of the oldest commit that added a version heading to a changelog,
46
+ * or null. The path of the changelog starts at `repoDir`.
47
+ */
48
+ function headingDate(repoDir, version, file) {
49
+ const dates = (git(repoDir, "log", "--format=%cI", `-S## ${version}`, "--", file) ?? "").trim().split(/\r?\n/).filter(Boolean);
50
+ return dates[dates.length - 1] ?? null;
51
+ }
52
+ /** This function gives the full SHA of `HEAD`, or null. */
53
+ function headCommit(repoDir) {
54
+ const sha = git(repoDir, "rev-parse", "HEAD")?.trim();
55
+ return sha && /^[0-9a-f]{40}$/.test(sha) ? sha : null;
56
+ }
57
+ /** This function gives "owner/name" of the GitHub remote "origin", or null. */
58
+ function originRepository(repoDir) {
59
+ const url = git(repoDir, "remote", "get-url", "origin")?.trim() ?? "";
60
+ const match = /github\.com[:/]([^/]+)\/(.+?)(?:\.git)?\/?$/.exec(url);
61
+ return match ? `${match[1]}/${match[2]}` : null;
62
+ }
63
+ // src/data/kpi.ts
64
+ /**
65
+ * The file `kpi.json` at the root of a site, format `kpi/1`. A reader outside the site takes the measures of the project
66
+ * from this file. Thus a number on a progress page comes from a record and not from a person.
67
+ *
68
+ * The field `at` is the time of the data and not the time of the build. Thus the writer has no default for it.
69
+ */
70
+ /** The name of the format. A new format gets a new name, so that an old reader refuses it. */
71
+ const KPI_FORMAT = "kpi/1";
72
+ /** The name of the file at the root of the built site. */
73
+ const KPI_FILE = "kpi.json";
74
+ /** The form of a project and a measure. A double hyphen separates fields in the file name of a reading. */
75
+ const SLUG = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
76
+ /** The form of a time in UTC, with or without seconds. */
77
+ const UTC_TIME = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?Z$/;
78
+ /** The form of a full commit. */
79
+ const COMMIT = /^[0-9a-f]{40}$/;
80
+ /** The clock difference between two computers that the check accepts, in milliseconds. */
81
+ const CLOCK_MARGIN = 3e5;
82
+ /** An error in the data of `kpi.json`. The field `problems` has one line for each fault. */
83
+ var KpiError = class extends Error {
84
+ problems;
85
+ constructor(problems) {
86
+ super(`${KPI_FILE} is not correct: ${problems.join(" ")}`);
87
+ this.name = "KpiError";
88
+ this.problems = problems;
89
+ }
90
+ };
91
+ const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
92
+ const isText = (value) => typeof value === "string" && value.trim() !== "";
93
+ /** This function gives the faults of one measure. */
94
+ function measureProblems(value, index, seen) {
95
+ if (!isRecord(value)) return [`Measure ${index} is not an object.`];
96
+ const { id, value: amount, unit } = value;
97
+ const problems = [];
98
+ if (typeof id !== "string" || !SLUG.test(id)) problems.push(`Measure ${index} has no id of lowercase words with single hyphens.`);
99
+ else if (seen.has(id)) problems.push(`The id ${id} occurs two times.`);
100
+ else seen.add(id);
101
+ if (typeof amount !== "number" || !Number.isFinite(amount)) problems.push(`Measure ${index} has no finite number as its value.`);
102
+ if (unit !== void 0 && !isText(unit)) problems.push(`Measure ${index} has a unit that is not a text.`);
103
+ return problems;
104
+ }
105
+ /** This function gives the faults of the list of engines. */
106
+ function engineProblems(value) {
107
+ if (value === void 0) return [];
108
+ if (!Array.isArray(value)) return ["The field engines is not a list."];
109
+ return value.flatMap((engine, index) => isRecord(engine) && isText(engine["name"]) && isText(engine["version"]) ? [] : [`Engine ${index} has no name and version.`]);
110
+ }
111
+ /**
112
+ * This function gives the faults of a parsed `kpi.json`, or an empty list.
113
+ *
114
+ * @param value - The parsed file.
115
+ * @param now - The time of the check, in milliseconds. A time of the data after this time is a fault.
116
+ */
117
+ function kpiProblems(value, now = Date.now()) {
118
+ if (!isRecord(value)) return ["The file is not an object."];
119
+ const problems = [];
120
+ if (value["format"] !== "kpi/1") problems.push(`The format is not ${KPI_FORMAT}.`);
121
+ const { project, at, commit, measures } = value;
122
+ if (typeof project !== "string" || !SLUG.test(project)) problems.push("The project is not lowercase words with single hyphens.");
123
+ if (typeof at !== "string" || !UTC_TIME.test(at) || Number.isNaN(Date.parse(at))) problems.push("The field at is not a time in UTC.");
124
+ else if (Date.parse(at) > now + CLOCK_MARGIN) problems.push(`The time of the data ${at} is after the time of the check.`);
125
+ if (typeof commit !== "string" || !COMMIT.test(commit)) problems.push("The commit is not a full commit.");
126
+ if (!Array.isArray(measures) || measures.length === 0) problems.push("The file has no measures.");
127
+ else {
128
+ const seen = /* @__PURE__ */ new Set();
129
+ problems.push(...measures.flatMap((measure, index) => measureProblems(measure, index, seen)));
130
+ }
131
+ problems.push(...engineProblems(value["engines"]));
132
+ return problems;
133
+ }
134
+ /** This function gives a copy of a measure with only its known fields. */
135
+ function cleanMeasure({ id, value, unit }) {
136
+ return unit === void 0 ? {
137
+ id,
138
+ value
139
+ } : {
140
+ id,
141
+ value,
142
+ unit
143
+ };
144
+ }
145
+ /** This function gives a copy of an engine with only its known fields. */
146
+ function cleanEngine({ name, version }) {
147
+ return {
148
+ name,
149
+ version
150
+ };
151
+ }
152
+ /**
153
+ * This function gives the checked content of `kpi.json`. The file has only its known fields, in a fixed order.
154
+ *
155
+ * @throws KpiError when the data is not correct
156
+ */
157
+ function kpiFile(input, now) {
158
+ const problems = kpiProblems({
159
+ format: KPI_FORMAT,
160
+ ...input
161
+ }, now);
162
+ if (problems.length > 0) throw new KpiError(problems);
163
+ const { project, at, commit, measures, engines } = input;
164
+ const file = {
165
+ format: KPI_FORMAT,
166
+ project,
167
+ at,
168
+ commit,
169
+ measures: measures.map(cleanMeasure)
170
+ };
171
+ return engines === void 0 ? file : {
172
+ ...file,
173
+ engines: engines.map(cleanEngine)
174
+ };
175
+ }
176
+ /** This function gives the text of `kpi.json`. */
177
+ function kpiText(file) {
178
+ return `${JSON.stringify(file, null, 2)}\n`;
179
+ }
180
+ /**
181
+ * This function reads the text of a `kpi.json`.
182
+ *
183
+ * @throws KpiError when the text is not correct
184
+ */
185
+ function readKpi(text, now) {
186
+ let value;
187
+ try {
188
+ value = JSON.parse(text);
189
+ } catch (error) {
190
+ throw new KpiError([`The file is not JSON: ${error instanceof Error ? error.message : String(error)}`]);
191
+ }
192
+ const problems = kpiProblems(value, now);
193
+ if (problems.length > 0) throw new KpiError(problems);
194
+ const { project, at, commit, measures, engines } = value;
195
+ return kpiFile(engines === void 0 ? {
196
+ project,
197
+ at,
198
+ commit,
199
+ measures
200
+ } : {
201
+ project,
202
+ at,
203
+ commit,
204
+ measures,
205
+ engines
206
+ }, now);
207
+ }
208
+ /**
209
+ * This function writes `kpi.json` into the built output folder of a site, and gives the path of the file.
210
+ *
211
+ * @throws KpiError when the data is not correct
212
+ */
213
+ function writeKpi(out, input, now) {
214
+ const text = kpiText(kpiFile(input, now));
215
+ mkdirSync(out, { recursive: true });
216
+ const file = join(out, KPI_FILE);
217
+ writeFileSync(file, text);
218
+ return file;
219
+ }
220
+ export { kpiProblems as a, writeKpi as c, headingDate as d, isShallow as f, kpiFile as i, gitTagDates as l, KPI_FORMAT as n, kpiText as o, originRepository as p, KpiError as r, readKpi as s, KPI_FILE as t, headCommit as u };
221
+
222
+ //# sourceMappingURL=kpi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kpi.js","names":[],"sources":["../../src/data/git.ts","../../src/data/kpi.ts"],"sourcesContent":["/**\n * The git source: the tags with their dates, the commit of the build and the GitHub remote. Each\n * function gives an empty result when git or the repository is not available.\n */\n\nimport { execFileSync } from \"node:child_process\";\n\n/** A git tag and the ISO date of its creation. */\nexport interface TagDate {\n tag: string;\n date: string;\n}\n\n/** This function starts git in a folder and gives its output, or null when git fails. */\nexport function git(repoDir: string, ...args: string[]): string | null {\n try {\n return execFileSync(\"git\", args, { cwd: repoDir, encoding: \"utf8\", stdio: [\"ignore\", \"pipe\", \"ignore\"], windowsHide: true });\n } catch {\n return null;\n }\n}\n\n/** This function tells if the clone is shallow. A shallow clone has not all the tags and commits. */\nexport function isShallow(repoDir: string): boolean {\n return git(repoDir, \"rev-parse\", \"--is-shallow-repository\")?.trim() === \"true\";\n}\n\n/** This function gives each tag of the repository with its date. An annotated tag has its own date. */\nexport function gitTagDates(repoDir: string): TagDate[] {\n const output = git(repoDir, \"for-each-ref\", \"--format=%(refname:strip=2) %(creatordate:iso-strict)\", \"refs/tags\");\n if (!output) return [];\n const tags: TagDate[] = [];\n for (const line of output.split(/\\r?\\n/)) {\n const match = /^(\\S+) (\\S+)$/.exec(line.trim());\n if (match?.[1] && match[2]) tags.push({ tag: match[1], date: match[2] });\n }\n return tags;\n}\n\n/**\n * This function gives the date of the oldest commit that added a version heading to a changelog,\n * or null. The path of the changelog starts at `repoDir`.\n */\nexport function headingDate(repoDir: string, version: string, file: string): string | null {\n const output = git(repoDir, \"log\", \"--format=%cI\", `-S## ${version}`, \"--\", file);\n const dates = (output ?? \"\").trim().split(/\\r?\\n/).filter(Boolean);\n return dates[dates.length - 1] ?? null;\n}\n\n/** This function gives the full SHA of `HEAD`, or null. */\nexport function headCommit(repoDir: string): string | null {\n const sha = git(repoDir, \"rev-parse\", \"HEAD\")?.trim();\n return sha && /^[0-9a-f]{40}$/.test(sha) ? sha : null;\n}\n\n/** This function gives \"owner/name\" of the GitHub remote \"origin\", or null. */\nexport function originRepository(repoDir: string): string | null {\n const url = git(repoDir, \"remote\", \"get-url\", \"origin\")?.trim() ?? \"\";\n const match = /github\\.com[:/]([^/]+)\\/(.+?)(?:\\.git)?\\/?$/.exec(url);\n return match ? `${match[1]}/${match[2]}` : null;\n}\n","/**\n * The file `kpi.json` at the root of a site, format `kpi/1`. A reader outside the site takes the measures of the project\n * from this file. Thus a number on a progress page comes from a record and not from a person.\n *\n * The field `at` is the time of the data and not the time of the build. Thus the writer has no default for it.\n */\n\nimport { mkdirSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport type { KpiEngine, KpiFile, KpiMeasure } from \"./types.ts\";\n\n/** The name of the format. A new format gets a new name, so that an old reader refuses it. */\nexport const KPI_FORMAT = \"kpi/1\";\n\n/** The name of the file at the root of the built site. */\nexport const KPI_FILE = \"kpi.json\";\n\n/** The data of `kpi.json`, without the name of the format. */\nexport type KpiInput = Omit<KpiFile, \"format\">;\n\n/** The form of a project and a measure. A double hyphen separates fields in the file name of a reading. */\nconst SLUG = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;\n\n/** The form of a time in UTC, with or without seconds. */\nconst UTC_TIME = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(?::\\d{2}(?:\\.\\d+)?)?Z$/;\n\n/** The form of a full commit. */\nconst COMMIT = /^[0-9a-f]{40}$/;\n\n/** The clock difference between two computers that the check accepts, in milliseconds. */\nconst CLOCK_MARGIN = 5 * 60 * 1000;\n\n/** An error in the data of `kpi.json`. The field `problems` has one line for each fault. */\nexport class KpiError extends Error {\n readonly problems: readonly string[];\n\n constructor(problems: readonly string[]) {\n super(`${KPI_FILE} is not correct: ${problems.join(\" \")}`);\n this.name = \"KpiError\";\n this.problems = problems;\n }\n}\n\nconst isRecord = (value: unknown): value is Record<string, unknown> => typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nconst isText = (value: unknown): value is string => typeof value === \"string\" && value.trim() !== \"\";\n\n/** This function gives the faults of one measure. */\nfunction measureProblems(value: unknown, index: number, seen: Set<string>): string[] {\n if (!isRecord(value)) return [`Measure ${index} is not an object.`];\n const { id, value: amount, unit } = value;\n const problems: string[] = [];\n if (typeof id !== \"string\" || !SLUG.test(id)) problems.push(`Measure ${index} has no id of lowercase words with single hyphens.`);\n else if (seen.has(id)) problems.push(`The id ${id} occurs two times.`);\n else seen.add(id);\n if (typeof amount !== \"number\" || !Number.isFinite(amount)) problems.push(`Measure ${index} has no finite number as its value.`);\n if (unit !== undefined && !isText(unit)) problems.push(`Measure ${index} has a unit that is not a text.`);\n return problems;\n}\n\n/** This function gives the faults of the list of engines. */\nfunction engineProblems(value: unknown): string[] {\n if (value === undefined) return [];\n if (!Array.isArray(value)) return [\"The field engines is not a list.\"];\n return value.flatMap((engine: unknown, index) => (isRecord(engine) && isText(engine[\"name\"]) && isText(engine[\"version\"]) ? [] : [`Engine ${index} has no name and version.`]));\n}\n\n/**\n * This function gives the faults of a parsed `kpi.json`, or an empty list.\n *\n * @param value - The parsed file.\n * @param now - The time of the check, in milliseconds. A time of the data after this time is a fault.\n */\nexport function kpiProblems(value: unknown, now: number = Date.now()): string[] {\n if (!isRecord(value)) return [\"The file is not an object.\"];\n const problems: string[] = [];\n if (value[\"format\"] !== KPI_FORMAT) problems.push(`The format is not ${KPI_FORMAT}.`);\n const { project, at, commit, measures } = value;\n if (typeof project !== \"string\" || !SLUG.test(project)) problems.push(\"The project is not lowercase words with single hyphens.\");\n if (typeof at !== \"string\" || !UTC_TIME.test(at) || Number.isNaN(Date.parse(at))) problems.push(\"The field at is not a time in UTC.\");\n else if (Date.parse(at) > now + CLOCK_MARGIN) problems.push(`The time of the data ${at} is after the time of the check.`);\n if (typeof commit !== \"string\" || !COMMIT.test(commit)) problems.push(\"The commit is not a full commit.\");\n if (!Array.isArray(measures) || measures.length === 0) problems.push(\"The file has no measures.\");\n else {\n const seen = new Set<string>();\n problems.push(...measures.flatMap((measure: unknown, index) => measureProblems(measure, index, seen)));\n }\n problems.push(...engineProblems(value[\"engines\"]));\n return problems;\n}\n\n/** This function gives a copy of a measure with only its known fields. */\nfunction cleanMeasure({ id, value, unit }: KpiMeasure): KpiMeasure {\n return unit === undefined ? { id, value } : { id, value, unit };\n}\n\n/** This function gives a copy of an engine with only its known fields. */\nfunction cleanEngine({ name, version }: KpiEngine): KpiEngine {\n return { name, version };\n}\n\n/**\n * This function gives the checked content of `kpi.json`. The file has only its known fields, in a fixed order.\n *\n * @throws KpiError when the data is not correct\n */\nexport function kpiFile(input: KpiInput, now?: number): KpiFile {\n const problems = kpiProblems({ format: KPI_FORMAT, ...input }, now);\n if (problems.length > 0) throw new KpiError(problems);\n const { project, at, commit, measures, engines } = input;\n const file: KpiFile = { format: KPI_FORMAT, project, at, commit, measures: measures.map(cleanMeasure) };\n return engines === undefined ? file : { ...file, engines: engines.map(cleanEngine) };\n}\n\n/** This function gives the text of `kpi.json`. */\nexport function kpiText(file: KpiFile): string {\n return `${JSON.stringify(file, null, 2)}\\n`;\n}\n\n/**\n * This function reads the text of a `kpi.json`.\n *\n * @throws KpiError when the text is not correct\n */\nexport function readKpi(text: string, now?: number): KpiFile {\n let value: unknown;\n try {\n value = JSON.parse(text);\n } catch (error) {\n throw new KpiError([`The file is not JSON: ${error instanceof Error ? error.message : String(error)}`]);\n }\n const problems = kpiProblems(value, now);\n if (problems.length > 0) throw new KpiError(problems);\n const { project, at, commit, measures, engines } = value as KpiFile;\n return kpiFile(engines === undefined ? { project, at, commit, measures } : { project, at, commit, measures, engines }, now);\n}\n\n/**\n * This function writes `kpi.json` into the built output folder of a site, and gives the path of the file.\n *\n * @throws KpiError when the data is not correct\n */\nexport function writeKpi(out: string, input: KpiInput, now?: number): string {\n const text = kpiText(kpiFile(input, now));\n mkdirSync(out, { recursive: true });\n const file = join(out, KPI_FILE);\n writeFileSync(file, text);\n return file;\n}\n"],"mappings":";;;;;;;;;AAcA,SAAgB,IAAI,SAAiB,GAAG,MAA+B;CACrE,IAAI;EACF,OAAO,aAAa,OAAO,MAAM;GAAE,KAAK;GAAS,UAAU;GAAQ,OAAO;IAAC;IAAU;IAAQ;GAAQ;GAAG,aAAa;EAAK,CAAC;CAC7H,QAAQ;EACN,OAAO;CACT;AACF;;AAGA,SAAgB,UAAU,SAA0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AI,YAAY;CAAE;CACtG,OAAO,YAAY,KAAA,IAAY,OAAO;EAAE,GAAG;EAAM,SAAS,QAAQ,IAAI,WAAW;CAAE;AACrF;;AAGA,SAAgB,QAAQ,MAAuB;CAC7C,OAAO,GAAG,KAAK,UAAU,MAAM,MAAM,CAAC,EAAE;AAC1C;;;;;;AAOA,SAAgB,QAAQ,MAAc,KAAuB;CAC3D,IAAI;CACJ,IAAI;EACF,QAAQ,KAAK,MAAM,IAAI;CACzB,SAAS,OAAO;EACd,MAAM,IAAI,SAAS,CAAC,yBAAyB,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,GAAG,CAAC;CACxG;CACA,MAAM,WAAW,YAAY,OAAO,GAAG;CACvC,IAAI,SAAS,SAAS,GAAG,MAAM,IAAI,SAAS,QAAQ;CACpD,MAAM,EAAE,SAAS,IAAI,QAAQ,UAAU,YAAY;CACnD,OAAO,QAAQ,YAAY,KAAA,IAAY;EAAE;EAAS;EAAI;EAAQ;CAAS,IAAI;EAAE;EAAS;EAAI;EAAQ;EAAU;CAAQ,GAAG,GAAG;AAC5H;;;;;;AAOA,SAAgB,SAAS,KAAa,OAAiB,KAAsB;CAC3E,MAAM,OAAO,QAAQ,QAAQ,OAAO,GAAG,CAAC;CACxC,UAAU,KAAK,EAAE,WAAW,KAAK,CAAC;CAClC,MAAM,OAAO,KAAK,KAAK,QAAQ;CAC/B,cAAc,MAAM,IAAI;CACxB,OAAO;AACT"}
package/build/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { a as runCli, o as TYPESCRIPT_PROBE, s as probeScript } from "./build-xJqNIzdO.js";
2
+ import { a as runCli, o as TYPESCRIPT_PROBE, s as probeScript } from "./chunks/build.js";
3
3
  import { spawn } from "node:child_process";
4
4
  import { appendFileSync, createReadStream, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync } from "node:fs";
5
5
  import { delimiter, extname, isAbsolute, join, normalize, resolve, sep } from "node:path";
package/build/index.d.ts CHANGED
@@ -1,147 +1,4 @@
1
- /**
2
- * The data shapes of `releases.json` and `status.json`. The standalone pages read them, and a site
3
- * can read the same JSON with its own components.
4
- */
5
- /** A link with its text, for example a pull request, a commit or a page on npm. */
6
- interface Link {
7
- label: string;
8
- url: string;
9
- }
10
- /**
11
- * The kind of a version. The oldest version is "first". `X.0.0` with `X` of 1 or more is "major".
12
- * A version with the PATCH number 0 is "minor". Each other version is "patch".
13
- */
14
- type ReleaseKind = "first" | "major" | "minor" | "patch";
15
- /** One change of a release: one commit, and the packages whose changelogs list it. */
16
- interface ReleaseChange {
17
- /** The short SHA of the commit, or null for an entry without a commit. */
18
- commit: string | null;
19
- /** The first sentence of the entry, as inline Markdown. */
20
- text: string;
21
- /** The npm names of the packages, sorted. */
22
- packages: string[];
23
- }
24
- /** One version of the repository. `releases.json` holds an array of them, the newest version first. */
25
- interface Release {
26
- version: string;
27
- /** The ISO date of the version: from the git tag, the GitHub release, npm, or the changelog commit. */
28
- date: string;
29
- kind: ReleaseKind;
30
- /** The changes, the change with the most packages first. */
31
- changes: ReleaseChange[];
32
- /** The pages of the version: the GitHub release, the changelog section and the npm page. */
33
- links: Link[];
34
- }
35
- /** A release of the GitHub repository, as `githubReleases` gives it. */
36
- interface GitHubRelease {
37
- tag: string;
38
- name: string;
39
- /** The text of the release, as Markdown. */
40
- body: string;
41
- /** The ISO date of the publication. */
42
- publishedAt: string;
43
- url: string;
44
- prerelease: boolean;
45
- }
46
- /** The result of `githubReleases`. Without a token, or after an error, it has only the reason. */
47
- type GitHubReleases = {
48
- available: true;
49
- releases: GitHubRelease[];
50
- } | {
51
- available: false;
52
- reason: string;
53
- };
54
- /** The publication time of one version of one package on npm. */
55
- interface NpmVersionTime {
56
- name: string;
57
- version: string;
58
- date: string;
59
- }
60
- /** The result of `npmPublishTimes`: the times that npm gave, and a message for each package that failed. */
61
- interface NpmPublishTimes {
62
- times: NpmVersionTime[];
63
- problems: string[];
64
- }
65
- /** The class of a status. The board shows the open classes in this sequence, and "done" last. */
66
- type StatusClass = "waiting" | "blocked" | "progress" | "open" | "later" | "done";
67
- /** One row of a table of the roadmap file. The text fields are inline Markdown. */
68
- interface BoardItem {
69
- id: string;
70
- title: string;
71
- /** The text of the Status cell, as the roadmap has it. */
72
- status: string;
73
- statusClass: StatusClass;
74
- owner?: string;
75
- area?: string;
76
- /** The IDs that the item needs, as the roadmap has them. */
77
- needs?: string;
78
- /** The nearest heading above the table, as plain text. */
79
- section: string;
80
- /** The line of the row in the roadmap file. */
81
- line: number;
82
- links: Link[];
83
- }
84
- /** The combined state of the checks of the last commit of a pull request. */
85
- type CheckState = "success" | "failure" | "pending" | "none";
86
- /** An open pull request of the repository. */
87
- interface BoardPullRequest {
88
- number: number;
89
- title: string;
90
- url: string;
91
- author: string;
92
- branch: string;
93
- draft: boolean;
94
- createdAt: string;
95
- updatedAt: string;
96
- labels: string[];
97
- checks: CheckState;
98
- }
99
- /** An open issue of the repository. */
100
- interface BoardIssue {
101
- number: number;
102
- title: string;
103
- url: string;
104
- author: string;
105
- createdAt: string;
106
- updatedAt: string;
107
- labels: string[];
108
- }
109
- /** The numbers of open pull requests and open issues on GitHub. A list can hold fewer than the total. */
110
- interface OpenWorkTotals {
111
- pullRequests: number;
112
- issues: number;
113
- }
114
- /** The result of `githubOpenWork`. Without a token, or after an error, it has only the reason. */
115
- type GitHubOpenWork = {
116
- available: true;
117
- pullRequests: BoardPullRequest[];
118
- issues: BoardIssue[];
119
- totals: OpenWorkTotals;
120
- } | {
121
- available: false;
122
- reason: string;
123
- };
124
- /** The data of the status page, as `status.json` holds it. */
125
- interface StatusBoardData {
126
- /** The ISO time of the build that read the data. */
127
- generatedAt: string;
128
- /** The commit of the build, or null. */
129
- commit: string | null;
130
- /** The roadmap file in the repository (null without a roadmap), and the repository on GitHub ("owner/name"). */
131
- source: {
132
- roadmap: string | null;
133
- github: string;
134
- };
135
- items: BoardItem[];
136
- pullRequests: BoardPullRequest[];
137
- issues: BoardIssue[];
138
- /** The GitHub part. When GitHub was not available, the board shows the reason. */
139
- github: {
140
- available: boolean;
141
- reason?: string;
142
- totals?: OpenWorkTotals;
143
- };
144
- }
1
+ import { C as OpenWorkTotals, D as StatusBoardData, E as ReleaseKind, O as StatusClass, S as NpmVersionTime, T as ReleaseChange, _ as KpiEngine, a as kpiFile, b as Link, c as readKpi, d as BoardItem, f as BoardPullRequest, g as GitHubReleases, h as GitHubRelease, i as KpiInput, l as writeKpi, m as GitHubOpenWork, n as KPI_FORMAT, o as kpiProblems, p as CheckState, r as KpiError, s as kpiText, t as KPI_FILE, u as BoardIssue, v as KpiFile, w as Release, x as NpmPublishTimes, y as KpiMeasure } from "./chunks/kpi.js";
145
2
  /** The parts of a SemVer 2.0.0 version. */
146
3
  interface ParsedVersion {
147
4
  major: number;
@@ -699,9 +556,10 @@ interface BuildResult {
699
556
  }
700
557
  /**
701
558
  * This function reads the sources and writes `data/releases.json`, `data/status.json`,
702
- * `releases/index.html` and `status/index.html` into the output folder.
559
+ * `releases/index.html` and `status/index.html` into the output folder. When the output folder has a
560
+ * `kpi.json`, the status data and the status page show it.
703
561
  *
704
- * @throws ReleaseDataError or RoadmapParseError when a source on disk is not correct
562
+ * @throws ReleaseDataError, RoadmapParseError or KpiError when a source on disk is not correct
705
563
  */
706
564
  export declare function build(options: BuildOptions): Promise<BuildResult>;
707
565
  /** The help of the CLI. */
@@ -726,5 +584,5 @@ export declare function parseBuildArgs(argv: readonly string[], io: Pick<CliIo,
726
584
  * source is not correct, and 2 for an incorrect command line.
727
585
  */
728
586
  export declare function runCli(argv: readonly string[], io: CliIo): Promise<number>;
729
- export type { BoardIssue, BoardItem, BoardPullRequest, BoardSection, BuildOptions, BuildResult, ChangelogEntry, ChangelogSection, ChangelogSource, CheckState, CliIo, GitHubOpenWork, GitHubOptions, GitHubRelease, GitHubReleases, ItemGroup, Link, LinkOptions, MarkdownTable, NpmOptions, NpmPublishTimes, NpmVersionTime, OpenWorkTotals, PageOptions, PageParts, ParsedVersion, ReadReleasesOptions, ReadStatusBoardOptions, Release, ReleaseChange, ReleaseKind, ReleasePoint, ReleaseSources, ReleaseSummary, StatusBoardData, StatusBoardInput, StatusClass, TagDate, TagVersion, TimelineBand, TimelineLayout, TimelineMark, TimelineOptions };
587
+ export { type BoardIssue, type BoardItem, type BoardPullRequest, type BoardSection, type BuildOptions, type BuildResult, type ChangelogEntry, type ChangelogSection, type ChangelogSource, type CheckState, type CliIo, type GitHubOpenWork, type GitHubOptions, type GitHubRelease, type GitHubReleases, type ItemGroup, KPI_FILE, KPI_FORMAT, type KpiEngine, KpiError, type KpiFile, type KpiInput, type KpiMeasure, type Link, type LinkOptions, type MarkdownTable, type NpmOptions, type NpmPublishTimes, type NpmVersionTime, type OpenWorkTotals, type PageOptions, type PageParts, type ParsedVersion, type ReadReleasesOptions, type ReadStatusBoardOptions, type Release, type ReleaseChange, type ReleaseKind, type ReleasePoint, type ReleaseSources, type ReleaseSummary, type StatusBoardData, type StatusBoardInput, type StatusClass, type TagDate, type TagVersion, type TimelineBand, type TimelineLayout, type TimelineMark, type TimelineOptions, kpiFile, kpiProblems, kpiText, readKpi, writeKpi };
730
588
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/data/types.ts","../src/data/versions.ts","../src/data/changelog.ts","../src/data/github.ts","../src/data/npm.ts","../src/data/git.ts","../src/data/glob.ts","../src/data/releases.ts","../src/data/status.ts","../src/render/html.ts","../src/render/dates.ts","../src/render/theme.ts","../src/render/timeline.ts","../src/render/releases.ts","../src/render/status.ts","../src/check/probe.ts","../src/build.ts"],"mappings":";;;;;UAMiB;EACf;EACA;;;;;;KAWU;;UAGK;;EAEf;;EAEA;;EAEA;;;UAIe;EACf;;EAEA;EACA,MAAM;;EAEN,SAAS;;EAET,OAAO;;;UAIQ;EACf;EACA;;EAEA;;EAEA;EACA;EACA;;;KAIU;EAAmB;EAAiB,UAAU;;EAAsB;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AI,QAAQ"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/data/versions.ts","../src/data/changelog.ts","../src/data/github.ts","../src/data/npm.ts","../src/data/git.ts","../src/data/glob.ts","../src/data/releases.ts","../src/data/status.ts","../src/render/html.ts","../src/render/dates.ts","../src/render/theme.ts","../src/render/timeline.ts","../src/render/releases.ts","../src/render/status.ts","../src/check/probe.ts","../src/build.ts"],"mappings":";;UAOiB;EACf;EACA;EACA;EACA;;;wBAMc,aAAa,kBAAkB;;;;;;wBAgB/B,gBAAgB,WAAW;;;;;wBA2B3B,OAAO,iBAAiB,kBAAkB;;UASzC;EACf;EACA;;;;;;wBAOc,aAAa,cAAc;;;;;;;UCvE1B;;EAEf;;EAEA;;;UAIe;EACf;;EAEA;EACA,SAAS;;;;;;;;;wBAqBK,cAAc;;;;;;;wBA0Cd,eAAe,mBAAmB;;;;;wBAwClC,mBAAmB,eAAe;;;;;wBAqClC,cAAc;;qBCtJjB;;qBAEA;;UAKI;EACf;EACA;;EAEA;;EAEA,eAAe;;EAEf;;;wBA0Bc,aAAa;EAAU;uBAA6C;;;;;;wBA4C9D,eAAe,SAAS;EAAkB;EAAmB;IAAmB,QAAQ;;;;;;;;wBAmFxF,eAAe,SAAS;EAAkB;EAAmB;IAAsB,QAAQ;;qBCzKpG;;UAGI;;EAEf;;EAEA,eAAe;EACf;;EAEA;;;;;;;wBAgBoB,gBAAgB,SAAS,aAAa,QAAQ;;UC1BnD;EACf;EACA;;;wBAac,UAAU;;wBAKV,YAAY,kBAAkB;;;;;wBAe9B,YAAY,iBAAiB,iBAAiB;;wBAO9C,WAAW;;wBAMX,iBAAiB;;;;;wBCrCjB,UAAU,cAAc;;qBCH3B,yBAAyB;;UAGrB;;EAEf;;EAEA;EACA;;;UAIe;EACf,sBAAsB;EACtB,0BAA0B;EAC1B,gBAAgB;EAChB,eAAe;;;;;EAKf;;EAEA;;EAEA;;EAEA,gBAAgB,iBAAiB;;EAEjC;EACA,SAAS;;;;;;;;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