@devvit/build-pack 0.11.20-next-2025-07-23-22-45-00-ff195dad6.0 → 0.11.20-next-2025-07-23-23-57-19-9b6898ff9.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"blocks.template.d.ts","sourceRoot":"","sources":["../../../src/esbuild/templatizer/blocks.template.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,MAAM,EACN,KAAK,OAAO,EAKb,MAAM,oBAAoB,CAAC;AAK5B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAmBtE,oFAAoF;AACpF,eAAO,MAAM,UAAU,EAAE;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAA;CAAO,CAAC;AAiG7D,gBAAgB;AAChB,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CA4D/D;AAgKD,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"blocks.template.d.ts","sourceRoot":"","sources":["../../../src/esbuild/templatizer/blocks.template.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,MAAM,EACN,KAAK,OAAO,EAKb,MAAM,oBAAoB,CAAC;AAK5B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAmBtE,oFAAoF;AACpF,eAAO,MAAM,UAAU,EAAE;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAA;CAAO,CAAC;AAiG7D,gBAAgB;AAChB,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CA4D/D;AAwKD,eAAe,MAAM,CAAC"}
@@ -172,15 +172,24 @@ async function callWebbitEndpoint(endpoint, body, metadata) {
172
172
  headers,
173
173
  });
174
174
  if (!response.ok) {
175
- const body = await response.text();
176
- let errorMessage = `Failed to POST ${endpoint}: ${response.statusText}, `;
177
- if (response.status === 404) {
178
- errorMessage += `ensure that you're handling this endpoint in your server code.`;
175
+ const bodyText = await response.text();
176
+ // Try parsing the response as JSON / UiResponse. If valid, return it so callers can handle
177
+ // it like effects. If not, fall down to error case.
178
+ try {
179
+ const jsonResponse = JSON.parse(bodyText);
180
+ validateUiResponse(jsonResponse);
181
+ return jsonResponse;
179
182
  }
180
- else {
181
- errorMessage += `body: ${body.substring(0, 100)}`;
183
+ catch {
184
+ let errorMessage = `Failed to POST ${endpoint}: ${response.statusText}, `;
185
+ if (response.status === 404) {
186
+ errorMessage += `ensure that you're handling this endpoint in your server code.`;
187
+ }
188
+ else {
189
+ errorMessage += `body: ${bodyText.substring(0, 100)}`;
190
+ }
191
+ throw new Error(errorMessage);
182
192
  }
183
- throw new Error(errorMessage);
184
193
  }
185
194
  const contentType = response.headers.get('Content-Type');
186
195
  if (!contentType || !contentType.includes('application/json')) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devvit/build-pack",
3
- "version": "0.11.20-next-2025-07-23-22-45-00-ff195dad6.0",
3
+ "version": "0.11.20-next-2025-07-23-23-57-19-9b6898ff9.0",
4
4
  "license": "BSD-3-Clause",
5
5
  "repository": {
6
6
  "type": "git",
@@ -23,8 +23,8 @@
23
23
  },
24
24
  "types": "./index.d.ts",
25
25
  "dependencies": {
26
- "@devvit/protos": "0.11.20-next-2025-07-23-22-45-00-ff195dad6.0",
27
- "@devvit/shared-types": "0.11.20-next-2025-07-23-22-45-00-ff195dad6.0",
26
+ "@devvit/protos": "0.11.20-next-2025-07-23-23-57-19-9b6898ff9.0",
27
+ "@devvit/shared-types": "0.11.20-next-2025-07-23-23-57-19-9b6898ff9.0",
28
28
  "esbuild": "0.23.0",
29
29
  "rxjs": "7.8.1",
30
30
  "tsv": "0.2.0",
@@ -35,12 +35,12 @@
35
35
  "@devvit/shared": "*"
36
36
  },
37
37
  "devDependencies": {
38
- "@devvit/public-api": "0.11.20-next-2025-07-23-22-45-00-ff195dad6.0",
39
- "@devvit/repo-tools": "0.11.20-next-2025-07-23-22-45-00-ff195dad6.0",
40
- "@devvit/scheduler": "0.11.20-next-2025-07-23-22-45-00-ff195dad6.0",
41
- "@devvit/server": "0.11.20-next-2025-07-23-22-45-00-ff195dad6.0",
42
- "@devvit/shared": "0.11.20-next-2025-07-23-22-45-00-ff195dad6.0",
43
- "@devvit/tsconfig": "0.11.20-next-2025-07-23-22-45-00-ff195dad6.0",
38
+ "@devvit/public-api": "0.11.20-next-2025-07-23-23-57-19-9b6898ff9.0",
39
+ "@devvit/repo-tools": "0.11.20-next-2025-07-23-23-57-19-9b6898ff9.0",
40
+ "@devvit/scheduler": "0.11.20-next-2025-07-23-23-57-19-9b6898ff9.0",
41
+ "@devvit/server": "0.11.20-next-2025-07-23-23-57-19-9b6898ff9.0",
42
+ "@devvit/shared": "0.11.20-next-2025-07-23-23-57-19-9b6898ff9.0",
43
+ "@devvit/tsconfig": "0.11.20-next-2025-07-23-23-57-19-9b6898ff9.0",
44
44
  "@types/tsv": "0.2.1",
45
45
  "eslint": "9.11.1",
46
46
  "vitest": "1.6.1"
@@ -49,5 +49,5 @@
49
49
  "directory": "dist"
50
50
  },
51
51
  "source": "./src/index.ts",
52
- "gitHead": "eb63220a7656507334c9ae6d86be7f782d92786d"
52
+ "gitHead": "a9e365d446cadf15060a6e2312021802923d435f"
53
53
  }