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.
- Reads and checks
package.hws(see package.hws rules). Every problem is listed before anything is built. - Builds the backend with
dotnet publish -c Releaseinto a fresh temporary folder, so stale files never reach the zip. - If
package.hwshas aFrontendsection, removesFrontend/distand runsnpm run build:next. - Checks that
bin/contains theAssemblyNameand thatdist/contains theFrontend.RemoteEntryfile. - 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
| Argument | Description | Default |
|---|---|---|
dir | The component folder (the one holding package.hws). | the current folder |
Options
| Option | Description | Default |
|---|---|---|
--out <file> | Where to write the zip. | <CODE>_<version>.zip in the current folder |
--no-build | Zip existing build output instead of building: Backend/bin/Release/<tfm>/publish (exactly one) and Frontend/dist. For CI, where an earlier step built. | |
--json | Print a machine-readable result on stdout. Progress goes to stderr. |
Examples
Pack the component in this folder
$ hws packPack another folder and choose the file name
$ hws pack ../hws_core --out core.zipZip what CI already built
$ hws pack --no-build --jsonWith --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 } ]
}