Build And Release
The current package is@plato/pc-printer.
Scripts
| Script | Command | Purpose |
|---|---|---|
clean | node scripts/clean.js | Removes build artifacts, output, logs, zip, and dump.rdb. |
build | esbuild src/index.ts src/scripts/*.ts --bundle --platform=node --target=node12 --outdir=dist | Bundles runtime code. |
start | node dist/index.js | Starts the built driver. |
pkg | pkg dist/index.js -t node12-win-x64 -o output/plato-printer.exe --config package.json | Creates Windows executable. |
bundle | version bump, build, Redis prep, pkg, zip | Produces plato-printer.zip. |
stress | node scripts/stress-test.js | Runs mock-printer load test. |
Build Locally
Create Release Zip
- Increments
src/version.ts. - Builds the driver into
dist. - Prepares the configured Windows Redis binary.
- Builds
output/plato-printer.exe. - Copies
config.json. - Copies Caddy assets.
- Copies certificates.
- Copies
redis-binaries/<redis.version>. - Creates
plato-printer.zip.
Release Contents
Versioning
src/version.ts contains:
GET /health and printed in the startup banner. Do not edit this file manually; scripts/increment-version.js updates it during pnpm bundle.
Caddy Preparation
Caddy is pinned to2.6.4.
To download Caddy into assets/caddy before bundling:
assets/caddy/caddy.exe exists, runtime setup can copy it instead of downloading Caddy on the customer machine.
Redis Binary Preparation
scripts/prepare-redis-binaries.js reads config.json and downloads the configured Windows Redis release if missing.
The expected path is:
Stress Test
The stress test starts mock TCP printers and sends many/print requests.
Release Checklist
- Confirm
config.jsonis correct for the release. - Confirm Caddy assets exist if HTTPS should work offline.
- Run
pnpm --filter @plato/pc-printer clean. - Run
pnpm --filter @plato/pc-printer bundle. - Run the executable from
output/. - Check
GET /health. - Run a real test print.
- Verify
plato-printer.zipcontains the expected files.