@dogsbay/corpus 0.2.0-beta.157 → 0.2.0-beta.159
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mounts.d.ts +7 -0
- package/dist/mounts.js +3 -0
- package/package.json +2 -2
package/dist/mounts.d.ts
CHANGED
|
@@ -27,6 +27,13 @@ export interface AssetMount {
|
|
|
27
27
|
* mounts too: VitePress's pages mount leaves out `public/`, which is a mount of its own.
|
|
28
28
|
*/
|
|
29
29
|
skip?: string[];
|
|
30
|
+
/**
|
|
31
|
+
* Only these files of the mount, as paths relative to it (an OpenAPI spec in `public/`, which
|
|
32
|
+
* holds everything else too). Read by `mountCopies`: the Dogsbay MD export and the browser
|
|
33
|
+
* imports; other exporters' own copiers do not read it, so an importer sets it only for Dogsbay
|
|
34
|
+
* MD output (format-starlight's starlight-openapi specs).
|
|
35
|
+
*/
|
|
36
|
+
files?: string[];
|
|
30
37
|
/** Public root the mount lands in; `_assets` unless the source used another. */
|
|
31
38
|
root?: string;
|
|
32
39
|
}
|
package/dist/mounts.js
CHANGED
|
@@ -18,10 +18,13 @@ export function mountCopies(paths, mounts) {
|
|
|
18
18
|
const dest = [mount.root ?? "_assets", mount.into].filter(Boolean).join("/");
|
|
19
19
|
const skip = new Set(mount.exclude ?? []);
|
|
20
20
|
const folders = (mount.skip ?? []).map((f) => f.replace(/^\/+|\/+$/g, "")).filter(Boolean);
|
|
21
|
+
const only = mount.files ? new Set(mount.files) : undefined;
|
|
21
22
|
for (const path of paths) {
|
|
22
23
|
if (dir && !path.startsWith(dir + "/"))
|
|
23
24
|
continue;
|
|
24
25
|
const rel = dir ? path.slice(dir.length + 1) : path;
|
|
26
|
+
if (only && !only.has(rel))
|
|
27
|
+
continue;
|
|
25
28
|
if (folders.some((f) => rel.startsWith(f + "/")))
|
|
26
29
|
continue;
|
|
27
30
|
const segs = rel.split("/");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dogsbay/corpus",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.159",
|
|
4
4
|
"description": "A documentation repository as its importers read it, in the browser or in Node: plain paths plus text on demand, from a map of files or from a folder whose symlinks are kept inside it",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"README.md"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@dogsbay/detect": "0.2.0-beta.
|
|
23
|
+
"@dogsbay/detect": "0.2.0-beta.159"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/node": "^22.20.1",
|