Skip to content
Hekana Spray
Documentation
Getting started
Theme development
Components and tags

Localization

Apps and custom code

Examples and recipes
API reference
Publishing
Build apps
AI development

sneferu build

Compile and package a theme into a .sneferu.json artifact. Usage, options, output, exit codes and errors.

On this page

Compile and package a theme into a .sneferu.json artifact.

Runs the same checks as validate and, when there are no errors, writes <id>-<version>.sneferu.json and the theme's image assets to the output folder. The artifact is what Hekana loads. Only dist is skipped when the folder is checked, so an --out folder with another name inside the theme makes the next validate or build report SN3003 for its files.

Usage

bash
sneferu build [options] [dir]

Arguments

ArgumentRequiredDefaultDescription
dirno.Theme folder.

Options

OptionDefaultDescription
--out <dir>distOutput folder, relative to the theme folder.

Examples

bash
sneferu build

Builds the current folder into ./dist.

bash
sneferu build my-theme --out ../out

Writes the artifact next to the theme, outside it.

Output

sneferu build my-theme (exit 0): The hash is the content hash of the artifact; yours will match for an unchanged starter at the same SDK version.

text
✔ built [email protected] → ./my-theme/dist/my-theme-0.1.0.sneferu.json (hash 21658eb137411586)

sneferu build my-theme (exit 1): With the same broken snippet as in validate.

text
snippets/demo.snf:1:1 error SN2001 <script> is not allowed in themes
snippets/demo.snf:2:4 error SN2002 attribute 'onclick' is not allowed
snippets/demo.snf:3:1 warning SN2015 <img> without width and height; set both so the page does not jump while the image loads
✖ build failed

Exit codes

CodeMeaning
0The artifact was written.
1The theme has errors; nothing was written.

Common errors

<path> error SN3003 file type or location not allowed: 'out/...'

A build output folder other than dist was left inside the theme folder. Delete it, or build with --out pointing outside the theme. See SN3003.

Next steps