Skip to content

fix(infra): chaintracks param typing + message-box-server lockfile resync - #213

Merged
sirdeggen merged 2 commits into
mainfrom
fix/infra-release-chaintracks-types-mbs-lockfile
Jun 19, 2026
Merged

fix(infra): chaintracks param typing + message-box-server lockfile resync#213
sirdeggen merged 2 commits into
mainfrom
fix/infra-release-chaintracks-types-mbs-lockfile

Conversation

@sirdeggen

Copy link
Copy Markdown
Contributor

Fixes both failures in the Infra Release Docker builds (run that broke on the #211 merge to main).

1. chaintracks-server — TS build failure

infra/chaintracks-server/src/v2-routes.ts failed npm run build:

src/v2-routes.ts(77,38): TS2345: 'string | string[]' not assignable to 'string'
src/v2-routes.ts(104,46): TS2345 …
src/v2-routes.ts(108,63): TS2345 …
src/v2-routes.ts(185,43): TS2339: Property 'replace' does not exist on 'string | string[]'
src/v2-routes.ts(214,36): TS2339 …

Stricter Express typings infer req.params.<name> as string | string[]. Added a firstParam() helper and normalized the height/hash params (and their .bin variants) to a single string before use. Behavior unchanged. Verified: npm ci && npm run build exits 0.

2. message-box-server — npm ci lockfile mismatch

Docker npm ci --omit=dev failed:

npm ci can only install packages when package.json and package-lock.json are in sync
Invalid: lock file's eslint@10.4.1 does not satisfy eslint@9.39.4
Missing: @eslint/js@9.39.4, globals@14.0.0, openapi-types@12.1.3 …

Merge artifact: the sync PR (#211) refreshed this lockfile with --legacy-peer-deps while package.json still had the eslint@10 stack; #212 then removed eslint from package.json. The merged result paired an eslint-free package.json with a lockfile still pinning eslint@10.

Regenerated infra/message-box-server/package-lock.json from the current package.json (ts-standard brings its own eslint). Verified in sync — no top-level eslint@10. (Note: the analysis suggestion to rm package-lock.json && npm install from repo root does not apply — root is a pnpm workspace; the affected lockfile is this package's own npm package-lock.json.)

🤖 Generated with Claude Code

sirdeggen and others added 2 commits June 19, 2026 10:43
Stricter Express typings infer req.params.<name> as `string | string[]`,
breaking the v2 header routes (TS2345 at lines passing params to string
APIs; TS2339 on .replace). Add a firstParam() helper and normalize
height/hash params (and the .bin variants) to a single string before use.
Behavior unchanged; fixes the chaintracks-server Docker `npm run build`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
….json

The release sync PR (#211) refreshed this lockfile with --legacy-peer-deps
while it still carried the old eslint@10 stack; #212 then removed eslint
from package.json. The merge left package.json (no eslint) against a
lockfile still pinning eslint@10.4.1, so the Docker `npm ci --omit=dev`
failed with "package.json and package-lock.json are not in sync".

Regenerate the lockfile from the current (eslint-free) package.json so
ts-standard's own bundled eslint resolves and npm ci passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​axios@​1.18.09710010096100

View full report

@sirdeggen
sirdeggen merged commit d246184 into main Jun 19, 2026
10 checks passed
@sonarqubecloud

Copy link
Copy Markdown

ty-everett pushed a commit to ty-everett/ts-stack that referenced this pull request Jun 22, 2026
… triggering npm Release

Two infra-release Docker failures + one spurious Release failure:

1. message-box-server `npm install` crashed with "Cannot read properties
   of undefined (reading 'extraneous')" — the lockfile committed in bsv-blockchain#213
   was generated with `npm install --package-lock-only` (npm 11) and was
   not reconcilable by the node:20 builder. Regenerated cleanly with
   node:20-alpine's npm.

2. message-box-server then failed compiling better-sqlite3 (no musl
   prebuilt → source build) because the Dockerfile installed no toolchain.
   Add python3/make/g++ to the builder and (virtual, removed after) to the
   production stage — mirroring chaintracks-server. Full image now builds
   locally (linux/amd64).

3. release.yaml's `**/v*` tag trigger also matched `infra/v*`, so infra
   release tags ran the npm Release workflow, whose resolve-plan can't map
   `infra/v*` to a package and exits 1. Exclude `infra/v*` from Release's
   triggers (infra-release.yaml owns those tags).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant