feat: export the library surface for dependents #124
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/library-surface"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
zelnetbecomes importable as a Zig package.build.zigdeclares the library withaddModule. Two modules joinroot.zigfor library callers:source, the strict source-capture engine behindsrc export, now generic over the transport and the output sink; andhostsession, one authenticated session that opens the file, remote-command and database services on first use and returns errors instead of ending the process.database.runSelectDiagandrunExecImmediateDiagreturn the SQLCA diagnostics throughSqlDiag.The CLI does not change:
src exportkeeps its directory sink, its stderr lines and itscapture.jsonbytes (a golden test pins the shape).make cipasses: format, Debug and ReleaseSafe tests, and the Binjovi package contract.The first consumer is
sean/sourcerer, the IBM i source-control CLI.https://claude.ai/code/session_01HPdKaFBKQVs8hzfgXMrnwV
`zelnet` becomes importable as a Zig package. build.zig declares the library with addModule, so a dependent can write `b.dependency("zelnet", .{}).module("zelnet")`. Two modules join root.zig for library callers: - `source` is the strict source-capture engine behind `src export`, lifted out of host.zig. It is generic over the transport and the output sink, so a test can drive it with an in-memory host and a library can write members wherever it wants. The CLI keeps a directory sink and the same stderr progress lines. The capture.json bytes do not change; a golden test pins the shape. - `hostsession` signs on once and opens the file, remote-command and database services on first use. It returns errors and never ends the process, unlike the CLI verb helpers. `database.runSelectDiag` and `runExecImmediateDiag` hand the SQLCA status, SQLCODE and message to the caller through `SqlDiag`; the existing functions keep printing as before. `readSqlca` has happy, absent, short and oversized-length tests. The first consumer is sean/sourcerer, the IBM i source-control CLI. `make ci` passes: format, Debug and ReleaseSafe tests, and the Binjovi package contract. Claude-Session: https://claude.ai/code/session_01HPdKaFBKQVs8hzfgXMrnwV