Switched npm to yarn. Resolved [[releases]] issues. Updated validation script to resolve errors.

This commit is contained in:
Chris 2018-05-17 20:41:21 -04:00
parent 78bbea3acc
commit 812df1a004
7 changed files with 63 additions and 58 deletions

View file

@ -1,10 +1,8 @@
language: node_js
node_js:
- "node"
install:
- cd validation
- npm install
- yarn install
script:
- node app.js

View file

@ -10,6 +10,7 @@ title = "0100B7D0022EE000"
region = "usa"
release_date = "2017-06-20"
[[ releases ]]
title = "0100B7D0022EE000"
region = "eur"
release_date = "2017-07-20"

View file

@ -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"

View file

@ -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"

View file

@ -10,6 +10,7 @@ title = "010021C000B6A000"
region = "usa"
release_date = "2017-03-17"
[[ releases ]]
title = "0100F8A004458000"
region = "eur"
release_date = "2017-03-17"

View file

@ -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.
if (config.boxart) {
validateImage(`${inputDirectoryGame}/${config.boxart.filename}`, config.boxart);
}
// Verify the game's image.
validateImage(`${inputDirectoryGame}/${config.icon.filename}`, config.icon);

52
validation/yarn.lock Normal file
View file

@ -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"