Skip to Content

Packaging

How builds are made and released.

Builds use electron-builder. The config is in package.json under build.

npm run dist:linux   # AppImage
npm run dist:win     # NSIS installer, on Windows

Output goes to out/.

The native runtime

The SDK's native library cannot load from inside app.asar, so each build ships its own platform's runtime next to it, at resources/smartspectra/. Other platforms' runtimes are excluded.

resources/app.asarone archive filedist/main.cjsrequire@smartspectra/node-sdkdist/preload.cjsdist/renderer.jssrc/renderer/index.htmlrecordings/guided.jsonlthe OS loader cannot read insideapp.asar.unpackedreal filesnode_modules/koffiasarUnpack: koffi'snative addonmust be a real filesmartspectra/real fileslibsmartspectra_capi.sograph/and its dependent librariesextraResources: thisplatform's runtime onlynative-path.ts sets SMARTSPECTRA_CAPI_PATH before the SDK is required
The Linux build. The main bundle requires the SDK, the SDK loads koffi, and koffi loads the native library. A Windows build has the same shape, with smartspectra_capi.dll in place of the .so file.

src/main/native-path.ts points the SDK at that folder by setting SMARTSPECTRA_CAPI_PATH. It must be the first import in main/index.ts, because the SDK resolves the library the moment it is required.

CI

.github/workflows/build.yml runs on every push to main, on Ubuntu 22.04 and Windows: typecheck, tests, build. On Linux it also runs the smoke test against the packaged app under a virtual display.

Releasing

Pushing a tag like v0.2.0 makes CI publish a GitHub Release with both builds. electron-builder itself never publishes.

Testing a packaged build

GLINT_BIN=out/linux-unpacked/glint node tools/smoke.ts /tmp/smoke.png

On this page