Files
Abue Ammar 9d9a964a17 Give the Response polyfill the Web spec's constructor, and track @raycast/api 2.0.3 (#299)
* Give the Response polyfill the Web spec's constructor

Bundled HTTP clients probe the platform at module scope — axios runs
`new Response()` through a feature check before any component mounts —
so `TinycastResponse`'s host-shaped `{ status, … }` constructor threw
during bundle evaluation and took the whole command down with it, past
the extension's own try/catch.

Take `(body, init)` as the spec does, keeping the host-assigned `url` as
an internal third argument. The body now lives as bytes rather than
base64, so a response no longer round-trips through base64 to satisfy
the new shape and reads no longer decode on every call; `encodeBody`
shares the same normalizer. Dead `Buffer.isBuffer` branch removed
(Buffer extends Uint8Array), and `ArrayBuffer.isView` now covers the
typed arrays that used to stringify into garbage.

Fixes #296

* Track @raycast/api 2.0.3

v2 hoists a namespaced enum's body to the top level and binds it back in
as `const Style: typeof ToastStyle_2;`, so gen-enums.mjs — which keys
enums by their declaration's nesting — emitted `ToastStyle` and
`AlertActionStyle` as roots and dropped `Toast.Style` and
`Alert.ActionStyle` from `nestedEnums`. src/api reads both directly, so
the module threw at load and every command died with it. Resolve those
`typeof` bindings back onto the enum they name.

Also report 2.0.3 as `environment.raycastVersion`, and drop the
`scopeNames` map nothing has ever read.

Icon.Quicklink is gone from v2's Icon enum; an extension that names it
now renders no icon, though the raw "quicklink-16" string still resolves
on the Swift side.
2026-08-20 23:02:51 +06:00

17 lines
458 B
JSON

{
"name": "tinycast-raycast-runtime",
"private": true,
"version": "0.1.0",
"description": "Builds Tinycast's embedded Raycast-extension JS runtime (React + reconciler + @raycast/api shim) into a single file consumed by JavaScriptCore.",
"type": "module",
"scripts": {
"build": "node build.mjs"
},
"devDependencies": {
"@raycast/api": "^2.0.3",
"esbuild": "^0.25.0",
"react": "^19.2.0",
"react-reconciler": "^0.33.0"
}
}