@devvit/build-pack 0.11.20-next-2025-07-29-00-56-04-93779ae17.0 → 0.11.20-next-2025-07-29-04-29-31-36003bf76.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":"
|
|
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;AAI5B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAoBjD,oFAAoF;AACpF,eAAO,MAAM,UAAU,EAAE;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAA;CAAO,CAAC;AA4F7D,gBAAgB;AAChB,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CA4D/D;AAwKD,eAAe,MAAM,CAAC"}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { LoggerDefinition, Severity } from '@devvit/protos';
|
|
2
|
-
import {
|
|
3
|
-
import { Devvit, useState, } from '@devvit/public-api';
|
|
2
|
+
import { Devvit, useWebView, } from '@devvit/public-api';
|
|
4
3
|
import { getServerPort } from '@devvit/server';
|
|
5
|
-
import { devvitPostDataRedisKey } from '@devvit/shared-types/post-data.js';
|
|
6
4
|
import { getDevvitConfig } from '@devvit/shared-types/server/get-devvit-config.js';
|
|
7
5
|
import { StringUtil } from '@devvit/shared-types/StringUtil.js';
|
|
8
|
-
import { Splash } from '@devvit/splash/splash.js';
|
|
9
6
|
// Hack: rename config2 to workaround declaration in
|
|
10
7
|
// packages/runtime-lite/src/runtime/SandboxedRuntimeLite.ts.
|
|
11
8
|
// __devvit__ is undefined in tests only.
|
|
@@ -30,27 +27,12 @@ function configurePermissions(permissions) {
|
|
|
30
27
|
redis: permissions.redis,
|
|
31
28
|
});
|
|
32
29
|
}
|
|
33
|
-
function configurePost(
|
|
30
|
+
function configurePost(post) {
|
|
31
|
+
// TODO: support post entrypoints beyond default.
|
|
34
32
|
const defaultEntrypoint = post.entrypoints.default;
|
|
35
33
|
Devvit.addCustomPostType({
|
|
36
34
|
name: '',
|
|
37
|
-
render: (
|
|
38
|
-
// to-do: post data.
|
|
39
|
-
// const postDataHeader = context.metadata[Header.PostData]?.values[0]
|
|
40
|
-
// const postData: DevvitPostData = postDataHeader ? JSON.parse(postDataHeader) : {};
|
|
41
|
-
const [data] = useState(async () => {
|
|
42
|
-
if (!ctx.postId)
|
|
43
|
-
throw Error('no post ID in context');
|
|
44
|
-
const json = await ctx.redis.hGet(devvitPostDataRedisKey, ctx.postId);
|
|
45
|
-
return json ? JSON.parse(json) : {};
|
|
46
|
-
});
|
|
47
|
-
const splash = data.splash;
|
|
48
|
-
return (Devvit.createElement(Splash, { appDisplayName: splash?.appDisplayName || name, appIconURI: splash?.appIconUri, backgroundURI: splash?.backgroundUri, buttonLabel: splash?.buttonLabel, description: splash?.description, entryURI: splash?.entryUri || defaultEntrypoint.entry, height: splash?.height == null
|
|
49
|
-
? defaultEntrypoint.height
|
|
50
|
-
: splash.height === Height.TALL
|
|
51
|
-
? 'tall'
|
|
52
|
-
: 'regular', title: splash?.title }));
|
|
53
|
-
},
|
|
35
|
+
render: () => renderModal(defaultEntrypoint.entry),
|
|
54
36
|
height: defaultEntrypoint.height,
|
|
55
37
|
});
|
|
56
38
|
}
|
|
@@ -269,10 +251,16 @@ function configureScheduler(schedulerConfig) {
|
|
|
269
251
|
});
|
|
270
252
|
}
|
|
271
253
|
}
|
|
254
|
+
function renderModal(path) {
|
|
255
|
+
const webView = useWebView({ url: path, onMessage() { } });
|
|
256
|
+
return (Devvit.createElement("vstack", { alignment: "center middle", height: "100%" },
|
|
257
|
+
Devvit.createElement("button", { onPress: webView.mount }, "Launch App"),
|
|
258
|
+
";"));
|
|
259
|
+
}
|
|
272
260
|
if (config2) {
|
|
273
261
|
configurePermissions(config2.permissions);
|
|
274
262
|
if (config2.post)
|
|
275
|
-
configurePost(config2.
|
|
263
|
+
configurePost(config2.post);
|
|
276
264
|
if (config2.menu?.items) {
|
|
277
265
|
configureMenuItems(config2.menu.items);
|
|
278
266
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devvit/build-pack",
|
|
3
|
-
"version": "0.11.20-next-2025-07-29-
|
|
3
|
+
"version": "0.11.20-next-2025-07-29-04-29-31-36003bf76.0",
|
|
4
4
|
"license": "BSD-3-Clause",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,9 +23,8 @@
|
|
|
23
23
|
},
|
|
24
24
|
"types": "./index.d.ts",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@devvit/protos": "0.11.20-next-2025-07-29-
|
|
27
|
-
"@devvit/shared-types": "0.11.20-next-2025-07-29-
|
|
28
|
-
"@devvit/splash": "0.11.20-next-2025-07-29-00-56-04-93779ae17.0",
|
|
26
|
+
"@devvit/protos": "0.11.20-next-2025-07-29-04-29-31-36003bf76.0",
|
|
27
|
+
"@devvit/shared-types": "0.11.20-next-2025-07-29-04-29-31-36003bf76.0",
|
|
29
28
|
"esbuild": "0.23.0",
|
|
30
29
|
"rxjs": "7.8.1",
|
|
31
30
|
"tsv": "0.2.0",
|
|
@@ -36,12 +35,12 @@
|
|
|
36
35
|
"@devvit/shared": "*"
|
|
37
36
|
},
|
|
38
37
|
"devDependencies": {
|
|
39
|
-
"@devvit/public-api": "0.11.20-next-2025-07-29-
|
|
40
|
-
"@devvit/repo-tools": "0.11.20-next-2025-07-29-
|
|
41
|
-
"@devvit/scheduler": "0.11.20-next-2025-07-29-
|
|
42
|
-
"@devvit/server": "0.11.20-next-2025-07-29-
|
|
43
|
-
"@devvit/shared": "0.11.20-next-2025-07-29-
|
|
44
|
-
"@devvit/tsconfig": "0.11.20-next-2025-07-29-
|
|
38
|
+
"@devvit/public-api": "0.11.20-next-2025-07-29-04-29-31-36003bf76.0",
|
|
39
|
+
"@devvit/repo-tools": "0.11.20-next-2025-07-29-04-29-31-36003bf76.0",
|
|
40
|
+
"@devvit/scheduler": "0.11.20-next-2025-07-29-04-29-31-36003bf76.0",
|
|
41
|
+
"@devvit/server": "0.11.20-next-2025-07-29-04-29-31-36003bf76.0",
|
|
42
|
+
"@devvit/shared": "0.11.20-next-2025-07-29-04-29-31-36003bf76.0",
|
|
43
|
+
"@devvit/tsconfig": "0.11.20-next-2025-07-29-04-29-31-36003bf76.0",
|
|
45
44
|
"@types/tsv": "0.2.1",
|
|
46
45
|
"eslint": "9.11.1",
|
|
47
46
|
"vitest": "1.6.1"
|
|
@@ -50,5 +49,5 @@
|
|
|
50
49
|
"directory": "dist"
|
|
51
50
|
},
|
|
52
51
|
"source": "./src/index.ts",
|
|
53
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "a0682bfdb82f462bc10733be3da00adc04dcf8da"
|
|
54
53
|
}
|