Application packaging

Packaging a JadeUI Python app is usually two steps:

  1. Front-end assets: plaintext JAPK (development) or a JadePack signed package (production)
  2. Python host: jadeui build into a standalone .exe (Nuitka by default, PyInstaller optional)

See CLI for the full command surface and project conventions.

Front-end assets (JAPK)

Shell
# Requires Node.js and: npm install -g @electron/asar
jadeui japk
jadeui japk --src web -o dist/my-app.japk

Load at runtime:

Python
from jadeui import Window

Window(title="My App").run(japk="dist/my-app.japk")

Or via LocalServer:

Python
from jadeui import LocalServer

server = LocalServer()
url = server.start("myapp", japk="dist/my-app.japk")

Host exe (jadeui build)

Packagers (auto-install)

jadeui build installs a missing packager automatically by default — you no longer need the old GitHub Nuitka rc zip:

  • Nuitka (default): installs nuitka>=4.0 from PyPI (do not use the obsolete 4.0rc7 zip)
  • --packager pyinstaller: runs pip install pyinstaller

Use --no-auto-deps for offline environments or when you do not want the environment mutated.

You can still preinstall manually:

Shell
pip install "nuitka>=4.0"
# or
pip install jadeui[pyinstaller]

Toolchain checks:

Shell
pip install jadeui[dev]
jadeui doctor

Basic usage

Shell
jadeui build
jadeui build app.py
jadeui build app.py -o MyApp
jadeui build --packager pyinstaller
jadeui build -i app.ico -o MyApp --output-dir dist
jadeui build --include-data-dir assets=assets --console
jadeui build --no-onefile -c 2

Defaults:

  • Onefile mode
  • Compress level 1 (basic LTO)
  • Auto-include JadeView DLL (matched to the current Python arch: x86 / x64 / arm64)
  • Auto-include sibling web/ when present
  • Auto-use web/favicon.png as icon when present
  • Without -o, the output name follows pyproject.toml (see CLI conventions)

Flags

FlagDescription
sourcePython entry (default tool.jadeui.entry or app.py)
--packagernuitka (default) or pyinstaller
-i, --iconIcon (.ico / .png)
-o, --outputOutput basename (no extension)
--output-dirOutput directory (default dist)
--include-data-dirData dir mapping src=dest (repeatable)
--include-data-fileData file mapping src=dest (repeatable)
--consoleShow a console window
--upxEnable UPX (Nuitka)
--no-jadeui-dllDo not auto-include JadeView DLL
-c, --compressNuitka compress level 0-3 (default 1)
--no-onefileDirectory build instead of onefile
--no-auto-depsDo not auto-install missing Nuitka / PyInstaller

Compress levels (Nuitka)

LevelNotesSpeedSize
0No extra compressionFastestLargest
1Basic LTOFastLarger
2LTO + strip docstrings / assertsSlowerSmaller
3Full opts + Python -OOSlowestSmallest

-c 2 is a good daily default.

Suggested layout

Markdown
my_app/
├── app.py
├── pyproject.toml      # [project] + [tool.jadeui]
├── web/                # front end (auto-included / japk source)
│   ├── index.html
│   └── favicon.png
└── assets/             # extra data (pass --include-data-dir)

End-to-end example

Shell
jadeui init my-app --frontend html
cd my-app
jadeui doctor
jadeui run
jadeui japk
jadeui build -o MyApp -c 2

Typical output:

Markdown
dist/
├── my-app.japk    # front-end assets (if you ran japk)
└── MyApp.exe      # host executable

Legacy script

scripts/build.py in the repo still forwards to the same implementation. New projects should call jadeui build directly.

FAQ

Q: Missing DLL / VC++ runtime after packaging?

A: Use Nuitka >=4.0 (pip install "nuitka>=4.0"), and make sure the bundled JadeView DLL matches the Python interpreter architecture used for the build.

Q: Does the SDK auto-upgrade JadeView?

A: Only within the adapted release tag (for example builds under v2.3.0). It will not jump to 2.4 automatically.

Q: How do I shrink the binary?

A: Raise -c, optionally --upx, drop unused data dirs, or use an older Python.

Q: web/ was not included?

A: Keep web next to the entry script, or pass --include-data-dir.

Q: How do I debug the packaged app?

A:

Shell
jadeui build app.py --console

During development, enable DevTools / context menu:

Python
app.initialize(enable_dev_tools=True)
window = Window(disable_right_click=False, ...)