music-routes-data 3.4.0 → 4.0.0

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/README.md CHANGED
@@ -6,19 +6,18 @@ Music Routes Data: What musicians played on which tracks?
6
6
  Schema
7
7
  ======
8
8
 
9
- Data is stored in eight JSON files in the `data` directory.
9
+ Data is stored in JSON files in the `data` directory.
10
10
 
11
- Four of the files contain basic data:
11
+ These files contain basic data:
12
12
 
13
13
  * `tracks.json` contains the `names` and unique `id` string for a track.
14
14
  * `releases.json` contains the `names` and unique `id` string for a release.
15
15
  * `artists.json` contains the `names` and unique `id` string for an artist.
16
16
  * `individuals.json` contains the `names` and unique `id` string for an individual.
17
17
 
18
- Four of the files describe relationships between the basic data and sometimes include extra data relevant to the relationship:
18
+ These files describe relationships between the basic data and sometimes include extra data relevant to the relationship:
19
19
 
20
20
  * `artist_track.json` contains `artistId` and `trackId` pairs where a track is attributed to an artist.
21
- * `individual_artist.json` contains `individualId` and `artistId` pairs where an individual is a member of an artist.
22
21
  * `individual_track.json` contains `individualId` and `trackId` pairs where the individual performed on the track. There is also an optional `credits` array that explains the person's role on the track (e.g., `["vocals","guitar"]`).
23
22
  * `track_release.json` contains `trackId` and `releaseId` pairs where a track appears on a release.
24
23
 
package/bin/verify CHANGED
@@ -15,7 +15,7 @@ if (rv.status === data.StatusEnum.ERROR) {
15
15
 
16
16
  var dump = {}; // local copy of all collections
17
17
 
18
- collections = ["tracks", "artists", "releases", "individuals", "artist_track", "individual_artist", "individual_track", "track_release"];
18
+ collections = ["tracks", "artists", "releases", "individuals", "artist_track", "individual_track", "track_release"];
19
19
 
20
20
  collections.forEach(function(collection) {
21
21
  var rv = data.search({collection: collection});
@@ -51,8 +51,6 @@ dump.included = function (basic, relation, propName) {
51
51
  assert.ok(dump.included("artists", "artist_track", "artist_id"));
52
52
  // All tracks should have artists.
53
53
  assert.ok(dump.included("tracks", "artist_track", "track_id"));
54
- // All artists have individuals. (Not all individuals are members of artists, though.)
55
- // assert.ok(dump.included("artists", "individual_artist", "artist_id"));
56
54
  // All individuals are associated with at least one track.
57
55
  // assert.ok(dump.included("individuals", "individual_track", "individual_id"));
58
56
  // All tracks are on at least one release.
package/lib/Data/index.js CHANGED
@@ -11,7 +11,6 @@ function Data (options) {
11
11
 
12
12
  const linkCollectionFields = {
13
13
  artist_track: [],
14
- individual_artist: [],
15
14
  individual_track: [],
16
15
  track_release: []
17
16
  }
package/lib/cli/index.js CHANGED
@@ -1,15 +1,6 @@
1
1
  module.exports = {
2
- dir: function (output) {
3
- console.dir(output)
4
- },
5
-
6
- exit: function (code) {
7
- process.exit(code)
8
- },
9
-
10
- error: function (message) {
11
- console.error(message)
12
- },
13
-
2
+ dir: console.dir,
3
+ exit: process.exit,
4
+ error: console.error,
14
5
  argv: require('./argv')
15
6
  }
package/lib/cli/link.js CHANGED
@@ -10,8 +10,8 @@ module.exports = function (data, collection1, id1, collection2, id2) {
10
10
  // Try track_release if release_track is what we have
11
11
  linkCollection = collection2 + '_' + collection1
12
12
  if (data.linkCollections.indexOf(linkCollection) === -1) {
13
- console.error(collection1 + ' and ' + collection2 + ' cannot be linked')
14
- return { status: data.StatusEnum.ERROR }
13
+ const message = `${collection1} and ${collection2} cannot be linked`
14
+ return { status: data.StatusEnum.ERROR, message }
15
15
  }
16
16
  }
17
17
  return data.link(linkCollection, link)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "music-routes-data",
3
- "version": "3.4.0",
3
+ "version": "4.0.0",
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,7 @@
11
11
  "README.md"
12
12
  ],
13
13
  "scripts": {
14
- "test": "standard && c8 jasmine spec/*.js && bin/verify"
14
+ "test": "standard && c8 --100 jasmine spec/*.js && bin/verify"
15
15
  },
16
16
  "repository": {
17
17
  "type": "git",