the command line tool for the petal framework.
you need haxe and hashlink installed.
haxe build.hxmlthis produces petal.hl which runs with:
hl petal.hlto produce a standalone native binary, compile to hlc instead:
haxe build-native.hxmlthen compile the output c code with your platform's c compiler. the petal ci handles this for distribution builds.
petal new my-app
petal run web
petal build web --release
petal add petal/camera
petal update
petal lint
petal lsp| target | description |
|---|---|
web |
html + css + js bundle |
desktop-linux |
linux via webview |
desktop-linux-native |
linux via skia renderer |
desktop-windows |
windows via webview |
desktop-windows-native |
windows via skia renderer |
desktop-macos |
macos via webview |
desktop-macos-native |
macos via skia renderer |
android |
android via webview |
android-native |
android via skia renderer |
ios |
ios via webview |
ios-native |
ios via skia renderer |
my-app/
src/
pages/ <- .petal files here are treated as pages (like sveltekit routes)
components/ <- .petal files here are components
petal.json <- project config, deps, targets
{
"name": "my-app",
"version": "0.1.0",
"petal": "0.1.0",
"targets": ["web", "desktop-linux"],
"dependencies": {
"petal/camera": "^1.0.0"
}
}