emit exposes replaceable generated source for inspection or integration.
build creates a managed delivery product. Deploy the build directory, not
temporary compiler storage or selected generated files copied out of context.
Build products
topaz build main.tpz --release --out-dir native-product
topaz build --target python --root my-app --locked --out-dir python-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 final command uses [build].target from topaz.toml; web-app and
http-service are package-only. topaz.lock belongs to authoring and
qualification. The finished managed product records its own identity in
topaz-artifact.json.
Files common to every product
Every successful build adds these files:
LICENSE
NOTICE
GENERATED-OUTPUT-NOTICE.txt
topaz-artifact.jsonThe artifact manifest records target, toolchain and language identity, runtime requirements, invocation, and each managed file's path, size, hash, and executable requirement. It is written last.
Target-specific trees
Native adds one platform-specific file:
target/debug/program[.exe]
target/release/program[.exe]Only the selected profile exists. On Windows the filename ends in .exe.
Python adds:
program.py
topaz_py_rt.pyRaw Web adds:
topaz-web.js
topaz-web.d.ts
topaz-web.wasmWeb Worker adds the Raw Web files plus:
topaz-web-worker.js
topaz-web-worker-client.jsA managed Web Application adds the Raw Web files plus:
index.html
topaz-app.js
topaz-web-capabilities.json
styles/app.cssDeclared styles and assets keep their normalized relative paths, so the last line varies with the package.
A bounded HTTP service adds:
target/release/program[.exe]
topaz-service-config.json
THIRD-PARTY-NOTICES.txtThis example captures a release build. A debug build uses target/debug; on
Windows, [.exe] is present.
Run without the Topaz package source
Copy the complete product directory to a fresh location. Then run from its root:
./target/release/program
python3 program.py
Use the command that belongs to the chosen native, HTTP, or Python product. Python requires version 3.11 or newer. Native and HTTP executables are specific to the platform where they were built.
Serve a managed Web Application directory over HTTP and open index.html.
Raw Web and Worker products need an ES-module host that imports the generated
JavaScript API. None of the Web products should rely on file:// module
loading.
Native and Python package applications resolve declared filesystem capability
roots from the process working directory. Copy application data/ and create
writable output directories beside the managed product when the manifest
requires them; package data is not added automatically. Web styles and assets
are different: declared [web] inputs are copied into the managed Web product.
Output-directory safety and recovery
Rebuilding the same target first verifies existing managed bytes. Topaz rejects a target change, malformed manifest, changed managed file, symlink, or collision with a user-owned path. Files not listed in the artifact manifest are preserved.
Do not erase an ambiguous directory to force a build. Keep it for inspection
and choose a new empty --out-dir. If the old product must be restored,
restore the complete known-good product rather than editing hashes or deleting
individual managed files.