Fix Dockerfile to copy all server/*.js modules; refresh vendor to v0.2.0

The runtime crash on v0.2.3:

  Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/app/server/util.js'
  imported from /app/server/index.js

happened because the Dockerfile's stage-2 COPY only listed server/
index.js + server/license.js explicitly. When I started extracting
modules in v0.2.3 (util.js, gemini-helpers.js, audio.js, ytdlp.js,
cookies.js, config.js, license-middleware.js, history.js, library.js)
I forgot to update the COPY list, so those files were never copied
into the runner image. Local 'node' tests passed because the modules
exist on disk; the .s9pk container had only the two original files
and crashed on first import.

Fix:

  COPY server/*.js ./server/

Glob picks up all top-level .js files automatically, including any
future extractions, while still skipping server/test/ and server/
node_modules/. This is the simplest forward-compatible form.

Bonus: refresh the vendored @keysat/licensing-client from 0.1.0 to
0.2.0. The new SDK adds:

  • policySlug field on StartPurchaseOptions (so we can drive Core/
    Pro tier selection programmatically from our backend)
  • client.listPublicPolicies(productSlug) for fetching the tier
    cards' data without auth

Both are prerequisites for the in-app buy flow planned in
~/.claude/plans/in-app-buy-flow.md. The vendor's own node_modules
(@noble/ed25519, @noble/hashes) is gitignored as before — Docker
builds re-install via `npm install --omit=dev --ignore-scripts` in
the vendor dir during stage 1.

Also includes the license-middleware update from earlier in the day:
a 30s license-file poll so a key set via the "Set Recap License"
StartOS action is picked up within seconds (instead of waiting for
the 6h scheduled validateOnline tick).
This commit is contained in:
Keysat
2026-05-09 11:57:41 -05:00
parent c06ffbbdf4
commit 495b4aef36
7 changed files with 2983 additions and 12 deletions
+12 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@keysat/licensing-client",
"version": "0.1.0",
"version": "0.2.0",
"description": "Client library for Keysat. Verifies signed license keys offline and wraps the HTTP API for purchase and revocation checks.",
"type": "module",
"main": "./dist/index.cjs",
@@ -14,7 +14,12 @@
}
},
"files": ["dist", "README.md", "LICENSE"],
"scripts": {},
"scripts": {
"build": "tsup src/index.ts --format esm,cjs --dts --clean",
"test": "vitest run",
"prepare": "npm run build",
"prepublishOnly": "npm run build && npm test"
},
"keywords": [
"bitcoin",
"licensing",
@@ -29,5 +34,9 @@
"@noble/ed25519": "^2.0.0",
"@noble/hashes": "^1.3.3"
},
"devDependencies": {}
"devDependencies": {
"typescript": "^5.3.0",
"tsup": "^8.0.0",
"vitest": "^1.0.0"
}
}