@@ -13,12 +13,12 @@ Any organization can deploy this package privately on their own domain.
1313
1414Field-for-field identical to the long-running Ruby API:
1515
16- | field | behavior |
17- | ---| ---|
18- | ` info ` | version JSON |
19- | ` systemCodes ` | all 287 transliteration systems |
20- | ` transliterate(systemCode!, input!) ` | transliterate (1MB input cap) |
21- | ` detect(input!, output!) ` | ranked ` [{mapName, distance}] ` |
16+ | field | behavior |
17+ | ------------------------------------ | ------------------------------- |
18+ | ` info ` | version JSON |
19+ | ` systemCodes ` | all 287 transliteration systems |
20+ | ` transliterate(systemCode!, input!) ` | transliterate (1MB input cap) |
21+ | ` detect(input!, output!) ` | ranked ` [{mapName, distance}] ` |
2222
2323Error strings match byte-for-byte (` Couldn't locate <code> ` ).
2424
@@ -28,16 +28,19 @@ Error strings match byte-for-byte (`Couldn't locate <code>`).
2828 [ ` interscript-ts ` ] ( https://github.com/interscript/interscript-ts ) —
2929 no regex compilation.
3030- ** Maps** : the full corpus (287 systems + 4 dependency libraries,
31- compiled to schema-versioned JSON IR from interscript-maps 2.4.3) is
32- ** bundled with the deploy as static assets** — minified ~ 260MB,
33- ~ 21MB gzipped, every file well under the 20MiB asset limit. Immutable
34- per release, edge-cached, zero runtime third-party fetches.
31+ compiled to schema-versioned JSON IR from interscript-maps) is a
32+ deploy-time asset, not part of this npm package. Deployment repos fetch
33+ a pinned map artifact from ` interscript/maps ` , verify it, and expose it
34+ through the Workers Assets binding. Immutable per release, edge-cached,
35+ zero runtime third-party fetches.
3536- ** Server** : Hono + GraphQL Yoga.
3637
3738## Deploy your own
3839
3940``` bash
4041npm install @interscript/api-worker
42+ # Then fetch/extract a pinned interscript/maps JSON-IR artifact into ./maps.
43+ # Do not copy maps from this npm package; the package is code-only.
4144```
4245
4346Minimal ` wrangler.jsonc ` :
@@ -48,10 +51,10 @@ Minimal `wrangler.jsonc`:
4851 " main" : " src/index.ts" ,
4952 " compatibility_date" : " 2026-08-01" ,
5053 " assets" : {
51- " directory" : " ./node_modules/@interscript/api-worker/ maps" ,
52- " binding" : " ASSETS"
54+ " directory" : " ./maps" ,
55+ " binding" : " ASSETS" ,
5356 },
54- " routes" : [{ " pattern" : " api.example.org/*" }]
57+ " routes" : [{ " pattern" : " api.example.org/*" }],
5558}
5659```
5760
@@ -72,16 +75,19 @@ npm run lint
7275Regenerating the map corpus (requires interscript-ruby + interscript-maps):
7376
7477``` bash
75- ruby -e ' ... see scripts/build-maps.rb ... '
78+ ruby scripts/build-maps.rb /path/to/interscript-ruby /path/to/maps ./maps
7679```
7780
81+ For production deploys, prefer a pinned release artifact from
82+ ` interscript/maps ` over local regeneration; verify the artifact checksum
83+ before ` wrangler deploy ` .
84+
7885## Parity
7986
8087` test/fixtures/parity.json ` holds queries recorded from the production
8188Ruby API; CI replays them against this implementation. Zero-diff is the
8289release gate.
8390
84-
8591## REST v1 (OpenAPI)
8692
8793REST endpoints serve alongside GraphQL (which remains at ` POST /graphql ` ):
0 commit comments