@devvit/build-pack 0.11.20-next-2025-07-23-18-02-25-3ea0d7aed.0 → 0.11.20-next-2025-07-23-18-26-20-68cb855f3.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;
|
|
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"}
|
|
@@ -28,8 +28,11 @@ function configurePermissions(permissions) {
|
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
30
|
function configurePost(post) {
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
let path = post.client.entry;
|
|
32
|
+
if (post.client.entry.startsWith(post.client.dir)) {
|
|
33
|
+
path = post.client.entry.slice(post.client.dir.length);
|
|
34
|
+
path = path[0] === '/' ? path.slice(1) : path;
|
|
35
|
+
}
|
|
33
36
|
Devvit.addCustomPostType({
|
|
34
37
|
name: '',
|
|
35
38
|
render: () => renderModal(path),
|
|
@@ -43,7 +46,7 @@ function configureMenuItems(menuItems) {
|
|
|
43
46
|
label: action.label,
|
|
44
47
|
location: action.location,
|
|
45
48
|
onPress: async (ev, ctx) => {
|
|
46
|
-
const responseJson = await callWebbitEndpoint(action.endpoint, ev, ctx.
|
|
49
|
+
const responseJson = await callWebbitEndpoint(action.endpoint, ev, ctx.metadata);
|
|
47
50
|
const uiResponse = responseJson;
|
|
48
51
|
validateUiResponse(uiResponse);
|
|
49
52
|
await handleUiResponse(ctx, uiResponse);
|
|
@@ -77,13 +80,13 @@ function configureTriggers(triggers) {
|
|
|
77
80
|
// Protobuf.toJSON() which would omit default values.
|
|
78
81
|
const body = JSON.parse(JSON.stringify(ev));
|
|
79
82
|
// Cast to JSONObject since interfaces are open types.
|
|
80
|
-
await callWebbitEndpoint(endpoint, body, ctx.
|
|
83
|
+
await callWebbitEndpoint(endpoint, body, ctx.metadata);
|
|
81
84
|
},
|
|
82
85
|
});
|
|
83
86
|
}
|
|
84
87
|
}
|
|
85
88
|
async function handleFormResponse(endpoint, event, ctx) {
|
|
86
|
-
const responseJson = await callWebbitEndpoint(endpoint, event.values, ctx.
|
|
89
|
+
const responseJson = await callWebbitEndpoint(endpoint, event.values, ctx.metadata);
|
|
87
90
|
const uiResponse = responseJson;
|
|
88
91
|
validateUiResponse(uiResponse);
|
|
89
92
|
await handleUiResponse(ctx, uiResponse);
|
|
@@ -196,7 +199,7 @@ function configureScheduler(schedulerConfig) {
|
|
|
196
199
|
Devvit.addSchedulerJob({
|
|
197
200
|
name: name,
|
|
198
201
|
onRun: async (event, context) => {
|
|
199
|
-
await callWebbitEndpoint(task.endpoint, { name: event.name, data: event.data }, context.
|
|
202
|
+
await callWebbitEndpoint(task.endpoint, { name: event.name, data: event.data }, context.metadata);
|
|
200
203
|
},
|
|
201
204
|
});
|
|
202
205
|
// Tasks with cron specified require a bit more work further down
|
|
@@ -234,10 +237,10 @@ function configureScheduler(schedulerConfig) {
|
|
|
234
237
|
message: `Failed to schedule ${name}: ${StringUtil.caughtToString(error, 'message')}`,
|
|
235
238
|
severity: Severity.ERROR,
|
|
236
239
|
tags: [],
|
|
237
|
-
}, context.
|
|
240
|
+
}, context.metadata);
|
|
238
241
|
throw error;
|
|
239
242
|
}
|
|
240
|
-
await logger.Log({ message: `Cron task '${name}' scheduled.`, severity: Severity.VERBOSE, tags: [] }, context.
|
|
243
|
+
await logger.Log({ message: `Cron task '${name}' scheduled.`, severity: Severity.VERBOSE, tags: [] }, context.metadata);
|
|
241
244
|
}));
|
|
242
245
|
},
|
|
243
246
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templatizer.d.ts","sourceRoot":"","sources":["../../../src/esbuild/templatizer/templatizer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,gBAAgB;AAChB,wBAAgB,UAAU,CAAC,IAAI,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"templatizer.d.ts","sourceRoot":"","sources":["../../../src/esbuild/templatizer/templatizer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,gBAAgB;AAChB,wBAAgB,UAAU,CAAC,IAAI,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAUxF"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
/** @internal */
|
|
3
3
|
export function templatize(root, blocksEntry) {
|
|
4
|
+
const template = path.join(import.meta.dirname, 'blocks.template.js');
|
|
5
|
+
const blocks = blocksEntry ? path.join(root, blocksEntry) : undefined;
|
|
4
6
|
// Import user code second so that it has precedence.
|
|
5
7
|
return `
|
|
6
|
-
import Devvit from
|
|
7
|
-
${
|
|
8
|
+
import Devvit from ${JSON.stringify(template.replaceAll('\\', '/'))};
|
|
9
|
+
${blocks ? `import ${JSON.stringify(blocks.replaceAll('\\', '/'))};` : ''}
|
|
8
10
|
export default Devvit;
|
|
9
11
|
`.trim();
|
|
10
12
|
}
|
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-18-
|
|
3
|
+
"version": "0.11.20-next-2025-07-23-18-26-20-68cb855f3.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-18-
|
|
27
|
-
"@devvit/shared-types": "0.11.20-next-2025-07-23-18-
|
|
26
|
+
"@devvit/protos": "0.11.20-next-2025-07-23-18-26-20-68cb855f3.0",
|
|
27
|
+
"@devvit/shared-types": "0.11.20-next-2025-07-23-18-26-20-68cb855f3.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-18-
|
|
39
|
-
"@devvit/repo-tools": "0.11.20-next-2025-07-23-18-
|
|
40
|
-
"@devvit/scheduler": "0.11.20-next-2025-07-23-18-
|
|
41
|
-
"@devvit/server": "0.11.20-next-2025-07-23-18-
|
|
42
|
-
"@devvit/shared": "0.11.20-next-2025-07-23-18-
|
|
43
|
-
"@devvit/tsconfig": "0.11.20-next-2025-07-23-18-
|
|
38
|
+
"@devvit/public-api": "0.11.20-next-2025-07-23-18-26-20-68cb855f3.0",
|
|
39
|
+
"@devvit/repo-tools": "0.11.20-next-2025-07-23-18-26-20-68cb855f3.0",
|
|
40
|
+
"@devvit/scheduler": "0.11.20-next-2025-07-23-18-26-20-68cb855f3.0",
|
|
41
|
+
"@devvit/server": "0.11.20-next-2025-07-23-18-26-20-68cb855f3.0",
|
|
42
|
+
"@devvit/shared": "0.11.20-next-2025-07-23-18-26-20-68cb855f3.0",
|
|
43
|
+
"@devvit/tsconfig": "0.11.20-next-2025-07-23-18-26-20-68cb855f3.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": "
|
|
52
|
+
"gitHead": "2deb8c2385da680e03cbad8f27318b4bc153144c"
|
|
53
53
|
}
|