« get me outta code hell

upd8, test: move import time shenanigans into #import-heck - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-03-04 13:33:50 -0400
committer(quasar) nebula <qznebula@protonmail.com>2024-05-01 07:06:03 -0300
commite83945ad63acd5d0c89a3e066ce4224351d3745d (patch)
tree1de140a7b0f9168d84a6465db0676440b541afb9
parent33cb835acac80575f2e73a638b8d01270426a653 (diff)
upd8, test: move import time shenanigans into #import-heck
This fixes a test that was previously failing to start. Yay!
-rw-r--r--package.json1
-rw-r--r--src/import-heck.js9
-rwxr-xr-xsrc/upd8.js23
-rw-r--r--test/unit/data/composite/things/track/withAlbum.js2
4 files changed, 21 insertions, 14 deletions
diff --git a/package.json b/package.json
index fc755f41..0a28b226 100644
--- a/package.json
+++ b/package.json
@@ -31,6 +31,7 @@
         "#external-links": "./src/util/external-links.js",
         "#find": "./src/find.js",
         "#html": "./src/util/html.js",
+        "#import-heck": "./src/import-heck.js",
         "#language": "./src/data/language.js",
         "#page-specs": "./src/page/index.js",
         "#node-utils": "./src/util/node-utils.js",
diff --git a/src/import-heck.js b/src/import-heck.js
new file mode 100644
index 00000000..3470fbb5
--- /dev/null
+++ b/src/import-heck.js
@@ -0,0 +1,9 @@
+// Due to import time shenanigans, these imports have to come in the specified
+// order. This obviously needs fixing up.
+
+/* precede #find */
+import '#data-checks';
+
+import '#find';
+
+// End of import time shenanigans (hopefully)
diff --git a/src/upd8.js b/src/upd8.js
index 6bd52da9..f955e5f3 100755
--- a/src/upd8.js
+++ b/src/upd8.js
@@ -31,6 +31,8 @@
 // Oh yeah, like. Just run this through some relatively recent version of
 // node.js and you'll 8e fine. ...Within the project root. O8viously.
 
+import '#import-heck';
+
 import {execSync} from 'node:child_process';
 import {readdir, readFile} from 'node:fs/promises';
 import * as path from 'node:path';
@@ -38,23 +40,10 @@ import {fileURLToPath} from 'node:url';
 
 import wrap from 'word-wrap';
 
-// Due to import time shenanigans, these imports have to come in the specified
-// order. This obviously needs fixing up.
-
-/* precede #find */
-import {
-  filterReferenceErrors,
-  reportDuplicateDirectories,
-  reportContentTextErrors,
-} from '#data-checks';
-
-import {bindFind, getAllFindSpecs} from '#find';
-
-// End of import time shenanigans (hopefully)
-
 import {showAggregate} from '#aggregate';
 import CacheableObject from '#cacheable-object';
 import {displayCompositeCacheAnalysis} from '#composite';
+import {bindFind, getAllFindSpecs} from '#find';
 import {processLanguageFile, watchLanguageFile, internalDefaultStringsFile}
   from '#language';
 import {isMain, traverse} from '#node-utils';
@@ -75,6 +64,12 @@ import {
   progressCallAll,
 } from '#cli';
 
+import {
+  filterReferenceErrors,
+  reportDuplicateDirectories,
+  reportContentTextErrors,
+} from '#data-checks';
+
 import genThumbs, {
   CACHE_FILE as thumbsCacheFile,
   defaultMagickThreads,
diff --git a/test/unit/data/composite/things/track/withAlbum.js b/test/unit/data/composite/things/track/withAlbum.js
index d822f318..f5c9e84c 100644
--- a/test/unit/data/composite/things/track/withAlbum.js
+++ b/test/unit/data/composite/things/track/withAlbum.js
@@ -1,5 +1,7 @@
 import t from 'tap';
 
+import '#import-heck';
+
 import {compositeFrom, input} from '#composite';
 import {exposeConstant, exposeDependency} from '#composite/control-flow';
 import {withAlbum} from '#composite/things/track';