Skip to content

the playground support lane: examples, CDN recipe, ambient types - #67

Merged
ronaldtse merged 1 commit into
mainfrom
playground-support
Sep 7, 2026
Merged

ronaldtse merged 1 commit into
mainfrom
playground-support

Conversation

@ronaldtse

Copy link
Copy Markdown
Contributor

What

The playground support lane (TODO.impl, 5/5 COMPLETE) - our side of audience-facing scripting: everything the website playground runs on, so the client agent never rediscovers it.

  • examples/ - the runnable gallery: convert, detect-chain, neural diacritize, batch columns, server mode. Each is a self-contained module ({title, summary, expected, run()}) sharing the site's exact strategy stack (iscStrategy first, compiled-JSON fallback). test/examples.test.ts iterates the registry in CI - the presets are the public-API regression suite and cannot rot.
  • docs/CDN.md - the no-bundler recipe, probed in a real browser: esm.sh works for both the entry (a full conversion completes: "Anton Olehovych") and /ml (namespace loads, no import-time ORT requirement). The kotoshu wasm-CDN trap does not apply - documented with the evidence. test/cdn-urls.test.ts pins the entry URLs.
  • src/playground.d.ts (shipped via dist/) - ambient declarations for the injected globals, so playground editors autocomplete against the real published types from the first keystroke.
  • API server-mode CORS verified open (ACAO * on preflight and POST /v1/transliterate) - the no-download example is truthful as written.

Verification

  • vitest run test/examples.test.ts 5/5 green (network: interscript.org/maps ISC + the API).
  • Full suite: 242 passed; tsc clean; eslint clean.
  • The worker-mode proof lands as a site-repo e2e spec (sibling PR) that imports this package from the CDN pin inside a real Web Worker - converting end to end.

TODO.impl register (5/5 COMPLETE) - our side of the audience-scripting
direction, everything the website playground runs on:

- examples/: the runnable gallery (convert, detect-chain, neural
  diacritize, batch columns, server mode) sharing the site's exact
  strategy stack; test/examples.test.ts runs the registry in CI so the
  presets cannot rot - they are the public-API regression suite
- docs/CDN.md: the no-bundler recipe, probed in a real browser -
  esm.sh works for both entry and /ml (a conversion completes
  end-to-end); the kotoshu wasm-CDN trap does not apply, and the doc
  says why with the evidence
- src/playground.d.ts (shipped via dist): ambient declarations for the
  injected globals so playground editors autocomplete from the real
  published types
- API server-mode CORS verified open (ACAO * on preflight and POST) -
  the no-download example is truthful as written
@ronaldtse
ronaldtse merged commit ad80e57 into main Sep 7, 2026
8 checks passed
@ronaldtse
ronaldtse deleted the playground-support branch September 7, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant