@devvit/build-pack 0.11.19-next-2025-07-03-19-32-19-0edd6138a.0 → 0.11.19-next-2025-07-07-21-40-10-09f9d86a3.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":"AACA,OAAO,EAEL,MAAM,EACN,KAAK,OAAO,EAMb,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAgBtE,oFAAoF;AACpF,eAAO,MAAM,UAAU,EAAE;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAA;CAAO,CAAC;AAqG7D,gBAAgB;AAChB,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CA4D/D;AAsJD,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,EAMb,MAAM,oBAAoB,CAAC;AAG5B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAiBtE,oFAAoF;AACpF,eAAO,MAAM,UAAU,EAAE;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAA;CAAO,CAAC;AAqG7D,gBAAgB;AAChB,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CA4D/D;AA0KD,eAAe,MAAM,CAAC"}
@@ -1,5 +1,8 @@
1
+ import { LoggerDefinition, Severity } from '@devvit/protos';
1
2
  import { Devvit, useWebView, } from '@devvit/public-api';
2
3
  import { getServerPort } from '@devvit/server';
4
+ import { getDevvitConfig } from '@devvit/server/get-devvit-config.js';
5
+ import { StringUtil } from '@devvit/shared-types/StringUtil.js';
3
6
  // __devvit__ is undefined in tests only.
4
7
  // @ts-expect-error no type.
5
8
  const config = globalThis.__devvit__?.config;
@@ -192,6 +195,8 @@ async function callWebbitEndpoint(endpoint, body, metadata) {
192
195
  }
193
196
  }
194
197
  function configureScheduler(schedulerConfig) {
198
+ const config = getDevvitConfig();
199
+ const logger = config.use(LoggerDefinition);
195
200
  const cronTasks = {};
196
201
  for (const [name, task] of Object.entries(schedulerConfig.tasks)) {
197
202
  Devvit.addSchedulerJob({
@@ -225,10 +230,22 @@ function configureScheduler(schedulerConfig) {
225
230
  await Promise.all(jobsToCancel.map((job) => context.scheduler.cancelJob(job.id)));
226
231
  // Schedule all the cron tasks we were given in the config
227
232
  await Promise.all(Object.entries(cronTasks).map(async ([name, task]) => {
228
- await context.scheduler.runJob({
229
- name: name,
230
- cron: task.cron,
231
- });
233
+ try {
234
+ await context.scheduler.runJob({
235
+ name: name,
236
+ cron: task.cron,
237
+ ...(task.data ? { data: task.data } : {}),
238
+ });
239
+ }
240
+ catch (error) {
241
+ await logger.Log({
242
+ message: `Failed to schedule ${name}: ${StringUtil.caughtToString(error, 'message')}`,
243
+ severity: Severity.ERROR,
244
+ tags: [],
245
+ }, context.debug.metadata);
246
+ throw error;
247
+ }
248
+ await logger.Log({ message: `Cron task '${name}' scheduled.`, severity: Severity.VERBOSE, tags: [] }, context.debug.metadata);
232
249
  }));
233
250
  },
234
251
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devvit/build-pack",
3
- "version": "0.11.19-next-2025-07-03-19-32-19-0edd6138a.0",
3
+ "version": "0.11.19-next-2025-07-07-21-40-10-09f9d86a3.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.19-next-2025-07-03-19-32-19-0edd6138a.0",
27
- "@devvit/shared-types": "0.11.19-next-2025-07-03-19-32-19-0edd6138a.0",
26
+ "@devvit/protos": "0.11.19-next-2025-07-07-21-40-10-09f9d86a3.0",
27
+ "@devvit/shared-types": "0.11.19-next-2025-07-07-21-40-10-09f9d86a3.0",
28
28
  "esbuild": "0.23.0",
29
29
  "rxjs": "7.8.1",
30
30
  "tsv": "0.2.0",
@@ -35,11 +35,11 @@
35
35
  "@devvit/shared": "*"
36
36
  },
37
37
  "devDependencies": {
38
- "@devvit/public-api": "0.11.19-next-2025-07-03-19-32-19-0edd6138a.0",
39
- "@devvit/repo-tools": "0.11.19-next-2025-07-03-19-32-19-0edd6138a.0",
40
- "@devvit/server": "0.11.19-next-2025-07-03-19-32-19-0edd6138a.0",
41
- "@devvit/shared": "0.11.19-next-2025-07-03-19-32-19-0edd6138a.0",
42
- "@devvit/tsconfig": "0.11.19-next-2025-07-03-19-32-19-0edd6138a.0",
38
+ "@devvit/public-api": "0.11.19-next-2025-07-07-21-40-10-09f9d86a3.0",
39
+ "@devvit/repo-tools": "0.11.19-next-2025-07-07-21-40-10-09f9d86a3.0",
40
+ "@devvit/server": "0.11.19-next-2025-07-07-21-40-10-09f9d86a3.0",
41
+ "@devvit/shared": "0.11.19-next-2025-07-07-21-40-10-09f9d86a3.0",
42
+ "@devvit/tsconfig": "0.11.19-next-2025-07-07-21-40-10-09f9d86a3.0",
43
43
  "@types/tsv": "0.2.1",
44
44
  "eslint": "9.11.1",
45
45
  "vitest": "1.6.1"
@@ -48,5 +48,5 @@
48
48
  "directory": "dist"
49
49
  },
50
50
  "source": "./src/index.ts",
51
- "gitHead": "279c870c8e14bd96edb60db754adb7b733ea871f"
51
+ "gitHead": "4564b3abf935509a137e3b0931ad2bc1180f4be2"
52
52
  }