@canopy-iiif/app 0.6.28 → 0.7.1
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/build/assets.js +30 -0
- package/lib/build/build.js +128 -0
- package/lib/{dev.js → build/dev.js} +494 -205
- package/lib/build/facets.js +19 -0
- package/lib/{iiif.js → build/iiif.js} +242 -384
- package/lib/build/log.js +31 -0
- package/lib/{mdx.js → build/mdx.js} +13 -10
- package/lib/build/pages.js +141 -0
- package/lib/build/runtimes.js +58 -0
- package/lib/build/search-index.js +42 -0
- package/lib/build/search-workflow.js +61 -0
- package/lib/build/search.js +219 -0
- package/lib/build/styles.js +141 -0
- package/lib/{thumbnail.js → iiif/thumbnail.js} +0 -1
- package/lib/index.js +2 -3
- package/lib/{search.js → search/search.js} +8 -8
- package/package.json +2 -1
- package/lib/build.js +0 -762
- package/lib/components/IIIFCard.js +0 -102
- package/lib/log.js +0 -64
- package/lib/runtime/command-entry.jsx +0 -44
- /package/lib/{devtoast.config.json → build/devtoast.config.json} +0 -0
- /package/lib/{devtoast.css → build/devtoast.css} +0 -0
- /package/lib/{search-app.jsx → search/search-app.jsx} +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
const { logLine } = require('./log');
|
|
3
|
+
|
|
4
|
+
async function generateFacets(combined) {
|
|
5
|
+
try {
|
|
6
|
+
const { loadConfig } = require('./iiif');
|
|
7
|
+
const searchBuild = require('./search');
|
|
8
|
+
const cfg = await loadConfig();
|
|
9
|
+
const labels = Array.isArray(cfg && cfg.metadata) ? cfg.metadata : [];
|
|
10
|
+
await searchBuild.buildFacetsForWorks(combined, labels);
|
|
11
|
+
await searchBuild.writeFacetCollections(labels, combined);
|
|
12
|
+
await searchBuild.writeFacetsSearchApi();
|
|
13
|
+
try { logLine('✓ Facets generated', 'cyan'); } catch (_) {}
|
|
14
|
+
} catch (e) {
|
|
15
|
+
try { logLine('! Facets generation skipped', 'yellow'); } catch (_) {}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
module.exports = { generateFacets };
|