horizechCLI
Workspace commands (hws)latest · 0.1.2

hws pack

Build a component and write its installable zip. No sign-in, no network.

hws pack [dir] [--out <file>] [--no-build] [--json]

Also available as horizech hws pack.

Runs the same build-and-zip steps as hws publish, then writes the zip to disk instead of uploading it. A zip from pack installs by hand exactly as the published one would.

  1. Reads and checks package.hws (see package.hws rules). Every problem is listed before anything is built.
  2. Builds the backend with dotnet publish -c Release into a fresh temporary folder, so stale files never reach the zip.
  3. If package.hws has a Frontend section, removes Frontend/dist and runs npm run build:next.
  4. Checks that bin/ contains the AssemblyName and that dist/ contains the Frontend.RemoteEntry file.
  5. Writes the zip and prints its size and SHA-256.

The zip is deterministic: the same build output always produces the same bytes. See Components and zips for the layout.

The CLI never runs npm install. If Frontend/node_modules is missing it stops and tells you to install first.

Arguments

ArgumentDescriptionDefault
dirThe component folder (the one holding package.hws).the current folder

Options

OptionDescriptionDefault
--out <file>Where to write the zip.<CODE>_<version>.zip in the current folder
--no-buildZip existing build output instead of building: Backend/bin/Release/<tfm>/publish (exactly one) and Frontend/dist. For CI, where an earlier step built.
--jsonPrint a machine-readable result on stdout. Progress goes to stderr.

Examples

Pack the component in this folder

$ hws pack

Pack another folder and choose the file name

$ hws pack ../hws_core --out core.zip

Zip what CI already built

$ hws pack --no-build --json

With --json

stdout
{
  "file": "/path/to/HWS_APP_NOTES_1.4.0.zip",
  "code": "HWS_APP_NOTES",
  "version": "1.4.0",
  "type": "APPLICATION",
  "size": 1048576,
  "sha256": "ae3c0da7…",
  "entries": [ { "name": "bin/Acme.Notes.dll", "size": 52224 }, { "name": "package.hws", "size": 912 } ]
}