react-cheminfo 0.48.0 → 0.49.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/README.md +2 -2
- package/bin/check-seo.mjs +4 -3
- package/lib/seo/core/routes.d.ts +1 -1
- package/lib/seo/core/routes.js +1 -1
- package/lib/seo/vite/prerender.d.ts +6 -0
- package/lib/seo/vite/prerender.d.ts.map +1 -1
- package/lib/seo/vite/prerender.js +7 -1
- package/lib/seo/vite/prerender.js.map +1 -1
- package/package.json +1 -1
- package/src/seo/core/routes.ts +1 -1
- package/src/seo/vite/prerender.ts +7 -1
package/README.md
CHANGED
|
@@ -1043,7 +1043,7 @@ keep in step.
|
|
|
1043
1043
|
```ts
|
|
1044
1044
|
cheminfoPrerender({ site: 'surge', routes: PAGE_ROUTES });
|
|
1045
1045
|
// origin defaults to https://surge.cheminfo.org — the site owns its host,
|
|
1046
|
-
// the mount is '', and /exercises is written at dist/exercises
|
|
1046
|
+
// the mount is '', and /exercises is written at dist/exercises.html.
|
|
1047
1047
|
|
|
1048
1048
|
cheminfoPrerender({
|
|
1049
1049
|
site: 'surge',
|
|
@@ -1055,7 +1055,7 @@ cheminfoPrerender({
|
|
|
1055
1055
|
```
|
|
1056
1056
|
|
|
1057
1057
|
The **files on disk are laid out from the build's own root either way** —
|
|
1058
|
-
`dist/exercises
|
|
1058
|
+
`dist/exercises.html`, never `dist/surge/exercises.html`. It is the
|
|
1059
1059
|
server that puts them under the mount. An origin must be an absolute `http` or
|
|
1060
1060
|
`https` address or it is refused: one written `localhost:3000` parses with
|
|
1061
1061
|
`localhost:` as its scheme, which would read the mount back as `/3000`.
|
package/bin/check-seo.mjs
CHANGED
|
@@ -63,7 +63,7 @@ if (stats === undefined || !stats.isDirectory()) {
|
|
|
63
63
|
const pages = [];
|
|
64
64
|
collect(root, pages);
|
|
65
65
|
if (pages.length === 0) {
|
|
66
|
-
process.exit(usageError(TOOL, `no
|
|
66
|
+
process.exit(usageError(TOOL, `no HTML page under ${root}`));
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
const problems = [];
|
|
@@ -367,8 +367,9 @@ function collect(path, pages) {
|
|
|
367
367
|
const next = join(path, entry.name);
|
|
368
368
|
if (entry.isDirectory()) {
|
|
369
369
|
collect(next, pages);
|
|
370
|
-
} else if (entry.name
|
|
371
|
-
const
|
|
370
|
+
} else if (entry.name.endsWith('.html')) {
|
|
371
|
+
const page = relative(root, next).replace(/\.html$/, '');
|
|
372
|
+
const address = `/${page.replace(/(?:^|\/)index$/, '')}`;
|
|
372
373
|
pages.push({ file: next, address: trimSlash(address) });
|
|
373
374
|
}
|
|
374
375
|
}
|
package/lib/seo/core/routes.d.ts
CHANGED
|
@@ -113,7 +113,7 @@ export declare function homeRoute(routes: readonly RouteMeta[]): RouteMeta;
|
|
|
113
113
|
* only the first entry describes, and one carrying a `..` segment writes its
|
|
114
114
|
* file outside the build output. Two addresses that differ only in an empty
|
|
115
115
|
* segment or in case are the same defect wearing a disguise: `//x` and `/x`
|
|
116
|
-
* both write `dist/x
|
|
116
|
+
* both write `dist/x.html`, and so do `/About` and `/about` on the
|
|
117
117
|
* case-insensitive filesystem macOS and Windows ship by default — one file, two
|
|
118
118
|
* sitemap entries, and only one of the two descriptions survives. All of it is
|
|
119
119
|
* author configuration read at build time, so it is refused where it is written
|
package/lib/seo/core/routes.js
CHANGED
|
@@ -93,7 +93,7 @@ export function homeRoute(routes) {
|
|
|
93
93
|
* only the first entry describes, and one carrying a `..` segment writes its
|
|
94
94
|
* file outside the build output. Two addresses that differ only in an empty
|
|
95
95
|
* segment or in case are the same defect wearing a disguise: `//x` and `/x`
|
|
96
|
-
* both write `dist/x
|
|
96
|
+
* both write `dist/x.html`, and so do `/About` and `/about` on the
|
|
97
97
|
* case-insensitive filesystem macOS and Windows ship by default — one file, two
|
|
98
98
|
* sitemap entries, and only one of the two descriptions survives. All of it is
|
|
99
99
|
* author configuration read at build time, so it is refused where it is written
|
|
@@ -15,6 +15,12 @@
|
|
|
15
15
|
* Every address the tool answers is on disk, so an address that is *not* on
|
|
16
16
|
* disk is genuinely not a page and must 404 rather than serving the tool under
|
|
17
17
|
* a name it does not have.
|
|
18
|
+
*
|
|
19
|
+
* `/about` is written to `about.html`, never `about/index.html`: a static host
|
|
20
|
+
* serves a folder's index at `/about/` and redirects the address every link and
|
|
21
|
+
* canonical uses to it (Cloudflare Pages does, with no way to turn it off),
|
|
22
|
+
* while `about.html` is served at `/about` itself by Pages, static-web-server
|
|
23
|
+
* and `vite preview` alike.
|
|
18
24
|
*/
|
|
19
25
|
import type { Plugin } from 'vite';
|
|
20
26
|
import type { SiteId, SiteRecord } from '../../ecosystem/core/sites.ts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prerender.d.ts","sourceRoot":"","sources":["../../../src/seo/vite/prerender.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"prerender.d.ts","sourceRoot":"","sources":["../../../src/seo/vite/prerender.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAKH,OAAO,KAAK,EAAU,MAAM,EAAE,MAAM,MAAM,CAAC;AAE3C,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAExE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAI7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAMnD,kEAAkE;AAClE,MAAM,WAAW,gBAAgB;IAC/B,iCAAiC;IACjC,IAAI,EAAE,UAAU,GAAG,MAAM,CAAC;IAC1B;;;;;;;;;OASG;IACH,MAAM,EAAE,SAAS,SAAS,EAAE,GAAG,CAAC,CAAC,QAAQ,EAAE,QAAQ,KAAK,SAAS,SAAS,EAAE,CAAC,CAAC;IAC9E;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,KAAK,GAAG,aAAa,CAAC,MAAM,GAAG,cAAc,CAAC,CAAC;IACxD;;;;OAIG;IACH,QAAQ,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAC1B;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;;;OAOG;IACH,QAAQ,CAAC,EACP,OAAO,GAAG,YAAY,GAAG,CAAC,CAAC,QAAQ,EAAE,QAAQ,KAAK,OAAO,GAAG,YAAY,CAAC,CAAC;IAC5E;;;;;;;;;;OAUG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,KAAK,WAAW,GAAG,SAAS,CAAC;IAC5E;;;;;;;;;;OAUG;IACH,SAAS,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAC;CACjC;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CA2HnE"}
|
|
@@ -15,6 +15,12 @@
|
|
|
15
15
|
* Every address the tool answers is on disk, so an address that is *not* on
|
|
16
16
|
* disk is genuinely not a page and must 404 rather than serving the tool under
|
|
17
17
|
* a name it does not have.
|
|
18
|
+
*
|
|
19
|
+
* `/about` is written to `about.html`, never `about/index.html`: a static host
|
|
20
|
+
* serves a folder's index at `/about/` and redirects the address every link and
|
|
21
|
+
* canonical uses to it (Cloudflare Pages does, with no way to turn it off),
|
|
22
|
+
* while `about.html` is served at `/about` itself by Pages, static-web-server
|
|
23
|
+
* and `vite preview` alike.
|
|
18
24
|
*/
|
|
19
25
|
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
20
26
|
import { dirname, join, resolve } from 'node:path';
|
|
@@ -105,7 +111,7 @@ export function cheminfoPrerender(options) {
|
|
|
105
111
|
root = true;
|
|
106
112
|
write(route, language, address === '/'
|
|
107
113
|
? join(out, 'index.html')
|
|
108
|
-
: join(out, address.slice(1)
|
|
114
|
+
: join(out, `${address.slice(1)}.html`));
|
|
109
115
|
written++;
|
|
110
116
|
}
|
|
111
117
|
// The file a static server hands out for the mount itself. A table
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prerender.js","sourceRoot":"","sources":["../../../src/seo/vite/prerender.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"prerender.js","sourceRoot":"","sources":["../../../src/seo/vite/prerender.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKnD,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAElE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGnD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,UAAU,EA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AkB;IAElB,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3D,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAChE,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CACb,OAAO,QAAQ,wGAAwG,CACxH,CAAC;IACJ,CAAC;AACH,CAAC;AAED,2EAA2E;AAC3E,+EAA+E;AAC/E,+BAA+B;AAC/B,SAAS,YAAY,CAAC,QAAgB,EAAE,QAAkB;IACxD,OAAO,QAAQ,CAAC,OAAO,CACrB,0CAA0C,EAC1C,4BAA4B,QAAQ,GAAG,CACxC,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-cheminfo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.49.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/seo/core/routes.ts
CHANGED
|
@@ -156,7 +156,7 @@ export function homeRoute(routes: readonly RouteMeta[]): RouteMeta {
|
|
|
156
156
|
* only the first entry describes, and one carrying a `..` segment writes its
|
|
157
157
|
* file outside the build output. Two addresses that differ only in an empty
|
|
158
158
|
* segment or in case are the same defect wearing a disguise: `//x` and `/x`
|
|
159
|
-
* both write `dist/x
|
|
159
|
+
* both write `dist/x.html`, and so do `/About` and `/about` on the
|
|
160
160
|
* case-insensitive filesystem macOS and Windows ship by default — one file, two
|
|
161
161
|
* sitemap entries, and only one of the two descriptions survives. All of it is
|
|
162
162
|
* author configuration read at build time, so it is refused where it is written
|
|
@@ -15,6 +15,12 @@
|
|
|
15
15
|
* Every address the tool answers is on disk, so an address that is *not* on
|
|
16
16
|
* disk is genuinely not a page and must 404 rather than serving the tool under
|
|
17
17
|
* a name it does not have.
|
|
18
|
+
*
|
|
19
|
+
* `/about` is written to `about.html`, never `about/index.html`: a static host
|
|
20
|
+
* serves a folder's index at `/about/` and redirects the address every link and
|
|
21
|
+
* canonical uses to it (Cloudflare Pages does, with no way to turn it off),
|
|
22
|
+
* while `about.html` is served at `/about` itself by Pages, static-web-server
|
|
23
|
+
* and `vite preview` alike.
|
|
18
24
|
*/
|
|
19
25
|
|
|
20
26
|
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
@@ -229,7 +235,7 @@ export function cheminfoPrerender(options: PrerenderOptions): Plugin {
|
|
|
229
235
|
language,
|
|
230
236
|
address === '/'
|
|
231
237
|
? join(out, 'index.html')
|
|
232
|
-
: join(out, address.slice(1)
|
|
238
|
+
: join(out, `${address.slice(1)}.html`),
|
|
233
239
|
);
|
|
234
240
|
written++;
|
|
235
241
|
}
|