Packaging and publishing

Build and pack

Build

dotnet build

The build puts the package, unpacked, into the artifacts/komods/<package id>/<version>/ folder (the artifacts/komods/ next to the projects; it can be redirected with the KofaKomodStagingRoot property). The komod.json, the server/ and client/ folders, the wwwroot/ and the private dependencies go here. Build both projects (server and .Ui).

The .komod file

The installable file is made in two ways.

With an MSBuild switch (no extra tool needed):

dotnet build Acme.Demo.Thermostat.Ui
dotnet build Acme.Demo.Thermostat -p:KomodPack=true

Build the UI project first, because the server package refers to it; with a missing UI assembly you get an error. The file goes to artifacts/packages/<id>-<version>.komod (elsewhere with the KomodPackageOutput property). The summary of the Komods in the manifest is written by the server at installation in this case.

With the kofa-pack tool (recommended for releases):

kofa-pack artifacts/komods/acme.demo.thermostat/1.0.0 -o artifacts/packages

It loads the package the same way as the server, lists the Komods and ports, writes their summary into the manifest, writes the .komod file and prints the SHA-256 hash. It warns if the UI refers to a framework assembly that is not complete in the released (trimmed) client.

The contents of a package without installing it:

kofa-pack inspect artifacts/packages/acme.demo.thermostat-1.0.0.komod

A fast development loop

Without installing, if the KOFA server watches the artifacts/komods folder (Kofa:Runtime:PackageDirectories, in appsettings or as an environment variable):

  1. Build the Komod.
  2. On the Komodok page: Rescan folders (a new package) or Reload (a new build of an already loaded package). Instances, settings and links are kept.
  3. For a changed UI dll refresh the browser.

Version

Raise KomodPackageVersion in Package.props (SemVer) for every release. For a development prerelease: -p:KomodVersionSuffix=preview.42 (1.2.1 becomes 1.2.1-preview.42).

Several Komods at once

If you have several packages in a folder, kofa-pack collect turns all the unpacked packages into .komod files in one step, and a faulty package does not stop the others:

kofa-pack collect artifacts/komods -o dist/komods