dotnet new install RecursiveAI.OneApp.Templates dotnet new oneapp -n MyApp cd MyApp dotnet tool restore # the oneapp tool, from .config/dotnet-tools.json dotnet run # the window
What you get
| File | |
|---|---|
MyApp.csproj | NativeAOT on, warnings as errors, the app's identity (OneAppId, OneAppName, OneAppVersion, OneAppIcon, see packaging). References RecursiveAI.OneApp and RecursiveAI.OneApp.Kit and nothing else. |
Program.cs | Creates the app host with the root component and runs it. --headless runs without a window or GPU, for driving through the harness. |
MainPage.html, .css, .cs | One component built from the kit: a card with a text field and a counter button. Every binding is checked when the project builds. |
icon.png | The launcher icon; replace it. |
.config/dotnet-tools.json | The oneapp tool, so a clone builds and drives the app with dotnet oneapp .... |
The markup compiler and the build step that makes each .html file and its .css neighbour a component template come with RecursiveAI.OneUI, which the two packages bring in.
Options
| Option | Default | |
|---|---|---|
-n, --name | MyApp | Project, namespace and window title. |
--appId | dev.example.myapp | Application id: the desktop entry name on Linux, the bundle identifier on macOS. Use your own reverse-DNS name. |
--oneappVersion | the version of the template package (set when it is packed) | The version of the three OneApp packages to reference. |
Driving it
dotnet oneapp run . --headless --detach # a Debug build with the development listener on dotnet oneapp call status dotnet oneapp click '#count' dotnet oneapp query '#count' # "Clicked 1 times" dotnet oneapp capture --out page.png dotnet oneapp install . # NativeAOT publish and a launcher entry
See harness for the verbs and packaging for install and package formats.
Building the template from source
dotnet pack src/OneApp.Templates writes the package; dotnet new install <file.nupkg> installs it from a folder. To try a generated app against unreleased packages, pack the OneApp packages into a folder, add that folder as a source in a nuget.config above the app, and pass --oneappVersion with the packed version.