Build & Delivery

Artifacts & Deployment

Find the files to deploy, run the copied product, and recover from changes to its output folder.

Copy the files your application needs to its deployment environment, then run it without the Topaz source package. This page explains which folder to copy and how to recover if a rebuild rejects it.

Start with the native package example or the JavaScript call example. Those guides provide the source files and build tools.

Choose the output folder

For a single file named main.tpz, choose the command for your deployment environment.

BASH
topaz build main.tpz --release --out-dir native-product
topaz build main.tpz --target web --out-dir web-product
topaz build main.tpz --target web-worker --out-dir worker-product
topaz build --root my-app --locked --release --out-dir package-product

The first three commands create native-product, web-product, or worker-product. The last command builds an existing my-app package into package-product. It reads [build].target from topaz.toml and checks topaz.lock with --locked.

Deploy the complete folder selected by --out-dir. build creates that folder for delivery. Use emit when you need generated source for inspection or integration. Temporary compiler files are not a deployable product.

Keep the common files

Every successful build includes these files.

Output
LICENSE
NOTICE
GENERATED-OUTPUT-NOTICE.txt
topaz-artifact.json

Keep the legal notices with the product. topaz-artifact.json is the manifest that lists the files Topaz created and manages. It records their paths, sizes, hashes, and executable requirements. It also records the target, toolchain and language identifiers, runtime requirements, and build invocation. Topaz writes this manifest last. Keep topaz.lock with the source package for later development and builds.

Find the files for your target

A native build adds an executable at one of these paths.

Output
target/debug/program[.exe]
target/release/program[.exe]

The default build uses debug. --release uses release. Each build creates the selected path. On Windows, the filename is program.exe.

A Web build adds the JavaScript module, type declarations, and WASM program.

Output
topaz-web.js
topaz-web.d.ts
topaz-web.wasm

A Worker build includes those Web files and adds two modules for sending requests and responses.

Output
topaz-web-worker.js
topaz-web-worker-client.js

Run from the copied folder

Copy the complete native product to a new location and open a terminal in that folder. For a release build, run the following command.

BASH
./target/release/program

In PowerShell, run .\target\release\program.exe. The program should produce the same output for the same input. For the study-plan example, expect tasks=2, remaining=25 minutes and exit code 0. Use the OS and architecture the executable was built for.

Native package applications resolve declared filesystem access roots from the process working directory. Copy the required data/ files and create writable output folders at the paths declared in topaz.toml. The build does not copy package data automatically.

For Web and Worker products, serve the copied folder over HTTP and import the generated JavaScript module. The JavaScript call example shows the input and result. Browsers do not support this loading path through file://.

Recover from a rejected output folder

Before rebuilding into the same folder, Topaz checks the files listed in topaz-artifact.json. It rejects a changed target, malformed manifest, modified managed file, symlink, or collision with a user-owned path. Files outside the manifest remain untouched.

Keep a rejected folder for inspection and choose a new empty --out-dir. Do not delete an unfamiliar folder to force the build. To restore an earlier product, restore its complete known-good copy. Do not edit hashes or delete individual managed files.