@mark1russell7/site-pages 0.0.0-bootstrap.0 → 0.1.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/LICENSE +21 -0
- package/README.md +281 -1
- package/build/build-vAps0mRE.js +2267 -0
- package/build/build-vAps0mRE.js.map +1 -0
- package/build/cli.d.ts +1 -0
- package/build/cli.js +18 -0
- package/build/cli.js.map +1 -0
- package/build/index.d.ts +737 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +1 -0
- package/package.json +53 -4
package/build/index.d.ts
ADDED
|
@@ -0,0 +1,737 @@
|
|
|
1
|
+
//#region src/data/types.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The data shapes of `releases.json` and `status.json`. The standalone pages read them, and a site
|
|
4
|
+
* can read the same JSON with its own components.
|
|
5
|
+
*/
|
|
6
|
+
/** A link with its text, for example a pull request, a commit or a page on npm. */
|
|
7
|
+
interface Link {
|
|
8
|
+
label: string;
|
|
9
|
+
url: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The kind of a version. The oldest version is "first". `X.0.0` with `X` of 1 or more is "major".
|
|
13
|
+
* A version with the PATCH number 0 is "minor". Each other version is "patch".
|
|
14
|
+
*/
|
|
15
|
+
type ReleaseKind = "first" | "major" | "minor" | "patch";
|
|
16
|
+
/** One change of a release: one commit, and the packages whose changelogs list it. */
|
|
17
|
+
interface ReleaseChange {
|
|
18
|
+
/** The short SHA of the commit, or null for an entry without a commit. */
|
|
19
|
+
commit: string | null;
|
|
20
|
+
/** The first sentence of the entry, as inline Markdown. */
|
|
21
|
+
text: string;
|
|
22
|
+
/** The npm names of the packages, sorted. */
|
|
23
|
+
packages: string[];
|
|
24
|
+
}
|
|
25
|
+
/** One version of the repository. `releases.json` holds an array of them, the newest version first. */
|
|
26
|
+
interface Release {
|
|
27
|
+
version: string;
|
|
28
|
+
/** The ISO date of the version: from the git tag, the GitHub release, npm, or the changelog commit. */
|
|
29
|
+
date: string;
|
|
30
|
+
kind: ReleaseKind;
|
|
31
|
+
/** The changes, the change with the most packages first. */
|
|
32
|
+
changes: ReleaseChange[];
|
|
33
|
+
/** The pages of the version: the GitHub release, the changelog section and the npm page. */
|
|
34
|
+
links: Link[];
|
|
35
|
+
}
|
|
36
|
+
/** A release of the GitHub repository, as `githubReleases` gives it. */
|
|
37
|
+
interface GitHubRelease {
|
|
38
|
+
tag: string;
|
|
39
|
+
name: string;
|
|
40
|
+
/** The text of the release, as Markdown. */
|
|
41
|
+
body: string;
|
|
42
|
+
/** The ISO date of the publication. */
|
|
43
|
+
publishedAt: string;
|
|
44
|
+
url: string;
|
|
45
|
+
prerelease: boolean;
|
|
46
|
+
}
|
|
47
|
+
/** The result of `githubReleases`. Without a token, or after an error, it has only the reason. */
|
|
48
|
+
type GitHubReleases = {
|
|
49
|
+
available: true;
|
|
50
|
+
releases: GitHubRelease[];
|
|
51
|
+
} | {
|
|
52
|
+
available: false;
|
|
53
|
+
reason: string;
|
|
54
|
+
};
|
|
55
|
+
/** The publication time of one version of one package on npm. */
|
|
56
|
+
interface NpmVersionTime {
|
|
57
|
+
name: string;
|
|
58
|
+
version: string;
|
|
59
|
+
date: string;
|
|
60
|
+
}
|
|
61
|
+
/** The result of `npmPublishTimes`: the times that npm gave, and a message for each package that failed. */
|
|
62
|
+
interface NpmPublishTimes {
|
|
63
|
+
times: NpmVersionTime[];
|
|
64
|
+
problems: string[];
|
|
65
|
+
}
|
|
66
|
+
/** The class of a status. The board shows the open classes in this sequence, and "done" last. */
|
|
67
|
+
type StatusClass = "waiting" | "blocked" | "progress" | "open" | "later" | "done";
|
|
68
|
+
/** One row of a table of the roadmap file. The text fields are inline Markdown. */
|
|
69
|
+
interface BoardItem {
|
|
70
|
+
id: string;
|
|
71
|
+
title: string;
|
|
72
|
+
/** The text of the Status cell, as the roadmap has it. */
|
|
73
|
+
status: string;
|
|
74
|
+
statusClass: StatusClass;
|
|
75
|
+
owner?: string;
|
|
76
|
+
area?: string;
|
|
77
|
+
/** The IDs that the item needs, as the roadmap has them. */
|
|
78
|
+
needs?: string;
|
|
79
|
+
/** The nearest heading above the table, as plain text. */
|
|
80
|
+
section: string;
|
|
81
|
+
/** The line of the row in the roadmap file. */
|
|
82
|
+
line: number;
|
|
83
|
+
links: Link[];
|
|
84
|
+
}
|
|
85
|
+
/** The combined state of the checks of the last commit of a pull request. */
|
|
86
|
+
type CheckState = "success" | "failure" | "pending" | "none";
|
|
87
|
+
/** An open pull request of the repository. */
|
|
88
|
+
interface BoardPullRequest {
|
|
89
|
+
number: number;
|
|
90
|
+
title: string;
|
|
91
|
+
url: string;
|
|
92
|
+
author: string;
|
|
93
|
+
branch: string;
|
|
94
|
+
draft: boolean;
|
|
95
|
+
createdAt: string;
|
|
96
|
+
updatedAt: string;
|
|
97
|
+
labels: string[];
|
|
98
|
+
checks: CheckState;
|
|
99
|
+
}
|
|
100
|
+
/** An open issue of the repository. */
|
|
101
|
+
interface BoardIssue {
|
|
102
|
+
number: number;
|
|
103
|
+
title: string;
|
|
104
|
+
url: string;
|
|
105
|
+
author: string;
|
|
106
|
+
createdAt: string;
|
|
107
|
+
updatedAt: string;
|
|
108
|
+
labels: string[];
|
|
109
|
+
}
|
|
110
|
+
/** The numbers of open pull requests and open issues on GitHub. A list can hold fewer than the total. */
|
|
111
|
+
interface OpenWorkTotals {
|
|
112
|
+
pullRequests: number;
|
|
113
|
+
issues: number;
|
|
114
|
+
}
|
|
115
|
+
/** The result of `githubOpenWork`. Without a token, or after an error, it has only the reason. */
|
|
116
|
+
type GitHubOpenWork = {
|
|
117
|
+
available: true;
|
|
118
|
+
pullRequests: BoardPullRequest[];
|
|
119
|
+
issues: BoardIssue[];
|
|
120
|
+
totals: OpenWorkTotals;
|
|
121
|
+
} | {
|
|
122
|
+
available: false;
|
|
123
|
+
reason: string;
|
|
124
|
+
};
|
|
125
|
+
/** The data of the status page, as `status.json` holds it. */
|
|
126
|
+
interface StatusBoardData {
|
|
127
|
+
/** The ISO time of the build that read the data. */
|
|
128
|
+
generatedAt: string;
|
|
129
|
+
/** The commit of the build, or null. */
|
|
130
|
+
commit: string | null;
|
|
131
|
+
/** The roadmap file in the repository (null without a roadmap), and the repository on GitHub ("owner/name"). */
|
|
132
|
+
source: {
|
|
133
|
+
roadmap: string | null;
|
|
134
|
+
github: string;
|
|
135
|
+
};
|
|
136
|
+
items: BoardItem[];
|
|
137
|
+
pullRequests: BoardPullRequest[];
|
|
138
|
+
issues: BoardIssue[];
|
|
139
|
+
/** The GitHub part. When GitHub was not available, the board shows the reason. */
|
|
140
|
+
github: {
|
|
141
|
+
available: boolean;
|
|
142
|
+
reason?: string;
|
|
143
|
+
totals?: OpenWorkTotals;
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
//#endregion
|
|
147
|
+
//#region src/data/versions.d.ts
|
|
148
|
+
/** The parts of a SemVer 2.0.0 version. */
|
|
149
|
+
interface ParsedVersion {
|
|
150
|
+
major: number;
|
|
151
|
+
minor: number;
|
|
152
|
+
patch: number;
|
|
153
|
+
prerelease: string[];
|
|
154
|
+
}
|
|
155
|
+
/** This function gives the parts of a version, or null when the text is not a SemVer version. */
|
|
156
|
+
export declare function parseVersion(version: string): ParsedVersion | null;
|
|
157
|
+
/**
|
|
158
|
+
* This function compares two versions by the SemVer precedence. It gives a negative number when `a`
|
|
159
|
+
* is older, a positive number when `a` is newer, and 0 for the same version. A text that is not a
|
|
160
|
+
* version comes before each version.
|
|
161
|
+
*/
|
|
162
|
+
export declare function compareVersions(a: string, b: string): number;
|
|
163
|
+
/**
|
|
164
|
+
* This function gives the kind of a version. The oldest version of the list is "first". The caller
|
|
165
|
+
* tells if the version is the oldest.
|
|
166
|
+
*/
|
|
167
|
+
export declare function kindOf(version: string, oldest: boolean): ReleaseKind;
|
|
168
|
+
/** The version of a git tag, and the package that the tag names (null for a tag like `v1.2.3`). */
|
|
169
|
+
interface TagVersion {
|
|
170
|
+
version: string;
|
|
171
|
+
package: string | null;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* This function reads the version of a git tag. It knows `1.2.3`, `v1.2.3` and the tags of Changesets:
|
|
175
|
+
* `name@1.2.3` and `@scope/name@1.2.3`. It gives null for another tag.
|
|
176
|
+
*/
|
|
177
|
+
export declare function versionOfTag(tag: string): TagVersion | null;
|
|
178
|
+
//#endregion
|
|
179
|
+
//#region src/data/changelog.d.ts
|
|
180
|
+
/**
|
|
181
|
+
* The changelog parser. Changesets writes a section for each version in the `CHANGELOG.md` of each
|
|
182
|
+
* package. The section has a `## 0.13.2` heading and a `###` heading for each kind of change. Each
|
|
183
|
+
* change is one `- <short sha>: <text>` entry. The next lines of an entry have an indent.
|
|
184
|
+
*/
|
|
185
|
+
/** One entry of a changelog section or of a release text. */
|
|
186
|
+
interface ChangelogEntry {
|
|
187
|
+
/** The short SHA of the commit, or null for an entry without a commit. */
|
|
188
|
+
commit: string | null;
|
|
189
|
+
/** The first sentence of the entry, with its code spans. */
|
|
190
|
+
text: string;
|
|
191
|
+
}
|
|
192
|
+
/** The entries of one version of a changelog. */
|
|
193
|
+
interface ChangelogSection {
|
|
194
|
+
version: string;
|
|
195
|
+
/** The text of the version heading, without the `##` marks. */
|
|
196
|
+
heading: string;
|
|
197
|
+
entries: ChangelogEntry[];
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* This function gives the first sentence of a text. A full stop, a question mark or an exclamation
|
|
201
|
+
* mark ends the sentence when a space and no lowercase letter follow it.
|
|
202
|
+
*
|
|
203
|
+
* @remarks A mark in a code span does not end the sentence. A text that ends with a colon (a list
|
|
204
|
+
* follows) ends with a full stop.
|
|
205
|
+
*/
|
|
206
|
+
export declare function firstSentence(text: string): string;
|
|
207
|
+
/**
|
|
208
|
+
* This function gives the entries of each version of a changelog, in the sequence of the file.
|
|
209
|
+
*
|
|
210
|
+
* @remarks An entry is a line that starts with "- " and the indented lines under it. An entry for a
|
|
211
|
+
* new dependency version is not a change.
|
|
212
|
+
*/
|
|
213
|
+
export declare function parseChangelog(markdown: string): ChangelogSection[];
|
|
214
|
+
/**
|
|
215
|
+
* This function gives the changes of the text of a GitHub release: one change for each top-level
|
|
216
|
+
* list item. Fenced code is not read.
|
|
217
|
+
*/
|
|
218
|
+
export declare function releaseBodyEntries(body: string): ChangelogEntry[];
|
|
219
|
+
/**
|
|
220
|
+
* This function gives the anchor of a heading on GitHub: lowercase, no punctuation, and a hyphen
|
|
221
|
+
* for each space. The anchor of "0.13.2" is "0132".
|
|
222
|
+
*/
|
|
223
|
+
export declare function headingAnchor(heading: string): string;
|
|
224
|
+
//#endregion
|
|
225
|
+
//#region src/data/github.d.ts
|
|
226
|
+
/** The GraphQL endpoint of GitHub. */
|
|
227
|
+
export declare const GITHUB_GRAPHQL = "https://api.github.com/graphql";
|
|
228
|
+
/** The REST endpoint of GitHub. */
|
|
229
|
+
export declare const GITHUB_API = "https://api.github.com";
|
|
230
|
+
/** The options of the GitHub functions. */
|
|
231
|
+
interface GitHubOptions {
|
|
232
|
+
owner: string;
|
|
233
|
+
repo: string;
|
|
234
|
+
/** A token with read access. Without it, the function sends no request. */
|
|
235
|
+
token: string | undefined;
|
|
236
|
+
/** The `fetch` function. The default is the global `fetch`. */
|
|
237
|
+
fetch?: typeof fetch;
|
|
238
|
+
/** The time limit of each request, in milliseconds. The default is 15000. */
|
|
239
|
+
timeoutMs?: number;
|
|
240
|
+
}
|
|
241
|
+
/** This function gives the combined check state of a commit: success, failure, pending or none. */
|
|
242
|
+
export declare function checkStateOf(rollup: {
|
|
243
|
+
state?: string | null;
|
|
244
|
+
} | null | undefined): CheckState;
|
|
245
|
+
/**
|
|
246
|
+
* This function reads the open pull requests and issues of a repository with one GraphQL request,
|
|
247
|
+
* the most recently updated first. It gives `{ available: false, reason }` without a token or after
|
|
248
|
+
* an error. It does not throw.
|
|
249
|
+
*/
|
|
250
|
+
export declare function githubOpenWork(options: GitHubOptions & {
|
|
251
|
+
endpoint?: string;
|
|
252
|
+
first?: number;
|
|
253
|
+
}): Promise<GitHubOpenWork>;
|
|
254
|
+
/**
|
|
255
|
+
* This function reads the published releases of a repository with the REST API, the newest first.
|
|
256
|
+
* It skips the drafts. It gives `{ available: false, reason }` without a token or after an error.
|
|
257
|
+
* It does not throw.
|
|
258
|
+
*
|
|
259
|
+
* @remarks The function reads 100 releases on each page, and at most `maxPages` pages (default 10).
|
|
260
|
+
*/
|
|
261
|
+
export declare function githubReleases(options: GitHubOptions & {
|
|
262
|
+
endpoint?: string;
|
|
263
|
+
maxPages?: number;
|
|
264
|
+
}): Promise<GitHubReleases>;
|
|
265
|
+
//#endregion
|
|
266
|
+
//#region src/data/npm.d.ts
|
|
267
|
+
/** The public npm registry. */
|
|
268
|
+
export declare const NPM_REGISTRY = "https://registry.npmjs.org";
|
|
269
|
+
/** The options of `npmPublishTimes`. */
|
|
270
|
+
interface NpmOptions {
|
|
271
|
+
/** The npm names of the packages, or a scope (for example `@procedures`) for all the packages of the scope. */
|
|
272
|
+
packages: readonly string[];
|
|
273
|
+
/** The `fetch` function. The default is the global `fetch`. */
|
|
274
|
+
fetch?: typeof fetch;
|
|
275
|
+
registry?: string;
|
|
276
|
+
/** The time limit of each request, in milliseconds. The default is 15000. */
|
|
277
|
+
timeoutMs?: number;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* This function reads the publication time of each version of the packages from the npm registry.
|
|
281
|
+
* A scope (`@name`) gives each package of the scope. It does not throw. Each failure gives a
|
|
282
|
+
* message in `problems`.
|
|
283
|
+
*/
|
|
284
|
+
export declare function npmPublishTimes(options: NpmOptions): Promise<NpmPublishTimes>;
|
|
285
|
+
//#endregion
|
|
286
|
+
//#region src/data/git.d.ts
|
|
287
|
+
/** A git tag and the ISO date of its creation. */
|
|
288
|
+
interface TagDate {
|
|
289
|
+
tag: string;
|
|
290
|
+
date: string;
|
|
291
|
+
}
|
|
292
|
+
/** This function tells if the clone is shallow. A shallow clone has not all the tags and commits. */
|
|
293
|
+
export declare function isShallow(repoDir: string): boolean;
|
|
294
|
+
/** This function gives each tag of the repository with its date. An annotated tag has its own date. */
|
|
295
|
+
export declare function gitTagDates(repoDir: string): TagDate[];
|
|
296
|
+
/**
|
|
297
|
+
* This function gives the date of the oldest commit that added a version heading to a changelog,
|
|
298
|
+
* or null. The path of the changelog starts at `repoDir`.
|
|
299
|
+
*/
|
|
300
|
+
export declare function headingDate(repoDir: string, version: string, file: string): string | null;
|
|
301
|
+
/** This function gives the full SHA of `HEAD`, or null. */
|
|
302
|
+
export declare function headCommit(repoDir: string): string | null;
|
|
303
|
+
/** This function gives "owner/name" of the GitHub remote "origin", or null. */
|
|
304
|
+
export declare function originRepository(repoDir: string): string | null;
|
|
305
|
+
//#endregion
|
|
306
|
+
//#region src/data/glob.d.ts
|
|
307
|
+
/**
|
|
308
|
+
* This function gives the files under `root` that match a pattern, as paths with `/` that start at
|
|
309
|
+
* `root`, sorted. It does not go into `node_modules` or `.git`.
|
|
310
|
+
*/
|
|
311
|
+
export declare function globFiles(root: string, pattern: string): string[];
|
|
312
|
+
//#endregion
|
|
313
|
+
//#region src/data/releases.d.ts
|
|
314
|
+
/** An error in the release sources, for example a group without a changelog. */
|
|
315
|
+
export declare class ReleaseDataError extends Error {}
|
|
316
|
+
/** One changelog file and the npm name of its package. */
|
|
317
|
+
interface ChangelogSource {
|
|
318
|
+
/** The npm name of the package. */
|
|
319
|
+
name: string;
|
|
320
|
+
/** The path of the file in the repository, with `/`. */
|
|
321
|
+
file: string;
|
|
322
|
+
markdown: string;
|
|
323
|
+
}
|
|
324
|
+
/** The sources of `mergeReleases`. Each source is optional. */
|
|
325
|
+
interface ReleaseSources {
|
|
326
|
+
changelogs?: readonly ChangelogSource[];
|
|
327
|
+
githubReleases?: readonly GitHubRelease[];
|
|
328
|
+
tags?: readonly TagDate[];
|
|
329
|
+
npm?: readonly NpmVersionTime[];
|
|
330
|
+
/**
|
|
331
|
+
* The npm name of the package whose changelog gives the versions, for a monorepo with one version
|
|
332
|
+
* for all its packages. Without it, each version of each source is a version.
|
|
333
|
+
*/
|
|
334
|
+
group?: string | undefined;
|
|
335
|
+
/** "owner/name" of the repository, for the links. */
|
|
336
|
+
repository?: string | undefined;
|
|
337
|
+
/** The branch or the commit of the changelog links. The default is "HEAD". */
|
|
338
|
+
ref?: string | undefined;
|
|
339
|
+
/** This function gives the date of a version without another date: the commit that added its heading. */
|
|
340
|
+
headingDate?: ((version: string, file: string) => string | null) | undefined;
|
|
341
|
+
/** The time of the build, for a version without a date. The default is the time of the call. */
|
|
342
|
+
now?: string | undefined;
|
|
343
|
+
warn?: ((message: string) => void) | undefined;
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* This function merges the release sources into one entry for each version, the newest first.
|
|
347
|
+
*
|
|
348
|
+
* - The versions: the changelog of `group`, or else each changelog version and each GitHub release.
|
|
349
|
+
* - The date: the git tag, else the GitHub release, else npm, else the commit of the changelog heading.
|
|
350
|
+
* - The changes: the changelog entries, else the list items of the GitHub release text.
|
|
351
|
+
*
|
|
352
|
+
* @throws ReleaseDataError when `group` has no changelog and other changelogs exist
|
|
353
|
+
*/
|
|
354
|
+
export declare function mergeReleases(sources: ReleaseSources): Release[];
|
|
355
|
+
/** The default patterns of the changelog files: the first pattern that finds a file wins. */
|
|
356
|
+
export declare const DEFAULT_CHANGELOGS: readonly string[];
|
|
357
|
+
/**
|
|
358
|
+
* This function reads the changelog files of a repository. The npm name of each changelog comes from
|
|
359
|
+
* the `package.json` next to it, else from its folder.
|
|
360
|
+
*/
|
|
361
|
+
export declare function readChangelogs(repoDir: string, pattern?: string): ChangelogSource[];
|
|
362
|
+
/** The options of `readReleases`. */
|
|
363
|
+
interface ReadReleasesOptions {
|
|
364
|
+
/** The folder of the repository. The changelog patterns start here. */
|
|
365
|
+
repoDir: string;
|
|
366
|
+
/** "owner/name" of the repository on GitHub, for the GitHub releases and the links. */
|
|
367
|
+
repository?: string | undefined;
|
|
368
|
+
token?: string | undefined;
|
|
369
|
+
/** The glob pattern of the changelog files. The default is `DEFAULT_CHANGELOGS`. */
|
|
370
|
+
changesets?: string | undefined;
|
|
371
|
+
/** The npm names or scopes for the npm dates. */
|
|
372
|
+
packages?: readonly string[] | undefined;
|
|
373
|
+
group?: string | undefined;
|
|
374
|
+
/** The branch or the commit of the changelog links. */
|
|
375
|
+
ref?: string | undefined;
|
|
376
|
+
fetch?: typeof fetch | undefined;
|
|
377
|
+
now?: string | undefined;
|
|
378
|
+
warn?: ((message: string) => void) | undefined;
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* This function reads all the release sources of a repository and merges them. A failure of GitHub
|
|
382
|
+
* or npm does not stop it, but gives a warning.
|
|
383
|
+
*
|
|
384
|
+
* @throws ReleaseDataError when `group` has no changelog and other changelogs exist
|
|
385
|
+
*/
|
|
386
|
+
export declare function readReleases(options: ReadReleasesOptions): Promise<Release[]>;
|
|
387
|
+
//#endregion
|
|
388
|
+
//#region src/data/status.d.ts
|
|
389
|
+
/** The classes of a status, in the sequence of the board. The open work comes first. */
|
|
390
|
+
export declare const STATUS_CLASSES: readonly StatusClass[];
|
|
391
|
+
/** The open classes, in the sequence of the board. */
|
|
392
|
+
export declare const OPEN_CLASSES: readonly StatusClass[];
|
|
393
|
+
/** An error in the roadmap file, with the file and the line. */
|
|
394
|
+
export declare class RoadmapParseError extends Error {}
|
|
395
|
+
/**
|
|
396
|
+
* This function gives the class of a free-text status: done, progress, waiting, blocked, later or
|
|
397
|
+
* open. The first keyword of the text decides. A text without a keyword ("next", "open") is open.
|
|
398
|
+
*/
|
|
399
|
+
export declare function statusClassOf(text: string | null | undefined): StatusClass;
|
|
400
|
+
/** This function gives the cells of a table row. A "|" in a code span or after "\" is text. */
|
|
401
|
+
export declare function splitRow(line: string): string[];
|
|
402
|
+
/** This function gives the plain text of inline Markdown: no code marks, no emphasis, the text of each link. */
|
|
403
|
+
export declare function plainText(markdown: string | null | undefined): string;
|
|
404
|
+
/** A table of a Markdown file. */
|
|
405
|
+
interface MarkdownTable {
|
|
406
|
+
/** The nearest heading above the table, as plain text. */
|
|
407
|
+
section: string;
|
|
408
|
+
/** The line of the header. */
|
|
409
|
+
line: number;
|
|
410
|
+
/** The header names, in lowercase plain text. */
|
|
411
|
+
header: string[];
|
|
412
|
+
rows: Array<{
|
|
413
|
+
line: number;
|
|
414
|
+
cells: string[];
|
|
415
|
+
}>;
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* This function gives the tables of a Markdown file. Each table has its header names in lowercase
|
|
419
|
+
* plain text, the nearest heading above it, the line of its header and its rows. Fenced code is not read.
|
|
420
|
+
*/
|
|
421
|
+
export declare function markdownTables(markdown: string): MarkdownTable[];
|
|
422
|
+
/** The options of the link functions. */
|
|
423
|
+
interface LinkOptions {
|
|
424
|
+
/** The path of the roadmap file in the repository. */
|
|
425
|
+
file?: string;
|
|
426
|
+
/** "owner/name" of the repository. */
|
|
427
|
+
repository?: string;
|
|
428
|
+
/** The branch or the commit of the relative links. The default is "HEAD". */
|
|
429
|
+
ref?: string;
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* This function gives the links of a cell: each Markdown link, then each bare reference in the rest
|
|
433
|
+
* of the text. A reference is a pull request ("PR #12", "#12") or a commit hash in a code span.
|
|
434
|
+
*
|
|
435
|
+
* @remarks A repository name right before a reference ("systems PR #16") applies to it and to the
|
|
436
|
+
* next references of the cell. Without a name, a reference belongs to `repository`.
|
|
437
|
+
*/
|
|
438
|
+
export declare function linksOf(cell: string | null | undefined, options?: LinkOptions): Link[];
|
|
439
|
+
/**
|
|
440
|
+
* This function gives the items of a roadmap file: one item for each row of each table with an `ID`
|
|
441
|
+
* column and a `Status` column. The header names match without case.
|
|
442
|
+
*
|
|
443
|
+
* @remarks The title comes from `Item`, else from `Title`. `Owner`, `Area` and `Needs` are optional.
|
|
444
|
+
* `Where`, `Commit` and `Links` give the links.
|
|
445
|
+
* @throws RoadmapParseError when the cells of a row do not match the header
|
|
446
|
+
*/
|
|
447
|
+
export declare function roadmapItems(markdown: string, options?: LinkOptions): BoardItem[];
|
|
448
|
+
/** The input of `buildStatusBoard`. */
|
|
449
|
+
interface StatusBoardInput {
|
|
450
|
+
items: BoardItem[];
|
|
451
|
+
/** The result of `githubOpenWork`. */
|
|
452
|
+
github: GitHubOpenWork;
|
|
453
|
+
/** The roadmap file in the repository, or null without a roadmap. */
|
|
454
|
+
roadmap: string | null;
|
|
455
|
+
/** "owner/name" of the repository. */
|
|
456
|
+
repository: string;
|
|
457
|
+
commit?: string | null;
|
|
458
|
+
generatedAt?: string;
|
|
459
|
+
}
|
|
460
|
+
/** This function puts the roadmap items and the GitHub part into the shape of `status.json`. */
|
|
461
|
+
export declare function buildStatusBoard(input: StatusBoardInput): StatusBoardData;
|
|
462
|
+
/** The options of `readStatusBoard`. */
|
|
463
|
+
interface ReadStatusBoardOptions {
|
|
464
|
+
repoDir: string;
|
|
465
|
+
/** The path of the roadmap file from `repoDir`, with `/`. Without it, the board has only the GitHub part. */
|
|
466
|
+
roadmap?: string | null | undefined;
|
|
467
|
+
owner: string;
|
|
468
|
+
repo: string;
|
|
469
|
+
token: string | undefined;
|
|
470
|
+
/** The commit of the build. The relative links of the roadmap go to it. */
|
|
471
|
+
commit?: string | null | undefined;
|
|
472
|
+
fetch?: typeof fetch | undefined;
|
|
473
|
+
generatedAt?: string | undefined;
|
|
474
|
+
}
|
|
475
|
+
/**
|
|
476
|
+
* This function reads the board of a repository on disk: the roadmap file, and the open work on GitHub.
|
|
477
|
+
*
|
|
478
|
+
* @throws RoadmapParseError when the roadmap has an incorrect row, or no table with an ID and a Status column
|
|
479
|
+
*/
|
|
480
|
+
export declare function readStatusBoard(options: ReadStatusBoardOptions): Promise<StatusBoardData>;
|
|
481
|
+
//#endregion
|
|
482
|
+
//#region src/render/html.d.ts
|
|
483
|
+
/** This function escapes a text for HTML content and for an attribute value in double quotes. */
|
|
484
|
+
export declare function escapeHtml(text: string): string;
|
|
485
|
+
/**
|
|
486
|
+
* This function gives a URL that a link can hold, or null. It accepts `http:`, `https:` and
|
|
487
|
+
* `mailto:` URLs, and relative URLs. It refuses each other scheme, for example `javascript:`.
|
|
488
|
+
*/
|
|
489
|
+
export declare function safeUrl(url: string): string | null;
|
|
490
|
+
/**
|
|
491
|
+
* This function renders inline Markdown as HTML: code spans, links, strong text and emphasis. It
|
|
492
|
+
* escapes all other text, so the result is safe.
|
|
493
|
+
*/
|
|
494
|
+
export declare function inlineMarkdown(markdown: string): string;
|
|
495
|
+
//#endregion
|
|
496
|
+
//#region src/render/dates.d.ts
|
|
497
|
+
/** This function gives the start of the UTC day of a time. */
|
|
498
|
+
export declare function utcDay(time: number): number;
|
|
499
|
+
/** This function gives "Oct 18": the UTC day of a time or of an ISO date. */
|
|
500
|
+
export declare function shortDate(date: string | number): string;
|
|
501
|
+
/** This function gives "Oct 18, 2026, 19:34 UTC", or "an unknown time" for a date that is not valid. */
|
|
502
|
+
export declare function longDate(date: string | number): string;
|
|
503
|
+
/** This function gives "Oct 13–15", or "Sep 30–Oct 2" over the end of a month. */
|
|
504
|
+
export declare function dayRange(start: number, end: number): string;
|
|
505
|
+
//#endregion
|
|
506
|
+
//#region src/render/theme.d.ts
|
|
507
|
+
/** The options of each page. */
|
|
508
|
+
interface PageOptions {
|
|
509
|
+
/** "owner/name" of the repository on GitHub. */
|
|
510
|
+
repository: string;
|
|
511
|
+
/** The path of the site home, with a `/` at the start and at the end, for example `/client/`. */
|
|
512
|
+
base: string;
|
|
513
|
+
/** The name of the site in the header. The default is the name of the repository. */
|
|
514
|
+
siteName?: string | undefined;
|
|
515
|
+
/** More CSS for the page. It comes after the default CSS, so it can change each variable. */
|
|
516
|
+
extraCss?: string | undefined;
|
|
517
|
+
/** The ISO time of the build. */
|
|
518
|
+
generatedAt: string;
|
|
519
|
+
/** The commit of the build, or null. */
|
|
520
|
+
commit: string | null;
|
|
521
|
+
}
|
|
522
|
+
/** The default CSS of the pages: the variables, the light and dark themes, and the parts of both pages. */
|
|
523
|
+
export declare const BASE_CSS: string;
|
|
524
|
+
/** The parts of one page. */
|
|
525
|
+
interface PageParts {
|
|
526
|
+
/** The title of the page, for example "Releases". */
|
|
527
|
+
title: string;
|
|
528
|
+
description: string;
|
|
529
|
+
/** The page of the navigation that is current. */
|
|
530
|
+
current: "releases" | "status";
|
|
531
|
+
/** The HTML of the main content. */
|
|
532
|
+
main: string;
|
|
533
|
+
/** The ES module of the interactions. */
|
|
534
|
+
script: string;
|
|
535
|
+
}
|
|
536
|
+
/** This function makes the complete HTML document of a page. */
|
|
537
|
+
export declare function pageShell(parts: PageParts, options: PageOptions): string;
|
|
538
|
+
//#endregion
|
|
539
|
+
//#region src/render/timeline.d.ts
|
|
540
|
+
/** What the timeline needs of a version. */
|
|
541
|
+
interface ReleasePoint {
|
|
542
|
+
version: string;
|
|
543
|
+
date: string;
|
|
544
|
+
kind: ReleaseKind;
|
|
545
|
+
}
|
|
546
|
+
/** The numbers of the lead line of the releases page. */
|
|
547
|
+
interface ReleaseSummary {
|
|
548
|
+
versions: number;
|
|
549
|
+
major: number;
|
|
550
|
+
minor: number;
|
|
551
|
+
patch: number;
|
|
552
|
+
/** The date of the oldest and of the newest version, or null without a release. */
|
|
553
|
+
first: string | null;
|
|
554
|
+
last: string | null;
|
|
555
|
+
}
|
|
556
|
+
/** This function counts the versions and the kinds. The first release counts as a version only. */
|
|
557
|
+
export declare function releaseSummary(releases: readonly ReleasePoint[]): ReleaseSummary;
|
|
558
|
+
/** This function sorts the versions from the oldest to the newest: the sequence of the marks and of the arrow keys. */
|
|
559
|
+
export declare function oldestFirst<T extends ReleasePoint>(releases: readonly T[]): T[];
|
|
560
|
+
/** The options of the layout. */
|
|
561
|
+
interface TimelineOptions {
|
|
562
|
+
/** The width of the SVG, in pixels. */
|
|
563
|
+
width: number;
|
|
564
|
+
/** The space at each side, for the labels of the first and the last mark. */
|
|
565
|
+
padX?: number;
|
|
566
|
+
laneHeight?: number;
|
|
567
|
+
/** The width of one character of a label (12 px monospace). */
|
|
568
|
+
charWidth?: number;
|
|
569
|
+
/** The minimum space between two labels in one lane. */
|
|
570
|
+
gap?: number;
|
|
571
|
+
/** The width of a run of days without a release, as a part of the width of a day with releases. */
|
|
572
|
+
emptyWeight?: number;
|
|
573
|
+
}
|
|
574
|
+
/** A band of the axis: one day with releases, or a run of days with none. */
|
|
575
|
+
interface TimelineBand {
|
|
576
|
+
start: number;
|
|
577
|
+
/** The end of the band: the start of the next day. */
|
|
578
|
+
end: number;
|
|
579
|
+
x0: number;
|
|
580
|
+
x1: number;
|
|
581
|
+
label: string;
|
|
582
|
+
count: number;
|
|
583
|
+
empty: boolean;
|
|
584
|
+
}
|
|
585
|
+
/** One mark of the timeline. */
|
|
586
|
+
interface TimelineMark<T extends ReleasePoint = ReleasePoint> {
|
|
587
|
+
release: T;
|
|
588
|
+
time: number;
|
|
589
|
+
x: number;
|
|
590
|
+
/** The lane of the mark: 0 is the lane next to the axis. */
|
|
591
|
+
lane: number;
|
|
592
|
+
/** The half width of the label and of the target of the pointer. */
|
|
593
|
+
half: number;
|
|
594
|
+
}
|
|
595
|
+
/** The layout of the timeline at one width. */
|
|
596
|
+
interface TimelineLayout<T extends ReleasePoint = ReleasePoint> {
|
|
597
|
+
width: number;
|
|
598
|
+
height: number;
|
|
599
|
+
plotTop: number;
|
|
600
|
+
/** The y of the axis line. */
|
|
601
|
+
plotBottom: number;
|
|
602
|
+
laneHeight: number;
|
|
603
|
+
lanes: number;
|
|
604
|
+
bands: TimelineBand[];
|
|
605
|
+
/** The marks from the oldest to the newest. */
|
|
606
|
+
marks: Array<TimelineMark<T>>;
|
|
607
|
+
}
|
|
608
|
+
/** This function gives the y of the center line of a lane. */
|
|
609
|
+
export declare function laneCenter(layout: {
|
|
610
|
+
plotBottom: number;
|
|
611
|
+
laneHeight: number;
|
|
612
|
+
}, lane: number): number;
|
|
613
|
+
/** This function calculates the layout of the timeline at a width. */
|
|
614
|
+
export declare function timelineLayout<T extends ReleasePoint>(releases: readonly T[], options: TimelineOptions): TimelineLayout<T>;
|
|
615
|
+
//#endregion
|
|
616
|
+
//#region src/render/releases.d.ts
|
|
617
|
+
/**
|
|
618
|
+
* This function gives the lead line of the releases page, for example "23 versions from Oct 12 to
|
|
619
|
+
* Oct 18, 2026. 7 MINOR releases and 15 PATCH releases came after the first release."
|
|
620
|
+
*/
|
|
621
|
+
export declare function releasesLead(releases: readonly Release[]): string;
|
|
622
|
+
/**
|
|
623
|
+
* The inline module of the releases page. It selects a version on a click, with the arrow keys,
|
|
624
|
+
* Home, End, Enter and Space. It also opens the long lists and keeps the version in the URL.
|
|
625
|
+
*/
|
|
626
|
+
export declare const RELEASES_SCRIPT: string;
|
|
627
|
+
/** This function renders the complete releases page from the data of `releases.json`. */
|
|
628
|
+
export declare function renderReleasesPage(releases: readonly Release[], options: PageOptions): string;
|
|
629
|
+
//#endregion
|
|
630
|
+
//#region src/render/status.d.ts
|
|
631
|
+
/**
|
|
632
|
+
* This function gives the lead line of the status page, for example "12 open roadmap items, 9 open
|
|
633
|
+
* pull requests and 0 open issues, read at Oct 19, 2026, 14:05 UTC from abc1234."
|
|
634
|
+
*/
|
|
635
|
+
export declare function statusLead(data: StatusBoardData): string;
|
|
636
|
+
/** This function gives the part of a URL for a text: "The server stack (R37)" gives "the-server-stack-r37". */
|
|
637
|
+
export declare function slugOf(text: string): string;
|
|
638
|
+
/** A section of the roadmap, with the count of its open items and of its done items. */
|
|
639
|
+
interface BoardSection {
|
|
640
|
+
slug: string;
|
|
641
|
+
label: string;
|
|
642
|
+
open: number;
|
|
643
|
+
done: number;
|
|
644
|
+
}
|
|
645
|
+
/** This function gives the sections of the items, in the sequence of the file. */
|
|
646
|
+
export declare function sectionsOf(items: readonly BoardItem[]): BoardSection[];
|
|
647
|
+
/** A group of items with one class. */
|
|
648
|
+
interface ItemGroup {
|
|
649
|
+
statusClass: StatusClass;
|
|
650
|
+
items: BoardItem[];
|
|
651
|
+
}
|
|
652
|
+
/** This function gives the groups of the open items in the sequence of `OPEN_CLASSES`, without the empty groups. */
|
|
653
|
+
export declare function openGroups(items: readonly BoardItem[]): ItemGroup[];
|
|
654
|
+
/** This function counts the items of each class. */
|
|
655
|
+
export declare function classCounts(items: readonly BoardItem[]): Record<StatusClass, number>;
|
|
656
|
+
/**
|
|
657
|
+
* The inline module of the status page. It filters the open work by class and by section, keeps the
|
|
658
|
+
* filters in the URL, and shows the age of each GitHub time.
|
|
659
|
+
*/
|
|
660
|
+
export declare const STATUS_SCRIPT: string;
|
|
661
|
+
/** This function renders the complete status page from the data of `status.json`. */
|
|
662
|
+
export declare function renderStatusPage(data: StatusBoardData, options: PageOptions): string;
|
|
663
|
+
//#endregion
|
|
664
|
+
//#region src/build.d.ts
|
|
665
|
+
/** An error in the command line. The CLI shows the help and exits with code 2. */
|
|
666
|
+
export declare class UsageError extends Error {}
|
|
667
|
+
/** The options of `build`. */
|
|
668
|
+
interface BuildOptions {
|
|
669
|
+
/** The folder of the repository. Relative paths start here. */
|
|
670
|
+
repoDir: string;
|
|
671
|
+
/** "owner/name" of the repository on GitHub. */
|
|
672
|
+
repository: string;
|
|
673
|
+
/** The built output folder of the site. */
|
|
674
|
+
out: string;
|
|
675
|
+
/** The path of the site home, for example `/client/`. */
|
|
676
|
+
base: string;
|
|
677
|
+
/** The roadmap file, from `repoDir`. Without it, the status page has only the GitHub part. */
|
|
678
|
+
roadmap?: string | undefined;
|
|
679
|
+
/** The npm names or scopes for the npm dates. */
|
|
680
|
+
packages?: readonly string[] | undefined;
|
|
681
|
+
/** The glob pattern of the changelog files. */
|
|
682
|
+
changesets?: string | undefined;
|
|
683
|
+
/** The npm name of the package whose changelog gives the versions. */
|
|
684
|
+
group?: string | undefined;
|
|
685
|
+
token?: string | undefined;
|
|
686
|
+
/** The commit of the build. */
|
|
687
|
+
commit?: string | null | undefined;
|
|
688
|
+
/** A CSS file whose content each page gets after the default CSS. */
|
|
689
|
+
css?: string | undefined;
|
|
690
|
+
/** The name of the site in the header of the pages. */
|
|
691
|
+
siteName?: string | undefined;
|
|
692
|
+
/** True to write only the JSON data, without the pages. */
|
|
693
|
+
dataOnly?: boolean | undefined;
|
|
694
|
+
fetch?: typeof fetch | undefined;
|
|
695
|
+
/** The ISO time of the build. The default is the time of the call. */
|
|
696
|
+
now?: string | undefined;
|
|
697
|
+
warn?: ((message: string) => void) | undefined;
|
|
698
|
+
}
|
|
699
|
+
/** The result of `build`. */
|
|
700
|
+
interface BuildResult {
|
|
701
|
+
/** The written files, as absolute paths. */
|
|
702
|
+
files: string[];
|
|
703
|
+
releases: Release[];
|
|
704
|
+
status: StatusBoardData;
|
|
705
|
+
}
|
|
706
|
+
/**
|
|
707
|
+
* This function reads the sources and writes `data/releases.json`, `data/status.json`,
|
|
708
|
+
* `releases/index.html` and `status/index.html` into the output folder.
|
|
709
|
+
*
|
|
710
|
+
* @throws ReleaseDataError or RoadmapParseError when a source on disk is not correct
|
|
711
|
+
*/
|
|
712
|
+
export declare function build(options: BuildOptions): Promise<BuildResult>;
|
|
713
|
+
/** The help of the CLI. */
|
|
714
|
+
export declare const HELP = "Usage: site-pages build --out <dir> [options]\n\nWrites <out>/data/releases.json, <out>/data/status.json, <out>/releases/index.html\nand <out>/status/index.html. Start it in the repository, after the build of the site.\n\nOptions:\n --out <dir> The built output folder of the site (necessary)\n --repo <owner/name> The GitHub repository (default: $GITHUB_REPOSITORY, else the remote \"origin\")\n --base </name/> The path of the site home (default: \"/<name>/\", or \"/\" for <owner>.github.io)\n --roadmap <file> The roadmap file (default: none, the status page has only the GitHub part)\n --packages <names> npm names or a @scope, separated by commas, for the npm dates\n --changesets <glob> The changelog files (default: packages/*/CHANGELOG.md, else CHANGELOG.md)\n --group <name> The npm name of the package whose changelog gives the versions\n --token <token> A GitHub token with read access (default: $GITHUB_TOKEN)\n --css <file> A CSS file for the pages, after the default CSS\n --site-name <name> The name of the site in the header (default: the repository name)\n --data-only Write only the JSON data, not the pages\n -h, --help Show this help\n";
|
|
715
|
+
/** The input and output of `runCli`. A test gives its own values. */
|
|
716
|
+
interface CliIo {
|
|
717
|
+
cwd: string;
|
|
718
|
+
env: Record<string, string | undefined>;
|
|
719
|
+
stdout: (text: string) => void;
|
|
720
|
+
stderr: (text: string) => void;
|
|
721
|
+
fetch?: typeof fetch;
|
|
722
|
+
now?: string;
|
|
723
|
+
}
|
|
724
|
+
/**
|
|
725
|
+
* This function reads the command line into the options of `build`.
|
|
726
|
+
*
|
|
727
|
+
* @throws UsageError when the command line is not correct
|
|
728
|
+
*/
|
|
729
|
+
export declare function parseBuildArgs(argv: readonly string[], io: Pick<CliIo, "cwd" | "env">): BuildOptions | "help";
|
|
730
|
+
/**
|
|
731
|
+
* This function starts the CLI and gives the exit code. The code is 0 after a build, 1 when a
|
|
732
|
+
* source is not correct, and 2 for an incorrect command line.
|
|
733
|
+
*/
|
|
734
|
+
export declare function runCli(argv: readonly string[], io: CliIo): Promise<number>;
|
|
735
|
+
//#endregion
|
|
736
|
+
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 };
|
|
737
|
+
//# sourceMappingURL=index.d.ts.map
|