Building a program
sh
thicket buildthicket build turns a project into a standalone program. The result runs on a machine with no thicket, no source code and no thicket_packages/ folder.
Try it
sh
thicket new hello
cd hello
thicket build
./build/hellotext
hello from thicketWhat you get
The output goes to build/ inside the project, replaced on each build:
text
build/
hello the program (a prebuilt runtime)
bundle.tbc your compiled code and its frozen config
package-receipt.json a record of every file that was placedThe program file is a prebuilt runtime. bundle.tbc is your compiled bytecode. Keep them side by side.
- A console app gets the console runtime.
- A window app (a project with a
windowsection) gets the window runtime, in a flat folder you can zip and share.
Ship your assets
Only what the assets field lists ships with the program:
json5
{
entry: "app.tks",
window: { title: "My Game" },
assets: ["assets/**"],
}Each file keeps the path it has in your project, so a path like assets/player.png means the same thing in thicket run and in the built program.
Give your app an id
thicket build warns when thicket.json has no id. Without one, the app's save and cache folders are named after the project folder, so two projects in folders with the same name would share them. Set an id before you ship.
Useful flags
| Flag | What it does |
|---|---|
--out <dir> | Write somewhere other than build/. A folder that is not empty is refused unless you add --force. |
--release | Drop the source map and function names. |
--strategy <name> | Choose how the program is packaged. |
--list-strategies | Show the strategies that fit this project. |
Ship a fix without rebuilding everything
The runtime is not tied to one bundle. A bundle.tbc from a later build of the same project, made with the same thicket version, can be dropped over the old one and runs the new code. Changed assets have to be copied too.
Platforms, strategies and asset options are covered in Building for each platform.