Skip to content

feat(mongo): consumer ./elf entry for npm-static builds - #51

Merged
espetro merged 2 commits into
mainfrom
feat/mongo-elf-export
Nov 10, 2026
Merged

espetro merged 2 commits into
mainfrom
feat/mongo-elf-export

Conversation

@espetro

@espetro espetro commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Consumer --npm-static compile contract for @cutils/mongo, matching the postgres/cache/cli ./elf story:

  • "./elf": "./dist/esm/index.js" export
  • netConnect(port, host) → createConnection({host, port}) — the positional form bound host into a listener slot under JS inference ("expected function, got string" at runtime)
  • @param JSDoc on connectTcp — unknown-inferred port hit the unlowered overload (SC2020)
  • test/consumer-elf.test.sh + consumer-elf-app.ts + canned OP_MSG mock-server.mjs: pack → install → --npm-static compile → ELF → findOne round-trip

Verification

  • scriptc build app.ts --npm-static @cutils/mongo: clean, zero errors/warnings
  • consumer-elf.test.sh: OK (ELF ↔ canned wire server, real TCP)
  • elf.test.sh, coverage 100%, node unit tests: all green

Audit found two real consumer-compile breaks fixed here:
- positional netConnect(port, host) bound host into a listener slot
  under JS inference -> createConnection({host, port}) options form,
  matching postgres's proven lowering
- connectTcp params inferred unknown in shipped JS -> @PARAM JSDoc so
  the concrete (string, number, number) signature survives tsc

Adds test/consumer-elf.test.sh + consumer-elf-app.ts + the canned
OP_MSG mock server; full pack -> install -> --npm-static -> ELF ->
wire round-trip verified.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Deploying cutilsjs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 14706db
Status: ✅  Deploy successful!
Preview URL: https://56dc5a2c.cutilsjs.pages.dev
Branch Preview URL: https://feat-mongo-elf-export.cutilsjs.pages.dev

View logs

@espetro
espetro merged commit 5a94b5e into main Nov 10, 2026
2 of 3 checks passed
@espetro
espetro deleted the feat/mongo-elf-export branch November 10, 2026 01:37
@espetro espetro mentioned this pull request Nov 10, 2026
3 tasks done
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