tjs-lang 0.8.4 → 0.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CLAUDE.md CHANGED
@@ -147,8 +147,30 @@ import { AgentVM } from 'tjs-lang/vm' // VM only (smaller bundle)
147
147
  import { batteryAtoms } from 'tjs-lang/batteries' // LM Studio batteries
148
148
  import { dot, norm_sq } from 'tjs-lang/linalg' // SIMD linear-algebra kernels
149
149
  // Editor integrations: 'tjs-lang/editors/monaco', '/codemirror', '/ace'
150
+
151
+ // Self-contained BROWSER bundles — drop-in via import() from any CDN, no
152
+ // import-map/config (acorn + tosijs-schema inlined):
153
+ const { tjs } = await import(
154
+ 'https://cdn.jsdelivr.net/npm/tjs-lang/dist/tjs-browser.js'
155
+ )
156
+ // TS→TJS in the browser: lazy-loads the TypeScript compiler from a CDN on first call:
157
+ const { fromTS } = await import(
158
+ 'https://cdn.jsdelivr.net/npm/tjs-lang/dist/tjs-browser-from-ts.js'
159
+ )
160
+ // → exports: 'tjs-lang/browser' (TJS/AJS) and 'tjs-lang/browser/from-ts' (TS).
150
161
  ```
151
162
 
163
+ **Browser bundles + CDN reality** (build targets `tjs-browser` / `tjs-browser-from-ts`
164
+ in `scripts/build.ts`; `src/lang/browser.ts`, `browser-from-ts.ts`, `ts-cdn-shim.ts`):
165
+ the TJS/AJS bundle is fully self-contained → loads from **any** CDN (jsDelivr,
166
+ unpkg, esm.sh). The TS path lazy-loads the `typescript` compiler from a CDN on
167
+ demand (Proxy shim aliased over `from-ts`'s `typescript` import; no source change).
168
+ **Verified in a real browser: esm.sh is the ONLY CDN that reliably serves
169
+ `typescript`** (~700ms) — jsDelivr `+esm` / esm.run time out on its ~10MB CJS,
170
+ skypack is dead. So `DEFAULT_TYPESCRIPT_URL = https://esm.sh/typescript@5`,
171
+ overridable via `fromTS(src, { typescriptUrl })` or by preloading
172
+ `globalThis.__TJS_TS__`. Self-containment guarded by `src/lang/browser-bundle.test.ts`.
173
+
152
174
  ### Transpiler Chain (TS → TJS → JS)
153
175
 
154
176
  TJS supports transpiling TypeScript to JavaScript with runtime type validation. The pipeline has two distinct, independently testable steps: