@vesk/vesk-cli 0.2.32 → 0.2.33

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.
Files changed (2) hide show
  1. package/dist/cli.js +15 -3
  2. package/package.json +5 -5
package/dist/cli.js CHANGED
@@ -2139,15 +2139,27 @@ var init_resource = __esm({
2139
2139
  isServer = () => !!g().__vsk_ssr;
2140
2140
  ssrSink = null;
2141
2141
  DEFAULT_FAILURE_TTL = 1e4;
2142
- useFetch.text = (url, options) => useFetch(() => doFetch(resolveFetchUrl(url), buildRequestInit(options ?? {})).then((r) => r.text()), {
2142
+ useFetch.text = (url, options) => useFetch(async () => {
2143
+ const res = await doFetch(resolveFetchUrl(url), buildRequestInit(options ?? {}));
2144
+ if (!res.ok) throw new HttpError(res.status, res.statusText);
2145
+ return res.text();
2146
+ }, {
2143
2147
  ...options,
2144
2148
  key: options?.key ?? url
2145
2149
  });
2146
- useFetch.json = (url, options) => useFetch(() => doFetch(resolveFetchUrl(url), buildRequestInit(options ?? {})).then((r) => r.json()), {
2150
+ useFetch.json = (url, options) => useFetch(async () => {
2151
+ const res = await doFetch(resolveFetchUrl(url), buildRequestInit(options ?? {}));
2152
+ if (!res.ok) throw new HttpError(res.status, res.statusText);
2153
+ return res.json();
2154
+ }, {
2147
2155
  ...options,
2148
2156
  key: options?.key ?? url
2149
2157
  });
2150
- useFetch.arrayBuffer = (url, options) => useFetch(() => doFetch(resolveFetchUrl(url), buildRequestInit(options ?? {})).then((r) => r.arrayBuffer()), {
2158
+ useFetch.arrayBuffer = (url, options) => useFetch(async () => {
2159
+ const res = await doFetch(resolveFetchUrl(url), buildRequestInit(options ?? {}));
2160
+ if (!res.ok) throw new HttpError(res.status, res.statusText);
2161
+ return res.arrayBuffer();
2162
+ }, {
2151
2163
  ...options,
2152
2164
  key: options?.key ?? url
2153
2165
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vesk/vesk-cli",
3
- "version": "0.2.32",
3
+ "version": "0.2.33",
4
4
  "type": "module",
5
5
  "description": "Vesk — compiler-first framework for the post-VDOM web. vesk dev, vesk build.",
6
6
  "bin": {
@@ -8,10 +8,10 @@
8
8
  },
9
9
  "main": "./dist/cli.js",
10
10
  "dependencies": {
11
- "@vesk/adapter": "^0.2.32",
12
- "@vesk/compiler": "^0.2.32",
13
- "@vesk/plugin-tailwind": "^0.2.32",
14
- "@vesk/runtime": "^0.2.32",
11
+ "@vesk/adapter": "^0.2.33",
12
+ "@vesk/compiler": "^0.2.33",
13
+ "@vesk/plugin-tailwind": "^0.2.33",
14
+ "@vesk/runtime": "^0.2.33",
15
15
  "esrap": "^2.3.0",
16
16
  "typescript": "^5.8.0",
17
17
  "ws": "^8.18.0",