@devvit/build-pack 0.12.0-next-2025-03-31-81fa43e0f.0 → 0.12.0-next-2025-04-10-a27f59c35.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":"
|
|
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"}
|
package/esbuild/BundleModule.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import * as protos from '@devvit/protos';
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
2
|
+
import * as protos from '@devvit/protos'; // The bootstrap provides protos.
|
|
3
3
|
import { Actor } from '@devvit/shared-types/Actor.js';
|
|
4
|
+
// Define require for server builds which may have externalized dependencies.
|
|
5
|
+
// ESM does not define require but bundles are CJS and evaluated inline .
|
|
6
|
+
globalThis.require ??= createRequire(import.meta.url);
|
|
4
7
|
/**
|
|
5
8
|
* Dangerously executes untrusted code and returns the Actor class. An Error is
|
|
6
9
|
* thrown if the code does not adhere to the BundleModule interface.
|
package/esbuild/ESBuildPack.js
CHANGED
|
@@ -372,6 +372,7 @@ function esbuildConfig(disableExternDevvitProtos, targetRuntime, watchMode = fal
|
|
|
372
372
|
return {
|
|
373
373
|
// Recursively inline any imported dependencies.
|
|
374
374
|
bundle: true,
|
|
375
|
+
external: ['node:*'],
|
|
375
376
|
// Split the @devvit/protos from the LinkedBundle. This means apps assume
|
|
376
377
|
// @devvit/protos is available for import at execution time.
|
|
377
378
|
plugins: [
|
package/lib/BuildPack.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BuildPack.d.ts","sourceRoot":"","sources":["../../src/lib/BuildPack.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAC/G,OAAO,KAAK,EACV,UAAU,EACV,aAAa,EACb,eAAe,EAChB,MAAM,kEAAkE,CAAC;AAE1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAEvC;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC;AAEpC,8BAAsB,SAAU,YAAW,gBAAgB;IACzD,oDAAoD;IACpD,MAAM,CAAC,sBAAsB,EAAE,MAAM,CAAa;IAElD,QAAQ,CAAC,OAAO,CACd,OAAO,EAAE,aAAa,EACtB,SAAS,EAAE,MAAM,CAAC,QAAQ,GAAG,SAAS,GACrC,OAAO,CAAC,eAAe,CAAC;IAE3B,QAAQ,CAAC,KAAK,CACZ,OAAO,EAAE,aAAa,EACtB,SAAS,EAAE,MAAM,CAAC,QAAQ,GAAG,SAAS,GACrC,UAAU,CAAC,eAAe,CAAC;IAE9B,QAAQ,CAAC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAClC;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,QAAQ,CAAC,UAAU,CAAC,EAAE,GAAG,MAAM,CAExE;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,MAAM,CAO3D;AAED,iEAAiE;AACjE,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"BuildPack.d.ts","sourceRoot":"","sources":["../../src/lib/BuildPack.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAC/G,OAAO,KAAK,EACV,UAAU,EACV,aAAa,EACb,eAAe,EAChB,MAAM,kEAAkE,CAAC;AAE1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAEvC;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC;AAEpC,8BAAsB,SAAU,YAAW,gBAAgB;IACzD,oDAAoD;IACpD,MAAM,CAAC,sBAAsB,EAAE,MAAM,CAAa;IAElD,QAAQ,CAAC,OAAO,CACd,OAAO,EAAE,aAAa,EACtB,SAAS,EAAE,MAAM,CAAC,QAAQ,GAAG,SAAS,GACrC,OAAO,CAAC,eAAe,CAAC;IAE3B,QAAQ,CAAC,KAAK,CACZ,OAAO,EAAE,aAAa,EACtB,SAAS,EAAE,MAAM,CAAC,QAAQ,GAAG,SAAS,GACrC,UAAU,CAAC,eAAe,CAAC;IAE9B,QAAQ,CAAC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAClC;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,QAAQ,CAAC,UAAU,CAAC,EAAE,GAAG,MAAM,CAExE;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,MAAM,CAO3D;AAED,iEAAiE;AACjE,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAqBhE"}
|
package/lib/BuildPack.js
CHANGED
|
@@ -22,7 +22,11 @@ export function getModuleEntrypoint(root) {
|
|
|
22
22
|
// favor src/ if it exists. single file projects may point directly to the
|
|
23
23
|
// source directory.
|
|
24
24
|
const src = path.join(root, ACTOR_SRC_DIR);
|
|
25
|
-
|
|
25
|
+
// With the advent of webviews and LLMs, it's nice to have all devvit
|
|
26
|
+
// code in a single folder. This helps tsconfig.json support, LLM inference
|
|
27
|
+
// and general code hygiene!
|
|
28
|
+
const srcDevvit = path.join(src, 'devvit');
|
|
29
|
+
const dir = fs.existsSync(srcDevvit) ? srcDevvit : fs.existsSync(src) ? src : root;
|
|
26
30
|
// Support TSX files and give them priority is they exist.
|
|
27
31
|
// This is used to power UI (aka BlockKit)
|
|
28
32
|
// TS needs to have the `.tsx` extension separately because JSX has some
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BuildPack.test.d.ts","sourceRoot":"","sources":["../../src/lib/BuildPack.test.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devvit/build-pack",
|
|
3
|
-
"version": "0.12.0-next-2025-
|
|
3
|
+
"version": "0.12.0-next-2025-04-10-a27f59c35.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.12.0-next-2025-
|
|
27
|
-
"@devvit/shared-types": "0.12.0-next-2025-
|
|
26
|
+
"@devvit/protos": "0.12.0-next-2025-04-10-a27f59c35.0",
|
|
27
|
+
"@devvit/shared-types": "0.12.0-next-2025-04-10-a27f59c35.0",
|
|
28
28
|
"esbuild": "0.23.0",
|
|
29
29
|
"rxjs": "7.8.1",
|
|
30
30
|
"tiny-glob": "0.2.9",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"typescript": "5.3.2"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@devvit/public-api": "0.12.0-next-2025-
|
|
36
|
-
"@devvit/repo-tools": "0.12.0-next-2025-
|
|
37
|
-
"@devvit/tsconfig": "0.12.0-next-2025-
|
|
35
|
+
"@devvit/public-api": "0.12.0-next-2025-04-10-a27f59c35.0",
|
|
36
|
+
"@devvit/repo-tools": "0.12.0-next-2025-04-10-a27f59c35.0",
|
|
37
|
+
"@devvit/tsconfig": "0.12.0-next-2025-04-10-a27f59c35.0",
|
|
38
38
|
"@types/tsv": "0.2.1",
|
|
39
39
|
"eslint": "9.11.1",
|
|
40
40
|
"typescript": "5.3.2",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"directory": "dist"
|
|
45
45
|
},
|
|
46
46
|
"source": "./src/index.ts",
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "6624afad774e1ef401d4933823ae67777622a473"
|
|
48
48
|
}
|