Repository navigation
Publish a library surface + real-server testing helpers - #124
Merged
Merged
Conversation
@haverstack/server has been an app only (Docker image, no npm exports) -- nothing could depend on it. Splits the executable entrypoint out to src/main.ts (dev/start/Dockerfile CMD updated accordingly) and makes src/index.ts a pure library barrel: createApp, initStack/StackContext, loadConfig/Config, createShutdownHandler. Adds @haverstack/server/testing (mirrors @haverstack/core/testing), promoting tests/setup.ts's fixtures to a public surface and adding startTestServer(): spins up a real, listening instance on an ephemeral port so a consumer's HTTP client (e.g. @haverstack/adapter-api) can be exercised against the actual wire protocol instead of a mocked fetch. tests/setup.ts now imports the shared pieces instead of duplicating them. package.json gains exports/main/types/files/publishConfig; release.yml gains an npm publish step (OIDC Trusted Publishing, alongside the existing Docker push); ci.yml gains a build job now that a broken build would break downstream consumers, not just the Docker image. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017sUHNZvaGXZVgA4w93Waco
CodeQL flagged all five jobs (format/lint/typecheck/test/build) for not limiting GITHUB_TOKEN permissions. None of them push, comment, or need anything beyond checking out the code, so a single workflow-level contents: read covers all of them. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017sUHNZvaGXZVgA4w93Waco
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@haverstack/serverhas been Docker-image-only (no npmexports/main) — nothing could depend on it. Splits the process entrypoint intosrc/main.ts(dev/start scripts + DockerfileCMDupdated) and makessrc/index.tsa pure library barrel (createApp,initStack/StackContext,loadConfig/Config,createShutdownHandler).@haverstack/server/testing(mirrors@haverstack/core/testing): promotestests/setup.ts's fixtures to a public surface and addsstartTestServer(), which spins up a real, listening instance on an ephemeral port — for a consumer's HTTP client (e.g.@haverstack/adapter-api, from@haverstack/cli's upcoming server-path integration tests) to exercise against the actual wire protocol instead of a mocked fetch.tests/setup.tsnow imports the shared pieces instead of duplicating them.package.jsongainsexports/main/types/files/publishConfig.access: "public".release.ymlgains annpm publishstep (OIDC Trusted Publishing,id-token: write, alongside the existing Docker push) — this repo will need npm Trusted Publishing configured forhaverstack/serveron npmjs.com before this step succeeds; it isn't something I can set up.ci.ymlgains abuildjob, since a broken build now breaks downstream consumers, not just the Docker image.Test plan
pnpm run format:check/lint/typecheck/test/buildall green (526 tests).tests/testing.test.tsprovesstartTestServer()actually listens: realfetch()against/.well-known/stackand an authenticated/typesround trip over a real socket, plus aclose()teardown check.dist/main.jsentrypoint (not verified in this environment — no Docker available; please confirm before merging).🤖 Generated with Claude Code
https://claude.ai/code/session_017sUHNZvaGXZVgA4w93Waco