Skip to main content

arc validate

Check the project for issues.

Usage​

arc validate [options]

Options:
-j, --json Format output as JSON [boolean] [default: false]
-q, --quiet Output only errors [boolean] [default: false]
-C, --cwd Set the working directory [string] [default: "."]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]

Description​

Checks the resolved manifest against the rules in the Arcadible Manifest and Arcadible Markdown references, including the media files' dimensions, aspect ratios, sizes, and durations. It runs locally and doesn't need you to be logged in.

It checks the project's own files, not what a build writes: for deploy_dir, only its path. What's in it, such as its index.html and the scripts its pages load, is checked when arc pack or arc deploy packs it. Each command checks only its own part, so arc validate never reads the build's files, and arc pack never the manifest's rules, which it leaves to arc validate, run first.

$ arc validate
2 issues:
✗ game.description: Invalid Markdown.
Value 'http://example.com' isn't allowed for href on <a>.
✗ game.icon: Invalid PNG.
Image is 500 × 400px.
Image must be at least 512px wide.
Image must be at least 512px tall.
Image must be 1:1.
2 references:
https://developer.arcadible.com/references/arcadible-manifest#game.description
https://developer.arcadible.com/references/arcadible-manifest#game.icon

Each field lists every rule it breaks, so one run shows everything to fix. A path is the exception: it stops at the first check it fails, such as Must be within the project., since the checks after it depend on it. A media file that breaks a rule is described first, with its dimensions and, for a video, its length.

With no issues, it prints No issues found. It exits with 1 when there are issues or the project's files can't be read, and 0 otherwise, so it works as a pre-commit hook or CI step. Use --json to get the issues as { "issues": [...], "warnings": [...] }, each with its code.

arc deploy runs the same checks first and aborts if any fail.

Warnings​

A warning is something in the project that's valid but rarely meant, and arc validate still exits with 0; --quiet leaves warnings out. It warns about:

  • A field or table in arcadible.toml that Arcadible doesn't know, which it ignores, with the name it might mean: one spelled close to it, the table that takes a field of that name, or a field sharing a word with it (field_unknown).
  • A release version without visibility or title, and a public one without inputs (field_unset). A prerelease isn't warned about, since it doesn't change the store page.
  • An art video without its PNG (art_video_unpaired).
  • A gallery file named almost like a screenshot, such as Screenshot_01.png or screenshot-01.png (screenshot_name_invalid).

For example:

$ arc validate
1 warning:
⚠ game.genre: Unknown field.
Did you mean: genres?
No issues found.

arc build, arc pack, and arc deploy print warnings too, on stderr, and go on. arc pack and arc deploy also warn about what they pack: a node_modules/ folder at the top of deploy_dir (package_file_dev), a .env file or .git/ folder anywhere in the game (package_file_private), and a page that loads a script under /arcadible/ other than the SDK's, /arcadible/lib/sdk.v1.js (sdk_script_path). arc build and arc deploy warn of a function that imports a package meant for a game or a server of your own (function_import_wrong), and arc deploy of a secret its function declares with no value on the version's channel (secret_unset). --quiet leaves them out. With --json, each lists them under warnings, as arc validate does, along with its own, such as arc build's deploy_dir_not_built. See Warnings.

Output​

With --json, the issues and the warnings, each an empty list when there are none. Each has the field's path, the rule's code, the message and its details, and the docs_url: for an issue, to the field's rules; for a warning, to its entry in Errors, or null for an unknown field:

{
"issues": [
{
"code": "media_invalid",
"details": [
"Image is 500 × 400px.",
"Image must be at least 512px wide."
],
"docs_url": "https://developer.arcadible.com/references/arcadible-manifest#game.icon",
"message": "Invalid PNG.",
"path": "game.icon"
}
],
"warnings": []
}
CodeWhen
0No issues
1One or more issues, or the project's files can't be read, such as an arcadible.toml that isn't valid TOML

What each message means is in Errors.