@devvit/build-pack 0.11.13 → 0.11.14-next-2025-04-22-b4f13237c.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":"BundleModule.d.ts","sourceRoot":"","sources":["../../src/esbuild/BundleModule.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAM7D;;;GAGG;AACH,wBAAsB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAUxF;AAyCD,cAAM,aAAc,SAAQ,KAAK;gBACnB,GAAG,EAAE,MAAM;CAGxB;AAED,2DAA2D;AAC3D,MAAM,MAAM,iBAAiB,GAAG,OAAO,aAAa,CAAC"}
1
+ {"version":3,"file":"BundleModule.d.ts","sourceRoot":"","sources":["../../src/esbuild/BundleModule.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAqB7D;;;GAGG;AACH,wBAAsB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAUxF;AAyCD,cAAM,aAAc,SAAQ,KAAK;gBACnB,GAAG,EAAE,MAAM;CAGxB;AAED,2DAA2D;AAC3D,MAAM,MAAM,iBAAiB,GAAG,OAAO,aAAa,CAAC"}
@@ -4,6 +4,20 @@ import { Actor } from '@devvit/shared-types/Actor.js';
4
4
  // Define require for server builds which may have externalized dependencies.
5
5
  // ESM does not define require but bundles are CJS and evaluated inline .
6
6
  globalThis.require ??= createRequire(import.meta.url);
7
+ // because we evaluate the code to create the actor bundle webbit apps fail because they cannot
8
+ // open their HTTP port. This overrides http.createServer().listen(), so it's a no-op
9
+ const webbitBundlingHack = `
10
+ const http = require('http');
11
+ const createServer = http.createServer;
12
+ http.createServer = () => {
13
+ const srv = createServer();
14
+ srv.listen = () => {};
15
+ return srv;
16
+ };
17
+ `;
18
+ const webbitBundlingHackRevert = `
19
+ http.createServer = createServer;
20
+ `;
7
21
  /**
8
22
  * Dangerously executes untrusted code and returns the Actor class. An Error is
9
23
  * thrown if the code does not adhere to the BundleModule interface.
@@ -39,7 +53,7 @@ async function dangerouslyGetBundleDefaultExport(code) {
39
53
  // JS please forgive us
40
54
  // TODO DX-63
41
55
  // eslint-disable-next-line security/detect-eval-with-expression
42
- eval(code);
56
+ eval(webbitBundlingHack + code + webbitBundlingHackRevert);
43
57
  return module.exports?.default;
44
58
  }
45
59
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devvit/build-pack",
3
- "version": "0.11.13",
3
+ "version": "0.11.14-next-2025-04-22-b4f13237c.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.13",
27
- "@devvit/shared-types": "0.11.13",
26
+ "@devvit/protos": "0.11.14-next-2025-04-22-b4f13237c.0",
27
+ "@devvit/shared-types": "0.11.14-next-2025-04-22-b4f13237c.0",
28
28
  "esbuild": "0.23.0",
29
29
  "rxjs": "7.8.1",
30
30
  "tiny-glob": "0.2.9",
@@ -32,17 +32,17 @@
32
32
  "typescript": "5.3.2"
33
33
  },
34
34
  "devDependencies": {
35
- "@devvit/public-api": "0.11.13",
36
- "@devvit/repo-tools": "0.11.13",
37
- "@devvit/tsconfig": "0.11.13",
35
+ "@devvit/public-api": "0.11.14-next-2025-04-22-b4f13237c.0",
36
+ "@devvit/repo-tools": "0.11.14-next-2025-04-22-b4f13237c.0",
37
+ "@devvit/tsconfig": "0.11.14-next-2025-04-22-b4f13237c.0",
38
38
  "@types/tsv": "0.2.1",
39
39
  "eslint": "9.11.1",
40
40
  "typescript": "5.3.2",
41
- "vitest": "1.6.0"
41
+ "vitest": "1.6.1"
42
42
  },
43
43
  "publishConfig": {
44
44
  "directory": "dist"
45
45
  },
46
46
  "source": "./src/index.ts",
47
- "gitHead": "6ebae441926485519748aff1791abc444ddf4f12"
47
+ "gitHead": "a2f2dc0264d544457f58a866c8d66ad80391ac68"
48
48
  }