queries: extract shared read layer to @atjam/lexicons/queries
Single source of truth for the network-read code that web/ and tests/
both need. Module-level configurable URLs (setConstellationUrl,
setPlcDirectoryUrl) called once at app startup; defaults work for
tests with zero config.
Created lexicons/src/queries/:
- at-uri.ts parseAtUri, buildAtUri
- did.ts resolveDid + plc-directory config
- pds.ts listRecords, getRecord (cross-DID, resolves PDS first)
- constellation.ts getBacklinks + normalization + url config
- fetchers.ts fetchRoundsForJam, fetchSignupsForRound,
fetchSubmissionsForRound, fetchHomeFeed, fetchMyJams,
fetchJam, fetchRound, fetchJamByUri
- index.ts barrel
Exported as `Queries` namespace from @atjam/lexicons root.
Web changes:
- root.tsx calls Queries.setConstellationUrl + setPlcDirectoryUrl once
from CONSTELLATION_URL + PLC_DIRECTORY_URL in ~/lib/config
- 6 import sites switched from ~/lib/{pds,fetchers,at-uri,etc} to
Queries.fnName via destructure
- Deleted web/app/lib/{at-uri,did,pds,constellation,fetchers}.ts
Tests changes:
- tests/src/reads.ts shrinks from ~170 lines to ~70: keeps only
listMyRecords (convenience for reset.ts) and waitForBacklinks
(polling wrapper, test-specific). Everything else delegates to
Queries.
- Scenarios + probe import Queries.listRecords / getRecord /
getBacklinks directly.
Behavior unchanged. All 9 unit tests + 11 integration tests pass.
No deploy needed — this is internal restructuring.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
queries: extract shared read layer to @atjam/lexicons/queries
Single source of truth for the network-read code that web/ and tests/
both need. Module-level configurable URLs (setConstellationUrl,
setPlcDirectoryUrl) called once at app startup; defaults work for
tests with zero config.
Created lexicons/src/queries/:
- at-uri.ts parseAtUri, buildAtUri
- did.ts resolveDid + plc-directory config
- pds.ts listRecords, getRecord (cross-DID, resolves PDS first)
- constellation.ts getBacklinks + normalization + url config
- fetchers.ts fetchRoundsForJam, fetchSignupsForRound,
fetchSubmissionsForRound, fetchHomeFeed, fetchMyJams,
fetchJam, fetchRound, fetchJamByUri
- index.ts barrel
Exported as `Queries` namespace from @atjam/lexicons root.
Web changes:
- root.tsx calls Queries.setConstellationUrl + setPlcDirectoryUrl once
from CONSTELLATION_URL + PLC_DIRECTORY_URL in ~/lib/config
- 6 import sites switched from ~/lib/{pds,fetchers,at-uri,etc} to
Queries.fnName via destructure
- Deleted web/app/lib/{at-uri,did,pds,constellation,fetchers}.ts
Tests changes:
- tests/src/reads.ts shrinks from ~170 lines to ~70: keeps only
listMyRecords (convenience for reset.ts) and waitForBacklinks
(polling wrapper, test-specific). Everything else delegates to
Queries.
- Scenarios + probe import Queries.listRecords / getRecord /
getBacklinks directly.
Behavior unchanged. All 9 unit tests + 11 integration tests pass.
No deploy needed — this is internal restructuring.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>