react-cheminfo 0.19.0 → 0.20.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/lib/about/core/about.d.ts +6 -4
- package/lib/about/core/about.d.ts.map +1 -1
- package/lib/about/core/about.js +8 -2
- package/lib/about/core/about.js.map +1 -1
- package/lib/about/ui/AboutPage.d.ts.map +1 -1
- package/lib/about/ui/AboutPage.js +1 -1
- package/lib/about/ui/AboutPage.js.map +1 -1
- package/lib/about/ui/AboutVersion.d.ts +7 -6
- package/lib/about/ui/AboutVersion.d.ts.map +1 -1
- package/lib/about/ui/AboutVersion.js +32 -9
- package/lib/about/ui/AboutVersion.js.map +1 -1
- package/lib/build/core/buildInfo.d.ts +28 -0
- package/lib/build/core/buildInfo.d.ts.map +1 -1
- package/lib/build/core/buildInfo.js +42 -0
- package/lib/build/core/buildInfo.js.map +1 -1
- package/lib/build/core/index.d.ts +1 -1
- package/lib/build/core/index.d.ts.map +1 -1
- package/lib/build/core/index.js +1 -1
- package/lib/build/core/index.js.map +1 -1
- package/package.json +1 -1
- package/src/about/core/about.ts +16 -7
- package/src/about/ui/AboutPage.tsx +12 -6
- package/src/about/ui/AboutVersion.tsx +43 -15
- package/src/build/core/buildInfo.ts +43 -0
- package/src/build/core/index.ts +3 -0
|
@@ -66,14 +66,15 @@ export interface AboutContent {
|
|
|
66
66
|
*/
|
|
67
67
|
publicRepository?: boolean;
|
|
68
68
|
/**
|
|
69
|
-
* Which build is running, from `
|
|
69
|
+
* Which build is running, from `react-cheminfo/build-info` — never written
|
|
70
70
|
* by hand, which is what keeps it true after the next release.
|
|
71
71
|
* @default undefined — the site's build does not publish one
|
|
72
72
|
*/
|
|
73
73
|
build?: BuildInfo;
|
|
74
74
|
/**
|
|
75
|
-
* Where a problem is reported
|
|
76
|
-
*
|
|
75
|
+
* Where a problem is reported: an address a visitor can actually open, so a
|
|
76
|
+
* site whose sources are private names one of its own or says nothing.
|
|
77
|
+
* @default the repository's /issues, and none at all when it is private
|
|
77
78
|
*/
|
|
78
79
|
issues?: string;
|
|
79
80
|
}
|
|
@@ -112,7 +113,8 @@ export interface ResolvedAbout {
|
|
|
112
113
|
publicRepository: boolean;
|
|
113
114
|
/** Which build is running, or `undefined` when the site does not say. */
|
|
114
115
|
build: BuildInfo | undefined;
|
|
115
|
-
|
|
116
|
+
/** Where a problem is reported, or `undefined` when there is nowhere open. */
|
|
117
|
+
issues: string | undefined;
|
|
116
118
|
}
|
|
117
119
|
/**
|
|
118
120
|
* Fill in what a site left to the family, and resolve what it named.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"about.d.ts","sourceRoot":"","sources":["../../../src/about/core/about.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAG3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAE3E,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGhE;;;;;;;;GAQG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC;IAC/B,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,iEAAiE;IACjE,GAAG,EAAE,SAAS,MAAM,EAAE,CAAC;IACvB,8DAA8D;IAC9D,OAAO,EAAE,SAAS,QAAQ,EAAE,CAAC;IAC7B;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,SAAS,EAAE,CAAC;IAC5B;;;;OAIG;IACH,MAAM,CAAC,EAAE,SAAS,WAAW,EAAE,CAA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14,6 +14,7 @@ export function resolveAbout(content) {
|
|
|
14
14
|
? siteById(content.siteId)
|
|
15
15
|
: content.siteId;
|
|
16
16
|
const repository = content.repository ?? site.repository;
|
|
17
|
+
const publicRepository = content.publicRepository ?? site.publicRepository ?? false;
|
|
17
18
|
return {
|
|
18
19
|
site,
|
|
19
20
|
what: content.what,
|
|
@@ -25,9 +26,14 @@ export function resolveAbout(content) {
|
|
|
25
26
|
providedBy: providers(content.providedBy ?? []),
|
|
26
27
|
license: content.license ?? DEFAULT_LICENSE,
|
|
27
28
|
repository,
|
|
28
|
-
publicRepository
|
|
29
|
+
publicRepository,
|
|
29
30
|
build: content.build,
|
|
30
|
-
|
|
31
|
+
// A tracker behind a private repository answers 404 to every visitor, so
|
|
32
|
+
// a site that names none of its own asks for a report nowhere.
|
|
33
|
+
issues: content.issues ??
|
|
34
|
+
(publicRepository
|
|
35
|
+
? `${withoutTrailingSlash(repository)}/issues`
|
|
36
|
+
: undefined),
|
|
31
37
|
};
|
|
32
38
|
}
|
|
33
39
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"about.js","sourceRoot":"","sources":["../../../src/about/core/about.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAI1D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"about.js","sourceRoot":"","sources":["../../../src/about/core/about.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAI1D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAsH3C;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,OAAqB;IAChD,MAAM,IAAI,GACR,OAAO,OAAO,CAAC,MAAM,K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,EAAE,CAAC;QACjC,QAAQ,CAAC,IAAI,CACX,2GAA2G,CAC5G,CAAC;IACJ,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,+DAA+D;AAC/D,MAAM,eAAe,GAAG,KAAK,CAAC;AAE9B,MAAM,UAAU,GAAG,GAAG,CAAC;AACvB,MAAM,OAAO,GAAG,CAAC,CAAC;AAClB,MAAM,OAAO,GAAG,CAAC,CAAC;AAClB,MAAM,cAAc,GAAG,EAAE,CAAC;AAC1B,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,eAAe,GAAG,GAAG,CAAC;AAE5B,SAAS,oBAAoB,CAAC,GAAW;IACvC,OAAO,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;AACpD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AboutPage.d.ts","sourceRoot":"","sources":["../../../src/about/ui/AboutPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AASrD,MAAM,WAAW,cAAc;IAC7B,uCAAuC;IACvC,OAAO,EAAE,YAAY,CAAC;IACtB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"AboutPage.d.ts","sourceRoot":"","sources":["../../../src/about/ui/AboutPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AASrD,MAAM,WAAW,cAAc;IAC7B,uCAAuC;IACvC,OAAO,EAAE,YAAY,CAAC;IACtB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,YAAY,CAqG7D"}
|
|
@@ -26,7 +26,7 @@ export function AboutPage(props) {
|
|
|
26
26
|
const site = about.site;
|
|
27
27
|
return (_jsxs("div", { className: className === undefined ? 'about-page' : `about-page ${className}`, style: PAGE_STYLE, children: [_jsxs("header", { className: "about-hero", style: HERO_STYLE, children: [logo === undefined
|
|
28
28
|
? (mark ?? _jsx(SiteMark, { site: site, size: 56 }))
|
|
29
|
-
: null, _jsxs("div", { style: HERO_BODY_STYLE, children: [_jsx("h1", { style: logo === undefined ? NAME_STYLE : LOGO_NAME_STYLE, children: logo ?? _jsx(Wordmark, { site: site, size: 26 }) }), _jsx("p", { style: TAGLINE_STYLE, children: site.tagline }), _jsx("p", { style: WHAT_STYLE, children: about.what })] }), _jsx(AboutVersion, { build: about.build, repository: about.repository, publicRepository: about.publicRepository })] }), about.people.length === 0 && about.providedBy.length === 0 ? null : (_jsx(AboutSection, { title: "Provided by", className: "about-provided-by", children: _jsx(AboutProvidedBy, { people: about.people, providers: about.providedBy }) })), _jsx(AboutSection, { title: "What you can do here", className: "about-can", children: _jsx("ul", { style: CAN_LIST_STYLE, children: about.can.map((line) => (_jsx("li", { children: line }, line))) }) }), about.paragraphs.length === 0 ? null : (_jsx(AboutSection, { className: "about-context", children: about.paragraphs.map((paragraph, index) => (_jsx("p", { style: index === 0 ? FIRST_PARAGRAPH_STYLE : PARAGRAPH_STYLE, children: paragraph }, paragraph))) })), children, _jsx(AboutSection, { title: "Built on", className: "about-credits", children: _jsx(CreditsList, { entries: about.credits }) }), about.cite.length === 0 ? null : (_jsx(AboutSection, { title: "How to cite", className: "about-cite", children: _jsx(AboutCitations, { works: about.cite }) })), !about.publicRepository ? null : (_jsxs(AboutSection, { title: "Licence and source", className: "about-licence", children: [_jsxs("p", { style: FIRST_PARAGRAPH_STYLE, children: [about.license, ", \u00A9 cheminfo. Use it in a course, fork it, or lift a piece of it into something else. The sources are at", ' ', _jsx(ExternalLink, { href: about.repository }), "."] }), about.build === undefined ? null : (_jsx(AboutBuild, { build: about.build, repository: about.repository }))] })), _jsx(AboutSection, { title: "Found a problem?", className: "about-issues", children: _jsxs("p", { style: FIRST_PARAGRAPH_STYLE, children: ["Tell us: a report naming what you typed and what came back is the fastest fix there is. ", _jsx(ExternalLink, { href: about.issues }), "."] }) })] }));
|
|
29
|
+
: null, _jsxs("div", { style: HERO_BODY_STYLE, children: [_jsx("h1", { style: logo === undefined ? NAME_STYLE : LOGO_NAME_STYLE, children: logo ?? _jsx(Wordmark, { site: site, size: 26 }) }), _jsx("p", { style: TAGLINE_STYLE, children: site.tagline }), _jsx("p", { style: WHAT_STYLE, children: about.what })] }), _jsx(AboutVersion, { build: about.build, repository: about.repository, publicRepository: about.publicRepository })] }), about.people.length === 0 && about.providedBy.length === 0 ? null : (_jsx(AboutSection, { title: "Provided by", className: "about-provided-by", children: _jsx(AboutProvidedBy, { people: about.people, providers: about.providedBy }) })), _jsx(AboutSection, { title: "What you can do here", className: "about-can", children: _jsx("ul", { style: CAN_LIST_STYLE, children: about.can.map((line) => (_jsx("li", { children: line }, line))) }) }), about.paragraphs.length === 0 ? null : (_jsx(AboutSection, { className: "about-context", children: about.paragraphs.map((paragraph, index) => (_jsx("p", { style: index === 0 ? FIRST_PARAGRAPH_STYLE : PARAGRAPH_STYLE, children: paragraph }, paragraph))) })), children, _jsx(AboutSection, { title: "Built on", className: "about-credits", children: _jsx(CreditsList, { entries: about.credits }) }), about.cite.length === 0 ? null : (_jsx(AboutSection, { title: "How to cite", className: "about-cite", children: _jsx(AboutCitations, { works: about.cite }) })), !about.publicRepository ? null : (_jsxs(AboutSection, { title: "Licence and source", className: "about-licence", children: [_jsxs("p", { style: FIRST_PARAGRAPH_STYLE, children: [about.license, ", \u00A9 cheminfo. Use it in a course, fork it, or lift a piece of it into something else. The sources are at", ' ', _jsx(ExternalLink, { href: about.repository }), "."] }), about.build === undefined ? null : (_jsx(AboutBuild, { build: about.build, repository: about.repository }))] })), about.issues === undefined ? null : (_jsx(AboutSection, { title: "Found a problem?", className: "about-issues", children: _jsxs("p", { style: FIRST_PARAGRAPH_STYLE, children: ["Tell us: a report naming what you typed and what came back is the fastest fix there is. ", _jsx(ExternalLink, { href: about.issues }), "."] }) }))] }));
|
|
30
30
|
}
|
|
31
31
|
function ExternalLink(props) {
|
|
32
32
|
const { href } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AboutPage.js","sourceRoot":"","sources":["../../../src/about/ui/AboutPage.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAkC,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAiC,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA8B,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAsB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAuB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAoB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AAU,GAAG;IACjB,MAAM,EAAE,CAAC;IACT,QAAQ,EAAE,EAAE;IACZ,UAAU,EAAE,GAAG;CACiB,CAAC;AAEnC,MAAM,eAAe,GAAG;IACtB,MAAM,EAAE,SAAS;CACe,CAAC;AAEnC,MAAM,aAAa,GAAG;IACpB,MAAM,EAAE,WAAW;IACnB,KAAK,EAAE,mBAAmB;IAC1B,QAAQ,EAAE,EAAE;CACoB,CAAC;AAEnC,MAAM,UAAU,GAAG,EAAE,MAAM,EAAE,CAAC,EAAmC,CAAC;AAElE,MAAM,cAAc,GAAG;IACrB,MAAM,EAAE,CAAC;IACT,WAAW,EAAE,EAAE;CACiB,CAAC;AAEnC,MAAM,qBAAqB,GAAG;IAC5B,MAAM,EAAE,CAAC;CACuB,CAAC;AAEnC,MAAM,eAAe,GAAG;IACtB,MAAM,EAAE,SAAS;CACe,CAAC;AAEnC,MAAM,UAAU,GAAG,EAAE,KAAK,EAAE,eAAe,EAAmC,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Which
|
|
2
|
+
* Which build of a site a visitor has open, in the corner of its hero.
|
|
3
3
|
*
|
|
4
4
|
* A report of something going wrong is worth answering only when we know what
|
|
5
|
-
* was running, and
|
|
6
|
-
*
|
|
5
|
+
* was running, and that is the one thing an About page cannot say from a
|
|
6
|
+
* hand-written record. It sits at the top of the page rather than at the
|
|
7
7
|
* bottom because it is the one line a reader is asked to quote back.
|
|
8
8
|
*/
|
|
9
9
|
import type { ReactElement } from 'react';
|
|
@@ -11,15 +11,16 @@ import type { BuildInfo } from '../../build/core/buildInfo.ts';
|
|
|
11
11
|
export interface AboutVersionProps {
|
|
12
12
|
/** What the build published about itself, or `undefined` when it published none. */
|
|
13
13
|
build: BuildInfo | undefined;
|
|
14
|
-
/** Where the sources live, which is what the
|
|
14
|
+
/** Where the sources live, which is what the badge links into. */
|
|
15
15
|
repository: string;
|
|
16
16
|
/** Whether a visitor can open that repository, and so whether it is linked. */
|
|
17
17
|
publicRepository: boolean;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
* The
|
|
20
|
+
* The build badge: the release a site is serving, or the commit it was built
|
|
21
|
+
* from while it has no release yet, and when it was made.
|
|
21
22
|
* @param props - See {@link AboutVersionProps}.
|
|
22
|
-
* @returns The badge, or `null
|
|
23
|
+
* @returns The badge, or `null` when the build says nothing worth showing.
|
|
23
24
|
*/
|
|
24
25
|
export declare function AboutVersion(props: AboutVersionProps): ReactElement | null;
|
|
25
26
|
//# sourceMappingURL=AboutVersion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AboutVersion.d.ts","sourceRoot":"","sources":["../../../src/about/ui/AboutVersion.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"AboutVersion.d.ts","sourceRoot":"","sources":["../../../src/about/ui/AboutVersion.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAS/D,MAAM,WAAW,iBAAiB;IAChC,oFAAoF;IACpF,KAAK,EAAE,SAAS,GAAG,SAAS,CAAC;IAC7B,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC;IACnB,+EAA+E;IAC/E,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,YAAY,GAAG,IAAI,CA6B1E"}
|
|
@@ -1,21 +1,44 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { releasedVersion } from "../../build/core/buildInfo.js";
|
|
2
|
+
import { buildLabel, buildStamp, buildSummary, releasedVersion, } from "../../build/core/buildInfo.js";
|
|
3
3
|
import { githubSources } from "../core/repository.js";
|
|
4
4
|
/**
|
|
5
|
-
* The
|
|
5
|
+
* The build badge: the release a site is serving, or the commit it was built
|
|
6
|
+
* from while it has no release yet, and when it was made.
|
|
6
7
|
* @param props - See {@link AboutVersionProps}.
|
|
7
|
-
* @returns The badge, or `null
|
|
8
|
+
* @returns The badge, or `null` when the build says nothing worth showing.
|
|
8
9
|
*/
|
|
9
10
|
export function AboutVersion(props) {
|
|
10
11
|
const { build, repository, publicRepository } = props;
|
|
11
|
-
const
|
|
12
|
-
if (
|
|
12
|
+
const label = buildLabel(build);
|
|
13
|
+
if (build === undefined || label === undefined)
|
|
13
14
|
return null;
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
const href = publicRepository ? addressOf(build, repository) : undefined;
|
|
16
|
+
const summary = buildSummary(build);
|
|
17
|
+
// The instant belongs on the badge rather than in its hover: a version
|
|
18
|
+
// nobody can date says nothing about how old the page they read is.
|
|
19
|
+
const badge = `${label} · ${buildStamp(build.builtAt)}`;
|
|
20
|
+
if (href === undefined) {
|
|
21
|
+
return (_jsx("span", { style: BADGE_STYLE, className: "about-version", title: summary, children: badge }));
|
|
17
22
|
}
|
|
18
|
-
return (_jsx("a", { className: "about-version", href:
|
|
23
|
+
return (_jsx("a", { className: "about-version", href: href, title: summary, target: "_blank", rel: "noopener noreferrer", style: LINK_BADGE_STYLE, children: badge }));
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* What the badge opens: the release it names, or the commit it was built from.
|
|
27
|
+
* @param build - What the build published about itself.
|
|
28
|
+
* @param repository - Where the sources live.
|
|
29
|
+
* @returns The address, or `undefined` when nothing inside the repository can
|
|
30
|
+
* be addressed.
|
|
31
|
+
*/
|
|
32
|
+
function addressOf(build, repository) {
|
|
33
|
+
const sources = githubSources(repository);
|
|
34
|
+
if (sources === undefined)
|
|
35
|
+
return undefined;
|
|
36
|
+
const version = releasedVersion(build);
|
|
37
|
+
if (version !== undefined)
|
|
38
|
+
return `${sources}/releases/tag/v${version}`;
|
|
39
|
+
return build.commit === undefined
|
|
40
|
+
? undefined
|
|
41
|
+
: `${sources}/commit/${build.commit}`;
|
|
19
42
|
}
|
|
20
43
|
const BADGE_STYLE = {
|
|
21
44
|
flex: '0 0 auto',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AboutVersion.js","sourceRoot":"","sources":["../../../src/about/ui/AboutVersion.tsx"],"names":[],"mappings":";AAYA,OAAO,
|
|
1
|
+
{"version":3,"file":"AboutVersion.js","sourceRoot":"","sources":["../../../src/about/ui/AboutVersion.tsx"],"names":[],"mappings":";AAYA,OAAO,EACL,UAAU,EACV,UAAU,EACV,YAAY,EACZ,eAAe,GAChB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAWtD;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,KAAwB;IACnD,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,GAAG,KAAK,CAAC;IACtD,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IAChC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IAC5D,MAAM,IAAI,GAAG,gBAAgB,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACzE,MAAM,OAAO,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACpC,uEAAuE;IACvE,oEAAoE;IACpE,MAAM,KAAK,GAAG,GAAG,KAAK,MAAM,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;IACxD,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,CACL,eAAM,KAAK,EAAE,WAAW,EAAE,SAAS,EAAC,eAAe,EAAC,KAAK,EAAE,OAAO,YAC/D,KAAK,GACD,CACR,CAAC;IACJ,CAAC;IAED,OAAO,CACL,YACE,SAAS,EAAC,eAAe,EACzB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,OAAO,EACd,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,qBAAqB,EACzB,KAAK,EAAE,gBAAgB,YAEtB,KAAK,GACJ,CACL,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,SAAS,SAAS,CAAC,KAAgB,EAAE,UAAkB;IACrD,MAAM,OAAO,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC;IAC1C,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC5C,MAAM,OAAO,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IACvC,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,GAAG,OAAO,kBAAkB,OAAO,EAAE,CAAC;IACxE,OAAO,KAAK,CAAC,MAAM,KAAK,SAAS;QAC/B,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,GAAG,OAAO,WAAW,KAAK,CAAC,MAAM,EAAE,CAAC;AAC1C,CAAC;AAED,MAAM,WAAW,GAAG;IAClB,IAAI,EAAE,UAAU;IAChB,UAAU,EAAE,2CAA2C;IACvD,QAAQ,EAAE,EAAE;IACZ,KAAK,EAAE,mBAAmB;IAC1B,UAAU,EAAE,QAAQ;CACY,CAAC;AAEnC,MAAM,gBAAgB,GAAG;IACvB,GAAG,WAAW;IACd,KAAK,EAAE,eAAe;CACU,CAAC"}
|
|
@@ -40,6 +40,34 @@ export declare const UNRELEASED_VERSION = "0.0.0";
|
|
|
40
40
|
* or has never been released.
|
|
41
41
|
*/
|
|
42
42
|
export declare function releasedVersion(build: BuildInfo | undefined): string | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* What the build is called on the page: the release when there is one, and the
|
|
45
|
+
* commit when there is not.
|
|
46
|
+
*
|
|
47
|
+
* A site that has never been released still has to be identifiable in a
|
|
48
|
+
* report, and `0.0.0` identifies nothing while the commit it was built from
|
|
49
|
+
* identifies exactly one build.
|
|
50
|
+
* @param build - What the build published about itself, or `undefined`.
|
|
51
|
+
* @returns The label, or `undefined` when the build published neither.
|
|
52
|
+
*/
|
|
53
|
+
export declare function buildLabel(build: BuildInfo | undefined): string | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* When the build was made, as it is read on the badge: the day and the minute.
|
|
56
|
+
*
|
|
57
|
+
* A build a reader is asked to quote is worth little without a date, and two
|
|
58
|
+
* builds of the same day are told apart by the minute. The seconds are left to
|
|
59
|
+
* the hover, where the whole record is.
|
|
60
|
+
* @param builtAt - The ISO instant the build wrote.
|
|
61
|
+
* @returns The instant, in UTC, e.g. `2026-09-16 09:41 UTC`.
|
|
62
|
+
*/
|
|
63
|
+
export declare function buildStamp(builtAt: string): string;
|
|
64
|
+
/**
|
|
65
|
+
* The whole record in one line, for the hover of a badge that shows one part
|
|
66
|
+
* of it.
|
|
67
|
+
* @param build - What the build published about itself.
|
|
68
|
+
* @returns e.g. `Built 2026-09-16 09:41:07 UTC from commit a1b2c3d`.
|
|
69
|
+
*/
|
|
70
|
+
export declare function buildSummary(build: BuildInfo): string;
|
|
43
71
|
/**
|
|
44
72
|
* The commit as it is written for a reader.
|
|
45
73
|
* @param commit - The full hash.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildInfo.d.ts","sourceRoot":"","sources":["../../../src/build/core/buildInfo.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,WAAW,SAAS;IACxB,0EAA0E;IAC1E,OAAO,EAAE,MAAM,CAAC;IAChB,mFAAmF;IACnF,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,UAAU,CAAC;AAE1C;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,SAAS,GAAG,SAAS,GAC3B,MAAM,GAAG,SAAS,CAIpB;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAGrD"}
|
|
1
|
+
{"version":3,"file":"buildInfo.d.ts","sourceRoot":"","sources":["../../../src/build/core/buildInfo.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,WAAW,SAAS;IACxB,0EAA0E;IAC1E,OAAO,EAAE,MAAM,CAAC;IAChB,mFAAmF;IACnF,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,UAAU,CAAC;AAE1C;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,SAAS,GAAG,SAAS,GAC3B,MAAM,GAAG,SAAS,CAIpB;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAK3E;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAIrD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAGrD"}
|
|
@@ -19,6 +19,47 @@ export function releasedVersion(build) {
|
|
|
19
19
|
return undefined;
|
|
20
20
|
return version;
|
|
21
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* What the build is called on the page: the release when there is one, and the
|
|
24
|
+
* commit when there is not.
|
|
25
|
+
*
|
|
26
|
+
* A site that has never been released still has to be identifiable in a
|
|
27
|
+
* report, and `0.0.0` identifies nothing while the commit it was built from
|
|
28
|
+
* identifies exactly one build.
|
|
29
|
+
* @param build - What the build published about itself, or `undefined`.
|
|
30
|
+
* @returns The label, or `undefined` when the build published neither.
|
|
31
|
+
*/
|
|
32
|
+
export function buildLabel(build) {
|
|
33
|
+
const version = releasedVersion(build);
|
|
34
|
+
if (version !== undefined)
|
|
35
|
+
return version;
|
|
36
|
+
const commit = build?.commit;
|
|
37
|
+
return commit === undefined ? undefined : shortCommit(commit);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* When the build was made, as it is read on the badge: the day and the minute.
|
|
41
|
+
*
|
|
42
|
+
* A build a reader is asked to quote is worth little without a date, and two
|
|
43
|
+
* builds of the same day are told apart by the minute. The seconds are left to
|
|
44
|
+
* the hover, where the whole record is.
|
|
45
|
+
* @param builtAt - The ISO instant the build wrote.
|
|
46
|
+
* @returns The instant, in UTC, e.g. `2026-09-16 09:41 UTC`.
|
|
47
|
+
*/
|
|
48
|
+
export function buildStamp(builtAt) {
|
|
49
|
+
return `${builtAt.slice(0, MINUTE_LENGTH).replace('T', ' ')} UTC`;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The whole record in one line, for the hover of a badge that shows one part
|
|
53
|
+
* of it.
|
|
54
|
+
* @param build - What the build published about itself.
|
|
55
|
+
* @returns e.g. `Built 2026-09-16 09:41:07 UTC from commit a1b2c3d`.
|
|
56
|
+
*/
|
|
57
|
+
export function buildSummary(build) {
|
|
58
|
+
const built = `Built ${formatBuiltAt(build.builtAt)}`;
|
|
59
|
+
if (build.commit === undefined)
|
|
60
|
+
return built;
|
|
61
|
+
return `${built} from commit ${shortCommit(build.commit)}`;
|
|
62
|
+
}
|
|
22
63
|
/**
|
|
23
64
|
* The commit as it is written for a reader.
|
|
24
65
|
* @param commit - The full hash.
|
|
@@ -37,5 +78,6 @@ export function formatBuiltAt(builtAt) {
|
|
|
37
78
|
return `${seconds} UTC`;
|
|
38
79
|
}
|
|
39
80
|
const SHORT_COMMIT_LENGTH = 7;
|
|
81
|
+
const MINUTE_LENGTH = 16;
|
|
40
82
|
const SECOND_LENGTH = 19;
|
|
41
83
|
//# sourceMappingURL=buildInfo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildInfo.js","sourceRoot":"","sources":["../../../src/build/core/buildInfo.ts"],"names":[],"mappings":"AA2BA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,OAAO,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAC7B,KAA4B;IAE5B,MAAM,OAAO,GAAG,KAAK,EAAE,OAAO,CAAC;IAC/B,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,kBAAkB;QAAE,OAAO,SAAS,CAAC;IAC9E,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,MAAc;IACxC,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC;AAC9C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,OAAe;IAC3C,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAClE,OAAO,GAAG,OAAO,MAAM,CAAC;AAC1B,CAAC;AAED,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAC9B,MAAM,aAAa,GAAG,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"buildInfo.js","sourceRoot":"","sources":["../../../src/build/core/buildInfo.ts"],"names":[],"mappings":"AA2BA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;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,OAAe;IAC3C,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAClE,OAAO,GAAG,OAAO,MAAM,CAAC;AAC1B,CAAC;AAED,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAC9B,MAAM,aAAa,GAAG,EAAE,CAAC;AACzB,MAAM,aAAa,GAAG,EAAE,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export type { BuildInfo } from './buildInfo.ts';
|
|
2
|
-
export { UNRELEASED_VERSION, formatBuiltAt, releasedVersion, shortCommit, } from './buildInfo.ts';
|
|
2
|
+
export { UNRELEASED_VERSION, buildLabel, buildStamp, buildSummary, formatBuiltAt, releasedVersion, shortCommit, } from './buildInfo.ts';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/build/core/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,WAAW,GACZ,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/build/core/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EACL,kBAAkB,EAClB,UAAU,EACV,UAAU,EACV,YAAY,EACZ,aAAa,EACb,eAAe,EACf,WAAW,GACZ,MAAM,gBAAgB,CAAC"}
|
package/lib/build/core/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { UNRELEASED_VERSION, formatBuiltAt, releasedVersion, shortCommit, } from "./buildInfo.js";
|
|
1
|
+
export { UNRELEASED_VERSION, buildLabel, buildStamp, buildSummary, formatBuiltAt, releasedVersion, shortCommit, } from "./buildInfo.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/build/core/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,WAAW,GACZ,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/build/core/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAClB,UAAU,EACV,UAAU,EACV,YAAY,EACZ,aAAa,EACb,eAAe,EACf,WAAW,GACZ,MAAM,gBAAgB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-cheminfo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "React components, hooks and framework-free helpers shared by the cheminfo sites: site chrome, citations, sharing, routing, pedagogy, charts, and the structure, orbital and 3D molecule viewers",
|
|
6
6
|
"author": "Luc Patiny",
|
package/src/about/core/about.ts
CHANGED
|
@@ -71,14 +71,15 @@ export interface AboutContent {
|
|
|
71
71
|
*/
|
|
72
72
|
publicRepository?: boolean;
|
|
73
73
|
/**
|
|
74
|
-
* Which build is running, from `
|
|
74
|
+
* Which build is running, from `react-cheminfo/build-info` — never written
|
|
75
75
|
* by hand, which is what keeps it true after the next release.
|
|
76
76
|
* @default undefined — the site's build does not publish one
|
|
77
77
|
*/
|
|
78
78
|
build?: BuildInfo;
|
|
79
79
|
/**
|
|
80
|
-
* Where a problem is reported
|
|
81
|
-
*
|
|
80
|
+
* Where a problem is reported: an address a visitor can actually open, so a
|
|
81
|
+
* site whose sources are private names one of its own or says nothing.
|
|
82
|
+
* @default the repository's /issues, and none at all when it is private
|
|
82
83
|
*/
|
|
83
84
|
issues?: string;
|
|
84
85
|
}
|
|
@@ -119,7 +120,8 @@ export interface ResolvedAbout {
|
|
|
119
120
|
publicRepository: boolean;
|
|
120
121
|
/** Which build is running, or `undefined` when the site does not say. */
|
|
121
122
|
build: BuildInfo | undefined;
|
|
122
|
-
|
|
123
|
+
/** Where a problem is reported, or `undefined` when there is nowhere open. */
|
|
124
|
+
issues: string | undefined;
|
|
123
125
|
}
|
|
124
126
|
|
|
125
127
|
/**
|
|
@@ -136,6 +138,8 @@ export function resolveAbout(content: AboutContent): ResolvedAbout {
|
|
|
136
138
|
? siteById(content.siteId)
|
|
137
139
|
: content.siteId;
|
|
138
140
|
const repository = content.repository ?? site.repository;
|
|
141
|
+
const publicRepository =
|
|
142
|
+
content.publicRepository ?? site.publicRepository ?? false;
|
|
139
143
|
|
|
140
144
|
return {
|
|
141
145
|
site,
|
|
@@ -148,10 +152,15 @@ export function resolveAbout(content: AboutContent): ResolvedAbout {
|
|
|
148
152
|
providedBy: providers(content.providedBy ?? []),
|
|
149
153
|
license: content.license ?? DEFAULT_LICENSE,
|
|
150
154
|
repository,
|
|
151
|
-
publicRepository
|
|
152
|
-
content.publicRepository ?? site.publicRepository ?? false,
|
|
155
|
+
publicRepository,
|
|
153
156
|
build: content.build,
|
|
154
|
-
|
|
157
|
+
// A tracker behind a private repository answers 404 to every visitor, so
|
|
158
|
+
// a site that names none of its own asks for a report nowhere.
|
|
159
|
+
issues:
|
|
160
|
+
content.issues ??
|
|
161
|
+
(publicRepository
|
|
162
|
+
? `${withoutTrailingSlash(repository)}/issues`
|
|
163
|
+
: undefined),
|
|
155
164
|
};
|
|
156
165
|
}
|
|
157
166
|
|
|
@@ -143,12 +143,18 @@ export function AboutPage(props: AboutPageProps): ReactElement {
|
|
|
143
143
|
</AboutSection>
|
|
144
144
|
)}
|
|
145
145
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
146
|
+
{/*
|
|
147
|
+
Asking for a report is worth nothing without somewhere to send it, and
|
|
148
|
+
the tracker of a private repository answers 404 to every visitor.
|
|
149
|
+
*/}
|
|
150
|
+
{about.issues === undefined ? null : (
|
|
151
|
+
<AboutSection title="Found a problem?" className="about-issues">
|
|
152
|
+
<p style={FIRST_PARAGRAPH_STYLE}>
|
|
153
|
+
Tell us: a report naming what you typed and what came back is the
|
|
154
|
+
fastest fix there is. <ExternalLink href={about.issues} />.
|
|
155
|
+
</p>
|
|
156
|
+
</AboutSection>
|
|
157
|
+
)}
|
|
152
158
|
</div>
|
|
153
159
|
);
|
|
154
160
|
}
|
|
@@ -1,41 +1,51 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Which
|
|
2
|
+
* Which build of a site a visitor has open, in the corner of its hero.
|
|
3
3
|
*
|
|
4
4
|
* A report of something going wrong is worth answering only when we know what
|
|
5
|
-
* was running, and
|
|
6
|
-
*
|
|
5
|
+
* was running, and that is the one thing an About page cannot say from a
|
|
6
|
+
* hand-written record. It sits at the top of the page rather than at the
|
|
7
7
|
* bottom because it is the one line a reader is asked to quote back.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import type { CSSProperties, ReactElement } from 'react';
|
|
11
11
|
|
|
12
12
|
import type { BuildInfo } from '../../build/core/buildInfo.ts';
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
buildLabel,
|
|
15
|
+
buildStamp,
|
|
16
|
+
buildSummary,
|
|
17
|
+
releasedVersion,
|
|
18
|
+
} from '../../build/core/buildInfo.ts';
|
|
14
19
|
import { githubSources } from '../core/repository.ts';
|
|
15
20
|
|
|
16
21
|
export interface AboutVersionProps {
|
|
17
22
|
/** What the build published about itself, or `undefined` when it published none. */
|
|
18
23
|
build: BuildInfo | undefined;
|
|
19
|
-
/** Where the sources live, which is what the
|
|
24
|
+
/** Where the sources live, which is what the badge links into. */
|
|
20
25
|
repository: string;
|
|
21
26
|
/** Whether a visitor can open that repository, and so whether it is linked. */
|
|
22
27
|
publicRepository: boolean;
|
|
23
28
|
}
|
|
24
29
|
|
|
25
30
|
/**
|
|
26
|
-
* The
|
|
31
|
+
* The build badge: the release a site is serving, or the commit it was built
|
|
32
|
+
* from while it has no release yet, and when it was made.
|
|
27
33
|
* @param props - See {@link AboutVersionProps}.
|
|
28
|
-
* @returns The badge, or `null
|
|
34
|
+
* @returns The badge, or `null` when the build says nothing worth showing.
|
|
29
35
|
*/
|
|
30
36
|
export function AboutVersion(props: AboutVersionProps): ReactElement | null {
|
|
31
37
|
const { build, repository, publicRepository } = props;
|
|
32
|
-
const
|
|
33
|
-
if (
|
|
34
|
-
const
|
|
35
|
-
|
|
38
|
+
const label = buildLabel(build);
|
|
39
|
+
if (build === undefined || label === undefined) return null;
|
|
40
|
+
const href = publicRepository ? addressOf(build, repository) : undefined;
|
|
41
|
+
const summary = buildSummary(build);
|
|
42
|
+
// The instant belongs on the badge rather than in its hover: a version
|
|
43
|
+
// nobody can date says nothing about how old the page they read is.
|
|
44
|
+
const badge = `${label} · ${buildStamp(build.builtAt)}`;
|
|
45
|
+
if (href === undefined) {
|
|
36
46
|
return (
|
|
37
|
-
<span style={BADGE_STYLE} className="about-version">
|
|
38
|
-
{
|
|
47
|
+
<span style={BADGE_STYLE} className="about-version" title={summary}>
|
|
48
|
+
{badge}
|
|
39
49
|
</span>
|
|
40
50
|
);
|
|
41
51
|
}
|
|
@@ -43,16 +53,34 @@ export function AboutVersion(props: AboutVersionProps): ReactElement | null {
|
|
|
43
53
|
return (
|
|
44
54
|
<a
|
|
45
55
|
className="about-version"
|
|
46
|
-
href={
|
|
56
|
+
href={href}
|
|
57
|
+
title={summary}
|
|
47
58
|
target="_blank"
|
|
48
59
|
rel="noopener noreferrer"
|
|
49
60
|
style={LINK_BADGE_STYLE}
|
|
50
61
|
>
|
|
51
|
-
{
|
|
62
|
+
{badge}
|
|
52
63
|
</a>
|
|
53
64
|
);
|
|
54
65
|
}
|
|
55
66
|
|
|
67
|
+
/**
|
|
68
|
+
* What the badge opens: the release it names, or the commit it was built from.
|
|
69
|
+
* @param build - What the build published about itself.
|
|
70
|
+
* @param repository - Where the sources live.
|
|
71
|
+
* @returns The address, or `undefined` when nothing inside the repository can
|
|
72
|
+
* be addressed.
|
|
73
|
+
*/
|
|
74
|
+
function addressOf(build: BuildInfo, repository: string): string | undefined {
|
|
75
|
+
const sources = githubSources(repository);
|
|
76
|
+
if (sources === undefined) return undefined;
|
|
77
|
+
const version = releasedVersion(build);
|
|
78
|
+
if (version !== undefined) return `${sources}/releases/tag/v${version}`;
|
|
79
|
+
return build.commit === undefined
|
|
80
|
+
? undefined
|
|
81
|
+
: `${sources}/commit/${build.commit}`;
|
|
82
|
+
}
|
|
83
|
+
|
|
56
84
|
const BADGE_STYLE = {
|
|
57
85
|
flex: '0 0 auto',
|
|
58
86
|
fontFamily: 'var(--font-mono, ui-monospace, monospace)',
|
|
@@ -49,6 +49,48 @@ export function releasedVersion(
|
|
|
49
49
|
return version;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
/**
|
|
53
|
+
* What the build is called on the page: the release when there is one, and the
|
|
54
|
+
* commit when there is not.
|
|
55
|
+
*
|
|
56
|
+
* A site that has never been released still has to be identifiable in a
|
|
57
|
+
* report, and `0.0.0` identifies nothing while the commit it was built from
|
|
58
|
+
* identifies exactly one build.
|
|
59
|
+
* @param build - What the build published about itself, or `undefined`.
|
|
60
|
+
* @returns The label, or `undefined` when the build published neither.
|
|
61
|
+
*/
|
|
62
|
+
export function buildLabel(build: BuildInfo | undefined): string | undefined {
|
|
63
|
+
const version = releasedVersion(build);
|
|
64
|
+
if (version !== undefined) return version;
|
|
65
|
+
const commit = build?.commit;
|
|
66
|
+
return commit === undefined ? undefined : shortCommit(commit);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* When the build was made, as it is read on the badge: the day and the minute.
|
|
71
|
+
*
|
|
72
|
+
* A build a reader is asked to quote is worth little without a date, and two
|
|
73
|
+
* builds of the same day are told apart by the minute. The seconds are left to
|
|
74
|
+
* the hover, where the whole record is.
|
|
75
|
+
* @param builtAt - The ISO instant the build wrote.
|
|
76
|
+
* @returns The instant, in UTC, e.g. `2026-09-16 09:41 UTC`.
|
|
77
|
+
*/
|
|
78
|
+
export function buildStamp(builtAt: string): string {
|
|
79
|
+
return `${builtAt.slice(0, MINUTE_LENGTH).replace('T', ' ')} UTC`;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* The whole record in one line, for the hover of a badge that shows one part
|
|
84
|
+
* of it.
|
|
85
|
+
* @param build - What the build published about itself.
|
|
86
|
+
* @returns e.g. `Built 2026-09-16 09:41:07 UTC from commit a1b2c3d`.
|
|
87
|
+
*/
|
|
88
|
+
export function buildSummary(build: BuildInfo): string {
|
|
89
|
+
const built = `Built ${formatBuiltAt(build.builtAt)}`;
|
|
90
|
+
if (build.commit === undefined) return built;
|
|
91
|
+
return `${built} from commit ${shortCommit(build.commit)}`;
|
|
92
|
+
}
|
|
93
|
+
|
|
52
94
|
/**
|
|
53
95
|
* The commit as it is written for a reader.
|
|
54
96
|
* @param commit - The full hash.
|
|
@@ -69,4 +111,5 @@ export function formatBuiltAt(builtAt: string): string {
|
|
|
69
111
|
}
|
|
70
112
|
|
|
71
113
|
const SHORT_COMMIT_LENGTH = 7;
|
|
114
|
+
const MINUTE_LENGTH = 16;
|
|
72
115
|
const SECOND_LENGTH = 19;
|