@devvit/build-pack 0.11.20-next-2025-07-28-21-36-29-20e2ce157.0 → 0.11.20-next-2025-07-28-22-27-23-0f9ecc6ab.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;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
+ {"version":3,"file":"blocks.template.d.ts","sourceRoot":"","sources":["../../../src/esbuild/templatizer/blocks.template.tsx"],"names":[],"mappings":"AAMA,OAAO,EAEL,MAAM,EACN,KAAK,OAAO,EAKb,MAAM,oBAAoB,CAAC;AAI5B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAsBjD,oFAAoF;AACpF,eAAO,MAAM,UAAU,EAAE;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAA;CAAO,CAAC;AAyH7D,gBAAgB;AAChB,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CA4D/D;AA+JD,eAAe,MAAM,CAAC"}
@@ -1,8 +1,11 @@
1
1
  import { LoggerDefinition, Severity } from '@devvit/protos';
2
- import { Devvit, useWebView, } from '@devvit/public-api';
2
+ import { Height, } from '@devvit/protos/json/devvit/ui/effects/web_view/v1alpha/context.js';
3
+ import { Devvit, useState, } from '@devvit/public-api';
3
4
  import { getServerPort } from '@devvit/server';
5
+ import { devvitPostDataRedisKey } from '@devvit/shared-types/post-data.js';
4
6
  import { getDevvitConfig } from '@devvit/shared-types/server/get-devvit-config.js';
5
7
  import { StringUtil } from '@devvit/shared-types/StringUtil.js';
8
+ import { Splash } from '@devvit/splash/splash.js';
6
9
  // Hack: rename config2 to workaround declaration in
7
10
  // packages/runtime-lite/src/runtime/SandboxedRuntimeLite.ts.
8
11
  // __devvit__ is undefined in tests only.
@@ -27,12 +30,27 @@ function configurePermissions(permissions) {
27
30
  redis: permissions.redis,
28
31
  });
29
32
  }
30
- function configurePost(post) {
31
- // TODO: support post entrypoints beyond default.
33
+ function configurePost(name, post) {
32
34
  const defaultEntrypoint = post.entrypoints.default;
33
35
  Devvit.addCustomPostType({
34
36
  name: '',
35
- render: () => renderModal(defaultEntrypoint.entry),
37
+ render: (ctx) => {
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
+ },
36
54
  height: defaultEntrypoint.height,
37
55
  });
38
56
  }
@@ -251,16 +269,10 @@ function configureScheduler(schedulerConfig) {
251
269
  });
252
270
  }
253
271
  }
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
- }
260
272
  if (config2) {
261
273
  configurePermissions(config2.permissions);
262
274
  if (config2.post)
263
- configurePost(config2.post);
275
+ configurePost(config2.name, config2.post);
264
276
  if (config2.menu?.items) {
265
277
  configureMenuItems(config2.menu.items);
266
278
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devvit/build-pack",
3
- "version": "0.11.20-next-2025-07-28-21-36-29-20e2ce157.0",
3
+ "version": "0.11.20-next-2025-07-28-22-27-23-0f9ecc6ab.0",
4
4
  "license": "BSD-3-Clause",
5
5
  "repository": {
6
6
  "type": "git",
@@ -23,8 +23,9 @@
23
23
  },
24
24
  "types": "./index.d.ts",
25
25
  "dependencies": {
26
- "@devvit/protos": "0.11.20-next-2025-07-28-21-36-29-20e2ce157.0",
27
- "@devvit/shared-types": "0.11.20-next-2025-07-28-21-36-29-20e2ce157.0",
26
+ "@devvit/protos": "0.11.20-next-2025-07-28-22-27-23-0f9ecc6ab.0",
27
+ "@devvit/shared-types": "0.11.20-next-2025-07-28-22-27-23-0f9ecc6ab.0",
28
+ "@devvit/splash": "0.11.20-next-2025-07-28-22-27-23-0f9ecc6ab.0",
28
29
  "esbuild": "0.23.0",
29
30
  "rxjs": "7.8.1",
30
31
  "tsv": "0.2.0",
@@ -35,12 +36,12 @@
35
36
  "@devvit/shared": "*"
36
37
  },
37
38
  "devDependencies": {
38
- "@devvit/public-api": "0.11.20-next-2025-07-28-21-36-29-20e2ce157.0",
39
- "@devvit/repo-tools": "0.11.20-next-2025-07-28-21-36-29-20e2ce157.0",
40
- "@devvit/scheduler": "0.11.20-next-2025-07-28-21-36-29-20e2ce157.0",
41
- "@devvit/server": "0.11.20-next-2025-07-28-21-36-29-20e2ce157.0",
42
- "@devvit/shared": "0.11.20-next-2025-07-28-21-36-29-20e2ce157.0",
43
- "@devvit/tsconfig": "0.11.20-next-2025-07-28-21-36-29-20e2ce157.0",
39
+ "@devvit/public-api": "0.11.20-next-2025-07-28-22-27-23-0f9ecc6ab.0",
40
+ "@devvit/repo-tools": "0.11.20-next-2025-07-28-22-27-23-0f9ecc6ab.0",
41
+ "@devvit/scheduler": "0.11.20-next-2025-07-28-22-27-23-0f9ecc6ab.0",
42
+ "@devvit/server": "0.11.20-next-2025-07-28-22-27-23-0f9ecc6ab.0",
43
+ "@devvit/shared": "0.11.20-next-2025-07-28-22-27-23-0f9ecc6ab.0",
44
+ "@devvit/tsconfig": "0.11.20-next-2025-07-28-22-27-23-0f9ecc6ab.0",
44
45
  "@types/tsv": "0.2.1",
45
46
  "eslint": "9.11.1",
46
47
  "vitest": "1.6.1"
@@ -49,5 +50,5 @@
49
50
  "directory": "dist"
50
51
  },
51
52
  "source": "./src/index.ts",
52
- "gitHead": "1ff795a4151710f05a34230378cb5cb325b2343e"
53
+ "gitHead": "c9f262f24e460f70de950e32853f049c26b75e48"
53
54
  }