@devvit/build-pack 0.12.0-next-2025-08-13-18-11-35-04294c99a.0 → 0.12.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":"AAGA,OAAO,EAEL,MAAM,EACN,KAAK,OAAO,EAOb,MAAM,oBAAoB,CAAC;AAG5B,OAAO,KAAK,EAA8C,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAwB7F,oFAAoF;AACpF,eAAO,MAAM,UAAU,EAAE;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAA;CAAO,CAAC;AAkH7D,gBAAgB;AAChB,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CA4D/D;AA4OD,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"blocks.template.d.ts","sourceRoot":"","sources":["../../../src/esbuild/templatizer/blocks.template.tsx"],"names":[],"mappings":"AAGA,OAAO,EAEL,MAAM,EACN,KAAK,OAAO,EAOb,MAAM,oBAAoB,CAAC;AAG5B,OAAO,KAAK,EAA8C,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAwB7F,oFAAoF;AACpF,eAAO,MAAM,UAAU,EAAE;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAA;CAAO,CAAC;AA8H7D,gBAAgB;AAChB,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CA4D/D;AA4OD,eAAe,MAAM,CAAC"}
@@ -32,18 +32,25 @@ function configurePermissions(permissions) {
32
32
  }
33
33
  function configurePost(name, post) {
34
34
  const defaultEntrypoint = post.entrypoints.default;
35
+ const renderSplash = (ctx) => {
36
+ const postDataHeader = ctx.metadata[Header.PostData]?.values[0];
37
+ const postData = postDataHeader
38
+ ? JSON.parse(postDataHeader)
39
+ : {};
40
+ const splash = postData.splash;
41
+ const entry = splash?.entry ? post.entrypoints[splash.entry] : undefined;
42
+ return (
43
+ // Align to `submitCustomPost()`.
44
+ Devvit.createElement(Splash, { appDisplayName: splash?.appDisplayName ?? name, appIconUri: splash?.appIconUri, backgroundUri: splash?.backgroundUri ?? backgroundUrl, buttonLabel: splash?.buttonLabel, description: splash?.description, entryUri: entry?.entry ?? defaultEntrypoint.entry, heading: splash?.title, height: entry?.height ?? defaultEntrypoint.height }));
45
+ };
46
+ const renderInline = (_ctx) => {
47
+ return (Devvit.createElement("blocks", { height: defaultEntrypoint.height },
48
+ Devvit.createElement("webview", { url: defaultEntrypoint.entry, width: "100%", height: "100%" })));
49
+ };
35
50
  Devvit.addCustomPostType({
36
51
  name: '',
37
52
  render: (ctx) => {
38
- const postDataHeader = ctx.metadata[Header.PostData]?.values[0];
39
- const postData = postDataHeader
40
- ? JSON.parse(postDataHeader)
41
- : {};
42
- const splash = postData.splash;
43
- const entry = splash?.entry ? post.entrypoints[splash.entry] : undefined;
44
- return (
45
- // Align to `submitCustomPost()`.
46
- Devvit.createElement(Splash, { appDisplayName: splash?.appDisplayName ?? name, appIconUri: splash?.appIconUri, backgroundUri: splash?.backgroundUri ?? backgroundUrl, buttonLabel: splash?.buttonLabel, description: splash?.description, entryUri: entry?.entry ?? defaultEntrypoint.entry, heading: splash?.title, height: entry?.height ?? defaultEntrypoint.height }));
53
+ return defaultEntrypoint.inline ? renderInline(ctx) : renderSplash(ctx);
47
54
  },
48
55
  // to-do: vary dynamically on entrypoint.
49
56
  height: defaultEntrypoint.height,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devvit/build-pack",
3
- "version": "0.12.0-next-2025-08-13-18-11-35-04294c99a.0",
3
+ "version": "0.12.0",
4
4
  "license": "BSD-3-Clause",
5
5
  "repository": {
6
6
  "type": "git",
@@ -31,9 +31,9 @@
31
31
  },
32
32
  "types": "./dist/index.d.ts",
33
33
  "dependencies": {
34
- "@devvit/protos": "0.12.0-next-2025-08-13-18-11-35-04294c99a.0",
35
- "@devvit/shared-types": "0.12.0-next-2025-08-13-18-11-35-04294c99a.0",
36
- "@devvit/splash": "0.12.0-next-2025-08-13-18-11-35-04294c99a.0",
34
+ "@devvit/protos": "0.12.0",
35
+ "@devvit/shared-types": "0.12.0",
36
+ "@devvit/splash": "0.12.0",
37
37
  "esbuild": "0.23.0",
38
38
  "rxjs": "7.8.1",
39
39
  "tsv": "0.2.0",
@@ -44,16 +44,16 @@
44
44
  "@devvit/shared": "*"
45
45
  },
46
46
  "devDependencies": {
47
- "@devvit/public-api": "0.12.0-next-2025-08-13-18-11-35-04294c99a.0",
48
- "@devvit/repo-tools": "0.12.0-next-2025-08-13-18-11-35-04294c99a.0",
49
- "@devvit/scheduler": "0.12.0-next-2025-08-13-18-11-35-04294c99a.0",
50
- "@devvit/server": "0.12.0-next-2025-08-13-18-11-35-04294c99a.0",
51
- "@devvit/shared": "0.12.0-next-2025-08-13-18-11-35-04294c99a.0",
52
- "@devvit/tsconfig": "0.12.0-next-2025-08-13-18-11-35-04294c99a.0",
47
+ "@devvit/public-api": "0.12.0",
48
+ "@devvit/repo-tools": "0.12.0",
49
+ "@devvit/scheduler": "0.12.0",
50
+ "@devvit/server": "0.12.0",
51
+ "@devvit/shared": "0.12.0",
52
+ "@devvit/tsconfig": "0.12.0",
53
53
  "@types/tsv": "0.2.1",
54
54
  "eslint": "9.11.1",
55
55
  "vitest": "1.6.1"
56
56
  },
57
57
  "source": "./src/index.ts",
58
- "gitHead": "42e314095fbc04613e6f3532768c423d2fdaea8a"
58
+ "gitHead": "3731eff756778353fa38302d4e5c03fa5f97652b"
59
59
  }