Repository navigation
routes: /meta sources version from package.json, adds build and network info - #74
Merged
joelpeace48-cell merged 2 commits intoAug 25, 2026
Merged
Conversation
… info
GET /meta hardcoded name/version/description as literals, duplicating
package.json and guaranteed to drift on the first release. It also
still described the service as a "scaffold".
- src/meta/version.ts reads name and version from package.json at
request time (cached after first read) instead of a literal.
- Adds build.commit and build.builtAt, sourced from BUILD_SHA /
BUILD_TIME environment variables rather than shelling out to git —
the deployed container has no .git directory. Both default to
"unknown" when unset. .env.example documents them as CI-injected
(e.g. BUILD_SHA=${{ github.sha }}).
- Adds network.stellarNetwork, network.sorobanRpcUrl, and the three
configured contract addresses, so integrators hitting /meta can
confirm which environment they're pointed at.
- Rewrites the description for a shipped service; no "scaffold"
wording remains.
Tests cover version sourcing from package.json, the unknown/injected
build-info cases, network/contract reporting, and the absence of
"scaffold" in the description.
Note: this touches the same /meta handler in src/routes/v1/index.ts
as PR FinesseStudioLab#58 (dispute routes), which adds a route registration line
right below it. The two changes are independent, but merging both
will need a small one-hunk conflict resolution in that file depending
on merge order — flagging it up front rather than leaving it as a
surprise.
Closes FinesseStudioLab#10.
# Conflicts: # src/routes/v1/index.ts
4 tasks
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.
Problem
src/routes/v1/index.tshardcoded the version string in the/metaresponse, duplicatingpackage.jsonand guaranteed to drift on the first release. The description also still called the service a "scaffold".What this does
New module
src/meta/version.ts, used by the/metahandler:package.json, read at request time (cached after the first read) instead of a literal.build.commit/build.builtAt, sourced fromBUILD_SHA/BUILD_TIMEenvironment variables rather than shelling out togit— the deployed container has no.gitdirectory. Both default to"unknown"when unset..env.exampledocuments them as CI-injected (e.g.BUILD_SHA=${{ github.sha }}).network.stellarNetwork,network.sorobanRpcUrl, and the three configured contract addresses, so integrators hitting/metacan confirm which environment they're pointed at.Testing
src/meta/version.test.tscovers: version sourced frompackage.json, the"unknown"default when build env vars are absent, build info being read correctly when present, network/contract reporting, and the absence of "scaffold" in the description.npm run lint,npm run build,npm test, andnpm audit --audit-level=highare all clean on this branch.Scope note
This adds
src/meta/**and touchessrc/routes/v1/index.ts(only the/metahandler body plus two new imports) and.env.example. Heads up for whoever merges: PR #58 (dispute routes) also touchessrc/routes/v1/index.ts, adding a route-registration line directly below the/metahandler this PR rewrites. The two changes don't conflict logically, but depending on merge order there will be a small one-hunk conflict in that file to resolve by hand — flagging it now rather than leaving it as a surprise.Closes #10.