Commit d322c2b
committed
feat: REST API + Service Worker + diff viewer + MARC tool + enriched authority pages
Round 4 — five more high-impact additions.
1. Public REST API (the big reach multiplier)
- /api/transliterate (GET + POST + OPTIONS) — real on-demand endpoint
running interscript-ts server-side. No auth, no rate limits, CORS
open. Returns {system, input, output, stage, durationMs}.
- /api/systems — list/filter the catalogue (by authority, source_script,
destination_script)
- /api/detect — detection API endpoint (returns candidate systems
for a given source-script family)
- Added @astrojs/node adapter; output stays static for prerendered
routes. API routes opt out via `export const prerender = false`.
- 12 integration tests in test/api-endpoints.test.ts spawn the real
server and curl each endpoint.
2. Service Worker for offline-first access
- public/sw.js with stale-while-revalidate for HTML, cache-first for
map IR + static assets, network-only for API
- public/offline.html as the fallback with brand mark
- Auto-registers from Base.astro (skips insecure origins)
- After first visit, all 8MB of map IR is cached → site + worker +
batch + compare all work without network. Critical for field
researchers in low-bandwidth environments.
3. /diff — map rule-set comparison
- Pick two systems, see their first 30 rules side-by-side
- Each row shows kind (sub/parallel/run/funcall), from, →, to
- Color-coded by kind (parallel=highlight, sub=brand, etc.)
- Use cases: adoption decisions, map authoring, linguistic research
4. /marc — librarian MARC tool
- Paste text-mode MARC fields (MarcEdit-style), get romanized 880
parallel fields
- Subfield-aware: only romanizes non-Latin content, leaves codes intact
- ALA-LC systems preloaded (default for North American cataloging)
- Privacy: text never leaves browser (Web Worker)
- Links to LOC 880 reference
5. Enriched /authorities/[slug] pages
- 11 narrative descriptions added for prominent authorities (BGN/PCGN,
ISO, ALA-LC, ODNI, UN, ICAO, DIN, GOST, ELOT, MOFA, Academia Sinica, SAC)
- Signature sample callout (dark ink panel) for prominent authorities
showing a real test vector
- Publication timeline by decade (visual bars)
- Source script coverage with display names (via @iso24229/iso15924-data)
6. API playground updates
- Hero now leads with the live curl snippet pointing at the real
https://interscript.org/api/transliterate endpoint
- Snippet URLs updated to match actual deployed path
Navigation: 13 → 16 destinations (added /diff, /marc).
Tests: 203 total (was 171).
- 12 new API integration tests (server spawned, real HTTP)
- 20 new round4 tests covering diff, marc, enriched authorities, SW
- All passing
Interscript-ts changes (companion):
- New `./loaders.node` subpath export so server-side code can import
filesystemStrategy without pulling node:fs into browser bundles1 parent 82b6643 commit d322c2b
24 files changed
Lines changed: 2159 additions & 26 deletions
File tree
- public
- src
- components
- layouts
- pages
- api
- authorities
- scripts
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
| 14 | + | |
11 | 15 | | |
12 | 16 | | |
13 | 17 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments