« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/content/dependencies/index.js9
-rw-r--r--src/write/build-modes/live-dev-server.js5
-rw-r--r--src/write/build-modes/static-build.js4
3 files changed, 14 insertions, 4 deletions
diff --git a/src/content/dependencies/index.js b/src/content/dependencies/index.js
index 58bac0d2..95247e9c 100644
--- a/src/content/dependencies/index.js
+++ b/src/content/dependencies/index.js
@@ -8,7 +8,11 @@ import {ESLint} from 'eslint';
 
 import {colors, logWarn} from '#cli';
 import contentFunction, {ContentFunctionSpecError} from '#content-function';
-import {annotateFunction} from '#sugar';
+
+import {
+  annotateFunction,
+  showAggregate as _showAggregate
+} from '#sugar';
 
 function cachebust(filePath) {
   if (filePath in cachebust.cache) {
@@ -25,6 +29,7 @@ cachebust.cache = Object.create(null);
 export function watchContentDependencies({
   mock = null,
   logging = true,
+  showAggregate = _showAggregate,
 } = {}) {
   const events = new EventEmitter();
   const contentDependencies = {};
@@ -229,7 +234,7 @@ export function watchContentDependencies({
       } else if (error instanceof ContentFunctionSpecError) {
         console.error(colors.yellow(error.message));
       } else {
-        console.error(error);
+        showAggregate(error);
       }
     }
 
diff --git a/src/write/build-modes/live-dev-server.js b/src/write/build-modes/live-dev-server.js
index 6e7df0ef..8160c8f9 100644
--- a/src/write/build-modes/live-dev-server.js
+++ b/src/write/build-modes/live-dev-server.js
@@ -106,7 +106,10 @@ export async function go({
   const skipServing = cliOptions['skip-serving'] ?? false;
   const serveSFX = cliOptions['serve-sfx'] ?? null;
 
-  const contentDependenciesWatcher = await watchContentDependencies();
+  const contentDependenciesWatcher = await watchContentDependencies({
+    showAggregate: niceShowAggregate,
+  });
+
   const {contentDependencies} = contentDependenciesWatcher;
 
   contentDependenciesWatcher.on('error', () => {});
diff --git a/src/write/build-modes/static-build.js b/src/write/build-modes/static-build.js
index d2802f4e..f292fde0 100644
--- a/src/write/build-modes/static-build.js
+++ b/src/write/build-modes/static-build.js
@@ -256,7 +256,9 @@ export async function go({
 
   let errored = false;
 
-  const contentDependencies = await quickLoadContentDependencies();
+  const contentDependencies = await quickLoadContentDependencies({
+    showAggregate: niceShowAggregate,
+  });
 
   const perLanguageFn = async (language, i, entries) => {
     const baseDirectory =