music-routes-data 6.0.1 → 6.0.3
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/bin/mrd +3 -3
- package/bin/verify +68 -35
- package/data/individual_track.json +198 -0
- package/data/individuals.json +100 -0
- package/data/tracks.json +135 -0
- package/lib/Data/index.js +122 -78
- package/lib/Data/validate-track.js +17 -9
- package/lib/cli/add.js +10 -6
- package/lib/cli/argv.js +46 -41
- package/lib/cli/index.js +2 -2
- package/lib/cli/link.js +11 -11
- package/lib/cli/search.js +5 -5
- package/package.json +10 -4
package/bin/mrd
CHANGED
package/bin/verify
CHANGED
|
@@ -1,61 +1,94 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const assert = require(
|
|
4
|
-
const path = require(
|
|
5
|
-
const Data = require(
|
|
3
|
+
const assert = require("assert");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
const Data = require("../lib/Data");
|
|
6
6
|
|
|
7
|
-
const data = new Data()
|
|
7
|
+
const data = new Data();
|
|
8
8
|
|
|
9
|
-
const rv = data.read(path.join(__dirname,
|
|
9
|
+
const rv = data.read(path.join(__dirname, "/../data"));
|
|
10
10
|
if (rv.status === data.StatusEnum.ERROR) {
|
|
11
|
-
console.error(rv.message ||
|
|
12
|
-
process.exit(1)
|
|
11
|
+
console.error(rv.message || "Unknown error");
|
|
12
|
+
process.exit(1);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
const dump = {} // local copy of all collections
|
|
15
|
+
const dump = {}; // local copy of all collections
|
|
16
16
|
|
|
17
|
-
const collections = [
|
|
17
|
+
const collections = ["tracks", "individuals", "individual_track"];
|
|
18
18
|
|
|
19
19
|
collections.forEach(function (collection) {
|
|
20
|
-
const rv = data.search({ collection })
|
|
21
|
-
assert.ok(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
const rv = data.search({ collection });
|
|
21
|
+
assert.ok(
|
|
22
|
+
rv.status === data.StatusEnum.OK,
|
|
23
|
+
"Could not retrieve contents of collection " + collection,
|
|
24
|
+
);
|
|
25
|
+
assert.ok(
|
|
26
|
+
rv.results.length > 0,
|
|
27
|
+
"Collection " + collection + " has no entries",
|
|
28
|
+
);
|
|
29
|
+
dump[collection] = rv.results;
|
|
30
|
+
});
|
|
25
31
|
|
|
26
32
|
const getSet = function (collectionName, options = {}) {
|
|
27
|
-
const idName = options.idName ||
|
|
28
|
-
const ignoreDuplicates = options.ignoreDuplicates || false
|
|
29
|
-
const myArray = dump[collectionName].map((item) => item[idName])
|
|
30
|
-
const mySet = new Set(myArray)
|
|
33
|
+
const idName = options.idName || "_id";
|
|
34
|
+
const ignoreDuplicates = options.ignoreDuplicates || false;
|
|
35
|
+
const myArray = dump[collectionName].map((item) => item[idName]);
|
|
36
|
+
const mySet = new Set(myArray);
|
|
31
37
|
if (!ignoreDuplicates) {
|
|
32
|
-
assert.strictEqual(
|
|
38
|
+
assert.strictEqual(
|
|
39
|
+
mySet.size,
|
|
40
|
+
myArray.length,
|
|
41
|
+
`Duplicate IDs found in ${collectionName} collection`,
|
|
42
|
+
);
|
|
33
43
|
}
|
|
34
|
-
return mySet
|
|
35
|
-
}
|
|
44
|
+
return mySet;
|
|
45
|
+
};
|
|
36
46
|
|
|
37
47
|
const compare = function (a, b, nameA, nameB) {
|
|
38
|
-
const diff = a.symmetricDifference(b)
|
|
39
|
-
assert.strictEqual(
|
|
40
|
-
|
|
48
|
+
const diff = a.symmetricDifference(b);
|
|
49
|
+
assert.strictEqual(
|
|
50
|
+
diff.size,
|
|
51
|
+
0,
|
|
52
|
+
`The ${nameA} and ${nameB} collections have different IDs: ${Array.from(diff).join(", ")}`,
|
|
53
|
+
);
|
|
54
|
+
};
|
|
41
55
|
|
|
42
|
-
const trackIds = getSet(
|
|
43
|
-
const individualIds = getSet(
|
|
56
|
+
const trackIds = getSet("tracks");
|
|
57
|
+
const individualIds = getSet("individuals");
|
|
44
58
|
|
|
45
59
|
// All IDs are strings but must not contain colons or slashes because the visualizer
|
|
46
60
|
// uses IDs as directory names.
|
|
47
61
|
const validateIds = (idsSet) => {
|
|
48
|
-
assert.ok(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
62
|
+
assert.ok(
|
|
63
|
+
idsSet
|
|
64
|
+
.values()
|
|
65
|
+
.every(
|
|
66
|
+
(id) =>
|
|
67
|
+
typeof id === "string" && !id.includes(":") && !id.includes("/"),
|
|
68
|
+
),
|
|
69
|
+
"Invalid ID found",
|
|
70
|
+
);
|
|
71
|
+
};
|
|
72
|
+
validateIds(trackIds);
|
|
73
|
+
validateIds(individualIds);
|
|
52
74
|
|
|
53
75
|
const individualTrackIds = {
|
|
54
|
-
individual: getSet(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
76
|
+
individual: getSet("individual_track", {
|
|
77
|
+
idName: "individual_id",
|
|
78
|
+
ignoreDuplicates: true,
|
|
79
|
+
}),
|
|
80
|
+
track: getSet("individual_track", {
|
|
81
|
+
idName: "track_id",
|
|
82
|
+
ignoreDuplicates: true,
|
|
83
|
+
}),
|
|
84
|
+
};
|
|
85
|
+
compare(
|
|
86
|
+
individualTrackIds.individual,
|
|
87
|
+
individualIds,
|
|
88
|
+
"individual_track",
|
|
89
|
+
"individual_id",
|
|
90
|
+
);
|
|
91
|
+
compare(individualTrackIds.track, trackIds, "individual_track", "track_id");
|
|
59
92
|
|
|
60
93
|
// TODO: Make sure that there are no duplicate link entries (Elvis on "Love Me Tender" exists twice should be an error)
|
|
61
94
|
// TODO: Check that all fields that should be strings are strings and all fields that should be arrays of strings are arrays of strings
|
|
@@ -258583,5 +258583,203 @@
|
|
|
258583
258583
|
"bass guitar",
|
|
258584
258584
|
"background vocals"
|
|
258585
258585
|
]
|
|
258586
|
+
},
|
|
258587
|
+
{
|
|
258588
|
+
"individual_id": "Fantastic Negrito",
|
|
258589
|
+
"track_id": "13530",
|
|
258590
|
+
"credits": [
|
|
258591
|
+
"vocals"
|
|
258592
|
+
]
|
|
258593
|
+
},
|
|
258594
|
+
{
|
|
258595
|
+
"individual_id": "E-40",
|
|
258596
|
+
"track_id": "13530",
|
|
258597
|
+
"credits": [
|
|
258598
|
+
"vocals"
|
|
258599
|
+
]
|
|
258600
|
+
},
|
|
258601
|
+
{
|
|
258602
|
+
"individual_id": "Fantastic Negrito",
|
|
258603
|
+
"track_id": "13531",
|
|
258604
|
+
"credits": [
|
|
258605
|
+
"vocals"
|
|
258606
|
+
]
|
|
258607
|
+
},
|
|
258608
|
+
{
|
|
258609
|
+
"individual_id": "Sting",
|
|
258610
|
+
"track_id": "13531",
|
|
258611
|
+
"credits": [
|
|
258612
|
+
"vocals"
|
|
258613
|
+
]
|
|
258614
|
+
},
|
|
258615
|
+
{
|
|
258616
|
+
"individual_id": "ZZ Ward",
|
|
258617
|
+
"track_id": "13532",
|
|
258618
|
+
"credits": [
|
|
258619
|
+
"vocals"
|
|
258620
|
+
]
|
|
258621
|
+
},
|
|
258622
|
+
{
|
|
258623
|
+
"individual_id": "Fantastic Negrito",
|
|
258624
|
+
"track_id": "13532",
|
|
258625
|
+
"credits": [
|
|
258626
|
+
"vocals"
|
|
258627
|
+
]
|
|
258628
|
+
},
|
|
258629
|
+
{
|
|
258630
|
+
"individual_id": "Kev Choice",
|
|
258631
|
+
"track_id": "13533",
|
|
258632
|
+
"credits": [
|
|
258633
|
+
"piano",
|
|
258634
|
+
"keyboards",
|
|
258635
|
+
"synthesizer"
|
|
258636
|
+
]
|
|
258637
|
+
},
|
|
258638
|
+
{
|
|
258639
|
+
"individual_id": "Dame Drummer",
|
|
258640
|
+
"track_id": "13533",
|
|
258641
|
+
"credits": [
|
|
258642
|
+
"drums"
|
|
258643
|
+
]
|
|
258644
|
+
},
|
|
258645
|
+
{
|
|
258646
|
+
"individual_id": "Uriah Duffy",
|
|
258647
|
+
"track_id": "13533",
|
|
258648
|
+
"credits": [
|
|
258649
|
+
"bass"
|
|
258650
|
+
]
|
|
258651
|
+
},
|
|
258652
|
+
{
|
|
258653
|
+
"individual_id": "Andrew Levin",
|
|
258654
|
+
"track_id": "13533",
|
|
258655
|
+
"credits": [
|
|
258656
|
+
"guitar"
|
|
258657
|
+
]
|
|
258658
|
+
},
|
|
258659
|
+
{
|
|
258660
|
+
"individual_id": "Manny Martinez",
|
|
258661
|
+
"track_id": "13534",
|
|
258662
|
+
"credits": [
|
|
258663
|
+
"lead vocals",
|
|
258664
|
+
"maracas",
|
|
258665
|
+
"backing vocals"
|
|
258666
|
+
]
|
|
258667
|
+
},
|
|
258668
|
+
{
|
|
258669
|
+
"individual_id": "Louie Romero",
|
|
258670
|
+
"track_id": "13534",
|
|
258671
|
+
"credits": [
|
|
258672
|
+
"timbales",
|
|
258673
|
+
"bongos"
|
|
258674
|
+
]
|
|
258675
|
+
},
|
|
258676
|
+
{
|
|
258677
|
+
"individual_id": "Marco Diaz",
|
|
258678
|
+
"track_id": "13534",
|
|
258679
|
+
"credits": [
|
|
258680
|
+
"piano",
|
|
258681
|
+
"trumpet"
|
|
258682
|
+
]
|
|
258683
|
+
},
|
|
258684
|
+
{
|
|
258685
|
+
"individual_id": "Ayla Dávila",
|
|
258686
|
+
"track_id": "13534",
|
|
258687
|
+
"credits": [
|
|
258688
|
+
"bass"
|
|
258689
|
+
]
|
|
258690
|
+
},
|
|
258691
|
+
{
|
|
258692
|
+
"individual_id": "Ahkeel Mestayer",
|
|
258693
|
+
"track_id": "13534",
|
|
258694
|
+
"credits": [
|
|
258695
|
+
"congas"
|
|
258696
|
+
]
|
|
258697
|
+
},
|
|
258698
|
+
{
|
|
258699
|
+
"individual_id": "Marty Wehner",
|
|
258700
|
+
"track_id": "13534",
|
|
258701
|
+
"credits": [
|
|
258702
|
+
"trombone"
|
|
258703
|
+
]
|
|
258704
|
+
},
|
|
258705
|
+
{
|
|
258706
|
+
"individual_id": "Carlos Caro",
|
|
258707
|
+
"track_id": "13534",
|
|
258708
|
+
"credits": [
|
|
258709
|
+
"güiro"
|
|
258710
|
+
]
|
|
258711
|
+
},
|
|
258712
|
+
{
|
|
258713
|
+
"individual_id": "Juan Perez",
|
|
258714
|
+
"track_id": "13534",
|
|
258715
|
+
"credits": [
|
|
258716
|
+
"backing vocals"
|
|
258717
|
+
]
|
|
258718
|
+
},
|
|
258719
|
+
{
|
|
258720
|
+
"individual_id": "Don Cherry",
|
|
258721
|
+
"track_id": "13535"
|
|
258722
|
+
},
|
|
258723
|
+
{
|
|
258724
|
+
"individual_id": "Michael Mantler",
|
|
258725
|
+
"track_id": "13535",
|
|
258726
|
+
"credits": [
|
|
258727
|
+
"trumpet"
|
|
258728
|
+
]
|
|
258729
|
+
},
|
|
258730
|
+
{
|
|
258731
|
+
"individual_id": "Roswell Rudd",
|
|
258732
|
+
"track_id": "13535",
|
|
258733
|
+
"credits": [
|
|
258734
|
+
"trombone"
|
|
258735
|
+
]
|
|
258736
|
+
},
|
|
258737
|
+
{
|
|
258738
|
+
"individual_id": "Bob Northern",
|
|
258739
|
+
"track_id": "13535"
|
|
258740
|
+
},
|
|
258741
|
+
{
|
|
258742
|
+
"individual_id": "Howard Johnson",
|
|
258743
|
+
"track_id": "13535",
|
|
258744
|
+
"credits": [
|
|
258745
|
+
"tuba"
|
|
258746
|
+
]
|
|
258747
|
+
},
|
|
258748
|
+
{
|
|
258749
|
+
"individual_id": "Perry Robinson",
|
|
258750
|
+
"track_id": "13535",
|
|
258751
|
+
"credits": [
|
|
258752
|
+
"clarinet"
|
|
258753
|
+
]
|
|
258754
|
+
},
|
|
258755
|
+
{
|
|
258756
|
+
"individual_id": "Dewey Redman",
|
|
258757
|
+
"track_id": "13535"
|
|
258758
|
+
},
|
|
258759
|
+
{
|
|
258760
|
+
"individual_id": "Gato Barbieri",
|
|
258761
|
+
"track_id": "13535"
|
|
258762
|
+
},
|
|
258763
|
+
{
|
|
258764
|
+
"individual_id": "Carla Bley",
|
|
258765
|
+
"track_id": "13535"
|
|
258766
|
+
},
|
|
258767
|
+
{
|
|
258768
|
+
"individual_id": "Sam Brown (American jazz guitarist)",
|
|
258769
|
+
"track_id": "13535"
|
|
258770
|
+
},
|
|
258771
|
+
{
|
|
258772
|
+
"individual_id": "Charlie Haden",
|
|
258773
|
+
"track_id": "13535",
|
|
258774
|
+
"credits": [
|
|
258775
|
+
"bass"
|
|
258776
|
+
]
|
|
258777
|
+
},
|
|
258778
|
+
{
|
|
258779
|
+
"individual_id": "Paul Motian",
|
|
258780
|
+
"track_id": "13535",
|
|
258781
|
+
"credits": [
|
|
258782
|
+
"percussion"
|
|
258783
|
+
]
|
|
258586
258784
|
}
|
|
258587
258785
|
]
|
package/data/individuals.json
CHANGED
|
@@ -63175,5 +63175,105 @@
|
|
|
63175
63175
|
"names": [
|
|
63176
63176
|
"Bill Ramsay"
|
|
63177
63177
|
]
|
|
63178
|
+
},
|
|
63179
|
+
{
|
|
63180
|
+
"_id": "Fantastic Negrito",
|
|
63181
|
+
"names": [
|
|
63182
|
+
"Fantastic Negrito",
|
|
63183
|
+
"Xavier Dphrepaulezz",
|
|
63184
|
+
"Xavier Amin Dphrepaulezz"
|
|
63185
|
+
]
|
|
63186
|
+
},
|
|
63187
|
+
{
|
|
63188
|
+
"_id": "ZZ Ward",
|
|
63189
|
+
"names": [
|
|
63190
|
+
"ZZ Ward",
|
|
63191
|
+
"Zsuzsanna Ward"
|
|
63192
|
+
]
|
|
63193
|
+
},
|
|
63194
|
+
{
|
|
63195
|
+
"_id": "Kev Choice",
|
|
63196
|
+
"names": [
|
|
63197
|
+
"Kev Choice"
|
|
63198
|
+
]
|
|
63199
|
+
},
|
|
63200
|
+
{
|
|
63201
|
+
"_id": "Dame Drummer",
|
|
63202
|
+
"names": [
|
|
63203
|
+
"Dame Drummer"
|
|
63204
|
+
]
|
|
63205
|
+
},
|
|
63206
|
+
{
|
|
63207
|
+
"_id": "Manny Martinez",
|
|
63208
|
+
"names": [
|
|
63209
|
+
"Manny Martinez"
|
|
63210
|
+
]
|
|
63211
|
+
},
|
|
63212
|
+
{
|
|
63213
|
+
"_id": "Louie Romero",
|
|
63214
|
+
"names": [
|
|
63215
|
+
"Louie Romero"
|
|
63216
|
+
]
|
|
63217
|
+
},
|
|
63218
|
+
{
|
|
63219
|
+
"_id": "Marco Diaz",
|
|
63220
|
+
"names": [
|
|
63221
|
+
"Marco Diaz"
|
|
63222
|
+
]
|
|
63223
|
+
},
|
|
63224
|
+
{
|
|
63225
|
+
"_id": "Ayla Dávila",
|
|
63226
|
+
"names": [
|
|
63227
|
+
"Ayla Dávila"
|
|
63228
|
+
]
|
|
63229
|
+
},
|
|
63230
|
+
{
|
|
63231
|
+
"_id": "Ahkeel Mestayer",
|
|
63232
|
+
"names": [
|
|
63233
|
+
"Ahkeel Mestayer"
|
|
63234
|
+
]
|
|
63235
|
+
},
|
|
63236
|
+
{
|
|
63237
|
+
"_id": "Carlos Caro",
|
|
63238
|
+
"names": [
|
|
63239
|
+
"Carlos Caro"
|
|
63240
|
+
]
|
|
63241
|
+
},
|
|
63242
|
+
{
|
|
63243
|
+
"_id": "Juan Perez",
|
|
63244
|
+
"names": [
|
|
63245
|
+
"Juan Perez"
|
|
63246
|
+
]
|
|
63247
|
+
},
|
|
63248
|
+
{
|
|
63249
|
+
"_id": "Michael Mantler",
|
|
63250
|
+
"names": [
|
|
63251
|
+
"Michael Mantler",
|
|
63252
|
+
"Mike Mantler"
|
|
63253
|
+
]
|
|
63254
|
+
},
|
|
63255
|
+
{
|
|
63256
|
+
"_id": "Roswell Rudd",
|
|
63257
|
+
"names": [
|
|
63258
|
+
"Roswell Rudd"
|
|
63259
|
+
]
|
|
63260
|
+
},
|
|
63261
|
+
{
|
|
63262
|
+
"_id": "Perry Robinson",
|
|
63263
|
+
"names": [
|
|
63264
|
+
"Perry Robinson"
|
|
63265
|
+
]
|
|
63266
|
+
},
|
|
63267
|
+
{
|
|
63268
|
+
"_id": "Dewey Redman",
|
|
63269
|
+
"names": [
|
|
63270
|
+
"Dewey Redman"
|
|
63271
|
+
]
|
|
63272
|
+
},
|
|
63273
|
+
{
|
|
63274
|
+
"_id": "Paul Motian",
|
|
63275
|
+
"names": [
|
|
63276
|
+
"Paul Motian"
|
|
63277
|
+
]
|
|
63178
63278
|
}
|
|
63179
63279
|
]
|
package/data/tracks.json
CHANGED
|
@@ -270264,5 +270264,140 @@
|
|
|
270264
270264
|
]
|
|
270265
270265
|
}
|
|
270266
270266
|
]
|
|
270267
|
+
},
|
|
270268
|
+
{
|
|
270269
|
+
"_id": "13530",
|
|
270270
|
+
"names": [
|
|
270271
|
+
"Searching for Captain Save a Hoe"
|
|
270272
|
+
],
|
|
270273
|
+
"artists": [
|
|
270274
|
+
{
|
|
270275
|
+
"names": [
|
|
270276
|
+
"Fantastic Negrito"
|
|
270277
|
+
]
|
|
270278
|
+
},
|
|
270279
|
+
{
|
|
270280
|
+
"names": [
|
|
270281
|
+
"E-40"
|
|
270282
|
+
]
|
|
270283
|
+
}
|
|
270284
|
+
],
|
|
270285
|
+
"releases": [
|
|
270286
|
+
{
|
|
270287
|
+
"names": [
|
|
270288
|
+
"Have You Lost Your Mind Yet?"
|
|
270289
|
+
]
|
|
270290
|
+
}
|
|
270291
|
+
]
|
|
270292
|
+
},
|
|
270293
|
+
{
|
|
270294
|
+
"_id": "13531",
|
|
270295
|
+
"names": [
|
|
270296
|
+
"Undefeated Eyes"
|
|
270297
|
+
],
|
|
270298
|
+
"artists": [
|
|
270299
|
+
{
|
|
270300
|
+
"names": [
|
|
270301
|
+
"Fantastic Negrito"
|
|
270302
|
+
]
|
|
270303
|
+
},
|
|
270304
|
+
{
|
|
270305
|
+
"names": [
|
|
270306
|
+
"Sting"
|
|
270307
|
+
]
|
|
270308
|
+
}
|
|
270309
|
+
],
|
|
270310
|
+
"releases": [
|
|
270311
|
+
{
|
|
270312
|
+
"names": [
|
|
270313
|
+
"Undefeated Eyes"
|
|
270314
|
+
]
|
|
270315
|
+
}
|
|
270316
|
+
]
|
|
270317
|
+
},
|
|
270318
|
+
{
|
|
270319
|
+
"_id": "13532",
|
|
270320
|
+
"names": [
|
|
270321
|
+
"Cannonball"
|
|
270322
|
+
],
|
|
270323
|
+
"artists": [
|
|
270324
|
+
{
|
|
270325
|
+
"names": [
|
|
270326
|
+
"ZZ Ward"
|
|
270327
|
+
]
|
|
270328
|
+
},
|
|
270329
|
+
{
|
|
270330
|
+
"names": [
|
|
270331
|
+
"Fantastic Negrito"
|
|
270332
|
+
]
|
|
270333
|
+
}
|
|
270334
|
+
],
|
|
270335
|
+
"releases": [
|
|
270336
|
+
{
|
|
270337
|
+
"names": [
|
|
270338
|
+
"The Storm"
|
|
270339
|
+
]
|
|
270340
|
+
}
|
|
270341
|
+
]
|
|
270342
|
+
},
|
|
270343
|
+
{
|
|
270344
|
+
"_id": "13533",
|
|
270345
|
+
"names": [
|
|
270346
|
+
"Hero's Theme"
|
|
270347
|
+
],
|
|
270348
|
+
"artists": [
|
|
270349
|
+
{
|
|
270350
|
+
"names": [
|
|
270351
|
+
"Kev Choice"
|
|
270352
|
+
]
|
|
270353
|
+
}
|
|
270354
|
+
],
|
|
270355
|
+
"releases": [
|
|
270356
|
+
{
|
|
270357
|
+
"names": [
|
|
270358
|
+
"88 Steps To Eternity"
|
|
270359
|
+
]
|
|
270360
|
+
}
|
|
270361
|
+
]
|
|
270362
|
+
},
|
|
270363
|
+
{
|
|
270364
|
+
"_id": "13534",
|
|
270365
|
+
"names": [
|
|
270366
|
+
"Tú y Yo (I Love You)"
|
|
270367
|
+
],
|
|
270368
|
+
"artists": [
|
|
270369
|
+
{
|
|
270370
|
+
"names": [
|
|
270371
|
+
"Manny Martinez Y Su Nuevo Azabache"
|
|
270372
|
+
]
|
|
270373
|
+
}
|
|
270374
|
+
],
|
|
270375
|
+
"releases": [
|
|
270376
|
+
{
|
|
270377
|
+
"names": [
|
|
270378
|
+
"Evolution"
|
|
270379
|
+
]
|
|
270380
|
+
}
|
|
270381
|
+
]
|
|
270382
|
+
},
|
|
270383
|
+
{
|
|
270384
|
+
"_id": "13535",
|
|
270385
|
+
"names": [
|
|
270386
|
+
"Song for Che"
|
|
270387
|
+
],
|
|
270388
|
+
"artists": [
|
|
270389
|
+
{
|
|
270390
|
+
"names": [
|
|
270391
|
+
"Charlie Haden"
|
|
270392
|
+
]
|
|
270393
|
+
}
|
|
270394
|
+
],
|
|
270395
|
+
"releases": [
|
|
270396
|
+
{
|
|
270397
|
+
"names": [
|
|
270398
|
+
"Liberation Music Orchestra"
|
|
270399
|
+
]
|
|
270400
|
+
}
|
|
270401
|
+
]
|
|
270267
270402
|
}
|
|
270268
270403
|
]
|
package/lib/Data/index.js
CHANGED
|
@@ -1,157 +1,201 @@
|
|
|
1
|
-
const fs = require(
|
|
2
|
-
const validateTrack = require(
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
const validateTrack = require("./validate-track");
|
|
3
3
|
|
|
4
|
-
function Data
|
|
5
|
-
const data = {}
|
|
4
|
+
function Data() {
|
|
5
|
+
const data = {};
|
|
6
6
|
const collectionFields = {
|
|
7
|
-
tracks: [
|
|
8
|
-
individuals: [
|
|
9
|
-
}
|
|
7
|
+
tracks: ["names"],
|
|
8
|
+
individuals: ["names"],
|
|
9
|
+
};
|
|
10
10
|
|
|
11
11
|
const linkCollectionFields = {
|
|
12
|
-
individual_track: []
|
|
13
|
-
}
|
|
12
|
+
individual_track: [],
|
|
13
|
+
};
|
|
14
14
|
|
|
15
|
-
this.dataCollections = Object.freeze(Object.keys(collectionFields))
|
|
16
|
-
this.linkCollections = Object.freeze(Object.keys(linkCollectionFields))
|
|
15
|
+
this.dataCollections = Object.freeze(Object.keys(collectionFields));
|
|
16
|
+
this.linkCollections = Object.freeze(Object.keys(linkCollectionFields));
|
|
17
17
|
|
|
18
|
-
const collections = this.dataCollections.concat(this.linkCollections)
|
|
18
|
+
const collections = this.dataCollections.concat(this.linkCollections);
|
|
19
19
|
collections.forEach(function (value) {
|
|
20
|
-
data[value] = []
|
|
21
|
-
})
|
|
20
|
+
data[value] = [];
|
|
21
|
+
});
|
|
22
22
|
|
|
23
23
|
const makeReturnValue = function (status, message) {
|
|
24
|
-
return { status, message }
|
|
25
|
-
}
|
|
24
|
+
return { status, message };
|
|
25
|
+
};
|
|
26
26
|
|
|
27
|
-
this.StatusEnum = Object.freeze({ OK: 0, ERROR: 1 })
|
|
27
|
+
this.StatusEnum = Object.freeze({ OK: 0, ERROR: 1 });
|
|
28
28
|
|
|
29
29
|
this.search = function (options) {
|
|
30
|
-
if (typeof options ===
|
|
31
|
-
return makeReturnValue(
|
|
30
|
+
if (typeof options === "undefined") {
|
|
31
|
+
return makeReturnValue(
|
|
32
|
+
this.StatusEnum.ERROR,
|
|
33
|
+
"options must be specified",
|
|
34
|
+
);
|
|
32
35
|
}
|
|
33
36
|
|
|
34
|
-
const collection = options.collection
|
|
37
|
+
const collection = options.collection;
|
|
35
38
|
|
|
36
|
-
if (typeof collection ===
|
|
37
|
-
return makeReturnValue(
|
|
39
|
+
if (typeof collection === "undefined") {
|
|
40
|
+
return makeReturnValue(
|
|
41
|
+
this.StatusEnum.ERROR,
|
|
42
|
+
"collection is a required option.",
|
|
43
|
+
);
|
|
38
44
|
}
|
|
39
45
|
|
|
40
46
|
if (collections.indexOf(collection) === -1) {
|
|
41
|
-
return makeReturnValue(
|
|
47
|
+
return makeReturnValue(
|
|
48
|
+
this.StatusEnum.ERROR,
|
|
49
|
+
"collection " + collection + " does not exist.",
|
|
50
|
+
);
|
|
42
51
|
}
|
|
43
52
|
|
|
44
53
|
// If no filterCallback sent, return everything
|
|
45
|
-
const filterCallback =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
54
|
+
const filterCallback =
|
|
55
|
+
options.filterCallback ||
|
|
56
|
+
function () {
|
|
57
|
+
return true;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
if (typeof filterCallback !== "function") {
|
|
61
|
+
return makeReturnValue(
|
|
62
|
+
this.StatusEnum.ERROR,
|
|
63
|
+
"filterCallback must be a function, got " + typeof filterCallback,
|
|
64
|
+
);
|
|
49
65
|
}
|
|
50
66
|
|
|
51
|
-
const results = data[collection].filter(filterCallback)
|
|
67
|
+
const results = data[collection].filter(filterCallback);
|
|
52
68
|
|
|
53
|
-
const rv = makeReturnValue(this.StatusEnum.OK,
|
|
54
|
-
rv.results = results
|
|
55
|
-
return rv
|
|
56
|
-
}
|
|
69
|
+
const rv = makeReturnValue(this.StatusEnum.OK, "");
|
|
70
|
+
rv.results = results;
|
|
71
|
+
return rv;
|
|
72
|
+
};
|
|
57
73
|
|
|
58
74
|
this.create = function (collection, entry) {
|
|
59
|
-
const newEntry = {}
|
|
60
|
-
let isFieldMissing = false
|
|
75
|
+
const newEntry = {};
|
|
76
|
+
let isFieldMissing = false;
|
|
61
77
|
|
|
62
78
|
if (this.dataCollections.indexOf(collection) === -1) {
|
|
63
|
-
return makeReturnValue(
|
|
79
|
+
return makeReturnValue(
|
|
80
|
+
this.StatusEnum.ERROR,
|
|
81
|
+
"Collection does not exist: " + collection,
|
|
82
|
+
);
|
|
64
83
|
}
|
|
65
84
|
|
|
66
85
|
if (!entry._id) {
|
|
67
|
-
entry._id = entry.names?.[0]
|
|
86
|
+
entry._id = entry.names?.[0];
|
|
68
87
|
}
|
|
69
88
|
|
|
70
|
-
if (typeof entry._id !==
|
|
71
|
-
return makeReturnValue(
|
|
89
|
+
if (typeof entry._id !== "string") {
|
|
90
|
+
return makeReturnValue(
|
|
91
|
+
this.StatusEnum.ERROR,
|
|
92
|
+
"_id must be a string, got " + typeof entry._id,
|
|
93
|
+
);
|
|
72
94
|
}
|
|
73
95
|
|
|
74
96
|
// Check if _id already exists. It should not.
|
|
75
|
-
if (
|
|
76
|
-
|
|
97
|
+
if (
|
|
98
|
+
data[collection].filter(function (value) {
|
|
99
|
+
return value._id === entry._id;
|
|
100
|
+
}).length > 0
|
|
101
|
+
) {
|
|
102
|
+
return makeReturnValue(
|
|
103
|
+
this.StatusEnum.ERROR,
|
|
104
|
+
"_id " + entry._id + " already exists",
|
|
105
|
+
);
|
|
77
106
|
}
|
|
78
107
|
|
|
79
|
-
newEntry._id = entry._id
|
|
108
|
+
newEntry._id = entry._id;
|
|
80
109
|
|
|
81
110
|
collectionFields[collection].forEach(function (field) {
|
|
82
111
|
if (!entry[field]) {
|
|
83
|
-
isFieldMissing = true
|
|
84
|
-
return
|
|
112
|
+
isFieldMissing = true;
|
|
113
|
+
return;
|
|
85
114
|
}
|
|
86
115
|
|
|
87
116
|
if (!(entry[field] instanceof Array)) {
|
|
88
|
-
isFieldMissing = true
|
|
89
|
-
return
|
|
117
|
+
isFieldMissing = true;
|
|
118
|
+
return;
|
|
90
119
|
}
|
|
91
120
|
|
|
92
121
|
// If some element in field array is not a string, reject the entry.
|
|
93
|
-
if (
|
|
94
|
-
|
|
95
|
-
|
|
122
|
+
if (
|
|
123
|
+
entry[field].some(function (value) {
|
|
124
|
+
return typeof value !== "string";
|
|
125
|
+
})
|
|
126
|
+
) {
|
|
127
|
+
isFieldMissing = true;
|
|
128
|
+
return;
|
|
96
129
|
}
|
|
97
130
|
|
|
98
|
-
newEntry[field] = entry[field]
|
|
99
|
-
})
|
|
131
|
+
newEntry[field] = entry[field];
|
|
132
|
+
});
|
|
100
133
|
|
|
101
134
|
if (isFieldMissing) {
|
|
102
|
-
return makeReturnValue(
|
|
135
|
+
return makeReturnValue(
|
|
136
|
+
this.StatusEnum.ERROR,
|
|
137
|
+
"Required field is missing",
|
|
138
|
+
);
|
|
103
139
|
}
|
|
104
140
|
|
|
105
|
-
if (collection ===
|
|
141
|
+
if (collection === "tracks") {
|
|
106
142
|
try {
|
|
107
|
-
validateTrack(entry)
|
|
143
|
+
validateTrack(entry);
|
|
108
144
|
} catch (error) {
|
|
109
|
-
return makeReturnValue(this.StatusEnum.ERROR, error.message)
|
|
145
|
+
return makeReturnValue(this.StatusEnum.ERROR, error.message);
|
|
110
146
|
}
|
|
111
|
-
newEntry.artists = entry.artists
|
|
112
|
-
newEntry.releases = entry.releases
|
|
147
|
+
newEntry.artists = entry.artists;
|
|
148
|
+
newEntry.releases = entry.releases;
|
|
113
149
|
}
|
|
114
150
|
|
|
115
|
-
data[collection].push(newEntry)
|
|
116
|
-
return makeReturnValue(this.StatusEnum.OK,
|
|
117
|
-
}
|
|
151
|
+
data[collection].push(newEntry);
|
|
152
|
+
return makeReturnValue(this.StatusEnum.OK, "");
|
|
153
|
+
};
|
|
118
154
|
|
|
119
155
|
this.link = function (collection, entry) {
|
|
120
156
|
// TODO: error checking for linkage that already exists
|
|
121
157
|
// TODO: how to handle credits? separate command? handle it here? I guess real challenge is handling from the command line.
|
|
122
158
|
if (this.linkCollections.indexOf(collection) === -1) {
|
|
123
|
-
return makeReturnValue(
|
|
159
|
+
return makeReturnValue(
|
|
160
|
+
this.StatusEnum.ERROR,
|
|
161
|
+
"Invalid link collection specified",
|
|
162
|
+
);
|
|
124
163
|
}
|
|
125
|
-
data[collection].push(entry)
|
|
126
|
-
return makeReturnValue(this.StatusEnum.OK,
|
|
127
|
-
}
|
|
164
|
+
data[collection].push(entry);
|
|
165
|
+
return makeReturnValue(this.StatusEnum.OK, "");
|
|
166
|
+
};
|
|
128
167
|
|
|
129
168
|
const fsOp = function (dir, callback) {
|
|
130
|
-
if (!dir || typeof dir !==
|
|
131
|
-
return makeReturnValue(this.StatusEnum.ERROR,
|
|
169
|
+
if (!dir || typeof dir !== "string") {
|
|
170
|
+
return makeReturnValue(this.StatusEnum.ERROR, "No directory specified");
|
|
132
171
|
}
|
|
133
172
|
|
|
134
173
|
try {
|
|
135
|
-
collections.forEach(callback)
|
|
174
|
+
collections.forEach(callback);
|
|
136
175
|
} catch (e) {
|
|
137
|
-
return makeReturnValue(this.StatusEnum.ERROR, e.message)
|
|
176
|
+
return makeReturnValue(this.StatusEnum.ERROR, e.message);
|
|
138
177
|
}
|
|
139
|
-
return makeReturnValue(this.StatusEnum.OK,
|
|
140
|
-
}
|
|
178
|
+
return makeReturnValue(this.StatusEnum.OK, "");
|
|
179
|
+
};
|
|
141
180
|
|
|
142
181
|
this.read = function (dir) {
|
|
143
182
|
return fsOp.call(this, dir, function (collection) {
|
|
144
|
-
data[collection] = JSON.parse(
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
183
|
+
data[collection] = JSON.parse(
|
|
184
|
+
fs.readFileSync(dir + "/" + collection + ".json"),
|
|
185
|
+
);
|
|
186
|
+
if (collection === "tracks") data[collection].forEach(validateTrack);
|
|
187
|
+
});
|
|
188
|
+
};
|
|
148
189
|
|
|
149
190
|
this.write = function (dir) {
|
|
150
191
|
return fsOp.call(this, dir, function (collection) {
|
|
151
|
-
if (collection ===
|
|
152
|
-
fs.writeFileSync(
|
|
153
|
-
|
|
154
|
-
|
|
192
|
+
if (collection === "tracks") data[collection].forEach(validateTrack);
|
|
193
|
+
fs.writeFileSync(
|
|
194
|
+
dir + "/" + collection + ".json",
|
|
195
|
+
JSON.stringify(data[collection], null, 2),
|
|
196
|
+
);
|
|
197
|
+
});
|
|
198
|
+
};
|
|
155
199
|
}
|
|
156
200
|
|
|
157
|
-
module.exports = Data
|
|
201
|
+
module.exports = Data;
|
|
@@ -1,14 +1,22 @@
|
|
|
1
|
-
const assert = require(
|
|
1
|
+
const assert = require("assert");
|
|
2
2
|
|
|
3
3
|
module.exports = function (track) {
|
|
4
|
-
for (const field of [
|
|
5
|
-
const entries = track[field]
|
|
6
|
-
assert.ok(
|
|
7
|
-
|
|
4
|
+
for (const field of ["artists", "releases"]) {
|
|
5
|
+
const entries = track[field];
|
|
6
|
+
assert.ok(
|
|
7
|
+
Array.isArray(entries) && entries.length > 0,
|
|
8
|
+
`Track ${track._id}: ${field} must be a non-empty array`,
|
|
9
|
+
);
|
|
8
10
|
for (const entry of entries) {
|
|
9
|
-
assert.ok(
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
assert.ok(
|
|
12
|
+
entry &&
|
|
13
|
+
Array.isArray(entry.names) &&
|
|
14
|
+
entry.names.length > 0 &&
|
|
15
|
+
Array.from(entry.names).every(
|
|
16
|
+
(name) => typeof name === "string" && name.trim().length > 0,
|
|
17
|
+
),
|
|
18
|
+
`Track ${track._id}: each ${field} entry must have a non-empty names array of non-empty strings`,
|
|
19
|
+
);
|
|
12
20
|
}
|
|
13
21
|
}
|
|
14
|
-
}
|
|
22
|
+
};
|
package/lib/cli/add.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
module.exports = function (data, collection, names, metadata) {
|
|
2
|
-
let entry = { names: [names] }
|
|
3
|
-
if (collection ===
|
|
2
|
+
let entry = { names: [names] };
|
|
3
|
+
if (collection === "tracks") {
|
|
4
4
|
try {
|
|
5
|
-
entry = { ...JSON.parse(metadata), names: [names] }
|
|
5
|
+
entry = { ...JSON.parse(metadata), names: [names] };
|
|
6
6
|
} catch {
|
|
7
|
-
return {
|
|
7
|
+
return {
|
|
8
|
+
status: data.StatusEnum.ERROR,
|
|
9
|
+
message:
|
|
10
|
+
"Tracks require JSON metadata containing artists and releases arrays",
|
|
11
|
+
};
|
|
8
12
|
}
|
|
9
13
|
}
|
|
10
|
-
return data.create(collection, entry)
|
|
11
|
-
}
|
|
14
|
+
return data.create(collection, entry);
|
|
15
|
+
};
|
package/lib/cli/argv.js
CHANGED
|
@@ -1,71 +1,76 @@
|
|
|
1
|
-
const fs = require(
|
|
2
|
-
const path = require(
|
|
3
|
-
const Data = require(
|
|
4
|
-
const add = require(
|
|
5
|
-
const search = require(
|
|
6
|
-
const link = require(
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
const path = require("path");
|
|
3
|
+
const Data = require("../Data");
|
|
4
|
+
const add = require("./add");
|
|
5
|
+
const search = require("./search");
|
|
6
|
+
const link = require("./link");
|
|
7
7
|
|
|
8
8
|
module.exports = function (argv) {
|
|
9
|
-
const that = this
|
|
10
|
-
const action = argv._[0]
|
|
11
|
-
const args = argv._.splice(1)
|
|
12
|
-
let rv = {}
|
|
13
|
-
let inputRv
|
|
9
|
+
const that = this;
|
|
10
|
+
const action = argv._[0];
|
|
11
|
+
const args = argv._.splice(1);
|
|
12
|
+
let rv = {};
|
|
13
|
+
let inputRv;
|
|
14
14
|
|
|
15
|
-
const defaultDir = path.join(__dirname,
|
|
16
|
-
const outputDir = argv.outputDir || argv.o || defaultDir
|
|
17
|
-
const inputDir = argv.inputDir || argv.i || defaultDir
|
|
15
|
+
const defaultDir = path.join(__dirname, "../../data");
|
|
16
|
+
const outputDir = argv.outputDir || argv.o || defaultDir;
|
|
17
|
+
const inputDir = argv.inputDir || argv.i || defaultDir;
|
|
18
18
|
|
|
19
|
-
const data = new Data()
|
|
19
|
+
const data = new Data();
|
|
20
20
|
|
|
21
21
|
const save = function () {
|
|
22
22
|
if (rv.status === data.StatusEnum.OK) {
|
|
23
23
|
if (outputDir) {
|
|
24
|
-
data.write(outputDir)
|
|
24
|
+
data.write(outputDir);
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
}
|
|
27
|
+
};
|
|
28
28
|
|
|
29
29
|
const run = function (actionFunction) {
|
|
30
|
-
const actionRv = actionFunction.apply(undefined, [data].concat(args))
|
|
30
|
+
const actionRv = actionFunction.apply(undefined, [data].concat(args));
|
|
31
31
|
if (actionRv.message) {
|
|
32
|
-
that.error(actionRv.message)
|
|
32
|
+
that.error(actionRv.message);
|
|
33
33
|
}
|
|
34
|
-
return actionRv
|
|
35
|
-
}
|
|
34
|
+
return actionRv;
|
|
35
|
+
};
|
|
36
36
|
|
|
37
37
|
if (inputDir) {
|
|
38
|
-
inputRv = data.read(inputDir)
|
|
38
|
+
inputRv = data.read(inputDir);
|
|
39
39
|
if (inputRv.message) {
|
|
40
|
-
this.error(inputRv.message)
|
|
40
|
+
this.error(inputRv.message);
|
|
41
41
|
}
|
|
42
42
|
if (inputRv.status === data.StatusEnum.ERROR) {
|
|
43
|
-
this.exit(1)
|
|
43
|
+
this.exit(1);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
switch (action) {
|
|
48
|
-
case
|
|
49
|
-
rv = run(add)
|
|
50
|
-
save()
|
|
51
|
-
break
|
|
48
|
+
case "add":
|
|
49
|
+
rv = run(add);
|
|
50
|
+
save();
|
|
51
|
+
break;
|
|
52
52
|
|
|
53
|
-
case
|
|
54
|
-
rv = run(link)
|
|
55
|
-
save()
|
|
56
|
-
break
|
|
53
|
+
case "link":
|
|
54
|
+
rv = run(link);
|
|
55
|
+
save();
|
|
56
|
+
break;
|
|
57
57
|
|
|
58
|
-
case
|
|
59
|
-
rv = run(search)
|
|
58
|
+
case "search":
|
|
59
|
+
rv = run(search);
|
|
60
60
|
if (rv.status === data.StatusEnum.OK) {
|
|
61
|
-
this.dir(rv.results)
|
|
61
|
+
this.dir(rv.results);
|
|
62
62
|
}
|
|
63
|
-
break
|
|
63
|
+
break;
|
|
64
64
|
|
|
65
65
|
default:
|
|
66
|
-
this.error(
|
|
67
|
-
|
|
66
|
+
this.error(
|
|
67
|
+
fs.readFileSync(
|
|
68
|
+
path.join(__dirname, "..", "..", "doc", "cli", "help.txt"),
|
|
69
|
+
"utf8",
|
|
70
|
+
),
|
|
71
|
+
);
|
|
72
|
+
rv = { status: data.StatusEnum.ERROR };
|
|
68
73
|
}
|
|
69
|
-
const code = rv.status === data.StatusEnum.OK ? 0 : 1
|
|
70
|
-
this.exit(code)
|
|
71
|
-
}
|
|
74
|
+
const code = rv.status === data.StatusEnum.OK ? 0 : 1;
|
|
75
|
+
this.exit(code);
|
|
76
|
+
};
|
package/lib/cli/index.js
CHANGED
package/lib/cli/link.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
module.exports = function (data, collection1, id1, collection2, id2) {
|
|
2
|
-
let linkCollection = collection1 +
|
|
3
|
-
const field1 = collection1 +
|
|
4
|
-
const field2 = collection2 +
|
|
5
|
-
const link = {}
|
|
6
|
-
link[field1] = id1.toString()
|
|
7
|
-
link[field2] = id2.toString()
|
|
2
|
+
let linkCollection = collection1 + "_" + collection2;
|
|
3
|
+
const field1 = collection1 + "_id";
|
|
4
|
+
const field2 = collection2 + "_id";
|
|
5
|
+
const link = {};
|
|
6
|
+
link[field1] = id1.toString();
|
|
7
|
+
link[field2] = id2.toString();
|
|
8
8
|
|
|
9
9
|
if (data.linkCollections.indexOf(linkCollection) === -1) {
|
|
10
10
|
// Allow the individual and track arguments in either order.
|
|
11
|
-
linkCollection = collection2 +
|
|
11
|
+
linkCollection = collection2 + "_" + collection1;
|
|
12
12
|
if (data.linkCollections.indexOf(linkCollection) === -1) {
|
|
13
|
-
const message = `${collection1} and ${collection2} cannot be linked
|
|
14
|
-
return { status: data.StatusEnum.ERROR, message }
|
|
13
|
+
const message = `${collection1} and ${collection2} cannot be linked`;
|
|
14
|
+
return { status: data.StatusEnum.ERROR, message };
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
return data.link(linkCollection, link)
|
|
18
|
-
}
|
|
17
|
+
return data.link(linkCollection, link);
|
|
18
|
+
};
|
package/lib/cli/search.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module.exports = function (data, collection, searchTerm) {
|
|
2
2
|
const filterCallback = function (value) {
|
|
3
|
-
const names = value.names.map(name => name.toLowerCase())
|
|
4
|
-
return names.indexOf(searchTerm.toLowerCase()) !== -1
|
|
5
|
-
}
|
|
6
|
-
return data.search({ collection, filterCallback })
|
|
7
|
-
}
|
|
3
|
+
const names = value.names.map((name) => name.toLowerCase());
|
|
4
|
+
return names.indexOf(searchTerm.toLowerCase()) !== -1;
|
|
5
|
+
};
|
|
6
|
+
return data.search({ collection, filterCallback });
|
|
7
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "music-routes-data",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.3",
|
|
4
4
|
"description": "What musicians played on what tracks",
|
|
5
5
|
"homepage": "https://github.com/Trott/music-routes-data",
|
|
6
6
|
"files": [
|
|
@@ -11,7 +11,10 @@
|
|
|
11
11
|
"README.md"
|
|
12
12
|
],
|
|
13
13
|
"scripts": {
|
|
14
|
-
"
|
|
14
|
+
"lint": "eslint .",
|
|
15
|
+
"format": "prettier --write --ignore-path .gitignore --parser babel \"**/*.js\" \"bin/*\"",
|
|
16
|
+
"format:check": "prettier --check --ignore-path .gitignore --parser babel \"**/*.js\" \"bin/*\"",
|
|
17
|
+
"test": "npm run lint && npm run format:check && c8 --100 jasmine spec/*.js && bin/verify"
|
|
15
18
|
},
|
|
16
19
|
"repository": {
|
|
17
20
|
"type": "git",
|
|
@@ -29,12 +32,15 @@
|
|
|
29
32
|
"Trott"
|
|
30
33
|
],
|
|
31
34
|
"devDependencies": {
|
|
35
|
+
"@eslint/js": "^10.0.1",
|
|
32
36
|
"@semantic-release/changelog": "^7.0.0",
|
|
33
37
|
"@semantic-release/git": "^11.0.1",
|
|
34
38
|
"c8": "12.0",
|
|
39
|
+
"eslint": "^10.14.0",
|
|
40
|
+
"globals": "^17.14.0",
|
|
35
41
|
"jasmine": "7.0",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
42
|
+
"prettier": "^3.9.10",
|
|
43
|
+
"semantic-release": "^26.0.1"
|
|
38
44
|
},
|
|
39
45
|
"dependencies": {
|
|
40
46
|
"minimist": "^1.2.7"
|