arc pack
Pack the game into a zip.
Usage
arc pack [options]
Options:
-i, --input Pack this directory instead of deploy_dir
[string] [default: null]
-o, --output Write the zip to this path [string] [default: null]
-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
Validates the project and packages it into the zip that gets uploaded. It checks what it packs, every file in it, and leaves the manifest's rules to arc validate, which it runs first.
arc pack
arc pack -o build.zip
arc pack -i dist # package a different directory than deploy_dir
The archive contains:
<handle-or-id>-v<version>.zip
└── <handle-or-id>-v<version>/
├── index.html # the contents of deploy_dir (or --input)
├── …
├── favicon.ico # added when deploy_dir has none
├── .arcadible/ # the media directory, as is
├── arcadible/function.js # the function's bundle, when the game has one
└── arcadible.json # the resolved game manifest
Everything is inside one folder named like the zip.
- By default it's written to
.arc/package/<handle-or-id>-v<version>.zip. Keep.arc/in.gitignore:arc deploy gitrefuses to release with untracked files. index.htmlmust be at the root of the input directory, andarcadible.json,.arcadible/, and anarcadible/folder mustn't: they're Arcadible's (package_path_reserved).- A
favicon.icois added at the root when the input directory has none, so every build answers browsers that ask for one: youriconat 16, 32, and 48 pixels, or Arcadible's when there's no icon. Your ownfavicon.icois packed as it is. --inputchanges only what goes in the zip. The project is still validated as a whole, sodeploy_dirhas to passarc validatetoo.- A symbolic link is packed as the file or folder it leads to, under its own name, when that's inside the folder. One that leads outside it, back into a folder that holds it, or to nothing fails (
package_link_invalid). - The zip must fit Arcadible's size limits: 64 MB compressed for
deploy_dir, 256 MB uncompressed with.arcadible/, up to 10,000 files and 20,000 files and folders together, no file over 64 MB, and no name a browser can't ask for. - It doesn't run the build. Build first if
deploy_diris generated, or if your game has a function: without its bundle, packing fails (function_not_built).
You don't need to run this yourself: arc deploy runs it, and so does the GitHub release workflow. It's mainly useful for checking exactly what will be uploaded.
Output
It prints the zip's path, SHA-256, and size. With --json:
{
"artifact": {
"path": "/home/you/star-drift/.arc/package/…-v1.2.0.zip",
"sha256": "d4eafacb…",
"size": 59206
},
"warnings": []
}
warnings lists arc validate's, then the package's own, such as a .env file in it (package_file_private), or a page that loads a script under /arcadible/ other than the SDK's, /arcadible/lib/sdk.v1.js (sdk_script_path).
| Code | When |
|---|---|
0 | The zip was written |
1 | The project has issues or its files can't be read, deploy_dir or --input doesn't exist or has no index.html, or the game breaks a package limit |