Skip to content

Commit d322c2b

Browse files
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 bundles
1 parent 82b6643 commit d322c2b

24 files changed

Lines changed: 2159 additions & 26 deletions

astro.config.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@
22
import { defineConfig } from "astro/config"
33
import vue from "@astrojs/vue"
44
import tailwindcss from "@tailwindcss/vite"
5+
import node from "@astrojs/node"
56

67
// Interscript.org v2 — Astro 7 + Vite 8 + Tailwind 4 + Vue 3 islands.
7-
// Uses interscript-ts for the map explorer.
8+
// Static output by default; per-route opt-out via `export const prerender = false`.
9+
// The /api/* endpoints are real on-demand Node routes served via
10+
// @astrojs/node. Deploy target: any Node-capable host.
811
export default defineConfig({
912
site: "https://www.interscript.org",
1013
output: "static",
14+
adapter: node({ mode: "standalone" }),
1115
integrations: [vue()],
1216
vite: {
1317
plugins: [tailwindcss()],

package-lock.json

Lines changed: 244 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)