From 16d955686be6d2d09b4856e4c6c45a997a58d784 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Wed, 27 May 2026 08:47:03 -0400 Subject: [PATCH] use app builder --- logos-calc-ui-cpp/flake.nix | 6 +++--- logos-calc-ui/flake.nix | 6 +++--- logos-developer-guide.md | 23 ++++++++++++----------- tutorial-cpp-ui-app.md | 12 ++++++------ tutorial-qml-ui-app.md | 16 ++++++++-------- 5 files changed, 32 insertions(+), 31 deletions(-) diff --git a/logos-calc-ui-cpp/flake.nix b/logos-calc-ui-cpp/flake.nix index a5b6e9c..7f10553 100644 --- a/logos-calc-ui-cpp/flake.nix +++ b/logos-calc-ui-cpp/flake.nix @@ -2,12 +2,12 @@ description = "Calculator C++ UI plugin for Logos - QML view with process-isolated backend for calc_module"; inputs = { - logos-module-builder.url = "github:logos-co/logos-module-builder"; + logos-app-builder.url = "github:logos-co/logos-app-builder"; calc_module.url = "github:logos-co/logos-tutorial?dir=logos-calc-module"; }; - outputs = inputs@{ logos-module-builder, calc_module, ... }: - logos-module-builder.lib.mkLogosQmlModule { + outputs = inputs@{ logos-app-builder, calc_module, ... }: + logos-app-builder.lib.mkLogosQmlModule { src = ./.; configFile = ./metadata.json; flakeInputs = inputs; diff --git a/logos-calc-ui/flake.nix b/logos-calc-ui/flake.nix index 85bd4e4..461404c 100644 --- a/logos-calc-ui/flake.nix +++ b/logos-calc-ui/flake.nix @@ -2,12 +2,12 @@ description = "Calculator QML UI Plugin for Logos - frontend for calc_module"; inputs = { - logos-module-builder.url = "github:logos-co/logos-module-builder"; + logos-app-builder.url = "github:logos-co/logos-app-builder"; calc_module.url = "github:logos-co/logos-tutorial?dir=logos-calc-module"; }; - outputs = inputs@{ logos-module-builder, ... }: - logos-module-builder.lib.mkLogosQmlModule { + outputs = inputs@{ logos-app-builder, ... }: + logos-app-builder.lib.mkLogosQmlModule { src = ./.; configFile = ./metadata.json; flakeInputs = inputs; diff --git a/logos-developer-guide.md b/logos-developer-guide.md index d1a976a..5ab9685 100644 --- a/logos-developer-guide.md +++ b/logos-developer-guide.md @@ -499,7 +499,7 @@ nix build .#lgx-portable This produces a `my_module-.lgx` file in the `result/` directory. -This works because `logos-module-builder` includes `nix-bundle-lgx` as its own dependency and both `mkLogosModule` and `mkLogosQmlModule` automatically create the `lgx` and `lgx-portable` package outputs. No extra configuration is needed — it is part of the standard module template: +This works because both `logos-module-builder` and `logos-app-builder` include `nix-bundle-lgx` as a dependency, and `mkLogosModule` / `mkLogosQmlModule` automatically create the `lgx` and `lgx-portable` package outputs. No extra configuration is needed — it is part of the standard module template: ```nix { @@ -1026,7 +1026,8 @@ When your module is installed via `lgpm`, its dependencies are automatically res | Repository | What It Provides | Key Outputs | | -------------------------------------------------------------------------------- | -------------------------- | --------------------------------------------------------------------------------- | -| [logos-module-builder](https://github.com/logos-co/logos-module-builder) | Build system / scaffolding | `mkLogosModule`, `mkLogosQmlModule` Nix functions, `LogosModule.cmake`, templates | +| [logos-module-builder](https://github.com/logos-co/logos-module-builder) | Core module build system | `mkLogosModule`, `buildCppPlugin` Nix functions, `LogosModule.cmake`, templates | +| [logos-app-builder](https://github.com/logos-co/logos-app-builder) | UI/app build system | `mkLogosQmlModule`, `mkLogosApp` Nix functions, UI templates | | [logos-module](https://github.com/logos-co/logos-module) | Plugin introspection | `liblogos_module.a` (static lib), `lm` (CLI) | | [logos-cpp-sdk](https://github.com/logos-co/logos-cpp-sdk) | SDK + code generator | `LogosAPI`, `LogosResult`, `logos-cpp-generator`, `PluginInterface` | | [logos-liblogos](https://github.com/logos-co/logos-liblogos) | Core library | `logos_host`, `liblogos_core` | @@ -1166,7 +1167,7 @@ When running a UI module with `nix run`, the standalone app automatically bundle **Requirements for auto-bundled dependencies:** -1. **Module type must be `"ui"` or use `mkLogosQmlModule`** — only UI modules get `apps.default` wired up with the standalone app. +1. **Module type must be `"ui"` or use `mkLogosQmlModule` (from `logos-app-builder`)** — only UI modules get `apps.default` wired up with the standalone app. 2. **Dependencies must be listed in `metadata.json`** under the `"dependencies"` array: @@ -1192,8 +1193,8 @@ When running a UI module with `nix run`, the standalone app automatically bundle **What changed (no more `logos-standalone-app` input):** -- `logos-standalone-app` is now bundled inside `logos-module-builder` — UI module flakes no longer need it as a separate input. -- No `logosStandalone` parameter is needed in `mkLogosQmlModule`, `mkLogosModule`, or `mkLogosQmlModule` calls. +- `logos-standalone-app` is bundled inside `logos-app-builder` — UI module flakes no longer need it as a separate input. +- No `logosStandalone` parameter is needed in `mkLogosQmlModule` or `mkLogosApp` calls. - Dependencies (including transitive ones) are automatically resolved from the flake input tree, bundled as LGX packages at build time, and extracted into the modules directory at runtime. - The standalone app uses `logos_core_load_plugin_with_dependencies()` which resolves the full transitive dependency graph via metadata.json files. @@ -1203,11 +1204,11 @@ When running a UI module with `nix run`, the standalone app automatically bundle { description = "My UI module"; inputs = { - logos-module-builder.url = "github:logos-co/logos-module-builder"; + logos-app-builder.url = "github:logos-co/logos-app-builder"; calc_module.url = "github:logos-co/logos-tutorial?dir=logos-calc-module"; }; - outputs = inputs@{ logos-module-builder, ... }: - logos-module-builder.lib.mkLogosQmlModule { + outputs = inputs@{ logos-app-builder, ... }: + logos-app-builder.lib.mkLogosQmlModule { src = ./.; configFile = ./metadata.json; flakeInputs = inputs; @@ -1221,11 +1222,11 @@ When running a UI module with `nix run`, the standalone app automatically bundle { description = "My QML UI module"; inputs = { - logos-module-builder.url = "github:logos-co/logos-module-builder"; + logos-app-builder.url = "github:logos-co/logos-app-builder"; calc_module.url = "github:logos-co/logos-tutorial?dir=logos-calc-module"; }; - outputs = inputs@{ logos-module-builder, ... }: - logos-module-builder.lib.mkLogosQmlModule { + outputs = inputs@{ logos-app-builder, ... }: + logos-app-builder.lib.mkLogosQmlModule { src = ./.; configFile = ./metadata.json; flakeInputs = inputs; diff --git a/tutorial-cpp-ui-app.md b/tutorial-cpp-ui-app.md index c21dae5..92984dc 100644 --- a/tutorial-cpp-ui-app.md +++ b/tutorial-cpp-ui-app.md @@ -69,7 +69,7 @@ The `.rep` file declares the interface. At build time, Qt's `repc` compiler gene ```bash mkdir logos-calc-ui-cpp && cd logos-calc-ui-cpp -nix flake init -t github:logos-co/logos-module-builder#ui-qml-backend +nix flake init -t github:logos-co/logos-app-builder#ui-qml-backend git init && git add -A ``` @@ -418,7 +418,7 @@ Key patterns: description = "Calculator C++ UI plugin — QML view with process-isolated backend"; inputs = { - logos-module-builder.url = "github:logos-co/logos-module-builder"; + logos-app-builder.url = "github:logos-co/logos-app-builder"; # Option A: point to a remote repo (for CI or when calc_module is published) calc_module.url = "github:logos-co/logos-tutorial?dir=logos-calc-module"; @@ -427,8 +427,8 @@ Key patterns: # calc_module.url = "path:../logos-calc-module"; }; - outputs = inputs@{ logos-module-builder, ... }: - logos-module-builder.lib.mkLogosQmlModule { + outputs = inputs@{ logos-app-builder, ... }: + logos-app-builder.lib.mkLogosQmlModule { src = ./.; configFile = ./metadata.json; flakeInputs = inputs; @@ -443,7 +443,7 @@ The `calc_module` input attribute name must match the dependency name in `metada > **Important:** Whichever URL scheme you use, `calc_module` must be built with its shared library (`.so` on Linux, `.dylib` on macOS) present in `lib/`. If it's missing, the nix build will fail with linker errors. See [Part 1, Step 1.5](tutorial-wrapping-c-library.md#15-build-the-shared-library). -`mkLogosQmlModule` handles everything: compiles the C++ backend (because `main` is set), bundles the QML view, generates LGX packages, and wires up `nix run`. +`mkLogosQmlModule` (from `logos-app-builder`) handles everything: compiles the C++ backend (because `main` is set), bundles the QML view, generates LGX packages, and wires up `nix run`. --- @@ -490,7 +490,7 @@ nix run --override-input calc_module path:../logos-calc-module ## Step 10: UI Integration Tests (Optional) -Add automated UI tests using the [logos-qt-mcp](https://github.com/logos-co/logos-qt-mcp) test framework. Just create `.mjs` files in `tests/` and `logos-module-builder` auto-wires `nix build .#integration-test`. +Add automated UI tests using the [logos-qt-mcp](https://github.com/logos-co/logos-qt-mcp) test framework. Just create `.mjs` files in `tests/` and `logos-app-builder` auto-wires `nix build .#integration-test`. Create `tests/ui-tests.mjs`: diff --git a/tutorial-qml-ui-app.md b/tutorial-qml-ui-app.md index 6c88d0b..fce6557 100644 --- a/tutorial-qml-ui-app.md +++ b/tutorial-qml-ui-app.md @@ -44,15 +44,15 @@ Key points: ## Step 1: Scaffold -Use the QML module template from `logos-module-builder`: +Use the QML module template from `logos-app-builder`: ```bash mkdir logos-calc-ui && cd logos-calc-ui -nix flake init -t github:logos-co/logos-module-builder#ui-qml +nix flake init -t github:logos-co/logos-app-builder#ui-qml git init && git add -A ``` -> **Note:** The generated `flake.nix` uses an unpinned `logos-module-builder` URL. Replace it with the pinned version shown in [Step 4](#step-4-update-flakenix) to ensure reproducible builds. +> **Note:** The generated `flake.nix` uses an unpinned `logos-app-builder` URL. Replace it with the pinned version shown in [Step 4](#step-4-update-flakenix) to ensure reproducible builds. This gives you: @@ -322,7 +322,7 @@ The template already has everything wired up. Update the description and add `ca description = "Calculator QML UI Plugin for Logos - frontend for calc_module"; inputs = { - logos-module-builder.url = "github:logos-co/logos-module-builder"; + logos-app-builder.url = "github:logos-co/logos-app-builder"; # Option A: point to a remote repo (for CI or when calc_module is published) calc_module.url = "github:logos-co/logos-tutorial?dir=logos-calc-module"; @@ -331,8 +331,8 @@ The template already has everything wired up. Update the description and add `ca # calc_module.url = "path:../logos-calc-module"; }; - outputs = inputs@{ logos-module-builder, ... }: - logos-module-builder.lib.mkLogosQmlModule { + outputs = inputs@{ logos-app-builder, ... }: + logos-app-builder.lib.mkLogosQmlModule { src = ./.; configFile = ./metadata.json; flakeInputs = inputs; @@ -349,7 +349,7 @@ The `calc_module.url` can be either: > **Important:** Whichever URL scheme you use, `calc_module` must be built with its shared library (`.so` on Linux, `.dylib` on macOS) present in `lib/`. If the library is missing, the nix build will fail with linker errors. See [Part 1, Step 1.5](tutorial-wrapping-c-library.md#15-build-the-shared-library) for build instructions. -`mkLogosQmlModule` handles everything — it stages QML files, metadata, and icons into a plugin directory, bundles all module dependencies (direct and transitive) from their LGX packages, and automatically wires up `apps.default` so `nix run .` launches the UI in a standalone window with all required backend modules self-contained. `flakeInputs = inputs` passes all inputs so that dependencies declared in `metadata.json` are resolved automatically. +`mkLogosQmlModule` (from `logos-app-builder`) handles everything — it stages QML files, metadata, and icons into a plugin directory, bundles all module dependencies (direct and transitive) from their LGX packages, and automatically wires up `apps.default` so `nix run .` launches the UI in a standalone window with all required backend modules self-contained. `flakeInputs = inputs` passes all inputs so that dependencies declared in `metadata.json` are resolved automatically. > **Tip:** Even if `flake.nix` uses a `github:` URL, you can override it at build time with `--override-input calc_module path:../logos-calc-module` to use your local checkout without editing `flake.nix`. This is covered in [Step 5.2](#52-full-functionality-with-modules). @@ -654,7 +654,7 @@ qml6 Main.qml ## Step 8: UI Integration Tests (Optional) -You can add automated UI tests that verify your QML plugin renders correctly. The test infrastructure is built into `logos-module-builder` — just add `.mjs` test files to a `tests/` directory and you get `nix build .#integration-test` for free. +You can add automated UI tests that verify your QML plugin renders correctly. The test infrastructure is built into `logos-app-builder` — just add `.mjs` test files to a `tests/` directory and you get `nix build .#integration-test` for free. Tests use the [logos-qt-mcp](https://github.com/logos-co/logos-qt-mcp) test framework, which connects to the QML inspector inside `logos-standalone-app` and can find elements, click buttons, verify text, and take screenshots.