From 812df1a004d0795c5be9ff22022327621b64ca99 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 17 May 2018 20:41:21 -0400 Subject: [PATCH] Switched npm to yarn. Resolved [[releases]] issues. Updated validation script to resolve errors. --- .travis.yml | 4 +- games/cave-story-plus/game.dat | 1 + .../game.dat | 2 + games/puyo-puyo-tetris/game.dat | 2 + .../game.dat | 1 + validation/app.js | 59 ++----------------- validation/yarn.lock | 52 ++++++++++++++++ 7 files changed, 63 insertions(+), 58 deletions(-) create mode 100644 validation/yarn.lock diff --git a/.travis.yml b/.travis.yml index 12a9694..de72fb0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,8 @@ language: node_js - node_js: - "node" - install: - cd validation - - npm install + - yarn install script: - node app.js diff --git a/games/cave-story-plus/game.dat b/games/cave-story-plus/game.dat index 968ac28..a363a0e 100644 --- a/games/cave-story-plus/game.dat +++ b/games/cave-story-plus/game.dat @@ -10,6 +10,7 @@ title = "0100B7D0022EE000" region = "usa" release_date = "2017-06-20" +[[ releases ]] title = "0100B7D0022EE000" region = "eur" release_date = "2017-07-20" diff --git a/games/one-piece-unlimited-world-red-deluxe/game.dat b/games/one-piece-unlimited-world-red-deluxe/game.dat index 6c79b58..ae877a4 100644 --- a/games/one-piece-unlimited-world-red-deluxe/game.dat +++ b/games/one-piece-unlimited-world-red-deluxe/game.dat @@ -10,10 +10,12 @@ title = "0100574002AF4000" region = "jpn" release_date = "2017-08-24" +[[ releases ]] title = "0100574002AF4000" region = "eur" release_date = "2017-09-29" +[[ releases ]] title = "0100574002AF4000" region = "usa" release_date = "2017-09-29" diff --git a/games/puyo-puyo-tetris/game.dat b/games/puyo-puyo-tetris/game.dat index 96d0740..122070d 100644 --- a/games/puyo-puyo-tetris/game.dat +++ b/games/puyo-puyo-tetris/game.dat @@ -10,10 +10,12 @@ title = "010073C001D5E000" region = "usa" release_date = "2017-04-25" +[[ releases ]] title = "0100F3D001DEE000" region = "eur" release_date = "2017-04-28" +[[ releases ]] title = "010053D0001BE000" region = "jpn" release_date = "2017-03-03" diff --git a/games/the-binding-of-isaac-afterbirth-plus/game.dat b/games/the-binding-of-isaac-afterbirth-plus/game.dat index 2a28248..f521835 100644 --- a/games/the-binding-of-isaac-afterbirth-plus/game.dat +++ b/games/the-binding-of-isaac-afterbirth-plus/game.dat @@ -10,6 +10,7 @@ title = "010021C000B6A000" region = "usa" release_date = "2017-03-17" +[[ releases ]] title = "0100F8A004458000" region = "eur" release_date = "2017-03-17" diff --git a/validation/app.js b/validation/app.js index 07f3b14..4312fc9 100644 --- a/validation/app.js +++ b/validation/app.js @@ -214,59 +214,6 @@ function validateTOML(path) { } else { validationError("No releases.") } - - let maxCompatibility = 999; - - // Check each testcase individually - if (tomlDoc["testcases"] !== undefined) { - section = tomlDoc["testcases"]; - section.forEach(testcase => { - validateContents(testcase, "title", field => { - if (field.length !== 16) { - validationError(`Testcase: Game title ID has an invalid length`); - } else if (!field.match(/^([A-Z0-9]){16}$/)) { - validationError(`Testcase: Game title ID is not a hexadecimal ID`); - } - }); - - validateNotEmpty(testcase, "compatibility"); - if (testcase["compatibility"] !== undefined) { - let compat = parseInt(testcase["compatibility"]); - if (compat < maxCompatibility) { - maxCompatibility = compat; - } - } - - validateIsDate(testcase, "date"); - validateContents(testcase, "version", test => { - if (test.length !== 12) { - validationError(`Testcase: Version is of incorrect length`); - } else if (!test.startsWith("HEAD-")) { - validationError(`Testcase: Unknown version commit source`); - } - }); - validateNotEmpty(testcase, "author"); - - validateNotEmpty(testcase, "cpu"); - validateNotEmpty(testcase, "gpu"); - validateNotEmpty(testcase, "os"); - }); - - // Validate dates are properly ordered - section.reduce(function(previousValue, currentValue) { - if (typeof previousValue === "undefined" || previousValue.date <= currentValue.date) { - return currentValue; - } - validationError("Test case dates are not properly sorted in ascending order."); - }); - } - - // We only check these if we have a known test result (we cannot know if a game needs - // resources if it doesn't even run!) - if (maxCompatibility < 5) { - validateIsBoolean(tomlDoc, "needs_system_files"); - validateIsBoolean(tomlDoc, "needs_shared_font"); - } } /// Validates the basic structure of a save game's TOML. Assumes it exists. @@ -370,7 +317,9 @@ getDirectories(config.directory).forEach(function (game) { }); // Verify the game's boxart. - validateImage(`${inputDirectoryGame}/${config.boxart.filename}`, config.boxart); + if (config.boxart) { + validateImage(`${inputDirectoryGame}/${config.boxart.filename}`, config.boxart); + } // Verify the game's image. validateImage(`${inputDirectoryGame}/${config.icon.filename}`, config.icon); @@ -380,7 +329,7 @@ getDirectories(config.directory).forEach(function (game) { // Verify the game's screenshots. validateDirImages(`${inputDirectoryGame}/${config.screenshots.dirname}`, - config.screenshots); + config.screenshots); // Verify the game's save files. validateSaves(`${inputDirectoryGame}/${config.saves.dirname}`); diff --git a/validation/yarn.lock b/validation/yarn.lock new file mode 100644 index 0000000..88bc9b2 --- /dev/null +++ b/validation/yarn.lock @@ -0,0 +1,52 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +component-props@*: + version "1.1.1" + resolved "https://registry.yarnpkg.com/component-props/-/component-props-1.1.1.tgz#f9b7df9b9927b6e6d97c9bd272aa867670f34944" + +file-type@^4.1.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/file-type/-/file-type-4.4.0.tgz#1b600e5fca1fbdc6e80c0a70c71c8dba5f7906c5" + +group-by@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/group-by/-/group-by-0.0.1.tgz#857620575f6714786f8d86bb19fd13e188dd68a4" + dependencies: + to-function "*" + +image-size@^0.5.4: + version "0.5.5" + resolved "https://registry.yarnpkg.com/image-size/-/image-size-0.5.5.tgz#09dfd4ab9d20e29eb1c3e80b8990378df9e3cb9c" + +image-type@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/image-type/-/image-type-3.0.0.tgz#1502af3135f906e122c877c31e94af7b7a9146c5" + dependencies: + file-type "^4.1.0" + +pify@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" + +read-chunk@latest: + version "2.1.0" + resolved "https://registry.yarnpkg.com/read-chunk/-/read-chunk-2.1.0.tgz#6a04c0928005ed9d42e1a6ac5600e19cbc7ff655" + dependencies: + pify "^3.0.0" + safe-buffer "^5.1.1" + +safe-buffer@^5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + +to-function@*: + version "2.0.6" + resolved "https://registry.yarnpkg.com/to-function/-/to-function-2.0.6.tgz#7d56cd9c3b92fa8dbd7b22e83d51924de740ebc5" + dependencies: + component-props "*" + +toml@^2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/toml/-/toml-2.3.3.tgz#8d683d729577cb286231dfc7a8affe58d31728fb"