« get me outta code hell

data: move sorting & generic functions out of #wiki-data - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-02-16 10:16:36 -0400
committer(quasar) nebula <qznebula@protonmail.com>2024-02-16 10:29:50 -0400
commit5457b88f8d3d234af0b08d15f3c6249f6649aac3 (patch)
treec07cee2cbfcd35d8b4a373915f59e6b619531241 /src/data
parent7a3038b982c4d318e146698527070f096591aa4f (diff)
data: move sorting & generic functions out of #wiki-data
Diffstat (limited to 'src/data')
-rw-r--r--src/data/composite/things/album/withTrackSections.js3
-rw-r--r--src/data/composite/things/track/inferredAdditionalNameList.js2
-rw-r--r--src/data/composite/wiki-data/withResolvedContribs.js3
-rw-r--r--src/data/composite/wiki-data/withThingsSortedAlphabetically.js2
-rw-r--r--src/data/things/album.js3
-rw-r--r--src/data/things/art-tag.js2
-rw-r--r--src/data/things/artist.js3
-rw-r--r--src/data/things/flash.js2
-rw-r--r--src/data/things/news-entry.js2
-rw-r--r--src/data/things/static-page.js2
-rw-r--r--src/data/yaml.js2
11 files changed, 12 insertions, 14 deletions
diff --git a/src/data/composite/things/album/withTrackSections.js b/src/data/composite/things/album/withTrackSections.js
index 679a09fd..0a1ebebc 100644
--- a/src/data/composite/things/album/withTrackSections.js
+++ b/src/data/composite/things/album/withTrackSections.js
@@ -1,8 +1,7 @@
 import {input, templateCompositeFrom} from '#composite';
 import find from '#find';
-import {empty, stitchArrays} from '#sugar';
+import {empty, filterMultipleArrays, stitchArrays} from '#sugar';
 import {isTrackSectionList} from '#validators';
-import {filterMultipleArrays} from '#wiki-data';
 
 import {exitWithoutDependency, exitWithoutUpdateValue}
   from '#composite/control-flow';
diff --git a/src/data/composite/things/track/inferredAdditionalNameList.js b/src/data/composite/things/track/inferredAdditionalNameList.js
index 9cf158c6..58e8d2a1 100644
--- a/src/data/composite/things/track/inferredAdditionalNameList.js
+++ b/src/data/composite/things/track/inferredAdditionalNameList.js
@@ -4,7 +4,7 @@
 // shares the same name differing from this one's.
 
 import {input, templateCompositeFrom} from '#composite';
-import {chunkByProperties} from '#wiki-data';
+import {chunkByProperties} from '#sugar';
 
 import {exitWithoutDependency} from '#composite/control-flow';
 import {withFilteredList, withPropertyFromList} from '#composite/data';
diff --git a/src/data/composite/wiki-data/withResolvedContribs.js b/src/data/composite/wiki-data/withResolvedContribs.js
index eda24160..77b0f96d 100644
--- a/src/data/composite/wiki-data/withResolvedContribs.js
+++ b/src/data/composite/wiki-data/withResolvedContribs.js
@@ -5,9 +5,8 @@
 
 import {input, templateCompositeFrom} from '#composite';
 import find from '#find';
-import {stitchArrays} from '#sugar';
+import {filterMultipleArrays, stitchArrays} from '#sugar';
 import {is, isContributionList} from '#validators';
-import {filterMultipleArrays} from '#wiki-data';
 
 import {
   raiseOutputWithoutDependency,
diff --git a/src/data/composite/wiki-data/withThingsSortedAlphabetically.js b/src/data/composite/wiki-data/withThingsSortedAlphabetically.js
index d2487e42..5e85fa6a 100644
--- a/src/data/composite/wiki-data/withThingsSortedAlphabetically.js
+++ b/src/data/composite/wiki-data/withThingsSortedAlphabetically.js
@@ -5,8 +5,8 @@
 // a list so same-name entries are beside each other.
 
 import {input, templateCompositeFrom} from '#composite';
+import {compareCaseLessSensitive, normalizeName} from '#sort';
 import {validateWikiData} from '#validators';
-import {compareCaseLessSensitive, normalizeName} from '#wiki-data';
 
 import {raiseOutputWithoutDependency} from '#composite/control-flow';
 import {withMappedList, withSortedList, withPropertiesFromList}
diff --git a/src/data/things/album.js b/src/data/things/album.js
index d92dd434..01a232d0 100644
--- a/src/data/things/album.js
+++ b/src/data/things/album.js
@@ -5,11 +5,10 @@ import * as path from 'node:path';
 import {input} from '#composite';
 import find from '#find';
 import {traverse} from '#node-utils';
+import {sortAlbumsTracksChronologically, sortChronologically} from '#sort';
 import {empty} from '#sugar';
 import Thing from '#thing';
 import {isDate} from '#validators';
-import {sortAlbumsTracksChronologically, sortChronologically}
-  from '#wiki-data';
 import {parseAdditionalFiles, parseContributors, parseDate, parseDimensions}
   from '#yaml';
 
diff --git a/src/data/things/art-tag.js b/src/data/things/art-tag.js
index 69fbb526..3149b310 100644
--- a/src/data/things/art-tag.js
+++ b/src/data/things/art-tag.js
@@ -1,9 +1,9 @@
 export const ART_TAG_DATA_FILE = 'tags.yaml';
 
 import {input} from '#composite';
+import {sortAlphabetically, sortAlbumsTracksChronologically} from '#sort';
 import Thing from '#thing';
 import {isName} from '#validators';
-import {sortAlphabetically, sortAlbumsTracksChronologically} from '#wiki-data';
 
 import {exposeUpdateValueOrContinue} from '#composite/control-flow';
 
diff --git a/src/data/things/artist.js b/src/data/things/artist.js
index 6e61c28f..73acba69 100644
--- a/src/data/things/artist.js
+++ b/src/data/things/artist.js
@@ -6,10 +6,11 @@ import CacheableObject from '#cacheable-object';
 import {colors} from '#cli';
 import {input} from '#composite';
 import find from '#find';
+import {sortAlphabetically} from '#sort';
 import {stitchArrays, unique} from '#sugar';
 import Thing from '#thing';
 import {isName, validateArrayItems} from '#validators';
-import {getKebabCase, sortAlphabetically} from '#wiki-data';
+import {getKebabCase} from '#wiki-data';
 
 import {withReverseContributionList} from '#composite/wiki-data';
 
diff --git a/src/data/things/flash.js b/src/data/things/flash.js
index 4823f723..81de3272 100644
--- a/src/data/things/flash.js
+++ b/src/data/things/flash.js
@@ -2,9 +2,9 @@ export const FLASH_DATA_FILE = 'flashes.yaml';
 
 import {input} from '#composite';
 import find from '#find';
+import {sortFlashesChronologically} from '#sort';
 import Thing from '#thing';
 import {anyOf, isColor, isDirectory, isNumber, isString} from '#validators';
-import {sortFlashesChronologically} from '#wiki-data';
 import {parseDate, parseContributors} from '#yaml';
 
 import {exposeDependency, exposeUpdateValueOrContinue}
diff --git a/src/data/things/news-entry.js b/src/data/things/news-entry.js
index cb8e3648..43d1638e 100644
--- a/src/data/things/news-entry.js
+++ b/src/data/things/news-entry.js
@@ -1,7 +1,7 @@
 export const NEWS_DATA_FILE = 'news.yaml';
 
+import {sortChronologically} from '#sort';
 import Thing from '#thing';
-import {sortChronologically} from '#wiki-data';
 import {parseDate} from '#yaml';
 
 import {contentString, directory, name, simpleDate}
diff --git a/src/data/things/static-page.js b/src/data/things/static-page.js
index 69cbfa11..03274979 100644
--- a/src/data/things/static-page.js
+++ b/src/data/things/static-page.js
@@ -3,9 +3,9 @@ export const DATA_STATIC_PAGE_DIRECTORY = 'static-page';
 import * as path from 'node:path';
 
 import {traverse} from '#node-utils';
+import {sortAlphabetically} from '#sort';
 import Thing from '#thing';
 import {isName} from '#validators';
-import {sortAlphabetically} from '#wiki-data';
 
 import {contentString, directory, name, simpleString}
   from '#composite/wiki-properties';
diff --git a/src/data/yaml.js b/src/data/yaml.js
index 100e07b9..0f73bdfb 100644
--- a/src/data/yaml.js
+++ b/src/data/yaml.js
@@ -10,11 +10,11 @@ import yaml from 'js-yaml';
 import {colors, ENABLE_COLOR, logInfo, logWarn} from '#cli';
 import {reportDuplicateDirectories, filterReferenceErrors}
   from '#data-checks';
+import {sortByName} from '#sort';
 import {atOffset, empty, filterProperties, typeAppearance, withEntries}
   from '#sugar';
 import Thing from '#thing';
 import thingConstructors from '#things';
-import {sortByName} from '#wiki-data';
 
 import {
   annotateErrorWithFile,