@devvit/build-pack 0.11.19-next-2025-07-03-20-29-32-724196ea6.0 → 0.11.19-next-2025-07-08-15-23-50-85a8fdbad.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.
@@ -351,7 +351,7 @@ function isEsbuildResult(err) {
351
351
  function esbuildConfig(config, disableExternDevvitProtos, targetRuntime, watchMode = false) {
352
352
  return {
353
353
  // When Blocks migration is used, the Devvit singleton used in the template
354
- // must be the same instance as that used elsehwhere. Aliases are resolved
354
+ // must be the same instance as that used elsewhere. Aliases are resolved
355
355
  // from the current working directory, not the compiled file's directory, so
356
356
  // this effectively maps the template's @devvit/public-api to the app's
357
357
  // version. The same could be done for @devvit/server but apps don't
@@ -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-20-29-32-724196ea6.0",
3
+ "version": "0.11.19-next-2025-07-08-15-23-50-85a8fdbad.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-20-29-32-724196ea6.0",
27
- "@devvit/shared-types": "0.11.19-next-2025-07-03-20-29-32-724196ea6.0",
26
+ "@devvit/protos": "0.11.19-next-2025-07-08-15-23-50-85a8fdbad.0",
27
+ "@devvit/shared-types": "0.11.19-next-2025-07-08-15-23-50-85a8fdbad.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-20-29-32-724196ea6.0",
39
- "@devvit/repo-tools": "0.11.19-next-2025-07-03-20-29-32-724196ea6.0",
40
- "@devvit/server": "0.11.19-next-2025-07-03-20-29-32-724196ea6.0",
41
- "@devvit/shared": "0.11.19-next-2025-07-03-20-29-32-724196ea6.0",
42
- "@devvit/tsconfig": "0.11.19-next-2025-07-03-20-29-32-724196ea6.0",
38
+ "@devvit/public-api": "0.11.19-next-2025-07-08-15-23-50-85a8fdbad.0",
39
+ "@devvit/repo-tools": "0.11.19-next-2025-07-08-15-23-50-85a8fdbad.0",
40
+ "@devvit/server": "0.11.19-next-2025-07-08-15-23-50-85a8fdbad.0",
41
+ "@devvit/shared": "0.11.19-next-2025-07-08-15-23-50-85a8fdbad.0",
42
+ "@devvit/tsconfig": "0.11.19-next-2025-07-08-15-23-50-85a8fdbad.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": "6d983c8facfaf069530efeffe2a6ca5e54743aaf"
51
+ "gitHead": "311eb656fbd41f62fe31e4047610ba72adf83008"
52
52
  }